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
@@ -16,6 +16,50 @@ class OrganizationsModelRoundTripTest < Minitest::Test
16
16
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
17
17
  end
18
18
 
19
+ def test_organization_domain_data_round_trip
20
+ fixture = {
21
+ "domain" => "stub",
22
+ "state" => "stub"
23
+ }
24
+ model = WorkOS::OrganizationDomainData.new(fixture.to_json)
25
+ json = model.to_h
26
+ assert_kind_of Hash, json
27
+ assert_equal fixture["domain"], json[:domain]
28
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
29
+ end
30
+
31
+ def test_organization_input_round_trip
32
+ fixture = {
33
+ "name" => "stub",
34
+ "allow_profiles_outside_organization" => true,
35
+ "domains" => [],
36
+ "domain_data" => [],
37
+ "metadata" => nil,
38
+ "external_id" => nil
39
+ }
40
+ model = WorkOS::OrganizationInput.new(fixture.to_json)
41
+ json = model.to_h
42
+ assert_kind_of Hash, json
43
+ assert_equal fixture["name"], json[:name]
44
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
45
+ end
46
+
47
+ def test_update_organization_round_trip
48
+ fixture = {
49
+ "name" => "stub",
50
+ "allow_profiles_outside_organization" => true,
51
+ "domains" => [],
52
+ "domain_data" => [],
53
+ "stripe_customer_id" => "stub",
54
+ "metadata" => nil,
55
+ "external_id" => nil
56
+ }
57
+ model = WorkOS::UpdateOrganization.new(fixture.to_json)
58
+ json = model.to_h
59
+ assert_kind_of Hash, json
60
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
61
+ end
62
+
19
63
  def test_audit_logs_retention_round_trip
20
64
  fixture = {
21
65
  "retention_period_in_days" => nil
@@ -26,4 +70,562 @@ class OrganizationsModelRoundTripTest < Minitest::Test
26
70
  assert_nil json[:retention_period_in_days]
27
71
  fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
28
72
  end
73
+
74
+ def test_organization_created_round_trip
75
+ fixture = {
76
+ "object" => "event",
77
+ "id" => "stub",
78
+ "event" => "organization.created",
79
+ "data" => {},
80
+ "created_at" => "stub",
81
+ "context" => {}
82
+ }
83
+ model = WorkOS::OrganizationCreated.new(fixture.to_json)
84
+ json = model.to_h
85
+ assert_kind_of Hash, json
86
+ assert_equal fixture["id"], json[:id]
87
+ assert_equal fixture["created_at"], json[:created_at]
88
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
89
+ end
90
+
91
+ def test_organization_created_data_round_trip
92
+ fixture = {
93
+ "object" => "organization",
94
+ "id" => "stub",
95
+ "name" => "stub",
96
+ "domains" => [],
97
+ "metadata" => {},
98
+ "external_id" => nil,
99
+ "stripe_customer_id" => "stub",
100
+ "created_at" => "stub",
101
+ "updated_at" => "stub"
102
+ }
103
+ model = WorkOS::OrganizationCreatedData.new(fixture.to_json)
104
+ json = model.to_h
105
+ assert_kind_of Hash, json
106
+ assert_equal fixture["id"], json[:id]
107
+ assert_equal fixture["name"], json[:name]
108
+ assert_nil json[:external_id]
109
+ assert_equal fixture["created_at"], json[:created_at]
110
+ assert_equal fixture["updated_at"], json[:updated_at]
111
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
112
+ end
113
+
114
+ def test_organization_created_data_domain_round_trip
115
+ fixture = {
116
+ "object" => "organization_domain",
117
+ "id" => "stub",
118
+ "organization_id" => "stub",
119
+ "domain" => "stub",
120
+ "state" => "stub",
121
+ "verification_prefix" => "stub",
122
+ "verification_token" => "stub",
123
+ "verification_strategy" => "stub",
124
+ "created_at" => "stub",
125
+ "updated_at" => "stub"
126
+ }
127
+ model = WorkOS::OrganizationCreatedDataDomain.new(fixture.to_json)
128
+ json = model.to_h
129
+ assert_kind_of Hash, json
130
+ assert_equal fixture["id"], json[:id]
131
+ assert_equal fixture["organization_id"], json[:organization_id]
132
+ assert_equal fixture["domain"], json[:domain]
133
+ assert_equal fixture["created_at"], json[:created_at]
134
+ assert_equal fixture["updated_at"], json[:updated_at]
135
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
136
+ end
137
+
138
+ def test_organization_deleted_round_trip
139
+ fixture = {
140
+ "object" => "event",
141
+ "id" => "stub",
142
+ "event" => "organization.deleted",
143
+ "data" => {},
144
+ "created_at" => "stub",
145
+ "context" => {}
146
+ }
147
+ model = WorkOS::OrganizationDeleted.new(fixture.to_json)
148
+ json = model.to_h
149
+ assert_kind_of Hash, json
150
+ assert_equal fixture["id"], json[:id]
151
+ assert_equal fixture["created_at"], json[:created_at]
152
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
153
+ end
154
+
155
+ def test_organization_deleted_data_round_trip
156
+ fixture = {
157
+ "object" => "organization",
158
+ "id" => "stub",
159
+ "name" => "stub",
160
+ "domains" => [],
161
+ "metadata" => {},
162
+ "external_id" => nil,
163
+ "stripe_customer_id" => "stub",
164
+ "created_at" => "stub",
165
+ "updated_at" => "stub"
166
+ }
167
+ model = WorkOS::OrganizationDeletedData.new(fixture.to_json)
168
+ json = model.to_h
169
+ assert_kind_of Hash, json
170
+ assert_equal fixture["id"], json[:id]
171
+ assert_equal fixture["name"], json[:name]
172
+ assert_nil json[:external_id]
173
+ assert_equal fixture["created_at"], json[:created_at]
174
+ assert_equal fixture["updated_at"], json[:updated_at]
175
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
176
+ end
177
+
178
+ def test_organization_deleted_data_domain_round_trip
179
+ fixture = {
180
+ "object" => "organization_domain",
181
+ "id" => "stub",
182
+ "organization_id" => "stub",
183
+ "domain" => "stub",
184
+ "state" => "stub",
185
+ "verification_prefix" => "stub",
186
+ "verification_token" => "stub",
187
+ "verification_strategy" => "stub",
188
+ "created_at" => "stub",
189
+ "updated_at" => "stub"
190
+ }
191
+ model = WorkOS::OrganizationDeletedDataDomain.new(fixture.to_json)
192
+ json = model.to_h
193
+ assert_kind_of Hash, json
194
+ assert_equal fixture["id"], json[:id]
195
+ assert_equal fixture["organization_id"], json[:organization_id]
196
+ assert_equal fixture["domain"], json[:domain]
197
+ assert_equal fixture["created_at"], json[:created_at]
198
+ assert_equal fixture["updated_at"], json[:updated_at]
199
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
200
+ end
201
+
202
+ def test_organization_membership_created_round_trip
203
+ fixture = {
204
+ "object" => "event",
205
+ "id" => "stub",
206
+ "event" => "organization_membership.created",
207
+ "data" => {},
208
+ "created_at" => "stub",
209
+ "context" => {}
210
+ }
211
+ model = WorkOS::OrganizationMembershipCreated.new(fixture.to_json)
212
+ json = model.to_h
213
+ assert_kind_of Hash, json
214
+ assert_equal fixture["id"], json[:id]
215
+ assert_equal fixture["created_at"], json[:created_at]
216
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
217
+ end
218
+
219
+ def test_organization_membership_created_data_round_trip
220
+ fixture = {
221
+ "object" => "organization_membership",
222
+ "id" => "stub",
223
+ "user_id" => "stub",
224
+ "organization_id" => "stub",
225
+ "status" => "stub",
226
+ "role" => {},
227
+ "roles" => [],
228
+ "custom_attributes" => {},
229
+ "directory_managed" => true,
230
+ "created_at" => "stub",
231
+ "updated_at" => "stub"
232
+ }
233
+ model = WorkOS::OrganizationMembershipCreatedData.new(fixture.to_json)
234
+ json = model.to_h
235
+ assert_kind_of Hash, json
236
+ assert_equal fixture["id"], json[:id]
237
+ assert_equal fixture["user_id"], json[:user_id]
238
+ assert_equal fixture["organization_id"], json[:organization_id]
239
+ assert_equal fixture["directory_managed"], json[:directory_managed]
240
+ assert_equal fixture["created_at"], json[:created_at]
241
+ assert_equal fixture["updated_at"], json[:updated_at]
242
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
243
+ end
244
+
245
+ def test_organization_membership_deleted_round_trip
246
+ fixture = {
247
+ "object" => "event",
248
+ "id" => "stub",
249
+ "event" => "organization_membership.deleted",
250
+ "data" => {},
251
+ "created_at" => "stub",
252
+ "context" => {}
253
+ }
254
+ model = WorkOS::OrganizationMembershipDeleted.new(fixture.to_json)
255
+ json = model.to_h
256
+ assert_kind_of Hash, json
257
+ assert_equal fixture["id"], json[:id]
258
+ assert_equal fixture["created_at"], json[:created_at]
259
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
260
+ end
261
+
262
+ def test_organization_membership_deleted_data_round_trip
263
+ fixture = {
264
+ "object" => "organization_membership",
265
+ "id" => "stub",
266
+ "user_id" => "stub",
267
+ "organization_id" => "stub",
268
+ "status" => "stub",
269
+ "role" => {},
270
+ "roles" => [],
271
+ "custom_attributes" => {},
272
+ "directory_managed" => true,
273
+ "created_at" => "stub",
274
+ "updated_at" => "stub"
275
+ }
276
+ model = WorkOS::OrganizationMembershipDeletedData.new(fixture.to_json)
277
+ json = model.to_h
278
+ assert_kind_of Hash, json
279
+ assert_equal fixture["id"], json[:id]
280
+ assert_equal fixture["user_id"], json[:user_id]
281
+ assert_equal fixture["organization_id"], json[:organization_id]
282
+ assert_equal fixture["directory_managed"], json[:directory_managed]
283
+ assert_equal fixture["created_at"], json[:created_at]
284
+ assert_equal fixture["updated_at"], json[:updated_at]
285
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
286
+ end
287
+
288
+ def test_organization_membership_updated_round_trip
289
+ fixture = {
290
+ "object" => "event",
291
+ "id" => "stub",
292
+ "event" => "organization_membership.updated",
293
+ "data" => {},
294
+ "created_at" => "stub",
295
+ "context" => {}
296
+ }
297
+ model = WorkOS::OrganizationMembershipUpdated.new(fixture.to_json)
298
+ json = model.to_h
299
+ assert_kind_of Hash, json
300
+ assert_equal fixture["id"], json[:id]
301
+ assert_equal fixture["created_at"], json[:created_at]
302
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
303
+ end
304
+
305
+ def test_organization_membership_updated_data_round_trip
306
+ fixture = {
307
+ "object" => "organization_membership",
308
+ "id" => "stub",
309
+ "user_id" => "stub",
310
+ "organization_id" => "stub",
311
+ "status" => "stub",
312
+ "role" => {},
313
+ "roles" => [],
314
+ "custom_attributes" => {},
315
+ "directory_managed" => true,
316
+ "created_at" => "stub",
317
+ "updated_at" => "stub"
318
+ }
319
+ model = WorkOS::OrganizationMembershipUpdatedData.new(fixture.to_json)
320
+ json = model.to_h
321
+ assert_kind_of Hash, json
322
+ assert_equal fixture["id"], json[:id]
323
+ assert_equal fixture["user_id"], json[:user_id]
324
+ assert_equal fixture["organization_id"], json[:organization_id]
325
+ assert_equal fixture["directory_managed"], json[:directory_managed]
326
+ assert_equal fixture["created_at"], json[:created_at]
327
+ assert_equal fixture["updated_at"], json[:updated_at]
328
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
329
+ end
330
+
331
+ def test_organization_role_created_round_trip
332
+ fixture = {
333
+ "object" => "event",
334
+ "id" => "stub",
335
+ "event" => "organization_role.created",
336
+ "data" => {},
337
+ "created_at" => "stub",
338
+ "context" => {}
339
+ }
340
+ model = WorkOS::OrganizationRoleCreated.new(fixture.to_json)
341
+ json = model.to_h
342
+ assert_kind_of Hash, json
343
+ assert_equal fixture["id"], json[:id]
344
+ assert_equal fixture["created_at"], json[:created_at]
345
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
346
+ end
347
+
348
+ def test_organization_role_created_data_round_trip
349
+ fixture = {
350
+ "object" => "organization_role",
351
+ "organization_id" => "stub",
352
+ "slug" => "stub",
353
+ "name" => "stub",
354
+ "description" => nil,
355
+ "resource_type_slug" => "stub",
356
+ "permissions" => [],
357
+ "created_at" => "stub",
358
+ "updated_at" => "stub"
359
+ }
360
+ model = WorkOS::OrganizationRoleCreatedData.new(fixture.to_json)
361
+ json = model.to_h
362
+ assert_kind_of Hash, json
363
+ assert_equal fixture["organization_id"], json[:organization_id]
364
+ assert_equal fixture["slug"], json[:slug]
365
+ assert_equal fixture["name"], json[:name]
366
+ assert_nil json[:description]
367
+ assert_equal fixture["resource_type_slug"], json[:resource_type_slug]
368
+ assert_equal fixture["created_at"], json[:created_at]
369
+ assert_equal fixture["updated_at"], json[:updated_at]
370
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
371
+ end
372
+
373
+ def test_organization_role_deleted_round_trip
374
+ fixture = {
375
+ "object" => "event",
376
+ "id" => "stub",
377
+ "event" => "organization_role.deleted",
378
+ "data" => {},
379
+ "created_at" => "stub",
380
+ "context" => {}
381
+ }
382
+ model = WorkOS::OrganizationRoleDeleted.new(fixture.to_json)
383
+ json = model.to_h
384
+ assert_kind_of Hash, json
385
+ assert_equal fixture["id"], json[:id]
386
+ assert_equal fixture["created_at"], json[:created_at]
387
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
388
+ end
389
+
390
+ def test_organization_role_deleted_data_round_trip
391
+ fixture = {
392
+ "object" => "organization_role",
393
+ "organization_id" => "stub",
394
+ "slug" => "stub",
395
+ "name" => "stub",
396
+ "description" => nil,
397
+ "resource_type_slug" => "stub",
398
+ "permissions" => [],
399
+ "created_at" => "stub",
400
+ "updated_at" => "stub"
401
+ }
402
+ model = WorkOS::OrganizationRoleDeletedData.new(fixture.to_json)
403
+ json = model.to_h
404
+ assert_kind_of Hash, json
405
+ assert_equal fixture["organization_id"], json[:organization_id]
406
+ assert_equal fixture["slug"], json[:slug]
407
+ assert_equal fixture["name"], json[:name]
408
+ assert_nil json[:description]
409
+ assert_equal fixture["resource_type_slug"], json[:resource_type_slug]
410
+ assert_equal fixture["created_at"], json[:created_at]
411
+ assert_equal fixture["updated_at"], json[:updated_at]
412
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
413
+ end
414
+
415
+ def test_organization_role_updated_round_trip
416
+ fixture = {
417
+ "object" => "event",
418
+ "id" => "stub",
419
+ "event" => "organization_role.updated",
420
+ "data" => {},
421
+ "created_at" => "stub",
422
+ "context" => {}
423
+ }
424
+ model = WorkOS::OrganizationRoleUpdated.new(fixture.to_json)
425
+ json = model.to_h
426
+ assert_kind_of Hash, json
427
+ assert_equal fixture["id"], json[:id]
428
+ assert_equal fixture["created_at"], json[:created_at]
429
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
430
+ end
431
+
432
+ def test_organization_role_updated_data_round_trip
433
+ fixture = {
434
+ "object" => "organization_role",
435
+ "organization_id" => "stub",
436
+ "slug" => "stub",
437
+ "name" => "stub",
438
+ "description" => nil,
439
+ "resource_type_slug" => "stub",
440
+ "permissions" => [],
441
+ "created_at" => "stub",
442
+ "updated_at" => "stub"
443
+ }
444
+ model = WorkOS::OrganizationRoleUpdatedData.new(fixture.to_json)
445
+ json = model.to_h
446
+ assert_kind_of Hash, json
447
+ assert_equal fixture["organization_id"], json[:organization_id]
448
+ assert_equal fixture["slug"], json[:slug]
449
+ assert_equal fixture["name"], json[:name]
450
+ assert_nil json[:description]
451
+ assert_equal fixture["resource_type_slug"], json[:resource_type_slug]
452
+ assert_equal fixture["created_at"], json[:created_at]
453
+ assert_equal fixture["updated_at"], json[:updated_at]
454
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
455
+ end
456
+
457
+ def test_organization_updated_round_trip
458
+ fixture = {
459
+ "object" => "event",
460
+ "id" => "stub",
461
+ "event" => "organization.updated",
462
+ "data" => {},
463
+ "created_at" => "stub",
464
+ "context" => {}
465
+ }
466
+ model = WorkOS::OrganizationUpdated.new(fixture.to_json)
467
+ json = model.to_h
468
+ assert_kind_of Hash, json
469
+ assert_equal fixture["id"], json[:id]
470
+ assert_equal fixture["created_at"], json[:created_at]
471
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
472
+ end
473
+
474
+ def test_organization_updated_data_round_trip
475
+ fixture = {
476
+ "object" => "organization",
477
+ "id" => "stub",
478
+ "name" => "stub",
479
+ "domains" => [],
480
+ "metadata" => {},
481
+ "external_id" => nil,
482
+ "stripe_customer_id" => "stub",
483
+ "created_at" => "stub",
484
+ "updated_at" => "stub"
485
+ }
486
+ model = WorkOS::OrganizationUpdatedData.new(fixture.to_json)
487
+ json = model.to_h
488
+ assert_kind_of Hash, json
489
+ assert_equal fixture["id"], json[:id]
490
+ assert_equal fixture["name"], json[:name]
491
+ assert_nil json[:external_id]
492
+ assert_equal fixture["created_at"], json[:created_at]
493
+ assert_equal fixture["updated_at"], json[:updated_at]
494
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
495
+ end
496
+
497
+ def test_organization_updated_data_domain_round_trip
498
+ fixture = {
499
+ "object" => "organization_domain",
500
+ "id" => "stub",
501
+ "organization_id" => "stub",
502
+ "domain" => "stub",
503
+ "state" => "stub",
504
+ "verification_prefix" => "stub",
505
+ "verification_token" => "stub",
506
+ "verification_strategy" => "stub",
507
+ "created_at" => "stub",
508
+ "updated_at" => "stub"
509
+ }
510
+ model = WorkOS::OrganizationUpdatedDataDomain.new(fixture.to_json)
511
+ json = model.to_h
512
+ assert_kind_of Hash, json
513
+ assert_equal fixture["id"], json[:id]
514
+ assert_equal fixture["organization_id"], json[:organization_id]
515
+ assert_equal fixture["domain"], json[:domain]
516
+ assert_equal fixture["created_at"], json[:created_at]
517
+ assert_equal fixture["updated_at"], json[:updated_at]
518
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
519
+ end
520
+
521
+ def test_organization_api_key_round_trip
522
+ fixture = {
523
+ "object" => "api_key",
524
+ "id" => "stub",
525
+ "owner" => {},
526
+ "name" => "stub",
527
+ "obfuscated_value" => "stub",
528
+ "last_used_at" => nil,
529
+ "expires_at" => nil,
530
+ "permissions" => [],
531
+ "created_at" => "stub",
532
+ "updated_at" => "stub"
533
+ }
534
+ model = WorkOS::OrganizationApiKey.new(fixture.to_json)
535
+ json = model.to_h
536
+ assert_kind_of Hash, json
537
+ assert_equal fixture["id"], json[:id]
538
+ assert_equal fixture["name"], json[:name]
539
+ assert_equal fixture["obfuscated_value"], json[:obfuscated_value]
540
+ assert_nil json[:last_used_at]
541
+ assert_nil json[:expires_at]
542
+ assert_equal fixture["created_at"], json[:created_at]
543
+ assert_equal fixture["updated_at"], json[:updated_at]
544
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
545
+ end
546
+
547
+ def test_organization_round_trip
548
+ fixture = {
549
+ "object" => "organization",
550
+ "id" => "stub",
551
+ "name" => "stub",
552
+ "domains" => [],
553
+ "metadata" => {},
554
+ "external_id" => nil,
555
+ "stripe_customer_id" => "stub",
556
+ "created_at" => "stub",
557
+ "updated_at" => "stub",
558
+ "allow_profiles_outside_organization" => true
559
+ }
560
+ model = WorkOS::Organization.new(fixture.to_json)
561
+ json = model.to_h
562
+ assert_kind_of Hash, json
563
+ assert_equal fixture["id"], json[:id]
564
+ assert_equal fixture["name"], json[:name]
565
+ assert_nil json[:external_id]
566
+ assert_equal fixture["created_at"], json[:created_at]
567
+ assert_equal fixture["updated_at"], json[:updated_at]
568
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
569
+ end
570
+
571
+ def test_audit_log_configuration_round_trip
572
+ fixture = {
573
+ "organization_id" => "stub",
574
+ "retention_period_in_days" => 1,
575
+ "state" => "stub",
576
+ "log_stream" => {}
577
+ }
578
+ model = WorkOS::AuditLogConfiguration.new(fixture.to_json)
579
+ json = model.to_h
580
+ assert_kind_of Hash, json
581
+ assert_equal fixture["organization_id"], json[:organization_id]
582
+ assert_equal fixture["retention_period_in_days"], json[:retention_period_in_days]
583
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
584
+ end
585
+
586
+ def test_audit_log_configuration_log_stream_round_trip
587
+ fixture = {
588
+ "id" => "stub",
589
+ "type" => "stub",
590
+ "state" => "stub",
591
+ "last_synced_at" => nil,
592
+ "created_at" => "stub"
593
+ }
594
+ model = WorkOS::AuditLogConfigurationLogStream.new(fixture.to_json)
595
+ json = model.to_h
596
+ assert_kind_of Hash, json
597
+ assert_equal fixture["id"], json[:id]
598
+ assert_nil json[:last_synced_at]
599
+ assert_equal fixture["created_at"], json[:created_at]
600
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
601
+ end
602
+
603
+ def test_organization_api_key_owner_round_trip
604
+ fixture = {
605
+ "type" => "organization",
606
+ "id" => "stub"
607
+ }
608
+ model = WorkOS::OrganizationApiKeyOwner.new(fixture.to_json)
609
+ json = model.to_h
610
+ assert_kind_of Hash, json
611
+ assert_equal fixture["id"], json[:id]
612
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
613
+ end
614
+
615
+ def test_organization_authorized_connect_application_list_data_round_trip
616
+ fixture = {
617
+ "object" => "authorized_connect_application",
618
+ "id" => "stub",
619
+ "granted_scopes" => [],
620
+ "oauth_resource" => "stub",
621
+ "application" => {},
622
+ "user_id" => "stub"
623
+ }
624
+ model = WorkOS::OrganizationAuthorizedConnectApplicationListData.new(fixture.to_json)
625
+ json = model.to_h
626
+ assert_kind_of Hash, json
627
+ assert_equal fixture["id"], json[:id]
628
+ assert_equal fixture["user_id"], json[:user_id]
629
+ fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
630
+ end
29
631
  end