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
@@ -0,0 +1,422 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ require "test_helper"
6
+
7
+ class SsoModelRoundTripTest < Minitest::Test
8
+ def test_token_query_round_trip
9
+ fixture = {
10
+ "client_id" => "stub",
11
+ "client_secret" => "stub",
12
+ "code" => "stub",
13
+ "grant_type" => "authorization_code"
14
+ }
15
+ model = WorkOS::TokenQuery.new(fixture.to_json)
16
+ json = model.to_h
17
+ assert_kind_of Hash, json
18
+ assert_equal fixture["client_id"], json[:client_id]
19
+ assert_equal fixture["client_secret"], json[:client_secret]
20
+ assert_equal fixture["code"], json[:code]
21
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
22
+ end
23
+
24
+ def test_connection_round_trip
25
+ fixture = {
26
+ "object" => "connection",
27
+ "id" => "stub",
28
+ "organization_id" => "stub",
29
+ "connection_type" => "stub",
30
+ "name" => "stub",
31
+ "state" => "stub",
32
+ "status" => "stub",
33
+ "domains" => [],
34
+ "callback_endpoint" => "stub",
35
+ "created_at" => "stub",
36
+ "updated_at" => "stub"
37
+ }
38
+ model = WorkOS::Connection.new(fixture.to_json)
39
+ json = model.to_h
40
+ assert_kind_of Hash, json
41
+ assert_equal fixture["id"], json[:id]
42
+ assert_equal fixture["name"], json[:name]
43
+ assert_equal fixture["created_at"], json[:created_at]
44
+ assert_equal fixture["updated_at"], json[:updated_at]
45
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
46
+ end
47
+
48
+ def test_connection_activated_round_trip
49
+ fixture = {
50
+ "object" => "event",
51
+ "id" => "stub",
52
+ "event" => "connection.activated",
53
+ "data" => {},
54
+ "created_at" => "stub",
55
+ "context" => {}
56
+ }
57
+ model = WorkOS::ConnectionActivated.new(fixture.to_json)
58
+ json = model.to_h
59
+ assert_kind_of Hash, json
60
+ assert_equal fixture["id"], json[:id]
61
+ assert_equal fixture["created_at"], json[:created_at]
62
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
63
+ end
64
+
65
+ def test_connection_activated_data_round_trip
66
+ fixture = {
67
+ "object" => "connection",
68
+ "id" => "stub",
69
+ "state" => "stub",
70
+ "name" => "stub",
71
+ "connection_type" => "stub",
72
+ "organization_id" => "stub",
73
+ "created_at" => "stub",
74
+ "updated_at" => "stub",
75
+ "external_key" => "stub",
76
+ "status" => "stub",
77
+ "domains" => []
78
+ }
79
+ model = WorkOS::ConnectionActivatedData.new(fixture.to_json)
80
+ json = model.to_h
81
+ assert_kind_of Hash, json
82
+ assert_equal fixture["id"], json[:id]
83
+ assert_equal fixture["name"], json[:name]
84
+ assert_equal fixture["created_at"], json[:created_at]
85
+ assert_equal fixture["updated_at"], json[:updated_at]
86
+ assert_equal fixture["external_key"], json[:external_key]
87
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
88
+ end
89
+
90
+ def test_connection_activated_data_domain_round_trip
91
+ fixture = {
92
+ "object" => "connection_domain",
93
+ "id" => "stub",
94
+ "domain" => "stub"
95
+ }
96
+ model = WorkOS::ConnectionActivatedDataDomain.new(fixture.to_json)
97
+ json = model.to_h
98
+ assert_kind_of Hash, json
99
+ assert_equal fixture["id"], json[:id]
100
+ assert_equal fixture["domain"], json[:domain]
101
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
102
+ end
103
+
104
+ def test_connection_deactivated_round_trip
105
+ fixture = {
106
+ "object" => "event",
107
+ "id" => "stub",
108
+ "event" => "connection.deactivated",
109
+ "data" => {},
110
+ "created_at" => "stub",
111
+ "context" => {}
112
+ }
113
+ model = WorkOS::ConnectionDeactivated.new(fixture.to_json)
114
+ json = model.to_h
115
+ assert_kind_of Hash, json
116
+ assert_equal fixture["id"], json[:id]
117
+ assert_equal fixture["created_at"], json[:created_at]
118
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
119
+ end
120
+
121
+ def test_connection_deactivated_data_round_trip
122
+ fixture = {
123
+ "object" => "connection",
124
+ "id" => "stub",
125
+ "state" => "stub",
126
+ "name" => "stub",
127
+ "connection_type" => "stub",
128
+ "organization_id" => "stub",
129
+ "created_at" => "stub",
130
+ "updated_at" => "stub",
131
+ "external_key" => "stub",
132
+ "status" => "stub",
133
+ "domains" => []
134
+ }
135
+ model = WorkOS::ConnectionDeactivatedData.new(fixture.to_json)
136
+ json = model.to_h
137
+ assert_kind_of Hash, json
138
+ assert_equal fixture["id"], json[:id]
139
+ assert_equal fixture["name"], json[:name]
140
+ assert_equal fixture["created_at"], json[:created_at]
141
+ assert_equal fixture["updated_at"], json[:updated_at]
142
+ assert_equal fixture["external_key"], json[:external_key]
143
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
144
+ end
145
+
146
+ def test_connection_deactivated_data_domain_round_trip
147
+ fixture = {
148
+ "object" => "connection_domain",
149
+ "id" => "stub",
150
+ "domain" => "stub"
151
+ }
152
+ model = WorkOS::ConnectionDeactivatedDataDomain.new(fixture.to_json)
153
+ json = model.to_h
154
+ assert_kind_of Hash, json
155
+ assert_equal fixture["id"], json[:id]
156
+ assert_equal fixture["domain"], json[:domain]
157
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
158
+ end
159
+
160
+ def test_connection_deleted_round_trip
161
+ fixture = {
162
+ "object" => "event",
163
+ "id" => "stub",
164
+ "event" => "connection.deleted",
165
+ "data" => {},
166
+ "created_at" => "stub",
167
+ "context" => {}
168
+ }
169
+ model = WorkOS::ConnectionDeleted.new(fixture.to_json)
170
+ json = model.to_h
171
+ assert_kind_of Hash, json
172
+ assert_equal fixture["id"], json[:id]
173
+ assert_equal fixture["created_at"], json[:created_at]
174
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
175
+ end
176
+
177
+ def test_connection_deleted_data_round_trip
178
+ fixture = {
179
+ "object" => "connection",
180
+ "id" => "stub",
181
+ "state" => "stub",
182
+ "name" => "stub",
183
+ "connection_type" => "stub",
184
+ "organization_id" => "stub",
185
+ "created_at" => "stub",
186
+ "updated_at" => "stub"
187
+ }
188
+ model = WorkOS::ConnectionDeletedData.new(fixture.to_json)
189
+ json = model.to_h
190
+ assert_kind_of Hash, json
191
+ assert_equal fixture["id"], json[:id]
192
+ assert_equal fixture["name"], json[:name]
193
+ assert_equal fixture["created_at"], json[:created_at]
194
+ assert_equal fixture["updated_at"], json[:updated_at]
195
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
196
+ end
197
+
198
+ def test_connection_saml_certificate_renewal_required_round_trip
199
+ fixture = {
200
+ "object" => "event",
201
+ "id" => "stub",
202
+ "event" => "connection.saml_certificate_renewal_required",
203
+ "data" => {},
204
+ "created_at" => "stub",
205
+ "context" => {}
206
+ }
207
+ model = WorkOS::ConnectionSAMLCertificateRenewalRequired.new(fixture.to_json)
208
+ json = model.to_h
209
+ assert_kind_of Hash, json
210
+ assert_equal fixture["id"], json[:id]
211
+ assert_equal fixture["created_at"], json[:created_at]
212
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
213
+ end
214
+
215
+ def test_connection_saml_certificate_renewal_required_data_round_trip
216
+ fixture = {
217
+ "connection" => {},
218
+ "certificate" => {},
219
+ "days_until_expiry" => 1
220
+ }
221
+ model = WorkOS::ConnectionSAMLCertificateRenewalRequiredData.new(fixture.to_json)
222
+ json = model.to_h
223
+ assert_kind_of Hash, json
224
+ assert_equal fixture["days_until_expiry"], json[:days_until_expiry]
225
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
226
+ end
227
+
228
+ def test_connection_saml_certificate_renewal_required_data_connection_round_trip
229
+ fixture = {
230
+ "id" => "stub",
231
+ "organization_id" => "stub"
232
+ }
233
+ model = WorkOS::ConnectionSAMLCertificateRenewalRequiredDataConnection.new(fixture.to_json)
234
+ json = model.to_h
235
+ assert_kind_of Hash, json
236
+ assert_equal fixture["id"], json[:id]
237
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
238
+ end
239
+
240
+ def test_connection_saml_certificate_renewal_required_data_certificate_round_trip
241
+ fixture = {
242
+ "certificate_type" => "stub",
243
+ "expiry_date" => "stub",
244
+ "is_expired" => true
245
+ }
246
+ model = WorkOS::ConnectionSAMLCertificateRenewalRequiredDataCertificate.new(fixture.to_json)
247
+ json = model.to_h
248
+ assert_kind_of Hash, json
249
+ assert_equal fixture["expiry_date"], json[:expiry_date]
250
+ assert_equal fixture["is_expired"], json[:is_expired]
251
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
252
+ end
253
+
254
+ def test_connection_saml_certificate_renewed_round_trip
255
+ fixture = {
256
+ "object" => "event",
257
+ "id" => "stub",
258
+ "event" => "connection.saml_certificate_renewed",
259
+ "data" => {},
260
+ "created_at" => "stub",
261
+ "context" => {}
262
+ }
263
+ model = WorkOS::ConnectionSAMLCertificateRenewed.new(fixture.to_json)
264
+ json = model.to_h
265
+ assert_kind_of Hash, json
266
+ assert_equal fixture["id"], json[:id]
267
+ assert_equal fixture["created_at"], json[:created_at]
268
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
269
+ end
270
+
271
+ def test_connection_saml_certificate_renewed_data_round_trip
272
+ fixture = {
273
+ "connection" => {},
274
+ "certificate" => {},
275
+ "renewed_at" => "stub"
276
+ }
277
+ model = WorkOS::ConnectionSAMLCertificateRenewedData.new(fixture.to_json)
278
+ json = model.to_h
279
+ assert_kind_of Hash, json
280
+ assert_equal fixture["renewed_at"], json[:renewed_at]
281
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
282
+ end
283
+
284
+ def test_connection_saml_certificate_renewed_data_connection_round_trip
285
+ fixture = {
286
+ "id" => "stub",
287
+ "organization_id" => "stub"
288
+ }
289
+ model = WorkOS::ConnectionSAMLCertificateRenewedDataConnection.new(fixture.to_json)
290
+ json = model.to_h
291
+ assert_kind_of Hash, json
292
+ assert_equal fixture["id"], json[:id]
293
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
294
+ end
295
+
296
+ def test_connection_saml_certificate_renewed_data_certificate_round_trip
297
+ fixture = {
298
+ "certificate_type" => "stub",
299
+ "expiry_date" => "stub"
300
+ }
301
+ model = WorkOS::ConnectionSAMLCertificateRenewedDataCertificate.new(fixture.to_json)
302
+ json = model.to_h
303
+ assert_kind_of Hash, json
304
+ assert_equal fixture["expiry_date"], json[:expiry_date]
305
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
306
+ end
307
+
308
+ def test_sso_authorize_url_response_round_trip
309
+ fixture = {
310
+ "url" => "stub"
311
+ }
312
+ model = WorkOS::SSOAuthorizeUrlResponse.new(fixture.to_json)
313
+ json = model.to_h
314
+ assert_kind_of Hash, json
315
+ assert_equal fixture["url"], json[:url]
316
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
317
+ end
318
+
319
+ def test_profile_round_trip
320
+ fixture = {
321
+ "object" => "profile",
322
+ "id" => "stub",
323
+ "organization_id" => nil,
324
+ "connection_id" => "stub",
325
+ "connection_type" => "stub",
326
+ "idp_id" => "stub",
327
+ "email" => "stub",
328
+ "first_name" => nil,
329
+ "last_name" => nil,
330
+ "name" => nil,
331
+ "role" => nil,
332
+ "roles" => nil,
333
+ "groups" => [],
334
+ "custom_attributes" => {},
335
+ "raw_attributes" => {}
336
+ }
337
+ model = WorkOS::Profile.new(fixture.to_json)
338
+ json = model.to_h
339
+ assert_kind_of Hash, json
340
+ assert_equal fixture["id"], json[:id]
341
+ assert_nil json[:organization_id]
342
+ assert_equal fixture["connection_id"], json[:connection_id]
343
+ assert_equal fixture["idp_id"], json[:idp_id]
344
+ assert_equal fixture["email"], json[:email]
345
+ assert_nil json[:first_name]
346
+ assert_nil json[:last_name]
347
+ assert_nil json[:name]
348
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
349
+ end
350
+
351
+ def test_sso_token_response_round_trip
352
+ fixture = {
353
+ "token_type" => "Bearer",
354
+ "access_token" => "stub",
355
+ "expires_in" => 1,
356
+ "profile" => {},
357
+ "oauth_tokens" => {}
358
+ }
359
+ model = WorkOS::SSOTokenResponse.new(fixture.to_json)
360
+ json = model.to_h
361
+ assert_kind_of Hash, json
362
+ assert_equal fixture["access_token"], json[:access_token]
363
+ assert_equal fixture["expires_in"], json[:expires_in]
364
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
365
+ end
366
+
367
+ def test_sso_logout_authorize_response_round_trip
368
+ fixture = {
369
+ "logout_url" => "stub",
370
+ "logout_token" => "stub"
371
+ }
372
+ model = WorkOS::SSOLogoutAuthorizeResponse.new(fixture.to_json)
373
+ json = model.to_h
374
+ assert_kind_of Hash, json
375
+ assert_equal fixture["logout_url"], json[:logout_url]
376
+ assert_equal fixture["logout_token"], json[:logout_token]
377
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
378
+ end
379
+
380
+ def test_sso_token_response_oauth_token_round_trip
381
+ fixture = {
382
+ "provider" => "stub",
383
+ "refresh_token" => "stub",
384
+ "access_token" => "stub",
385
+ "expires_at" => 1,
386
+ "scopes" => []
387
+ }
388
+ model = WorkOS::SSOTokenResponseOAuthToken.new(fixture.to_json)
389
+ json = model.to_h
390
+ assert_kind_of Hash, json
391
+ assert_equal fixture["provider"], json[:provider]
392
+ assert_equal fixture["refresh_token"], json[:refresh_token]
393
+ assert_equal fixture["access_token"], json[:access_token]
394
+ assert_equal fixture["expires_at"], json[:expires_at]
395
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
396
+ end
397
+
398
+ def test_connection_domain_round_trip
399
+ fixture = {
400
+ "id" => "stub",
401
+ "object" => "connection_domain",
402
+ "domain" => "stub"
403
+ }
404
+ model = WorkOS::ConnectionDomain.new(fixture.to_json)
405
+ json = model.to_h
406
+ assert_kind_of Hash, json
407
+ assert_equal fixture["id"], json[:id]
408
+ assert_equal fixture["domain"], json[:domain]
409
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
410
+ end
411
+
412
+ def test_sso_logout_authorize_request_round_trip
413
+ fixture = {
414
+ "profile_id" => "stub"
415
+ }
416
+ model = WorkOS::SSOLogoutAuthorizeRequest.new(fixture.to_json)
417
+ json = model.to_h
418
+ assert_kind_of Hash, json
419
+ assert_equal fixture["profile_id"], json[:profile_id]
420
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
421
+ end
422
+ end
@@ -189,6 +189,13 @@ class UserManagementTest < Minitest::Test
189
189
  refute_nil result
190
190
  end
191
191
 
192
+ def test_get_radar_challenge_returns_expected_result
193
+ stub_request(:get, %r{\Ahttps://api\.workos\.com/user_management/radar_challenges/stub(\?|\z)})
194
+ .to_return(body: "{}", status: 200)
195
+ result = @client.user_management.get_radar_challenge(id: "stub")
196
+ refute_nil result
197
+ end
198
+
192
199
  def test_revoke_session_returns_expected_result
193
200
  stub_request(:post, %r{\Ahttps://api\.workos\.com/user_management/sessions/revoke(\?|\z)})
194
201
  .to_return(body: "{}", status: 200)
@@ -431,6 +438,13 @@ class UserManagementTest < Minitest::Test
431
438
  refute_nil result
432
439
  end
433
440
 
441
+ def test_delete_redirect_uris_returns_expected_result
442
+ stub_request(:delete, %r{\Ahttps://api\.workos\.com/user_management/redirect_uris/stub(\?|\z)})
443
+ .to_return(body: "{}", status: 200)
444
+ result = @client.user_management.delete_redirect_uris(id: "stub")
445
+ assert_nil result
446
+ end
447
+
434
448
  def test_list_user_authorized_applications_returns_expected_result
435
449
  stub_request(:get, %r{\Ahttps://api\.workos\.com/user_management/users/stub/authorized_applications(\?|\z)})
436
450
  .to_return(body: '{"data": [], "list_metadata": {}}', status: 200)
@@ -465,6 +479,7 @@ class UserManagementTest < Minitest::Test
465
479
  {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"}},
466
480
  {name: :create_device, verb: :post, url: %r{\Ahttps://api\.workos\.com/user_management/authorize/device(\?|\z)}, args: {client_id: "stub"}},
467
481
  {name: :create_radar_challenge, verb: :post, url: %r{\Ahttps://api\.workos\.com/user_management/radar_challenges(\?|\z)}, args: {user_id: "stub", pending_authentication_token: "stub", phone_number: "stub"}},
482
+ {name: :get_radar_challenge, verb: :get, url: %r{\Ahttps://api\.workos\.com/user_management/radar_challenges/stub(\?|\z)}, args: {id: "stub"}},
468
483
  {name: :revoke_session, verb: :post, url: %r{\Ahttps://api\.workos\.com/user_management/sessions/revoke(\?|\z)}, args: {session_id: "stub"}},
469
484
  {name: :list_cors_origins, verb: :get, url: %r{\Ahttps://api\.workos\.com/user_management/cors_origins(\?|\z)}},
470
485
  {name: :create_cors_origin, verb: :post, url: %r{\Ahttps://api\.workos\.com/user_management/cors_origins(\?|\z)}, args: {origin: "stub"}},
@@ -497,6 +512,7 @@ class UserManagementTest < Minitest::Test
497
512
  {name: :get_magic_auth, verb: :get, url: %r{\Ahttps://api\.workos\.com/user_management/magic_auth/stub(\?|\z)}, args: {id: "stub"}},
498
513
  {name: :list_redirect_uris, verb: :get, url: %r{\Ahttps://api\.workos\.com/user_management/redirect_uris(\?|\z)}},
499
514
  {name: :create_redirect_uri, verb: :post, url: %r{\Ahttps://api\.workos\.com/user_management/redirect_uris(\?|\z)}, args: {uri: "stub"}},
515
+ {name: :delete_redirect_uris, verb: :delete, url: %r{\Ahttps://api\.workos\.com/user_management/redirect_uris/stub(\?|\z)}, args: {id: "stub"}},
500
516
  {name: :list_user_authorized_applications, verb: :get, url: %r{\Ahttps://api\.workos\.com/user_management/users/stub/authorized_applications(\?|\z)}, args: {user_id: "stub"}},
501
517
  {name: :delete_user_authorized_application, verb: :delete, url: %r{\Ahttps://api\.workos\.com/user_management/users/stub/authorized_applications/stub(\?|\z)}, args: {application_id: "stub", user_id: "stub"}},
502
518
  {name: :list_user_api_keys, verb: :get, url: %r{\Ahttps://api\.workos\.com/user_management/users/stub/api_keys(\?|\z)}, args: {user_id: "stub"}},