workos 9.5.0 → 10.0.0

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.
Files changed (195) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/block-generated-edits.yml +13 -0
  3. data/.github/workflows/ci.yml +1 -1
  4. data/.github/workflows/docs.yml +1 -1
  5. data/.github/workflows/lint.yml +1 -1
  6. data/.github/workflows/release-please.yml +7 -1
  7. data/.github/workflows/release.yml +1 -1
  8. data/.last-synced-sha +1 -1
  9. data/.oagen-manifest.json +197 -75
  10. data/.release-please-manifest.json +1 -1
  11. data/CHANGELOG.md +87 -0
  12. data/Gemfile.lock +2 -2
  13. data/README.md +15 -14
  14. data/lib/workos/agents/agent_admin_link_claim_attempt_to_external_user_request.rb +28 -0
  15. data/lib/workos/agents/agent_admin_link_claim_attempt_to_external_user_request_user.rb +22 -0
  16. data/lib/workos/agents/agent_admin_validate_credential_request.rb +25 -0
  17. data/lib/workos/agents/agent_credential_validation.rb +25 -0
  18. data/lib/workos/agents/agent_registration.rb +40 -0
  19. data/lib/workos/agents/agent_registration_agent_identity.rb +28 -0
  20. data/lib/workos/agents/agent_registration_claim.rb +31 -0
  21. data/lib/workos/agents/agent_registration_claim_claim_completion.rb +31 -0
  22. data/lib/workos/agents/claim_view_response.rb +28 -0
  23. data/lib/workos/agents/claim_view_response_organization.rb +7 -0
  24. data/lib/workos/agents.rb +93 -0
  25. data/lib/workos/api_keys/api_key_validation_response.rb +6 -2
  26. data/lib/workos/api_keys.rb +3 -4
  27. data/lib/workos/authorization/permission_created_data.rb +1 -34
  28. data/lib/workos/authorization/permission_deleted_data.rb +1 -1
  29. data/lib/workos/authorization/permission_updated_data.rb +1 -1
  30. data/lib/workos/authorization.rb +24 -24
  31. data/lib/workos/base_client.rb +4 -4
  32. data/lib/workos/client.rb +4 -0
  33. data/lib/workos/connect.rb +23 -19
  34. data/lib/workos/directory_sync.rb +10 -2
  35. data/lib/workos/groups.rb +7 -7
  36. data/lib/workos/inflections.rb +0 -1
  37. data/lib/workos/organization_domains.rb +4 -4
  38. data/lib/workos/organizations/organization_authorized_connect_application_list_data.rb +34 -0
  39. data/lib/workos/organizations.rb +57 -10
  40. data/lib/workos/pipes/api_key_installation.rb +25 -0
  41. data/lib/workos/pipes/{connected_account_dto.rb → connected_account_input.rb} +1 -1
  42. data/lib/workos/pipes/create_data_integration.rb +7 -1
  43. data/lib/workos/pipes/data_integration.rb +6 -0
  44. data/lib/workos/pipes/{data_integration_credentials_dto.rb → data_integration_credentials_input.rb} +1 -1
  45. data/lib/workos/pipes/data_integration_installation.rb +28 -0
  46. data/lib/workos/pipes/data_integrations_upsert_api_key_request.rb +1 -19
  47. data/lib/workos/pipes/update_data_integration.rb +4 -1
  48. data/lib/workos/pipes.rb +25 -16
  49. data/lib/workos/pipes_provider.rb +2 -2
  50. data/lib/workos/shared/access_token_agent_registration_credential_issued_data_detail.rb +25 -0
  51. data/lib/workos/shared/agent_registration_claim_attempt_created.rb +34 -0
  52. data/lib/workos/shared/agent_registration_claim_attempt_created_data.rb +40 -0
  53. data/lib/workos/shared/agent_registration_claim_completed.rb +34 -0
  54. data/lib/workos/shared/agent_registration_claim_completed_data.rb +40 -0
  55. data/lib/workos/shared/agent_registration_claim_completed_data_claimed_by.rb +22 -0
  56. data/lib/workos/shared/agent_registration_created.rb +34 -0
  57. data/lib/workos/{organization_domains/organization_domain_stand_alone.rb → shared/agent_registration_created_data.rb} +13 -16
  58. data/lib/workos/shared/agent_registration_created_data_agent_identity.rb +25 -0
  59. data/lib/workos/shared/agent_registration_credential_issued.rb +34 -0
  60. data/lib/workos/shared/agent_registration_credential_issued_data.rb +34 -0
  61. data/lib/workos/shared/agent_registration_credential_issued_data_detail.rb +22 -0
  62. data/lib/workos/shared/agent_registration_deleted.rb +34 -0
  63. data/lib/workos/shared/agent_registration_deleted_data.rb +18 -0
  64. data/lib/workos/shared/agent_registration_expired.rb +34 -0
  65. data/lib/workos/shared/agent_registration_expired_data.rb +7 -0
  66. data/lib/workos/shared/agent_registration_organization_switched.rb +34 -0
  67. data/lib/workos/shared/agent_registration_organization_switched_data.rb +25 -0
  68. data/lib/workos/shared/agent_registration_revoked.rb +34 -0
  69. data/lib/workos/shared/agent_registration_revoked_data.rb +7 -0
  70. data/lib/workos/shared/pipes_connected_account_connection_failed.rb +34 -0
  71. data/lib/workos/shared/pipes_connected_account_connection_failed_data.rb +46 -0
  72. data/lib/workos/shared/radar_challenge_created.rb +34 -0
  73. data/lib/workos/shared/radar_challenge_created_data.rb +28 -0
  74. data/lib/workos/sso/connection.rb +3 -3
  75. data/lib/workos/types/agent_admin_validate_credential_request_type.rb +13 -0
  76. data/lib/workos/types/agent_registration_created_data_kind.rb +14 -0
  77. data/lib/workos/types/agent_registration_created_data_method.rb +14 -0
  78. data/lib/workos/types/agent_registration_created_data_status.rb +15 -0
  79. data/lib/workos/types/{data_integration_credentials_type.rb → agent_registration_kind.rb} +1 -1
  80. data/lib/workos/types/{organization_domain_stand_alone_state.rb → agent_registration_status.rb} +1 -1
  81. data/lib/workos/types/applications_registration_types.rb +13 -0
  82. data/lib/workos/types/{organization_domain_stand_alone_verification_strategy.rb → claim_view_response_status.rb} +1 -1
  83. data/lib/workos/types/connected_account_input_state.rb +13 -0
  84. data/lib/workos/types/connected_account_state.rb +2 -1
  85. data/lib/workos/types/create_data_integration_auth_methods.rb +9 -0
  86. data/lib/workos/types/create_user_password_hash_type.rb +2 -1
  87. data/lib/workos/types/create_webhook_endpoint_events.rb +5 -1
  88. data/lib/workos/types/data_integration_auth_methods.rb +9 -0
  89. data/lib/workos/types/data_integration_credentials_input_type.rb +9 -0
  90. data/lib/workos/types/data_integrations_list_response_data_connected_account_state.rb +1 -6
  91. data/lib/workos/types/pipe_connected_account_state.rb +1 -5
  92. data/lib/workos/types/vault_kek_deleted_data_actor_source.rb +9 -0
  93. data/lib/workos/user_management/authentication_reauthentication_succeeded.rb +34 -0
  94. data/lib/workos/user_management/authentication_reauthentication_succeeded_data.rb +34 -0
  95. data/lib/workos/user_management/radar_challenge.rb +43 -0
  96. data/lib/workos/user_management.rb +59 -23
  97. data/lib/workos/vault/vault_kek_deleted.rb +34 -0
  98. data/lib/workos/vault/vault_kek_deleted_data.rb +31 -0
  99. data/lib/workos/vault.rb +4 -4
  100. data/lib/workos/version.rb +1 -1
  101. data/lib/workos/widgets.rb +2 -2
  102. data/lib/workos.rb +11 -0
  103. data/rbi/workos/access_token_agent_registration_credential_issued_data_detail.rbi +36 -0
  104. data/rbi/workos/agent_admin_link_claim_attempt_to_external_user_request.rbi +42 -0
  105. data/rbi/workos/agent_admin_link_claim_attempt_to_external_user_request_user.rbi +30 -0
  106. data/rbi/workos/agent_admin_validate_credential_request.rbi +36 -0
  107. data/rbi/workos/{sso_intent_options.rbi → agent_credential_validation.rbi} +11 -5
  108. data/rbi/workos/agent_registration.rbi +66 -0
  109. data/rbi/workos/agent_registration_agent_identity.rbi +42 -0
  110. data/rbi/workos/agent_registration_claim.rbi +48 -0
  111. data/rbi/workos/agent_registration_claim_attempt_created.rbi +54 -0
  112. data/rbi/workos/agent_registration_claim_attempt_created_data.rbi +66 -0
  113. data/rbi/workos/agent_registration_claim_claim_completion.rbi +48 -0
  114. data/rbi/workos/agent_registration_claim_completed.rbi +54 -0
  115. data/rbi/workos/agent_registration_claim_completed_data.rbi +66 -0
  116. data/rbi/workos/agent_registration_claim_completed_data_claimed_by.rbi +30 -0
  117. data/rbi/workos/agent_registration_created.rbi +54 -0
  118. data/rbi/workos/agent_registration_created_data.rbi +72 -0
  119. data/rbi/workos/agent_registration_created_data_agent_identity.rbi +36 -0
  120. data/rbi/workos/agent_registration_credential_issued.rbi +54 -0
  121. data/rbi/workos/agent_registration_credential_issued_data.rbi +54 -0
  122. data/rbi/workos/agent_registration_credential_issued_data_detail.rbi +30 -0
  123. data/rbi/workos/agent_registration_deleted.rbi +54 -0
  124. data/rbi/workos/{connection_option.rbi → agent_registration_deleted_data.rbi} +5 -5
  125. data/rbi/workos/agent_registration_expired.rbi +54 -0
  126. data/rbi/workos/{domain_verification_intent_options.rbi → agent_registration_expired_data.rbi} +5 -5
  127. data/rbi/workos/agent_registration_organization_switched.rbi +54 -0
  128. data/rbi/workos/agent_registration_organization_switched_data.rbi +36 -0
  129. data/rbi/workos/agent_registration_revoked.rbi +54 -0
  130. data/rbi/workos/agent_registration_revoked_data.rbi +24 -0
  131. data/rbi/workos/agents.rbi +42 -0
  132. data/rbi/workos/api_key_installation.rbi +36 -0
  133. data/rbi/workos/api_key_validation_response.rbi +6 -0
  134. data/rbi/workos/authentication_reauthentication_succeeded.rbi +54 -0
  135. data/rbi/workos/authentication_reauthentication_succeeded_data.rbi +54 -0
  136. data/rbi/workos/claim_view_response.rbi +42 -0
  137. data/rbi/workos/claim_view_response_organization.rbi +30 -0
  138. data/rbi/workos/client.rbi +3 -0
  139. data/rbi/workos/connect.rbi +2 -1
  140. data/rbi/workos/{connected_account_dto.rbi → connected_account_input.rbi} +1 -1
  141. data/rbi/workos/connection.rbi +4 -4
  142. data/rbi/workos/create_data_integration.rbi +14 -2
  143. data/rbi/workos/data_integration.rbi +12 -0
  144. data/rbi/workos/{data_integration_credentials_dto.rbi → data_integration_credentials_input.rbi} +1 -1
  145. data/rbi/workos/data_integration_installation.rbi +42 -0
  146. data/rbi/workos/directory_sync.rbi +3 -1
  147. data/rbi/workos/organization_authorized_connect_application_list_data.rbi +54 -0
  148. data/rbi/workos/organization_domains.rbi +2 -2
  149. data/rbi/workos/organizations.rbi +12 -0
  150. data/rbi/workos/permission_created_data.rbi +6 -0
  151. data/rbi/workos/permission_deleted_data.rbi +6 -0
  152. data/rbi/workos/permission_updated_data.rbi +6 -0
  153. data/rbi/workos/pipes.rbi +7 -4
  154. data/rbi/workos/pipes_connected_account_connection_failed.rbi +54 -0
  155. data/rbi/workos/{organization_domain_stand_alone.rbi → pipes_connected_account_connection_failed_data.rbi} +23 -23
  156. data/rbi/workos/radar_challenge.rbi +72 -0
  157. data/rbi/workos/radar_challenge_created.rbi +54 -0
  158. data/rbi/workos/radar_challenge_created_data.rbi +42 -0
  159. data/rbi/workos/update_data_integration.rbi +8 -2
  160. data/rbi/workos/user_management.rbi +16 -0
  161. data/rbi/workos/vault_kek_deleted.rbi +54 -0
  162. data/rbi/workos/vault_kek_deleted_data.rbi +48 -0
  163. data/rbi/workos/widget_session_token.rbi +2 -2
  164. data/rbi/workos/widgets.rbi +1 -1
  165. data/test/workos/test_agents.rb +49 -0
  166. data/test/workos/test_agents_model_round_trip.rb +165 -0
  167. data/test/workos/test_api_keys_model_round_trip.rb +307 -0
  168. data/test/workos/test_authorization_model_round_trip.rb +237 -0
  169. data/test/workos/test_base_client.rb +27 -0
  170. data/test/workos/test_client_api_model_round_trip.rb +31 -0
  171. data/test/workos/test_connect_model_round_trip.rb +175 -0
  172. data/test/workos/test_directory_sync_model_round_trip.rb +579 -0
  173. data/test/workos/test_feature_flags_model_round_trip.rb +580 -0
  174. data/test/workos/test_groups_model_round_trip.rb +56 -0
  175. data/test/workos/test_multi_factor_auth_model_round_trip.rb +192 -0
  176. data/test/workos/test_organization_domains_model_round_trip.rb +260 -0
  177. data/test/workos/test_organization_membership_model_round_trip.rb +89 -0
  178. data/test/workos/test_organizations.rb +9 -1
  179. data/test/workos/test_organizations_model_round_trip.rb +602 -0
  180. data/test/workos/test_pipes_model_round_trip.rb +40 -4
  181. data/test/workos/test_pipes_provider_model_round_trip.rb +75 -0
  182. data/test/workos/test_shared_model_round_trip.rb +787 -0
  183. data/test/workos/test_sso_model_round_trip.rb +422 -0
  184. data/test/workos/test_user_management.rb +16 -0
  185. data/test/workos/test_user_management_model_round_trip.rb +1501 -0
  186. data/test/workos/test_vault_model_round_trip.rb +571 -0
  187. data/test/workos/test_widgets.rb +2 -2
  188. data/test/workos/test_widgets_model_round_trip.rb +30 -0
  189. metadata +118 -19
  190. data/lib/workos/admin_portal/domain_verification_intent_options.rb +0 -18
  191. data/lib/workos/admin_portal/intent_options.rb +0 -22
  192. data/lib/workos/admin_portal/sso_intent_options.rb +0 -22
  193. data/lib/workos/sso/connection_option.rb +0 -18
  194. data/rbi/workos/intent_options.rbi +0 -30
  195. data/test/workos/test_model_round_trip.rb +0 -6
@@ -615,16 +615,16 @@ module WorkOS
615
615
  organization_id:,
616
616
  name:,
617
617
  slug: nil,
618
- description: nil,
618
+ description: WorkOS::OMIT,
619
619
  resource_type_slug: nil,
620
620
  request_options: {}
621
621
  )
622
622
  body = {
623
623
  "slug" => slug,
624
624
  "name" => name,
625
- "description" => description,
626
625
  "resource_type_slug" => resource_type_slug
627
626
  }.compact
627
+ body["description"] = description unless description.equal?(WorkOS::OMIT)
628
628
  response = @client.request(
629
629
  method: :post,
630
630
  path: "/authorization/organizations/#{WorkOS::Util.encode_path(organization_id)}/roles",
@@ -669,13 +669,13 @@ module WorkOS
669
669
  organization_id:,
670
670
  slug:,
671
671
  name: nil,
672
- description: nil,
672
+ description: WorkOS::OMIT,
673
673
  request_options: {}
674
674
  )
675
675
  body = {
676
- "name" => name,
677
- "description" => description
676
+ "name" => name
678
677
  }.compact
678
+ body["description"] = description unless description.equal?(WorkOS::OMIT)
679
679
  response = @client.request(
680
680
  method: :patch,
681
681
  path: "/authorization/organizations/#{WorkOS::Util.encode_path(organization_id)}/roles/#{WorkOS::Util.encode_path(slug)}",
@@ -821,14 +821,14 @@ module WorkOS
821
821
  resource_type_slug:,
822
822
  external_id:,
823
823
  name: nil,
824
- description: nil,
824
+ description: WorkOS::OMIT,
825
825
  parent_resource: nil,
826
826
  request_options: {}
827
827
  )
828
828
  body = {
829
- "name" => name,
830
- "description" => description
829
+ "name" => name
831
830
  }.compact
831
+ body["description"] = description unless description.equal?(WorkOS::OMIT)
832
832
  if parent_resource
833
833
  case parent_resource
834
834
  when WorkOS::Authorization::ParentResourceById
@@ -1081,17 +1081,17 @@ module WorkOS
1081
1081
  name:,
1082
1082
  resource_type_slug:,
1083
1083
  organization_id:,
1084
- description: nil,
1084
+ description: WorkOS::OMIT,
1085
1085
  parent_resource: nil,
1086
1086
  request_options: {}
1087
1087
  )
1088
1088
  body = {
1089
1089
  "external_id" => external_id,
1090
1090
  "name" => name,
1091
- "description" => description,
1092
1091
  "resource_type_slug" => resource_type_slug,
1093
1092
  "organization_id" => organization_id
1094
- }.compact
1093
+ }
1094
+ body["description"] = description unless description.equal?(WorkOS::OMIT)
1095
1095
  if parent_resource
1096
1096
  case parent_resource
1097
1097
  when WorkOS::Authorization::ParentResourceById
@@ -1144,14 +1144,14 @@ module WorkOS
1144
1144
  def update_resource(
1145
1145
  resource_id:,
1146
1146
  name: nil,
1147
- description: nil,
1147
+ description: WorkOS::OMIT,
1148
1148
  parent_resource: nil,
1149
1149
  request_options: {}
1150
1150
  )
1151
1151
  body = {
1152
- "name" => name,
1153
- "description" => description
1152
+ "name" => name
1154
1153
  }.compact
1154
+ body["description"] = description unless description.equal?(WorkOS::OMIT)
1155
1155
  if parent_resource
1156
1156
  case parent_resource
1157
1157
  when WorkOS::Authorization::ParentResourceById
@@ -1329,16 +1329,16 @@ module WorkOS
1329
1329
  def create_environment_role(
1330
1330
  slug:,
1331
1331
  name:,
1332
- description: nil,
1332
+ description: WorkOS::OMIT,
1333
1333
  resource_type_slug: nil,
1334
1334
  request_options: {}
1335
1335
  )
1336
1336
  body = {
1337
1337
  "slug" => slug,
1338
1338
  "name" => name,
1339
- "description" => description,
1340
1339
  "resource_type_slug" => resource_type_slug
1341
1340
  }.compact
1341
+ body["description"] = description unless description.equal?(WorkOS::OMIT)
1342
1342
  response = @client.request(
1343
1343
  method: :post,
1344
1344
  path: "/authorization/roles",
@@ -1379,13 +1379,13 @@ module WorkOS
1379
1379
  def update_environment_role(
1380
1380
  slug:,
1381
1381
  name: nil,
1382
- description: nil,
1382
+ description: WorkOS::OMIT,
1383
1383
  request_options: {}
1384
1384
  )
1385
1385
  body = {
1386
- "name" => name,
1387
- "description" => description
1386
+ "name" => name
1388
1387
  }.compact
1388
+ body["description"] = description unless description.equal?(WorkOS::OMIT)
1389
1389
  response = @client.request(
1390
1390
  method: :patch,
1391
1391
  path: "/authorization/roles/#{WorkOS::Util.encode_path(slug)}",
@@ -1502,16 +1502,16 @@ module WorkOS
1502
1502
  def create_permission(
1503
1503
  slug:,
1504
1504
  name:,
1505
- description: nil,
1505
+ description: WorkOS::OMIT,
1506
1506
  resource_type_slug: nil,
1507
1507
  request_options: {}
1508
1508
  )
1509
1509
  body = {
1510
1510
  "slug" => slug,
1511
1511
  "name" => name,
1512
- "description" => description,
1513
1512
  "resource_type_slug" => resource_type_slug
1514
1513
  }.compact
1514
+ body["description"] = description unless description.equal?(WorkOS::OMIT)
1515
1515
  response = @client.request(
1516
1516
  method: :post,
1517
1517
  path: "/authorization/permissions",
@@ -1552,13 +1552,13 @@ module WorkOS
1552
1552
  def update_permission(
1553
1553
  slug:,
1554
1554
  name: nil,
1555
- description: nil,
1555
+ description: WorkOS::OMIT,
1556
1556
  request_options: {}
1557
1557
  )
1558
1558
  body = {
1559
- "name" => name,
1560
- "description" => description
1559
+ "name" => name
1561
1560
  }.compact
1561
+ body["description"] = description unless description.equal?(WorkOS::OMIT)
1562
1562
  response = @client.request(
1563
1563
  method: :patch,
1564
1564
  path: "/authorization/permissions/#{WorkOS::Util.encode_path(slug)}",
@@ -66,7 +66,7 @@ module WorkOS
66
66
  def post_request(path:, auth: false, body: {}, params: {}, request_options: nil)
67
67
  req = build_request(Net::HTTP::Post, append_query(path, params),
68
68
  auth: auth, request_options: request_options)
69
- req.body = body.nil? ? "" : body.compact.to_json
69
+ req.body = body.nil? ? "" : body.to_json
70
70
  req["Content-Type"] = "application/json"
71
71
  inject_idempotency_key(req, request_options)
72
72
  req
@@ -75,7 +75,7 @@ module WorkOS
75
75
  def put_request(path:, auth: false, body: {}, params: {}, request_options: nil)
76
76
  req = build_request(Net::HTTP::Put, append_query(path, params),
77
77
  auth: auth, request_options: request_options)
78
- req.body = body.nil? ? "" : body.compact.to_json
78
+ req.body = body.nil? ? "" : body.to_json
79
79
  req["Content-Type"] = "application/json"
80
80
  inject_idempotency_key(req, request_options)
81
81
  req
@@ -84,7 +84,7 @@ module WorkOS
84
84
  def patch_request(path:, auth: false, body: {}, params: {}, request_options: nil)
85
85
  req = build_request(Net::HTTP::Patch, append_query(path, params),
86
86
  auth: auth, request_options: request_options)
87
- req.body = body.nil? ? "" : body.compact.to_json
87
+ req.body = body.nil? ? "" : body.to_json
88
88
  req["Content-Type"] = "application/json"
89
89
  inject_idempotency_key(req, request_options)
90
90
  req
@@ -94,7 +94,7 @@ module WorkOS
94
94
  req = build_request(Net::HTTP::Delete, append_query(path, params),
95
95
  auth: auth, request_options: request_options)
96
96
  if body
97
- req.body = body.compact.to_json
97
+ req.body = body.to_json
98
98
  req["Content-Type"] = "application/json"
99
99
  end
100
100
  req
data/lib/workos/client.rb CHANGED
@@ -4,6 +4,10 @@
4
4
 
5
5
  module WorkOS
6
6
  class Client < BaseClient
7
+ def agents
8
+ @agents ||= WorkOS::Agents.new(self)
9
+ end
10
+
7
11
  def multi_factor_auth
8
12
  @multi_factor_auth ||= WorkOS::MultiFactorAuth.new(self)
9
13
  end
@@ -44,6 +44,7 @@ module WorkOS
44
44
  # @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"`.
45
45
  # @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
46
46
  # @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).
47
+ # @param registration_types [Array<WorkOS::Types::ApplicationsRegistrationTypes>, nil] Filter Connect Applications by registration type. Specify multiple as a comma-separated list (e.g. `registration_types=dynamic,authenticated`). Defaults to `authenticated` only when not specified.
47
48
  # @param organization_id [String, nil] Filter Connect Applications by organization ID.
48
49
  # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
49
50
  # @return [WorkOS::Types::ListStruct<WorkOS::ConnectApplication>]
@@ -52,6 +53,7 @@ module WorkOS
52
53
  after: nil,
53
54
  limit: 10,
54
55
  order: "desc",
56
+ registration_types: nil,
55
57
  organization_id: nil,
56
58
  request_options: {}
57
59
  )
@@ -60,6 +62,7 @@ module WorkOS
60
62
  "after" => after,
61
63
  "limit" => limit,
62
64
  "order" => order,
65
+ "registration_types" => registration_types,
63
66
  "organization_id" => organization_id
64
67
  }.compact
65
68
  response = @client.request(
@@ -75,6 +78,7 @@ module WorkOS
75
78
  after: cursor,
76
79
  limit: limit,
77
80
  order: order,
81
+ registration_types: registration_types,
78
82
  organization_id: organization_id,
79
83
  request_options: request_options
80
84
  )
@@ -82,7 +86,7 @@ module WorkOS
82
86
  WorkOS::Types::ListStruct.from_response(
83
87
  response,
84
88
  model: WorkOS::ConnectApplication,
85
- filters: {before: before, limit: limit, order: order, organization_id: organization_id},
89
+ filters: {before: before, limit: limit, order: order, registration_types: registration_types, organization_id: organization_id},
86
90
  fetch_next: fetch_next
87
91
  )
88
92
  end
@@ -101,24 +105,24 @@ module WorkOS
101
105
  def create_application(
102
106
  name:,
103
107
  application_type:,
104
- description: nil,
105
- scopes: nil,
106
- redirect_uris: nil,
107
- uses_pkce: nil,
108
+ description: WorkOS::OMIT,
109
+ scopes: WorkOS::OMIT,
110
+ redirect_uris: WorkOS::OMIT,
111
+ uses_pkce: WorkOS::OMIT,
108
112
  is_first_party: nil,
109
- organization_id: nil,
113
+ organization_id: WorkOS::OMIT,
110
114
  request_options: {}
111
115
  )
112
116
  body = {
113
117
  "name" => name,
114
118
  "application_type" => application_type,
115
- "description" => description,
116
- "scopes" => scopes,
117
- "redirect_uris" => redirect_uris,
118
- "uses_pkce" => uses_pkce,
119
- "is_first_party" => is_first_party,
120
- "organization_id" => organization_id
119
+ "is_first_party" => is_first_party
121
120
  }.compact
121
+ body["description"] = description unless description.equal?(WorkOS::OMIT)
122
+ body["scopes"] = scopes unless scopes.equal?(WorkOS::OMIT)
123
+ body["redirect_uris"] = redirect_uris unless redirect_uris.equal?(WorkOS::OMIT)
124
+ body["uses_pkce"] = uses_pkce unless uses_pkce.equal?(WorkOS::OMIT)
125
+ body["organization_id"] = organization_id unless organization_id.equal?(WorkOS::OMIT)
122
126
  response = @client.request(
123
127
  method: :post,
124
128
  path: "/connect/applications",
@@ -232,17 +236,17 @@ module WorkOS
232
236
  def update_application(
233
237
  id:,
234
238
  name: nil,
235
- description: nil,
236
- scopes: nil,
237
- redirect_uris: nil,
239
+ description: WorkOS::OMIT,
240
+ scopes: WorkOS::OMIT,
241
+ redirect_uris: WorkOS::OMIT,
238
242
  request_options: {}
239
243
  )
240
244
  body = {
241
- "name" => name,
242
- "description" => description,
243
- "scopes" => scopes,
244
- "redirect_uris" => redirect_uris
245
+ "name" => name
245
246
  }.compact
247
+ body["description"] = description unless description.equal?(WorkOS::OMIT)
248
+ body["scopes"] = scopes unless scopes.equal?(WorkOS::OMIT)
249
+ body["redirect_uris"] = redirect_uris unless redirect_uris.equal?(WorkOS::OMIT)
246
250
  response = @client.request(
247
251
  method: :put,
248
252
  path: "/connect/applications/#{WorkOS::Util.encode_path(id)}",
@@ -180,6 +180,8 @@ module WorkOS
180
180
  # @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).
181
181
  # @param directory [String, nil] Unique identifier of the WorkOS Directory. This value can be obtained from the WorkOS dashboard or from the WorkOS API.
182
182
  # @param group [String, nil] Unique identifier of the WorkOS Directory Group. This value can be obtained from the WorkOS API.
183
+ # @param idp_id [String, nil] Filter Directory Users by the identity provider's unique identifier (`idp_id`). Requires the `directory` parameter to also be provided.
184
+ # @param email [String, nil] Filter Directory Users by their primary email address. Requires the `directory` parameter to also be provided.
183
185
  # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
184
186
  # @return [WorkOS::Types::ListStruct<WorkOS::DirectoryUserWithGroups>]
185
187
  def list_users(
@@ -189,6 +191,8 @@ module WorkOS
189
191
  order: "desc",
190
192
  directory: nil,
191
193
  group: nil,
194
+ idp_id: nil,
195
+ email: nil,
192
196
  request_options: {}
193
197
  )
194
198
  params = {
@@ -197,7 +201,9 @@ module WorkOS
197
201
  "limit" => limit,
198
202
  "order" => order,
199
203
  "directory" => directory,
200
- "group" => group
204
+ "group" => group,
205
+ "idp_id" => idp_id,
206
+ "email" => email
201
207
  }.compact
202
208
  response = @client.request(
203
209
  method: :get,
@@ -214,13 +220,15 @@ module WorkOS
214
220
  order: order,
215
221
  directory: directory,
216
222
  group: group,
223
+ idp_id: idp_id,
224
+ email: email,
217
225
  request_options: request_options
218
226
  )
219
227
  }
220
228
  WorkOS::Types::ListStruct.from_response(
221
229
  response,
222
230
  model: WorkOS::DirectoryUserWithGroups,
223
- filters: {before: before, limit: limit, order: order, directory: directory, group: group},
231
+ filters: {before: before, limit: limit, order: order, directory: directory, group: group, idp_id: idp_id, email: email},
224
232
  fetch_next: fetch_next
225
233
  )
226
234
  end
data/lib/workos/groups.rb CHANGED
@@ -66,13 +66,13 @@ module WorkOS
66
66
  def create_organization_group(
67
67
  organization_id:,
68
68
  name:,
69
- description: nil,
69
+ description: WorkOS::OMIT,
70
70
  request_options: {}
71
71
  )
72
72
  body = {
73
- "name" => name,
74
- "description" => description
75
- }.compact
73
+ "name" => name
74
+ }
75
+ body["description"] = description unless description.equal?(WorkOS::OMIT)
76
76
  response = @client.request(
77
77
  method: :post,
78
78
  path: "/organizations/#{WorkOS::Util.encode_path(organization_id)}/groups",
@@ -117,13 +117,13 @@ module WorkOS
117
117
  organization_id:,
118
118
  group_id:,
119
119
  name: nil,
120
- description: nil,
120
+ description: WorkOS::OMIT,
121
121
  request_options: {}
122
122
  )
123
123
  body = {
124
- "name" => name,
125
- "description" => description
124
+ "name" => name
126
125
  }.compact
126
+ body["description"] = description unless description.equal?(WorkOS::OMIT)
127
127
  response = @client.request(
128
128
  method: :patch,
129
129
  path: "/organizations/#{WorkOS::Util.encode_path(organization_id)}/groups/#{WorkOS::Util.encode_path(group_id)}",
@@ -54,7 +54,6 @@ WORKOS_INFLECTIONS = {
54
54
  "sso" => "SSO",
55
55
  "sso_authorize_url_response" => "SSOAuthorizeUrlResponse",
56
56
  "sso_device_authorization_request" => "SSODeviceAuthorizationRequest",
57
- "sso_intent_options" => "SSOIntentOptions",
58
57
  "sso_logout_authorize_request" => "SSOLogoutAuthorizeRequest",
59
58
  "sso_logout_authorize_response" => "SSOLogoutAuthorizeResponse",
60
59
  "sso_provider" => "SSOProvider",
@@ -39,7 +39,7 @@ module WorkOS
39
39
  # Get an Organization Domain
40
40
  # @param id [String] Unique identifier of the organization domain.
41
41
  # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
42
- # @return [WorkOS::OrganizationDomainStandAlone]
42
+ # @return [WorkOS::OrganizationDomain]
43
43
  def get_organization_domain(
44
44
  id:,
45
45
  request_options: {}
@@ -50,7 +50,7 @@ module WorkOS
50
50
  auth: true,
51
51
  request_options: request_options
52
52
  )
53
- result = WorkOS::OrganizationDomainStandAlone.new(response.body)
53
+ result = WorkOS::OrganizationDomain.new(response.body)
54
54
  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"])
55
55
  result
56
56
  end
@@ -75,7 +75,7 @@ module WorkOS
75
75
  # Verify an Organization Domain
76
76
  # @param id [String] Unique identifier of the organization domain.
77
77
  # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
78
- # @return [WorkOS::OrganizationDomainStandAlone]
78
+ # @return [WorkOS::OrganizationDomain]
79
79
  def verify_organization_domain(
80
80
  id:,
81
81
  request_options: {}
@@ -86,7 +86,7 @@ module WorkOS
86
86
  auth: true,
87
87
  request_options: request_options
88
88
  )
89
- result = WorkOS::OrganizationDomainStandAlone.new(response.body)
89
+ result = WorkOS::OrganizationDomain.new(response.body)
90
90
  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"])
91
91
  result
92
92
  end
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module WorkOS
6
+ class OrganizationAuthorizedConnectApplicationListData < WorkOS::Types::BaseModel
7
+ HASH_ATTRS = {
8
+ object: :object,
9
+ id: :id,
10
+ granted_scopes: :granted_scopes,
11
+ oauth_resource: :oauth_resource,
12
+ application: :application,
13
+ user_id: :user_id
14
+ }.freeze
15
+
16
+ attr_accessor \
17
+ :object,
18
+ :id,
19
+ :granted_scopes,
20
+ :oauth_resource,
21
+ :application,
22
+ :user_id
23
+
24
+ def initialize(json)
25
+ hash = self.class.normalize(json)
26
+ @object = hash[:object]
27
+ @id = hash[:id]
28
+ @granted_scopes = hash[:granted_scopes] || []
29
+ @oauth_resource = hash[:oauth_resource]
30
+ @application = hash[:application] ? WorkOS::ConnectApplication.new(hash[:application]) : nil
31
+ @user_id = hash[:user_id]
32
+ end
33
+ end
34
+ end
@@ -76,18 +76,18 @@ module WorkOS
76
76
  allow_profiles_outside_organization: nil,
77
77
  domains: nil,
78
78
  domain_data: nil,
79
- metadata: nil,
80
- external_id: nil,
79
+ metadata: WorkOS::OMIT,
80
+ external_id: WorkOS::OMIT,
81
81
  request_options: {}
82
82
  )
83
83
  body = {
84
84
  "name" => name,
85
85
  "allow_profiles_outside_organization" => allow_profiles_outside_organization,
86
86
  "domains" => domains,
87
- "domain_data" => domain_data,
88
- "metadata" => metadata,
89
- "external_id" => external_id
87
+ "domain_data" => domain_data
90
88
  }.compact
89
+ body["metadata"] = metadata unless metadata.equal?(WorkOS::OMIT)
90
+ body["external_id"] = external_id unless external_id.equal?(WorkOS::OMIT)
91
91
  response = @client.request(
92
92
  method: :post,
93
93
  path: "/organizations",
@@ -156,8 +156,8 @@ module WorkOS
156
156
  domains: nil,
157
157
  domain_data: nil,
158
158
  stripe_customer_id: nil,
159
- metadata: nil,
160
- external_id: nil,
159
+ metadata: WorkOS::OMIT,
160
+ external_id: WorkOS::OMIT,
161
161
  request_options: {}
162
162
  )
163
163
  body = {
@@ -165,10 +165,10 @@ module WorkOS
165
165
  "allow_profiles_outside_organization" => allow_profiles_outside_organization,
166
166
  "domains" => domains,
167
167
  "domain_data" => domain_data,
168
- "stripe_customer_id" => stripe_customer_id,
169
- "metadata" => metadata,
170
- "external_id" => external_id
168
+ "stripe_customer_id" => stripe_customer_id
171
169
  }.compact
170
+ body["metadata"] = metadata unless metadata.equal?(WorkOS::OMIT)
171
+ body["external_id"] = external_id unless external_id.equal?(WorkOS::OMIT)
172
172
  response = @client.request(
173
173
  method: :put,
174
174
  path: "/organizations/#{WorkOS::Util.encode_path(id)}",
@@ -216,5 +216,52 @@ module WorkOS
216
216
  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"])
217
217
  result
218
218
  end
219
+
220
+ # List authorized applications
221
+ # @param organization_id [String] The ID of the organization.
222
+ # @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"`.
223
+ # @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"`.
224
+ # @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
225
+ # @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).
226
+ # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
227
+ # @return [WorkOS::Types::ListStruct<WorkOS::OrganizationAuthorizedConnectApplicationListData>]
228
+ def list_authorized_applications(
229
+ organization_id:,
230
+ before: nil,
231
+ after: nil,
232
+ limit: 10,
233
+ order: "desc",
234
+ request_options: {}
235
+ )
236
+ params = {
237
+ "before" => before,
238
+ "after" => after,
239
+ "limit" => limit,
240
+ "order" => order
241
+ }.compact
242
+ response = @client.request(
243
+ method: :get,
244
+ path: "/organizations/#{WorkOS::Util.encode_path(organization_id)}/authorized_applications",
245
+ auth: true,
246
+ params: params,
247
+ request_options: request_options
248
+ )
249
+ fetch_next = ->(cursor) {
250
+ list_authorized_applications(
251
+ organization_id: organization_id,
252
+ before: before,
253
+ after: cursor,
254
+ limit: limit,
255
+ order: order,
256
+ request_options: request_options
257
+ )
258
+ }
259
+ WorkOS::Types::ListStruct.from_response(
260
+ response,
261
+ model: WorkOS::OrganizationAuthorizedConnectApplicationListData,
262
+ filters: {organization_id: organization_id, before: before, limit: limit, order: order},
263
+ fetch_next: fetch_next
264
+ )
265
+ end
219
266
  end
220
267
  end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module WorkOS
6
+ class ApiKeyInstallation < WorkOS::Types::BaseModel
7
+ HASH_ATTRS = {
8
+ secret: :secret,
9
+ user_id: :user_id,
10
+ organization_id: :organization_id
11
+ }.freeze
12
+
13
+ attr_accessor \
14
+ :secret,
15
+ :user_id,
16
+ :organization_id
17
+
18
+ def initialize(json)
19
+ hash = self.class.normalize(json)
20
+ @secret = hash[:secret]
21
+ @user_id = hash[:user_id]
22
+ @organization_id = hash[:organization_id]
23
+ end
24
+ end
25
+ end
@@ -3,7 +3,7 @@
3
3
  # This file is auto-generated by oagen. Do not edit.
4
4
 
5
5
  module WorkOS
6
- class ConnectedAccountDto < WorkOS::Types::BaseModel
6
+ class ConnectedAccountInput < WorkOS::Types::BaseModel
7
7
  HASH_ATTRS = {
8
8
  access_token: :access_token,
9
9
  refresh_token: :refresh_token,
@@ -9,7 +9,9 @@ module WorkOS
9
9
  description: :description,
10
10
  enabled: :enabled,
11
11
  scopes: :scopes,
12
+ auth_methods: :auth_methods,
12
13
  credentials: :credentials,
14
+ api_key: :api_key,
13
15
  custom_provider: :custom_provider
14
16
  }.freeze
15
17
 
@@ -18,7 +20,9 @@ module WorkOS
18
20
  :description,
19
21
  :enabled,
20
22
  :scopes,
23
+ :auth_methods,
21
24
  :credentials,
25
+ :api_key,
22
26
  :custom_provider
23
27
 
24
28
  def initialize(json)
@@ -27,7 +31,9 @@ module WorkOS
27
31
  @description = hash[:description]
28
32
  @enabled = hash[:enabled]
29
33
  @scopes = hash[:scopes] || []
30
- @credentials = hash[:credentials] ? WorkOS::DataIntegrationCredentialsDto.new(hash[:credentials]) : nil
34
+ @auth_methods = hash[:auth_methods] || []
35
+ @credentials = hash[:credentials] ? WorkOS::DataIntegrationCredentialsInput.new(hash[:credentials]) : nil
36
+ @api_key = hash[:api_key] ? WorkOS::ApiKeyInstallation.new(hash[:api_key]) : nil
31
37
  @custom_provider = hash[:custom_provider] ? WorkOS::CustomProviderDefinition.new(hash[:custom_provider]) : nil
32
38
  end
33
39
  end
@@ -14,7 +14,9 @@ module WorkOS
14
14
  state: :state,
15
15
  scopes: :scopes,
16
16
  redirect_uri: :redirect_uri,
17
+ auth_methods: :auth_methods,
17
18
  credentials: :credentials,
19
+ installation: :installation,
18
20
  custom_provider: :custom_provider,
19
21
  created_at: :created_at,
20
22
  updated_at: :updated_at
@@ -30,7 +32,9 @@ module WorkOS
30
32
  :state,
31
33
  :scopes,
32
34
  :redirect_uri,
35
+ :auth_methods,
33
36
  :credentials,
37
+ :installation,
34
38
  :custom_provider,
35
39
  :created_at,
36
40
  :updated_at
@@ -46,7 +50,9 @@ module WorkOS
46
50
  @state = hash[:state]
47
51
  @scopes = hash[:scopes] || []
48
52
  @redirect_uri = hash[:redirect_uri]
53
+ @auth_methods = hash[:auth_methods] || []
49
54
  @credentials = hash[:credentials] ? WorkOS::DataIntegrationCredential.new(hash[:credentials]) : nil
55
+ @installation = hash[:installation] ? WorkOS::DataIntegrationInstallation.new(hash[:installation]) : nil
50
56
  @custom_provider = hash[:custom_provider] ? WorkOS::DataIntegrationCustomProvider.new(hash[:custom_provider]) : nil
51
57
  @created_at = hash[:created_at]
52
58
  @updated_at = hash[:updated_at]