workos 7.0.0 → 7.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +1 -1
- data/.github/workflows/lint.yml +1 -1
- data/.github/workflows/release-please.yml +30 -2
- data/.github/workflows/release.yml +1 -1
- data/.last-synced-sha +1 -0
- data/.oagen-manifest.json +739 -4
- data/.release-please-manifest.json +1 -1
- data/CHANGELOG.md +23 -0
- data/Gemfile.lock +2 -2
- data/README.md +0 -1
- data/lib/workos/admin_portal/domain_verification_intent_options.rb +18 -0
- data/lib/workos/admin_portal/generate_link.rb +3 -3
- data/lib/workos/admin_portal/intent_options.rb +6 -2
- data/lib/workos/admin_portal.rb +3 -3
- data/lib/workos/authorization.rb +61 -67
- data/lib/workos/client.rb +8 -0
- data/lib/workos/directory_sync/directory_user_with_groups.rb +10 -2
- data/lib/workos/groups/create_group.rb +22 -0
- data/lib/workos/groups/create_group_membership.rb +18 -0
- data/lib/workos/groups/update_group.rb +7 -0
- data/lib/workos/groups.rb +256 -0
- data/lib/workos/session.rb +16 -5
- data/lib/workos/shared/waitlist_user.rb +37 -0
- data/lib/workos/shared/waitlist_user_approved.rb +34 -0
- data/lib/workos/shared/waitlist_user_created.rb +34 -0
- data/lib/workos/shared/waitlist_user_denied.rb +34 -0
- data/lib/workos/types/create_webhook_endpoint_events.rb +4 -1
- data/lib/workos/types/groups_order.rb +9 -0
- data/lib/workos/types/sso_provider.rb +10 -1
- data/lib/workos/types/user_management_authentication_provider.rb +10 -1
- data/lib/workos/types/user_management_organization_membership_groups_order.rb +9 -0
- data/lib/workos/types/waitlist_user_state.rb +14 -0
- data/lib/workos/user_management/invitation.rb +3 -0
- data/lib/workos/user_management/invitation_accepted_data.rb +3 -0
- data/lib/workos/user_management/invitation_created_data.rb +3 -0
- data/lib/workos/user_management/invitation_resent_data.rb +3 -0
- data/lib/workos/user_management/invitation_revoked_data.rb +3 -0
- data/lib/workos/user_management/user_invite.rb +3 -0
- data/lib/workos/user_management.rb +32 -40
- data/lib/workos/user_management_organization_membership_groups.rb +60 -0
- data/lib/workos/version.rb +1 -1
- data/lib/workos.rb +4 -0
- data/rbi/workos/admin_portal.rbi +2 -2
- data/rbi/workos/authorization.rbi +13 -12
- data/rbi/workos/client.rbi +6 -0
- data/rbi/workos/create_group.rbi +30 -0
- data/rbi/workos/create_group_membership.rbi +24 -0
- data/rbi/workos/domain_verification_intent_options.rbi +24 -0
- data/rbi/workos/generate_link.rbi +2 -2
- data/rbi/workos/groups.rbi +97 -0
- data/rbi/workos/intent_options.rbi +8 -2
- data/rbi/workos/invitation.rbi +6 -0
- data/rbi/workos/invitation_accepted_data.rbi +6 -0
- data/rbi/workos/invitation_created_data.rbi +6 -0
- data/rbi/workos/invitation_resent_data.rbi +6 -0
- data/rbi/workos/invitation_revoked_data.rbi +6 -0
- data/rbi/workos/update_group.rbi +30 -0
- data/rbi/workos/user_invite.rbi +6 -0
- data/rbi/workos/user_management_organization_membership_groups.rbi +25 -0
- data/rbi/workos/waitlist_user.rbi +60 -0
- data/rbi/workos/waitlist_user_approved.rbi +54 -0
- data/rbi/workos/waitlist_user_created.rbi +54 -0
- data/rbi/workos/waitlist_user_denied.rbi +54 -0
- data/test/workos/test_authorization.rb +33 -33
- data/test/workos/test_groups.rb +89 -0
- data/test/workos/test_model_round_trip.rb +153 -24
- data/test/workos/test_session.rb +125 -0
- data/test/workos/test_user_management_organization_membership_groups.rb +33 -0
- metadata +29 -8
- data/lib/workos/user_management/urn_ietf_params_oauth_grant_type_device_code_session_authenticate_request.rb +0 -8
- data/lib/workos/user_management/urn_workos_oauth_grant_type_email_verification_code_session_authenticate_request.rb +0 -8
- data/lib/workos/user_management/urn_workos_oauth_grant_type_magic_auth_code_session_authenticate_request.rb +0 -8
- data/lib/workos/user_management/urn_workos_oauth_grant_type_mfa_totp_session_authenticate_request.rb +0 -8
- data/lib/workos/user_management/urn_workos_oauth_grant_type_organization_selection_session_authenticate_request.rb +0 -8
- /data/lib/workos/{shared → groups}/group.rb +0 -0
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [7.1.1](https://github.com/workos/workos-ruby/compare/v7.1.0...v7.1.1) (2026-04-29)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* seal session client-side in Session#refresh ([#470](https://github.com/workos/workos-ruby/issues/470)) ([32662ab](https://github.com/workos/workos-ruby/commit/32662ab3d67ffdcc895141aa8fd5efb22ba79fdb))
|
|
9
|
+
|
|
10
|
+
## [7.1.0](https://github.com/workos/workos-ruby/compare/v7.0.0...v7.1.0) (2026-04-27)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* **generated:** update generated SDK from spec changes ([#465](https://github.com/workos/workos-ruby/issues/465)) ([6c145d2](https://github.com/workos/workos-ruby/commit/6c145d2bfec9af8fcffdc5ffe678f452ea925f22))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* add ruby/setup-ruby to release-please workflow ([aa5ebd0](https://github.com/workos/workos-ruby/commit/aa5ebd0e26edc291f54d92b2f4681a224b0d3889))
|
|
21
|
+
* eagerly load configuration.rb to fix WorkOS.configure ([#467](https://github.com/workos/workos-ruby/issues/467)) ([eea391c](https://github.com/workos/workos-ruby/commit/eea391cd88015373fb89f3b8fbe1dda9c5cfedbe))
|
|
22
|
+
* remove stale URN-prefixed alias files breaking Zeitwerk ([#466](https://github.com/workos/workos-ruby/issues/466)) ([92b2aa5](https://github.com/workos/workos-ruby/commit/92b2aa5166e370bc8f9aaaee22626058d93521a5))
|
|
23
|
+
* update Gemfile.lock in release-please PR and bump action pins ([2aa0574](https://github.com/workos/workos-ruby/commit/2aa0574f3084e79af488c2125adbfc337604a3be))
|
|
24
|
+
* update Zeitwerk autoload for inflections.rb ([#460](https://github.com/workos/workos-ruby/issues/460)) ([4fa1332](https://github.com/workos/workos-ruby/commit/4fa1332f66c14e89c6df8d8d6af6ac8024824b15))
|
|
25
|
+
|
|
3
26
|
## [7.0.0](https://github.com/workos/workos-ruby/compare/v6.2.0...v7.0.0) (2026-04-20)
|
|
4
27
|
|
|
5
28
|
This is a major release that introduces a fully redesigned SDK architecture. The SDK is now **generated from the WorkOS OpenAPI spec**, bringing type safety, consistent interfaces, and improved developer ergonomics.
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
workos (7.
|
|
4
|
+
workos (7.1.1)
|
|
5
5
|
jwt (~> 3.1)
|
|
6
6
|
logger (~> 1.7)
|
|
7
7
|
zeitwerk (~> 2.6)
|
|
@@ -124,7 +124,7 @@ CHECKSUMS
|
|
|
124
124
|
unicode-display_width (3.2.0) sha256=0cdd96b5681a5949cdbc2c55e7b420facae74c4aaf9a9815eee1087cb1853c42
|
|
125
125
|
unicode-emoji (4.2.0) sha256=519e69150f75652e40bf736106cfbc8f0f73aa3fb6a65afe62fefa7f80b0f80f
|
|
126
126
|
webmock (3.26.2) sha256=774556f2ea6371846cca68c01769b2eac0d134492d21f6d0ab5dd643965a4c90
|
|
127
|
-
workos (7.
|
|
127
|
+
workos (7.1.1)
|
|
128
128
|
zeitwerk (2.7.5) sha256=d8da92128c09ea6ec62c949011b00ed4a20242b255293dd66bf41545398f73dd
|
|
129
129
|
|
|
130
130
|
BUNDLED WITH
|
data/README.md
CHANGED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# This file is auto-generated by oagen. Do not edit.
|
|
4
|
+
|
|
5
|
+
module WorkOS
|
|
6
|
+
class DomainVerificationIntentOptions < WorkOS::Types::BaseModel
|
|
7
|
+
HASH_ATTRS = {
|
|
8
|
+
domain_name: :domain_name
|
|
9
|
+
}.freeze
|
|
10
|
+
|
|
11
|
+
attr_accessor :domain_name
|
|
12
|
+
|
|
13
|
+
def initialize(json)
|
|
14
|
+
hash = self.class.normalize(json)
|
|
15
|
+
@domain_name = hash[:domain_name]
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -10,7 +10,7 @@ module WorkOS
|
|
|
10
10
|
organization: :organization,
|
|
11
11
|
intent: :intent,
|
|
12
12
|
intent_options: :intent_options,
|
|
13
|
-
|
|
13
|
+
it_contact_emails: :it_contact_emails
|
|
14
14
|
}.freeze
|
|
15
15
|
|
|
16
16
|
attr_accessor \
|
|
@@ -19,7 +19,7 @@ module WorkOS
|
|
|
19
19
|
:organization,
|
|
20
20
|
:intent,
|
|
21
21
|
:intent_options,
|
|
22
|
-
:
|
|
22
|
+
:it_contact_emails
|
|
23
23
|
|
|
24
24
|
def initialize(json)
|
|
25
25
|
hash = self.class.normalize(json)
|
|
@@ -28,7 +28,7 @@ module WorkOS
|
|
|
28
28
|
@organization = hash[:organization]
|
|
29
29
|
@intent = hash[:intent]
|
|
30
30
|
@intent_options = hash[:intent_options] ? WorkOS::IntentOptions.new(hash[:intent_options]) : nil
|
|
31
|
-
@
|
|
31
|
+
@it_contact_emails = hash[:it_contact_emails] || []
|
|
32
32
|
end
|
|
33
33
|
end
|
|
34
34
|
end
|
|
@@ -5,14 +5,18 @@
|
|
|
5
5
|
module WorkOS
|
|
6
6
|
class IntentOptions < WorkOS::Types::BaseModel
|
|
7
7
|
HASH_ATTRS = {
|
|
8
|
-
sso: :sso
|
|
8
|
+
sso: :sso,
|
|
9
|
+
domain_verification: :domain_verification
|
|
9
10
|
}.freeze
|
|
10
11
|
|
|
11
|
-
attr_accessor
|
|
12
|
+
attr_accessor \
|
|
13
|
+
:sso,
|
|
14
|
+
:domain_verification
|
|
12
15
|
|
|
13
16
|
def initialize(json)
|
|
14
17
|
hash = self.class.normalize(json)
|
|
15
18
|
@sso = hash[:sso] ? WorkOS::SSOIntentOptions.new(hash[:sso]) : nil
|
|
19
|
+
@domain_verification = hash[:domain_verification] ? WorkOS::DomainVerificationIntentOptions.new(hash[:domain_verification]) : nil
|
|
16
20
|
end
|
|
17
21
|
end
|
|
18
22
|
end
|
data/lib/workos/admin_portal.rb
CHANGED
|
@@ -16,7 +16,7 @@ module WorkOS
|
|
|
16
16
|
# @param organization [String] An [Organization](https://workos.com/docs/reference/organization) identifier.
|
|
17
17
|
# @param intent [WorkOS::Types::GenerateLinkIntent, nil] The intent of the Admin Portal. - `sso` - Launch Admin Portal for creating SSO connections - `dsync` - Launch Admin Portal for creating Directory Sync connections - `audit_logs` - Launch Admin Portal for viewing Audit Logs - `log_streams` - Launch Admin Portal for creating Log Streams - `domain_verification` - Launch Admin Portal for Domain Verification - `certificate_renewal` - Launch Admin Portal for renewing SAML Certificates - `bring_your_own_key` - Launch Admin Portal for configuring Bring Your Own Key
|
|
18
18
|
# @param intent_options [WorkOS::IntentOptions, nil] Options to configure the Admin Portal based on the intent.
|
|
19
|
-
# @param
|
|
19
|
+
# @param it_contact_emails [Array<String>, nil] The email addresses of the IT contacts to grant access to the Admin Portal for the given organization. Accepts up to 20 emails.
|
|
20
20
|
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
21
21
|
# @return [WorkOS::PortalLinkResponse]
|
|
22
22
|
def generate_link(
|
|
@@ -25,7 +25,7 @@ module WorkOS
|
|
|
25
25
|
success_url: nil,
|
|
26
26
|
intent: nil,
|
|
27
27
|
intent_options: nil,
|
|
28
|
-
|
|
28
|
+
it_contact_emails: nil,
|
|
29
29
|
request_options: {}
|
|
30
30
|
)
|
|
31
31
|
body = {
|
|
@@ -34,7 +34,7 @@ module WorkOS
|
|
|
34
34
|
"organization" => organization,
|
|
35
35
|
"intent" => intent,
|
|
36
36
|
"intent_options" => intent_options,
|
|
37
|
-
"
|
|
37
|
+
"it_contact_emails" => it_contact_emails
|
|
38
38
|
}.compact
|
|
39
39
|
response = @client.request(
|
|
40
40
|
method: :post,
|
data/lib/workos/authorization.rb
CHANGED
|
@@ -27,25 +27,23 @@ module WorkOS
|
|
|
27
27
|
resource_type_slug: nil,
|
|
28
28
|
request_options: {}
|
|
29
29
|
)
|
|
30
|
-
params = {}.compact
|
|
31
|
-
case resource_target[:type]
|
|
32
|
-
when "by_id"
|
|
33
|
-
params["resource_id"] = resource_target[:resource_id]
|
|
34
|
-
when "by_external_id"
|
|
35
|
-
params["resource_external_id"] = resource_target[:resource_external_id]
|
|
36
|
-
params["resource_type_slug"] = resource_target[:resource_type_slug]
|
|
37
|
-
end
|
|
38
30
|
body = {
|
|
39
31
|
"permission_slug" => permission_slug,
|
|
40
32
|
"resource_id" => resource_id,
|
|
41
33
|
"resource_external_id" => resource_external_id,
|
|
42
34
|
"resource_type_slug" => resource_type_slug
|
|
43
35
|
}.compact
|
|
36
|
+
case resource_target[:type]
|
|
37
|
+
when "by_id"
|
|
38
|
+
body["resource_id"] = resource_target[:resource_id]
|
|
39
|
+
when "by_external_id"
|
|
40
|
+
body["resource_external_id"] = resource_target[:resource_external_id]
|
|
41
|
+
body["resource_type_slug"] = resource_target[:resource_type_slug]
|
|
42
|
+
end
|
|
44
43
|
response = @client.request(
|
|
45
44
|
method: :post,
|
|
46
45
|
path: "/authorization/organization_memberships/#{WorkOS::Util.encode_path(organization_membership_id)}/check",
|
|
47
46
|
auth: true,
|
|
48
|
-
params: params,
|
|
49
47
|
body: body,
|
|
50
48
|
request_options: request_options
|
|
51
49
|
)
|
|
@@ -63,7 +61,7 @@ module WorkOS
|
|
|
63
61
|
# @param permission_slug [String] The permission slug to filter by. Only child resources where the organization membership has this permission are returned.
|
|
64
62
|
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
65
63
|
# @return [WorkOS::Types::ListStruct<WorkOS::AuthorizationResource>]
|
|
66
|
-
def
|
|
64
|
+
def list_resources_for_membership(
|
|
67
65
|
organization_membership_id:,
|
|
68
66
|
permission_slug:,
|
|
69
67
|
parent_resource:,
|
|
@@ -95,7 +93,7 @@ module WorkOS
|
|
|
95
93
|
request_options: request_options
|
|
96
94
|
)
|
|
97
95
|
fetch_next = ->(cursor) {
|
|
98
|
-
|
|
96
|
+
list_resources_for_membership(
|
|
99
97
|
organization_membership_id: organization_membership_id,
|
|
100
98
|
before: before,
|
|
101
99
|
after: cursor,
|
|
@@ -123,7 +121,7 @@ module WorkOS
|
|
|
123
121
|
# @param order [WorkOS::Types::AuthorizationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending.
|
|
124
122
|
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
125
123
|
# @return [WorkOS::Types::ListStruct<WorkOS::AuthorizationPermission>]
|
|
126
|
-
def
|
|
124
|
+
def list_effective_permissions(
|
|
127
125
|
organization_membership_id:,
|
|
128
126
|
resource_id:,
|
|
129
127
|
before: nil,
|
|
@@ -146,7 +144,7 @@ module WorkOS
|
|
|
146
144
|
request_options: request_options
|
|
147
145
|
)
|
|
148
146
|
fetch_next = ->(cursor) {
|
|
149
|
-
|
|
147
|
+
list_effective_permissions(
|
|
150
148
|
organization_membership_id: organization_membership_id,
|
|
151
149
|
resource_id: resource_id,
|
|
152
150
|
before: before,
|
|
@@ -225,7 +223,7 @@ module WorkOS
|
|
|
225
223
|
# @param order [WorkOS::Types::AuthorizationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending.
|
|
226
224
|
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
227
225
|
# @return [WorkOS::Types::ListStruct<WorkOS::RoleAssignment>]
|
|
228
|
-
def
|
|
226
|
+
def list_role_assignments(
|
|
229
227
|
organization_membership_id:,
|
|
230
228
|
before: nil,
|
|
231
229
|
after: nil,
|
|
@@ -247,7 +245,7 @@ module WorkOS
|
|
|
247
245
|
request_options: request_options
|
|
248
246
|
)
|
|
249
247
|
fetch_next = ->(cursor) {
|
|
250
|
-
|
|
248
|
+
list_role_assignments(
|
|
251
249
|
organization_membership_id: organization_membership_id,
|
|
252
250
|
before: before,
|
|
253
251
|
after: cursor,
|
|
@@ -281,25 +279,23 @@ module WorkOS
|
|
|
281
279
|
resource_type_slug: nil,
|
|
282
280
|
request_options: {}
|
|
283
281
|
)
|
|
284
|
-
params = {}.compact
|
|
285
|
-
case resource_target[:type]
|
|
286
|
-
when "by_id"
|
|
287
|
-
params["resource_id"] = resource_target[:resource_id]
|
|
288
|
-
when "by_external_id"
|
|
289
|
-
params["resource_external_id"] = resource_target[:resource_external_id]
|
|
290
|
-
params["resource_type_slug"] = resource_target[:resource_type_slug]
|
|
291
|
-
end
|
|
292
282
|
body = {
|
|
293
283
|
"role_slug" => role_slug,
|
|
294
284
|
"resource_id" => resource_id,
|
|
295
285
|
"resource_external_id" => resource_external_id,
|
|
296
286
|
"resource_type_slug" => resource_type_slug
|
|
297
287
|
}.compact
|
|
288
|
+
case resource_target[:type]
|
|
289
|
+
when "by_id"
|
|
290
|
+
body["resource_id"] = resource_target[:resource_id]
|
|
291
|
+
when "by_external_id"
|
|
292
|
+
body["resource_external_id"] = resource_target[:resource_external_id]
|
|
293
|
+
body["resource_type_slug"] = resource_target[:resource_type_slug]
|
|
294
|
+
end
|
|
298
295
|
response = @client.request(
|
|
299
296
|
method: :post,
|
|
300
297
|
path: "/authorization/organization_memberships/#{WorkOS::Util.encode_path(organization_membership_id)}/role_assignments",
|
|
301
298
|
auth: true,
|
|
302
|
-
params: params,
|
|
303
299
|
body: body,
|
|
304
300
|
request_options: request_options
|
|
305
301
|
)
|
|
@@ -355,7 +351,7 @@ module WorkOS
|
|
|
355
351
|
# @param role_assignment_id [String] The ID of the role assignment to remove.
|
|
356
352
|
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
357
353
|
# @return [void]
|
|
358
|
-
def
|
|
354
|
+
def remove_role_assignment(
|
|
359
355
|
organization_membership_id:,
|
|
360
356
|
role_assignment_id:,
|
|
361
357
|
request_options: {}
|
|
@@ -498,7 +494,7 @@ module WorkOS
|
|
|
498
494
|
# @param body_slug [String] The slug of the permission to add to the role.
|
|
499
495
|
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
500
496
|
# @return [WorkOS::Role]
|
|
501
|
-
def
|
|
497
|
+
def add_organization_role_permission(
|
|
502
498
|
organization_id:,
|
|
503
499
|
slug:,
|
|
504
500
|
body_slug:,
|
|
@@ -525,7 +521,7 @@ module WorkOS
|
|
|
525
521
|
# @param permissions [Array<String>] The permission slugs to assign to the role.
|
|
526
522
|
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
527
523
|
# @return [WorkOS::Role]
|
|
528
|
-
def
|
|
524
|
+
def set_organization_role_permissions(
|
|
529
525
|
organization_id:,
|
|
530
526
|
slug:,
|
|
531
527
|
permissions:,
|
|
@@ -552,7 +548,7 @@ module WorkOS
|
|
|
552
548
|
# @param permission_slug [String] The slug of the permission to remove.
|
|
553
549
|
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
554
550
|
# @return [WorkOS::Role]
|
|
555
|
-
def
|
|
551
|
+
def remove_organization_role_permission(
|
|
556
552
|
organization_id:,
|
|
557
553
|
slug:,
|
|
558
554
|
permission_slug:,
|
|
@@ -575,7 +571,7 @@ module WorkOS
|
|
|
575
571
|
# @param external_id [String] An identifier you provide to reference the resource in your system.
|
|
576
572
|
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
577
573
|
# @return [WorkOS::AuthorizationResource]
|
|
578
|
-
def
|
|
574
|
+
def get_resource_by_external_id(
|
|
579
575
|
organization_id:,
|
|
580
576
|
resource_type_slug:,
|
|
581
577
|
external_id:,
|
|
@@ -603,7 +599,7 @@ module WorkOS
|
|
|
603
599
|
# @param parent_resource_type_slug [String, nil] The resource type slug of the parent resource. Required with `parent_resource_external_id`. Mutually exclusive with `parent_resource_id`.
|
|
604
600
|
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
605
601
|
# @return [WorkOS::AuthorizationResource]
|
|
606
|
-
def
|
|
602
|
+
def update_resource_by_external_id(
|
|
607
603
|
organization_id:,
|
|
608
604
|
resource_type_slug:,
|
|
609
605
|
external_id:,
|
|
@@ -615,16 +611,6 @@ module WorkOS
|
|
|
615
611
|
parent_resource: nil,
|
|
616
612
|
request_options: {}
|
|
617
613
|
)
|
|
618
|
-
params = {}.compact
|
|
619
|
-
if parent_resource
|
|
620
|
-
case parent_resource[:type]
|
|
621
|
-
when "by_id"
|
|
622
|
-
params["parent_resource_id"] = parent_resource[:parent_resource_id]
|
|
623
|
-
when "by_external_id"
|
|
624
|
-
params["parent_resource_external_id"] = parent_resource[:parent_resource_external_id]
|
|
625
|
-
params["parent_resource_type_slug"] = parent_resource[:parent_resource_type_slug]
|
|
626
|
-
end
|
|
627
|
-
end
|
|
628
614
|
body = {
|
|
629
615
|
"name" => name,
|
|
630
616
|
"description" => description,
|
|
@@ -632,11 +618,19 @@ module WorkOS
|
|
|
632
618
|
"parent_resource_external_id" => parent_resource_external_id,
|
|
633
619
|
"parent_resource_type_slug" => parent_resource_type_slug
|
|
634
620
|
}.compact
|
|
621
|
+
if parent_resource
|
|
622
|
+
case parent_resource[:type]
|
|
623
|
+
when "by_id"
|
|
624
|
+
body["parent_resource_id"] = parent_resource[:parent_resource_id]
|
|
625
|
+
when "by_external_id"
|
|
626
|
+
body["parent_resource_external_id"] = parent_resource[:parent_resource_external_id]
|
|
627
|
+
body["parent_resource_type_slug"] = parent_resource[:parent_resource_type_slug]
|
|
628
|
+
end
|
|
629
|
+
end
|
|
635
630
|
response = @client.request(
|
|
636
631
|
method: :patch,
|
|
637
632
|
path: "/authorization/organizations/#{WorkOS::Util.encode_path(organization_id)}/resources/#{WorkOS::Util.encode_path(resource_type_slug)}/#{WorkOS::Util.encode_path(external_id)}",
|
|
638
633
|
auth: true,
|
|
639
|
-
params: params,
|
|
640
634
|
body: body,
|
|
641
635
|
request_options: request_options
|
|
642
636
|
)
|
|
@@ -652,7 +646,7 @@ module WorkOS
|
|
|
652
646
|
# @param cascade_delete [Boolean, nil] If true, deletes all descendant resources and role assignments. If not set and the resource has children or assignments, the request will fail.
|
|
653
647
|
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
654
648
|
# @return [void]
|
|
655
|
-
def
|
|
649
|
+
def delete_resource_by_external_id(
|
|
656
650
|
organization_id:,
|
|
657
651
|
resource_type_slug:,
|
|
658
652
|
external_id:,
|
|
@@ -684,7 +678,7 @@ module WorkOS
|
|
|
684
678
|
# @param assignment [WorkOS::Types::AuthorizationAssignment, nil] Filter by assignment type. Use "direct" for direct assignments only, or "indirect" to include inherited assignments.
|
|
685
679
|
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
686
680
|
# @return [WorkOS::Types::ListStruct<WorkOS::UserOrganizationMembershipBaseListData>]
|
|
687
|
-
def
|
|
681
|
+
def list_memberships_for_resource_by_external_id(
|
|
688
682
|
organization_id:,
|
|
689
683
|
resource_type_slug:,
|
|
690
684
|
external_id:,
|
|
@@ -712,7 +706,7 @@ module WorkOS
|
|
|
712
706
|
request_options: request_options
|
|
713
707
|
)
|
|
714
708
|
fetch_next = ->(cursor) {
|
|
715
|
-
|
|
709
|
+
list_memberships_for_resource_by_external_id(
|
|
716
710
|
organization_id: organization_id,
|
|
717
711
|
resource_type_slug: resource_type_slug,
|
|
718
712
|
external_id: external_id,
|
|
@@ -740,6 +734,7 @@ module WorkOS
|
|
|
740
734
|
# @param order [WorkOS::Types::AuthorizationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending.
|
|
741
735
|
# @param organization_id [String, nil] Filter resources by organization ID.
|
|
742
736
|
# @param resource_type_slug [String, nil] Filter resources by resource type slug.
|
|
737
|
+
# @param resource_external_id [String, nil] Filter resources by external ID.
|
|
743
738
|
# @param search [String, nil] Search resources by name.
|
|
744
739
|
# @param request_options [Hash] (see WorkOS::Types::RequestOptions)
|
|
745
740
|
# @return [WorkOS::Types::ListStruct<WorkOS::AuthorizationResource>]
|
|
@@ -750,6 +745,7 @@ module WorkOS
|
|
|
750
745
|
order: "desc",
|
|
751
746
|
organization_id: nil,
|
|
752
747
|
resource_type_slug: nil,
|
|
748
|
+
resource_external_id: nil,
|
|
753
749
|
search: nil,
|
|
754
750
|
parent: nil,
|
|
755
751
|
request_options: {}
|
|
@@ -761,6 +757,7 @@ module WorkOS
|
|
|
761
757
|
"order" => order,
|
|
762
758
|
"organization_id" => organization_id,
|
|
763
759
|
"resource_type_slug" => resource_type_slug,
|
|
760
|
+
"resource_external_id" => resource_external_id,
|
|
764
761
|
"search" => search
|
|
765
762
|
}.compact
|
|
766
763
|
if parent
|
|
@@ -787,6 +784,7 @@ module WorkOS
|
|
|
787
784
|
order: order,
|
|
788
785
|
organization_id: organization_id,
|
|
789
786
|
resource_type_slug: resource_type_slug,
|
|
787
|
+
resource_external_id: resource_external_id,
|
|
790
788
|
search: search,
|
|
791
789
|
parent: parent,
|
|
792
790
|
request_options: request_options
|
|
@@ -795,7 +793,7 @@ module WorkOS
|
|
|
795
793
|
WorkOS::Types::ListStruct.from_response(
|
|
796
794
|
response,
|
|
797
795
|
model: WorkOS::AuthorizationResource,
|
|
798
|
-
filters: {before: before, limit: limit, order: order, organization_id: organization_id, resource_type_slug: resource_type_slug, search: search, parent: parent},
|
|
796
|
+
filters: {before: before, limit: limit, order: order, organization_id: organization_id, resource_type_slug: resource_type_slug, resource_external_id: resource_external_id, search: search, parent: parent},
|
|
799
797
|
fetch_next: fetch_next
|
|
800
798
|
)
|
|
801
799
|
end
|
|
@@ -823,16 +821,6 @@ module WorkOS
|
|
|
823
821
|
parent_resource: nil,
|
|
824
822
|
request_options: {}
|
|
825
823
|
)
|
|
826
|
-
params = {}.compact
|
|
827
|
-
if parent_resource
|
|
828
|
-
case parent_resource[:type]
|
|
829
|
-
when "by_id"
|
|
830
|
-
params["parent_resource_id"] = parent_resource[:parent_resource_id]
|
|
831
|
-
when "by_external_id"
|
|
832
|
-
params["parent_resource_external_id"] = parent_resource[:parent_resource_external_id]
|
|
833
|
-
params["parent_resource_type_slug"] = parent_resource[:parent_resource_type_slug]
|
|
834
|
-
end
|
|
835
|
-
end
|
|
836
824
|
body = {
|
|
837
825
|
"external_id" => external_id,
|
|
838
826
|
"name" => name,
|
|
@@ -843,11 +831,19 @@ module WorkOS
|
|
|
843
831
|
"parent_resource_external_id" => parent_resource_external_id,
|
|
844
832
|
"parent_resource_type_slug" => parent_resource_type_slug
|
|
845
833
|
}.compact
|
|
834
|
+
if parent_resource
|
|
835
|
+
case parent_resource[:type]
|
|
836
|
+
when "by_id"
|
|
837
|
+
body["parent_resource_id"] = parent_resource[:parent_resource_id]
|
|
838
|
+
when "by_external_id"
|
|
839
|
+
body["parent_resource_external_id"] = parent_resource[:parent_resource_external_id]
|
|
840
|
+
body["parent_resource_type_slug"] = parent_resource[:parent_resource_type_slug]
|
|
841
|
+
end
|
|
842
|
+
end
|
|
846
843
|
response = @client.request(
|
|
847
844
|
method: :post,
|
|
848
845
|
path: "/authorization/resources",
|
|
849
846
|
auth: true,
|
|
850
|
-
params: params,
|
|
851
847
|
body: body,
|
|
852
848
|
request_options: request_options
|
|
853
849
|
)
|
|
@@ -894,16 +890,6 @@ module WorkOS
|
|
|
894
890
|
parent_resource: nil,
|
|
895
891
|
request_options: {}
|
|
896
892
|
)
|
|
897
|
-
params = {}.compact
|
|
898
|
-
if parent_resource
|
|
899
|
-
case parent_resource[:type]
|
|
900
|
-
when "by_id"
|
|
901
|
-
params["parent_resource_id"] = parent_resource[:parent_resource_id]
|
|
902
|
-
when "by_external_id"
|
|
903
|
-
params["parent_resource_external_id"] = parent_resource[:parent_resource_external_id]
|
|
904
|
-
params["parent_resource_type_slug"] = parent_resource[:parent_resource_type_slug]
|
|
905
|
-
end
|
|
906
|
-
end
|
|
907
893
|
body = {
|
|
908
894
|
"name" => name,
|
|
909
895
|
"description" => description,
|
|
@@ -911,11 +897,19 @@ module WorkOS
|
|
|
911
897
|
"parent_resource_external_id" => parent_resource_external_id,
|
|
912
898
|
"parent_resource_type_slug" => parent_resource_type_slug
|
|
913
899
|
}.compact
|
|
900
|
+
if parent_resource
|
|
901
|
+
case parent_resource[:type]
|
|
902
|
+
when "by_id"
|
|
903
|
+
body["parent_resource_id"] = parent_resource[:parent_resource_id]
|
|
904
|
+
when "by_external_id"
|
|
905
|
+
body["parent_resource_external_id"] = parent_resource[:parent_resource_external_id]
|
|
906
|
+
body["parent_resource_type_slug"] = parent_resource[:parent_resource_type_slug]
|
|
907
|
+
end
|
|
908
|
+
end
|
|
914
909
|
response = @client.request(
|
|
915
910
|
method: :patch,
|
|
916
911
|
path: "/authorization/resources/#{WorkOS::Util.encode_path(resource_id)}",
|
|
917
912
|
auth: true,
|
|
918
|
-
params: params,
|
|
919
913
|
body: body,
|
|
920
914
|
request_options: request_options
|
|
921
915
|
)
|
data/lib/workos/client.rb
CHANGED
|
@@ -48,6 +48,10 @@ module WorkOS
|
|
|
48
48
|
@organizations ||= WorkOS::Organizations.new(self)
|
|
49
49
|
end
|
|
50
50
|
|
|
51
|
+
def groups
|
|
52
|
+
@groups ||= WorkOS::Groups.new(self)
|
|
53
|
+
end
|
|
54
|
+
|
|
51
55
|
def admin_portal
|
|
52
56
|
@admin_portal ||= WorkOS::AdminPortal.new(self)
|
|
53
57
|
end
|
|
@@ -60,6 +64,10 @@ module WorkOS
|
|
|
60
64
|
@user_management ||= WorkOS::UserManagement.new(self)
|
|
61
65
|
end
|
|
62
66
|
|
|
67
|
+
def user_management_organization_membership_groups
|
|
68
|
+
@user_management_organization_membership_groups ||= WorkOS::UserManagementOrganizationMembershipGroups.new(self)
|
|
69
|
+
end
|
|
70
|
+
|
|
63
71
|
def webhooks
|
|
64
72
|
@webhooks ||= WorkOS::Webhooks.new(self)
|
|
65
73
|
end
|
|
@@ -34,6 +34,8 @@ module WorkOS
|
|
|
34
34
|
# @deprecated The username of the user.
|
|
35
35
|
# @!attribute raw_attributes
|
|
36
36
|
# @deprecated The raw attributes received from the directory provider.
|
|
37
|
+
# @!attribute groups
|
|
38
|
+
# @deprecated The directory groups the user belongs to. Use the List Directory Groups endpoint with a user filter instead.
|
|
37
39
|
|
|
38
40
|
attr_accessor \
|
|
39
41
|
:object,
|
|
@@ -49,8 +51,7 @@ module WorkOS
|
|
|
49
51
|
:role,
|
|
50
52
|
:roles,
|
|
51
53
|
:created_at,
|
|
52
|
-
:updated_at
|
|
53
|
-
:groups
|
|
54
|
+
:updated_at
|
|
54
55
|
|
|
55
56
|
def emails
|
|
56
57
|
warn "[DEPRECATION] `emails` is deprecated and will be removed in a future version.", uplevel: 1
|
|
@@ -80,6 +81,13 @@ module WorkOS
|
|
|
80
81
|
|
|
81
82
|
attr_writer :raw_attributes
|
|
82
83
|
|
|
84
|
+
def groups
|
|
85
|
+
warn "[DEPRECATION] `groups` is deprecated and will be removed in a future version.", uplevel: 1
|
|
86
|
+
@groups
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
attr_writer :groups
|
|
90
|
+
|
|
83
91
|
def initialize(json)
|
|
84
92
|
hash = self.class.normalize(json)
|
|
85
93
|
@object = hash[:object]
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# This file is auto-generated by oagen. Do not edit.
|
|
4
|
+
|
|
5
|
+
module WorkOS
|
|
6
|
+
class CreateGroup < WorkOS::Types::BaseModel
|
|
7
|
+
HASH_ATTRS = {
|
|
8
|
+
name: :name,
|
|
9
|
+
description: :description
|
|
10
|
+
}.freeze
|
|
11
|
+
|
|
12
|
+
attr_accessor \
|
|
13
|
+
:name,
|
|
14
|
+
:description
|
|
15
|
+
|
|
16
|
+
def initialize(json)
|
|
17
|
+
hash = self.class.normalize(json)
|
|
18
|
+
@name = hash[:name]
|
|
19
|
+
@description = hash[:description]
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# This file is auto-generated by oagen. Do not edit.
|
|
4
|
+
|
|
5
|
+
module WorkOS
|
|
6
|
+
class CreateGroupMembership < WorkOS::Types::BaseModel
|
|
7
|
+
HASH_ATTRS = {
|
|
8
|
+
organization_membership_id: :organization_membership_id
|
|
9
|
+
}.freeze
|
|
10
|
+
|
|
11
|
+
attr_accessor :organization_membership_id
|
|
12
|
+
|
|
13
|
+
def initialize(json)
|
|
14
|
+
hash = self.class.normalize(json)
|
|
15
|
+
@organization_membership_id = hash[:organization_membership_id]
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|