workos 9.5.0 → 10.1.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 (208) hide show
  1. checksums.yaml +4 -4
  2. data/.claude/CLAUDE.md +38 -0
  3. data/.github/workflows/block-generated-edits.yml +13 -0
  4. data/.github/workflows/ci.yml +1 -1
  5. data/.github/workflows/docs.yml +1 -1
  6. data/.github/workflows/lint.yml +1 -1
  7. data/.github/workflows/release-please.yml +7 -1
  8. data/.github/workflows/release.yml +1 -1
  9. data/.last-synced-sha +1 -1
  10. data/.oagen-manifest.json +197 -75
  11. data/.release-please-manifest.json +1 -1
  12. data/AGENTS.md +1 -0
  13. data/CHANGELOG.md +118 -0
  14. data/Gemfile.lock +2 -2
  15. data/README.md +15 -14
  16. data/lib/workos/agents/agent_admin_link_claim_attempt_to_external_user_request.rb +28 -0
  17. data/lib/workos/agents/agent_admin_link_claim_attempt_to_external_user_request_user.rb +22 -0
  18. data/lib/workos/agents/agent_admin_validate_credential_request.rb +25 -0
  19. data/lib/workos/agents/agent_credential_validation.rb +25 -0
  20. data/lib/workos/agents/agent_registration.rb +40 -0
  21. data/lib/workos/agents/agent_registration_agent_identity.rb +28 -0
  22. data/lib/workos/agents/agent_registration_claim.rb +31 -0
  23. data/lib/workos/agents/agent_registration_claim_claim_completion.rb +31 -0
  24. data/lib/workos/agents/claim_view_response.rb +28 -0
  25. data/lib/workos/agents/claim_view_response_organization.rb +7 -0
  26. data/lib/workos/agents.rb +93 -0
  27. data/lib/workos/api_keys/api_key_validation_response.rb +6 -2
  28. data/lib/workos/api_keys.rb +3 -4
  29. data/lib/workos/authorization/permission_created_data.rb +1 -34
  30. data/lib/workos/authorization/permission_deleted_data.rb +1 -1
  31. data/lib/workos/authorization/permission_updated_data.rb +1 -1
  32. data/lib/workos/authorization.rb +24 -24
  33. data/lib/workos/base_client.rb +4 -4
  34. data/lib/workos/client.rb +4 -0
  35. data/lib/workos/connect.rb +23 -19
  36. data/lib/workos/directory_sync.rb +10 -2
  37. data/lib/workos/groups.rb +7 -7
  38. data/lib/workos/inflections.rb +0 -1
  39. data/lib/workos/organization_domains.rb +4 -4
  40. data/lib/workos/organizations/organization_authorized_connect_application_list_data.rb +34 -0
  41. data/lib/workos/organizations.rb +57 -10
  42. data/lib/workos/pipes/api_key_installation.rb +25 -0
  43. data/lib/workos/pipes/{connected_account_dto.rb → connected_account_input.rb} +1 -1
  44. data/lib/workos/pipes/create_data_integration.rb +10 -1
  45. data/lib/workos/pipes/data_integration.rb +9 -0
  46. data/lib/workos/pipes/{data_integration_credentials_dto.rb → data_integration_credentials_input.rb} +1 -1
  47. data/lib/workos/pipes/data_integration_installation.rb +28 -0
  48. data/lib/workos/pipes/data_integrations_get_data_integration_authorize_url_request.rb +5 -2
  49. data/lib/workos/pipes/data_integrations_upsert_api_key_request.rb +1 -19
  50. data/lib/workos/pipes/update_data_integration.rb +4 -1
  51. data/lib/workos/pipes.rb +32 -17
  52. data/lib/workos/pipes_provider/configure_data_integration_body.rb +5 -2
  53. data/lib/workos/pipes_provider/data_integration_configuration_response.rb +3 -0
  54. data/lib/workos/pipes_provider.rb +6 -3
  55. data/lib/workos/shared/access_token_agent_registration_credential_issued_data_detail.rb +25 -0
  56. data/lib/workos/shared/agent_registration_claim_attempt_created.rb +34 -0
  57. data/lib/workos/shared/agent_registration_claim_attempt_created_data.rb +40 -0
  58. data/lib/workos/shared/agent_registration_claim_completed.rb +34 -0
  59. data/lib/workos/shared/agent_registration_claim_completed_data.rb +40 -0
  60. data/lib/workos/shared/agent_registration_claim_completed_data_claimed_by.rb +22 -0
  61. data/lib/workos/shared/agent_registration_created.rb +34 -0
  62. data/lib/workos/{organization_domains/organization_domain_stand_alone.rb → shared/agent_registration_created_data.rb} +13 -16
  63. data/lib/workos/shared/agent_registration_created_data_agent_identity.rb +25 -0
  64. data/lib/workos/shared/agent_registration_credential_issued.rb +34 -0
  65. data/lib/workos/shared/agent_registration_credential_issued_data.rb +34 -0
  66. data/lib/workos/shared/agent_registration_credential_issued_data_detail.rb +22 -0
  67. data/lib/workos/shared/agent_registration_deleted.rb +34 -0
  68. data/lib/workos/shared/agent_registration_deleted_data.rb +18 -0
  69. data/lib/workos/shared/agent_registration_expired.rb +34 -0
  70. data/lib/workos/shared/agent_registration_expired_data.rb +7 -0
  71. data/lib/workos/shared/agent_registration_organization_switched.rb +34 -0
  72. data/lib/workos/shared/agent_registration_organization_switched_data.rb +25 -0
  73. data/lib/workos/shared/agent_registration_revoked.rb +34 -0
  74. data/lib/workos/shared/agent_registration_revoked_data.rb +7 -0
  75. data/lib/workos/shared/pipes_connected_account_connection_failed.rb +34 -0
  76. data/lib/workos/shared/pipes_connected_account_connection_failed_data.rb +46 -0
  77. data/lib/workos/shared/radar_challenge_created.rb +34 -0
  78. data/lib/workos/shared/radar_challenge_created_data.rb +28 -0
  79. data/lib/workos/sso/connection.rb +0 -3
  80. data/lib/workos/sso.rb +73 -26
  81. data/lib/workos/types/agent_admin_validate_credential_request_type.rb +13 -0
  82. data/lib/workos/types/agent_registration_created_data_kind.rb +14 -0
  83. data/lib/workos/types/agent_registration_created_data_method.rb +14 -0
  84. data/lib/workos/types/agent_registration_created_data_status.rb +15 -0
  85. data/lib/workos/types/{data_integration_credentials_type.rb → agent_registration_kind.rb} +1 -1
  86. data/lib/workos/types/{organization_domain_stand_alone_state.rb → agent_registration_status.rb} +1 -1
  87. data/lib/workos/types/applications_registration_types.rb +13 -0
  88. data/lib/workos/types/{organization_domain_stand_alone_verification_strategy.rb → claim_view_response_status.rb} +1 -1
  89. data/lib/workos/types/connected_account_auth_method.rb +2 -1
  90. data/lib/workos/types/connected_account_input_state.rb +13 -0
  91. data/lib/workos/types/connected_account_state.rb +2 -1
  92. data/lib/workos/types/create_data_integration_auth_methods.rb +13 -0
  93. data/lib/workos/types/create_user_password_hash_type.rb +2 -1
  94. data/lib/workos/types/create_webhook_endpoint_events.rb +5 -1
  95. data/lib/workos/types/data_integration_auth_methods.rb +9 -0
  96. data/lib/workos/types/data_integration_credentials_input_type.rb +9 -0
  97. data/lib/workos/types/data_integrations_list_response_data_connected_account_state.rb +1 -6
  98. data/lib/workos/types/pipe_connected_account_state.rb +1 -5
  99. data/lib/workos/types/vault_kek_deleted_data_actor_source.rb +9 -0
  100. data/lib/workos/user_management/authentication_reauthentication_succeeded.rb +34 -0
  101. data/lib/workos/user_management/authentication_reauthentication_succeeded_data.rb +34 -0
  102. data/lib/workos/user_management/radar_challenge.rb +43 -0
  103. data/lib/workos/user_management.rb +149 -67
  104. data/lib/workos/vault/vault_kek_deleted.rb +34 -0
  105. data/lib/workos/vault/vault_kek_deleted_data.rb +31 -0
  106. data/lib/workos/vault.rb +4 -4
  107. data/lib/workos/version.rb +1 -1
  108. data/lib/workos/widgets.rb +2 -2
  109. data/lib/workos.rb +11 -0
  110. data/rbi/workos/access_token_agent_registration_credential_issued_data_detail.rbi +36 -0
  111. data/rbi/workos/agent_admin_link_claim_attempt_to_external_user_request.rbi +42 -0
  112. data/rbi/workos/agent_admin_link_claim_attempt_to_external_user_request_user.rbi +30 -0
  113. data/rbi/workos/agent_admin_validate_credential_request.rbi +36 -0
  114. data/rbi/workos/{sso_intent_options.rbi → agent_credential_validation.rbi} +11 -5
  115. data/rbi/workos/agent_registration.rbi +66 -0
  116. data/rbi/workos/agent_registration_agent_identity.rbi +42 -0
  117. data/rbi/workos/agent_registration_claim.rbi +48 -0
  118. data/rbi/workos/agent_registration_claim_attempt_created.rbi +54 -0
  119. data/rbi/workos/agent_registration_claim_attempt_created_data.rbi +66 -0
  120. data/rbi/workos/agent_registration_claim_claim_completion.rbi +48 -0
  121. data/rbi/workos/agent_registration_claim_completed.rbi +54 -0
  122. data/rbi/workos/agent_registration_claim_completed_data.rbi +66 -0
  123. data/rbi/workos/agent_registration_claim_completed_data_claimed_by.rbi +30 -0
  124. data/rbi/workos/agent_registration_created.rbi +54 -0
  125. data/rbi/workos/agent_registration_created_data.rbi +72 -0
  126. data/rbi/workos/agent_registration_created_data_agent_identity.rbi +36 -0
  127. data/rbi/workos/agent_registration_credential_issued.rbi +54 -0
  128. data/rbi/workos/agent_registration_credential_issued_data.rbi +54 -0
  129. data/rbi/workos/agent_registration_credential_issued_data_detail.rbi +30 -0
  130. data/rbi/workos/agent_registration_deleted.rbi +54 -0
  131. data/rbi/workos/{connection_option.rbi → agent_registration_deleted_data.rbi} +5 -5
  132. data/rbi/workos/agent_registration_expired.rbi +54 -0
  133. data/rbi/workos/{domain_verification_intent_options.rbi → agent_registration_expired_data.rbi} +5 -5
  134. data/rbi/workos/agent_registration_organization_switched.rbi +54 -0
  135. data/rbi/workos/agent_registration_organization_switched_data.rbi +36 -0
  136. data/rbi/workos/agent_registration_revoked.rbi +54 -0
  137. data/rbi/workos/agent_registration_revoked_data.rbi +24 -0
  138. data/rbi/workos/agents.rbi +42 -0
  139. data/rbi/workos/api_key_installation.rbi +36 -0
  140. data/rbi/workos/api_key_validation_response.rbi +6 -0
  141. data/rbi/workos/authentication_reauthentication_succeeded.rbi +54 -0
  142. data/rbi/workos/authentication_reauthentication_succeeded_data.rbi +54 -0
  143. data/rbi/workos/claim_view_response.rbi +42 -0
  144. data/rbi/workos/claim_view_response_organization.rbi +30 -0
  145. data/rbi/workos/client.rbi +3 -0
  146. data/rbi/workos/configure_data_integration_body.rbi +6 -0
  147. data/rbi/workos/connect.rbi +2 -1
  148. data/rbi/workos/{connected_account_dto.rbi → connected_account_input.rbi} +1 -1
  149. data/rbi/workos/connection.rbi +0 -6
  150. data/rbi/workos/create_data_integration.rbi +20 -2
  151. data/rbi/workos/data_integration.rbi +18 -0
  152. data/rbi/workos/data_integration_configuration_response.rbi +6 -0
  153. data/rbi/workos/{data_integration_credentials_dto.rbi → data_integration_credentials_input.rbi} +1 -1
  154. data/rbi/workos/data_integration_installation.rbi +42 -0
  155. data/rbi/workos/data_integrations_get_data_integration_authorize_url_request.rbi +6 -0
  156. data/rbi/workos/directory_sync.rbi +3 -1
  157. data/rbi/workos/organization_authorized_connect_application_list_data.rbi +54 -0
  158. data/rbi/workos/organization_domains.rbi +2 -2
  159. data/rbi/workos/organizations.rbi +12 -0
  160. data/rbi/workos/permission_created_data.rbi +6 -0
  161. data/rbi/workos/permission_deleted_data.rbi +6 -0
  162. data/rbi/workos/permission_updated_data.rbi +6 -0
  163. data/rbi/workos/pipes.rbi +10 -5
  164. data/rbi/workos/pipes_connected_account_connection_failed.rbi +54 -0
  165. data/rbi/workos/{organization_domain_stand_alone.rbi → pipes_connected_account_connection_failed_data.rbi} +23 -23
  166. data/rbi/workos/pipes_provider.rbi +2 -1
  167. data/rbi/workos/radar_challenge.rbi +72 -0
  168. data/rbi/workos/radar_challenge_created.rbi +54 -0
  169. data/rbi/workos/radar_challenge_created_data.rbi +42 -0
  170. data/rbi/workos/sso.rbi +26 -0
  171. data/rbi/workos/update_data_integration.rbi +8 -2
  172. data/rbi/workos/user_management.rbi +46 -0
  173. data/rbi/workos/vault_kek_deleted.rbi +54 -0
  174. data/rbi/workos/vault_kek_deleted_data.rbi +48 -0
  175. data/rbi/workos/widget_session_token.rbi +2 -2
  176. data/rbi/workos/widgets.rbi +1 -1
  177. data/test/workos/test_agents.rb +49 -0
  178. data/test/workos/test_agents_model_round_trip.rb +165 -0
  179. data/test/workos/test_api_keys_model_round_trip.rb +307 -0
  180. data/test/workos/test_authkit_helpers.rb +22 -10
  181. data/test/workos/test_authorization_model_round_trip.rb +237 -0
  182. data/test/workos/test_base_client.rb +27 -0
  183. data/test/workos/test_client_api_model_round_trip.rb +31 -0
  184. data/test/workos/test_connect_model_round_trip.rb +175 -0
  185. data/test/workos/test_directory_sync_model_round_trip.rb +579 -0
  186. data/test/workos/test_feature_flags_model_round_trip.rb +580 -0
  187. data/test/workos/test_groups_model_round_trip.rb +56 -0
  188. data/test/workos/test_multi_factor_auth_model_round_trip.rb +192 -0
  189. data/test/workos/test_organization_domains_model_round_trip.rb +260 -0
  190. data/test/workos/test_organization_membership_model_round_trip.rb +89 -0
  191. data/test/workos/test_organizations.rb +9 -1
  192. data/test/workos/test_organizations_model_round_trip.rb +602 -0
  193. data/test/workos/test_pipes_model_round_trip.rb +44 -5
  194. data/test/workos/test_pipes_provider_model_round_trip.rb +77 -0
  195. data/test/workos/test_shared_model_round_trip.rb +725 -0
  196. data/test/workos/test_sso_model_round_trip.rb +421 -0
  197. data/test/workos/test_user_management.rb +16 -0
  198. data/test/workos/test_user_management_model_round_trip.rb +1501 -0
  199. data/test/workos/test_vault_model_round_trip.rb +571 -0
  200. data/test/workos/test_widgets.rb +2 -2
  201. data/test/workos/test_widgets_model_round_trip.rb +30 -0
  202. metadata +120 -19
  203. data/lib/workos/admin_portal/domain_verification_intent_options.rb +0 -18
  204. data/lib/workos/admin_portal/intent_options.rb +0 -22
  205. data/lib/workos/admin_portal/sso_intent_options.rb +0 -22
  206. data/lib/workos/sso/connection_option.rb +0 -18
  207. data/rbi/workos/intent_options.rbi +0 -30
  208. data/test/workos/test_model_round_trip.rb +0 -6
@@ -14,7 +14,10 @@ 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,
20
+ config: :config,
18
21
  custom_provider: :custom_provider,
19
22
  created_at: :created_at,
20
23
  updated_at: :updated_at
@@ -30,7 +33,10 @@ module WorkOS
30
33
  :state,
31
34
  :scopes,
32
35
  :redirect_uri,
36
+ :auth_methods,
33
37
  :credentials,
38
+ :installation,
39
+ :config,
34
40
  :custom_provider,
35
41
  :created_at,
36
42
  :updated_at
@@ -46,7 +52,10 @@ module WorkOS
46
52
  @state = hash[:state]
47
53
  @scopes = hash[:scopes] || []
48
54
  @redirect_uri = hash[:redirect_uri]
55
+ @auth_methods = hash[:auth_methods] || []
49
56
  @credentials = hash[:credentials] ? WorkOS::DataIntegrationCredential.new(hash[:credentials]) : nil
57
+ @installation = hash[:installation] ? WorkOS::DataIntegrationInstallation.new(hash[:installation]) : nil
58
+ @config = hash[:config] || {}
50
59
  @custom_provider = hash[:custom_provider] ? WorkOS::DataIntegrationCustomProvider.new(hash[:custom_provider]) : nil
51
60
  @created_at = hash[:created_at]
52
61
  @updated_at = hash[:updated_at]
@@ -3,7 +3,7 @@
3
3
  # This file is auto-generated by oagen. Do not edit.
4
4
 
5
5
  module WorkOS
6
- class DataIntegrationCredentialsDto < WorkOS::Types::BaseModel
6
+ class DataIntegrationCredentialsInput < WorkOS::Types::BaseModel
7
7
  HASH_ATTRS = {
8
8
  type: :type,
9
9
  client_id: :client_id,
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module WorkOS
6
+ class DataIntegrationInstallation < WorkOS::Types::BaseModel
7
+ HASH_ATTRS = {
8
+ id: :id,
9
+ user_id: :user_id,
10
+ organization_id: :organization_id,
11
+ api_key_last_4: :api_key_last_4
12
+ }.freeze
13
+
14
+ attr_accessor \
15
+ :id,
16
+ :user_id,
17
+ :organization_id,
18
+ :api_key_last_4
19
+
20
+ def initialize(json)
21
+ hash = self.class.normalize(json)
22
+ @id = hash[:id]
23
+ @user_id = hash[:user_id]
24
+ @organization_id = hash[:organization_id]
25
+ @api_key_last_4 = hash[:api_key_last_4]
26
+ end
27
+ end
28
+ end
@@ -7,19 +7,22 @@ module WorkOS
7
7
  HASH_ATTRS = {
8
8
  user_id: :user_id,
9
9
  organization_id: :organization_id,
10
- return_to: :return_to
10
+ return_to: :return_to,
11
+ config: :config
11
12
  }.freeze
12
13
 
13
14
  attr_accessor \
14
15
  :user_id,
15
16
  :organization_id,
16
- :return_to
17
+ :return_to,
18
+ :config
17
19
 
18
20
  def initialize(json)
19
21
  hash = self.class.normalize(json)
20
22
  @user_id = hash[:user_id]
21
23
  @organization_id = hash[:organization_id]
22
24
  @return_to = hash[:return_to]
25
+ @config = hash[:config] || {}
23
26
  end
24
27
  end
25
28
  end
@@ -3,23 +3,5 @@
3
3
  # This file is auto-generated by oagen. Do not edit.
4
4
 
5
5
  module WorkOS
6
- class DataIntegrationsUpsertApiKeyRequest < WorkOS::Types::BaseModel
7
- HASH_ATTRS = {
8
- user_id: :user_id,
9
- organization_id: :organization_id,
10
- secret: :secret
11
- }.freeze
12
-
13
- attr_accessor \
14
- :user_id,
15
- :organization_id,
16
- :secret
17
-
18
- def initialize(json)
19
- hash = self.class.normalize(json)
20
- @user_id = hash[:user_id]
21
- @organization_id = hash[:organization_id]
22
- @secret = hash[:secret]
23
- end
24
- end
6
+ DataIntegrationsUpsertApiKeyRequest = ApiKeyInstallation
25
7
  end
@@ -9,6 +9,7 @@ module WorkOS
9
9
  enabled: :enabled,
10
10
  scopes: :scopes,
11
11
  credentials: :credentials,
12
+ api_key: :api_key,
12
13
  custom_provider: :custom_provider
13
14
  }.freeze
14
15
 
@@ -17,6 +18,7 @@ module WorkOS
17
18
  :enabled,
18
19
  :scopes,
19
20
  :credentials,
21
+ :api_key,
20
22
  :custom_provider
21
23
 
22
24
  def initialize(json)
@@ -24,7 +26,8 @@ module WorkOS
24
26
  @description = hash[:description]
25
27
  @enabled = hash[:enabled]
26
28
  @scopes = hash[:scopes] || []
27
- @credentials = hash[:credentials] ? WorkOS::DataIntegrationCredentialsDto.new(hash[:credentials]) : nil
29
+ @credentials = hash[:credentials] ? WorkOS::DataIntegrationCredentialsInput.new(hash[:credentials]) : nil
30
+ @api_key = hash[:api_key] ? WorkOS::ApiKeyInstallation.new(hash[:api_key]) : nil
28
31
  @custom_provider = hash[:custom_provider] ? WorkOS::UpdateCustomProviderDefinition.new(hash[:custom_provider]) : nil
29
32
  end
30
33
  end
data/lib/workos/pipes.rb CHANGED
@@ -59,27 +59,36 @@ module WorkOS
59
59
  # @param description [String, nil] An optional description of the Data Integration.
60
60
  # @param enabled [Boolean, nil] Whether the Data Integration is enabled. Defaults to `false`.
61
61
  # @param scopes [Array<String>, nil] The OAuth scopes to request for the Data Integration. Defaults to the provider's configured scopes when omitted.
62
- # @param credentials [WorkOS::DataIntegrationCredentialsDto, nil] The credentials to configure for the Data Integration. Required for both built-in and custom providers.
62
+ # @param auth_methods [Array<WorkOS::Types::CreateDataIntegrationAuthMethods>, nil] How accounts authenticate with the provider. Defaults to `["oauth"]`. Use `["api_key"]` to declare an API key integration; `credentials` is then not required and keys are supplied per-tenant (optionally via `api_key` on this request).
63
+ # @param config [Hash{String => String}, nil] Provider-specific config values (e.g. a Snowflake `account_identifier`), keyed by the config field. Only fields the built-in provider declares are accepted.
64
+ # @param credentials [WorkOS::DataIntegrationCredentialsInput, nil] The OAuth credentials to configure for the Data Integration. Required for OAuth integrations; omit when `auth_methods` is `["api_key"]`.
65
+ # @param api_key [WorkOS::ApiKeyInstallation, nil] An optional API key to install for the first tenant on an `api_key` integration. Omit to declare a keyless integration; tenants can be added later via the per-installation API key path.
63
66
  # @param custom_provider [WorkOS::CustomProviderDefinition, nil] The OAuth definition for a custom provider. Supply this to define a custom provider; omit it to create an integration for a built-in provider.
64
67
  # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
65
68
  # @return [WorkOS::DataIntegration]
66
69
  def create_data_integration(
67
70
  provider:,
68
- description: nil,
71
+ description: WorkOS::OMIT,
69
72
  enabled: nil,
70
- scopes: nil,
73
+ scopes: WorkOS::OMIT,
74
+ auth_methods: nil,
75
+ config: nil,
71
76
  credentials: nil,
77
+ api_key: nil,
72
78
  custom_provider: nil,
73
79
  request_options: {}
74
80
  )
75
81
  body = {
76
82
  "provider" => provider,
77
- "description" => description,
78
83
  "enabled" => enabled,
79
- "scopes" => scopes,
84
+ "auth_methods" => auth_methods,
85
+ "config" => config,
80
86
  "credentials" => credentials,
87
+ "api_key" => api_key,
81
88
  "custom_provider" => custom_provider
82
89
  }.compact
90
+ body["description"] = description unless description.equal?(WorkOS::OMIT)
91
+ body["scopes"] = scopes unless scopes.equal?(WorkOS::OMIT)
83
92
  response = @client.request(
84
93
  method: :post,
85
94
  path: "/data-integrations",
@@ -116,26 +125,29 @@ module WorkOS
116
125
  # @param description [String, nil] An optional description of the Data Integration.
117
126
  # @param enabled [Boolean, nil] Whether the Data Integration is enabled.
118
127
  # @param scopes [Array<String>, nil] The OAuth scopes to request for the Data Integration. Pass `null` to reset to the provider's configured scopes.
119
- # @param credentials [WorkOS::DataIntegrationCredentialsDto, nil] New credentials for the Data Integration. When provided, rotates the stored client secret.
128
+ # @param credentials [WorkOS::DataIntegrationCredentialsInput, nil] New OAuth credentials for the Data Integration. When provided, rotates the stored client secret. Mutually exclusive with `api_key`.
129
+ # @param api_key [WorkOS::ApiKeyInstallation, nil] An API key to install or rotate for a tenant on an `api_key` integration. Upserts the tenant installation identified by `user_id` (and optional `organization_id`).
120
130
  # @param custom_provider [WorkOS::UpdateCustomProviderDefinition, nil] Updates to a custom provider's OAuth definition. Only valid for custom-provider integrations.
121
131
  # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
122
132
  # @return [WorkOS::DataIntegration]
123
133
  def update_data_integration(
124
134
  slug:,
125
- description: nil,
135
+ description: WorkOS::OMIT,
126
136
  enabled: nil,
127
- scopes: nil,
137
+ scopes: WorkOS::OMIT,
128
138
  credentials: nil,
139
+ api_key: nil,
129
140
  custom_provider: nil,
130
141
  request_options: {}
131
142
  )
132
143
  body = {
133
- "description" => description,
134
144
  "enabled" => enabled,
135
- "scopes" => scopes,
136
145
  "credentials" => credentials,
146
+ "api_key" => api_key,
137
147
  "custom_provider" => custom_provider
138
148
  }.compact
149
+ body["description"] = description unless description.equal?(WorkOS::OMIT)
150
+ body["scopes"] = scopes unless scopes.equal?(WorkOS::OMIT)
139
151
  response = @client.request(
140
152
  method: :put,
141
153
  path: "/data-integrations/#{WorkOS::Util.encode_path(slug)}",
@@ -201,6 +213,7 @@ module WorkOS
201
213
  # @param user_id [String] The ID of the user to authorize.
202
214
  # @param organization_id [String, nil] An organization ID to scope the authorization to a specific organization.
203
215
  # @param return_to [String, nil] The URL to redirect the user to after authorization.
216
+ # @param config [Hash{String => String}, nil] Connect-time config values for the provider-declared `installation`-scope fields (e.g. a Zendesk `subdomain`), keyed by the config field. Only fields the provider declares may be supplied, and required fields must be provided unless already pinned on the integration.
204
217
  # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
205
218
  # @return [WorkOS::DataIntegrationAuthorizeUrlResponse]
206
219
  def authorize_data_integration(
@@ -208,12 +221,14 @@ module WorkOS
208
221
  user_id:,
209
222
  organization_id: nil,
210
223
  return_to: nil,
224
+ config: nil,
211
225
  request_options: {}
212
226
  )
213
227
  body = {
214
228
  "user_id" => user_id,
215
229
  "organization_id" => organization_id,
216
- "return_to" => return_to
230
+ "return_to" => return_to,
231
+ "config" => config
217
232
  }.compact
218
233
  response = @client.request(
219
234
  method: :post,
@@ -264,13 +279,13 @@ module WorkOS
264
279
  def get_access_token(
265
280
  provider:,
266
281
  user_id:,
267
- organization_id: nil,
282
+ organization_id: WorkOS::OMIT,
268
283
  request_options: {}
269
284
  )
270
285
  body = {
271
- "user_id" => user_id,
272
- "organization_id" => organization_id
273
- }.compact
286
+ "user_id" => user_id
287
+ }
288
+ body["organization_id"] = organization_id unless organization_id.equal?(WorkOS::OMIT)
274
289
  response = @client.request(
275
290
  method: :post,
276
291
  path: "/data-integrations/#{WorkOS::Util.encode_path(provider)}/token",
@@ -317,7 +332,7 @@ module WorkOS
317
332
  # @param refresh_token [String, nil] The OAuth refresh token for the connected account.
318
333
  # @param expires_at [String, nil] The ISO-8601 timestamp when the access token expires. Required when `access_token` is provided for tokens that expire.
319
334
  # @param scopes [Array<String>, nil] The OAuth scopes granted for this connection.
320
- # @param state [WorkOS::Types::ConnectedAccountState, nil] Explicitly set the state of the connected account. When omitted, the state is derived from the token combination provided.
335
+ # @param state [WorkOS::Types::ConnectedAccountInputState, nil] Explicitly set the state of the connected account. When omitted, the state is derived from the token combination provided.
321
336
  # @param organization_id [String, nil] An [Organization](https://workos.com/docs/reference/organization) identifier. Optional parameter if the connection is scoped to an organization.
322
337
  # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
323
338
  # @return [WorkOS::ConnectedAccount]
@@ -362,7 +377,7 @@ module WorkOS
362
377
  # @param refresh_token [String, nil] The OAuth refresh token for the connected account.
363
378
  # @param expires_at [String, nil] The ISO-8601 timestamp when the access token expires. Required when `access_token` is provided for tokens that expire.
364
379
  # @param scopes [Array<String>, nil] The OAuth scopes granted for this connection.
365
- # @param state [WorkOS::Types::ConnectedAccountState, nil] Explicitly set the state of the connected account. When omitted, the state is derived from the token combination provided.
380
+ # @param state [WorkOS::Types::ConnectedAccountInputState, nil] Explicitly set the state of the connected account. When omitted, the state is derived from the token combination provided.
366
381
  # @param organization_id [String, nil] An [Organization](https://workos.com/docs/reference/organization) identifier. Optional parameter if the connection is scoped to an organization.
367
382
  # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
368
383
  # @return [WorkOS::ConnectedAccount]
@@ -8,14 +8,16 @@ module WorkOS
8
8
  enabled: :enabled,
9
9
  scopes: :scopes,
10
10
  client_id: :client_id,
11
- client_secret: :client_secret
11
+ client_secret: :client_secret,
12
+ config: :config
12
13
  }.freeze
13
14
 
14
15
  attr_accessor \
15
16
  :enabled,
16
17
  :scopes,
17
18
  :client_id,
18
- :client_secret
19
+ :client_secret,
20
+ :config
19
21
 
20
22
  def initialize(json)
21
23
  hash = self.class.normalize(json)
@@ -23,6 +25,7 @@ module WorkOS
23
25
  @scopes = hash[:scopes] || []
24
26
  @client_id = hash[:client_id]
25
27
  @client_secret = hash[:client_secret]
28
+ @config = hash[:config] || {}
26
29
  end
27
30
  end
28
31
  end
@@ -12,6 +12,7 @@ module WorkOS
12
12
  name: :name,
13
13
  enabled: :enabled,
14
14
  scopes: :scopes,
15
+ config: :config,
15
16
  created_at: :created_at,
16
17
  updated_at: :updated_at,
17
18
  credentials: :credentials
@@ -25,6 +26,7 @@ module WorkOS
25
26
  :name,
26
27
  :enabled,
27
28
  :scopes,
29
+ :config,
28
30
  :created_at,
29
31
  :updated_at,
30
32
  :credentials
@@ -38,6 +40,7 @@ module WorkOS
38
40
  @name = hash[:name]
39
41
  @enabled = hash[:enabled]
40
42
  @scopes = hash[:scopes] || []
43
+ @config = hash[:config] || {}
41
44
  @created_at = hash[:created_at]
42
45
  @updated_at = hash[:updated_at]
43
46
  @credentials = hash[:credentials] ? WorkOS::DataIntegrationCredentials.new(hash[:credentials]) : nil
@@ -36,23 +36,26 @@ module WorkOS
36
36
  # @param scopes [Array<String>, nil] The OAuth scopes to request for the organization. Pass `null` to inherit the provider scopes.
37
37
  # @param client_id [String, nil] The OAuth client ID of the organization's own application. Must be provided together with `client_secret`, and only for providers whose credentials are supplied by the organization.
38
38
  # @param client_secret [String, nil] The OAuth client secret of the organization's own application. Must be provided together with `client_id`.
39
+ # @param config [Hash{String => String}, nil] Provider-specific config values to set for the organization, keyed by config field. Only fields the provider declares are accepted, and each value must match that field's pattern. Accepted only for providers whose credentials are organization-managed; for shared or custom credential providers, config belongs on the integration itself (via the data-integrations API) and supplying it here is rejected.
39
40
  # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
40
41
  # @return [WorkOS::DataIntegrationConfigurationResponse]
41
42
  def update_organization_data_integration_configuration(
42
43
  organization_id:,
43
44
  slug:,
44
45
  enabled: nil,
45
- scopes: nil,
46
+ scopes: WorkOS::OMIT,
46
47
  client_id: nil,
47
48
  client_secret: nil,
49
+ config: nil,
48
50
  request_options: {}
49
51
  )
50
52
  body = {
51
53
  "enabled" => enabled,
52
- "scopes" => scopes,
53
54
  "client_id" => client_id,
54
- "client_secret" => client_secret
55
+ "client_secret" => client_secret,
56
+ "config" => config
55
57
  }.compact
58
+ body["scopes"] = scopes unless scopes.equal?(WorkOS::OMIT)
56
59
  response = @client.request(
57
60
  method: :put,
58
61
  path: "/organizations/#{WorkOS::Util.encode_path(organization_id)}/data_integration_configurations/#{WorkOS::Util.encode_path(slug)}",
@@ -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 AccessTokenAgentRegistrationCredentialIssuedDataDetail < WorkOS::Types::BaseModel
7
+ HASH_ATTRS = {
8
+ kind: :kind,
9
+ jti: :jti,
10
+ expires_at: :expires_at
11
+ }.freeze
12
+
13
+ attr_accessor \
14
+ :kind,
15
+ :jti,
16
+ :expires_at
17
+
18
+ def initialize(json)
19
+ hash = self.class.normalize(json)
20
+ @kind = hash[:kind]
21
+ @jti = hash[:jti]
22
+ @expires_at = hash[:expires_at]
23
+ end
24
+ end
25
+ 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 AgentRegistrationClaimAttemptCreated < WorkOS::Types::BaseModel
7
+ HASH_ATTRS = {
8
+ object: :object,
9
+ id: :id,
10
+ event: :event,
11
+ data: :data,
12
+ created_at: :created_at,
13
+ context: :context
14
+ }.freeze
15
+
16
+ attr_accessor \
17
+ :object,
18
+ :id,
19
+ :event,
20
+ :data,
21
+ :created_at,
22
+ :context
23
+
24
+ def initialize(json)
25
+ hash = self.class.normalize(json)
26
+ @object = hash[:object]
27
+ @id = hash[:id]
28
+ @event = hash[:event]
29
+ @data = hash[:data] ? WorkOS::AgentRegistrationClaimAttemptCreatedData.new(hash[:data]) : nil
30
+ @created_at = hash[:created_at]
31
+ @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module WorkOS
6
+ class AgentRegistrationClaimAttemptCreatedData < WorkOS::Types::BaseModel
7
+ HASH_ATTRS = {
8
+ object: :object,
9
+ id: :id,
10
+ agent_registration_id: :agent_registration_id,
11
+ agent_registration_claim_id: :agent_registration_claim_id,
12
+ login_hint: :login_hint,
13
+ expires_at: :expires_at,
14
+ created_at: :created_at,
15
+ updated_at: :updated_at
16
+ }.freeze
17
+
18
+ attr_accessor \
19
+ :object,
20
+ :id,
21
+ :agent_registration_id,
22
+ :agent_registration_claim_id,
23
+ :login_hint,
24
+ :expires_at,
25
+ :created_at,
26
+ :updated_at
27
+
28
+ def initialize(json)
29
+ hash = self.class.normalize(json)
30
+ @object = hash[:object]
31
+ @id = hash[:id]
32
+ @agent_registration_id = hash[:agent_registration_id]
33
+ @agent_registration_claim_id = hash[:agent_registration_claim_id]
34
+ @login_hint = hash[:login_hint]
35
+ @expires_at = hash[:expires_at]
36
+ @created_at = hash[:created_at]
37
+ @updated_at = hash[:updated_at]
38
+ end
39
+ end
40
+ 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 AgentRegistrationClaimCompleted < WorkOS::Types::BaseModel
7
+ HASH_ATTRS = {
8
+ object: :object,
9
+ id: :id,
10
+ event: :event,
11
+ data: :data,
12
+ created_at: :created_at,
13
+ context: :context
14
+ }.freeze
15
+
16
+ attr_accessor \
17
+ :object,
18
+ :id,
19
+ :event,
20
+ :data,
21
+ :created_at,
22
+ :context
23
+
24
+ def initialize(json)
25
+ hash = self.class.normalize(json)
26
+ @object = hash[:object]
27
+ @id = hash[:id]
28
+ @event = hash[:event]
29
+ @data = hash[:data] ? WorkOS::AgentRegistrationClaimCompletedData.new(hash[:data]) : nil
30
+ @created_at = hash[:created_at]
31
+ @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module WorkOS
6
+ class AgentRegistrationClaimCompletedData < WorkOS::Types::BaseModel
7
+ HASH_ATTRS = {
8
+ object: :object,
9
+ id: :id,
10
+ agent_registration_id: :agent_registration_id,
11
+ completed_by_attempt_id: :completed_by_attempt_id,
12
+ claimed_by: :claimed_by,
13
+ completed_at: :completed_at,
14
+ created_at: :created_at,
15
+ updated_at: :updated_at
16
+ }.freeze
17
+
18
+ attr_accessor \
19
+ :object,
20
+ :id,
21
+ :agent_registration_id,
22
+ :completed_by_attempt_id,
23
+ :claimed_by,
24
+ :completed_at,
25
+ :created_at,
26
+ :updated_at
27
+
28
+ def initialize(json)
29
+ hash = self.class.normalize(json)
30
+ @object = hash[:object]
31
+ @id = hash[:id]
32
+ @agent_registration_id = hash[:agent_registration_id]
33
+ @completed_by_attempt_id = hash[:completed_by_attempt_id]
34
+ @claimed_by = hash[:claimed_by] ? WorkOS::AgentRegistrationClaimCompletedDataClaimedBy.new(hash[:claimed_by]) : nil
35
+ @completed_at = hash[:completed_at]
36
+ @created_at = hash[:created_at]
37
+ @updated_at = hash[:updated_at]
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module WorkOS
6
+ class AgentRegistrationClaimCompletedDataClaimedBy < WorkOS::Types::BaseModel
7
+ HASH_ATTRS = {
8
+ user_id: :user_id,
9
+ organization_id: :organization_id
10
+ }.freeze
11
+
12
+ attr_accessor \
13
+ :user_id,
14
+ :organization_id
15
+
16
+ def initialize(json)
17
+ hash = self.class.normalize(json)
18
+ @user_id = hash[:user_id]
19
+ @organization_id = hash[:organization_id]
20
+ end
21
+ end
22
+ 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 AgentRegistrationCreated < WorkOS::Types::BaseModel
7
+ HASH_ATTRS = {
8
+ object: :object,
9
+ id: :id,
10
+ event: :event,
11
+ data: :data,
12
+ created_at: :created_at,
13
+ context: :context
14
+ }.freeze
15
+
16
+ attr_accessor \
17
+ :object,
18
+ :id,
19
+ :event,
20
+ :data,
21
+ :created_at,
22
+ :context
23
+
24
+ def initialize(json)
25
+ hash = self.class.normalize(json)
26
+ @object = hash[:object]
27
+ @id = hash[:id]
28
+ @event = hash[:event]
29
+ @data = hash[:data] ? WorkOS::AgentRegistrationCreatedData.new(hash[:data]) : nil
30
+ @created_at = hash[:created_at]
31
+ @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil
32
+ end
33
+ end
34
+ end
@@ -3,16 +3,15 @@
3
3
  # This file is auto-generated by oagen. Do not edit.
4
4
 
5
5
  module WorkOS
6
- class OrganizationDomainStandAlone < WorkOS::Types::BaseModel
6
+ class AgentRegistrationCreatedData < WorkOS::Types::BaseModel
7
7
  HASH_ATTRS = {
8
8
  object: :object,
9
9
  id: :id,
10
+ agent_identity: :agent_identity,
10
11
  organization_id: :organization_id,
11
- domain: :domain,
12
- state: :state,
13
- verification_prefix: :verification_prefix,
14
- verification_token: :verification_token,
15
- verification_strategy: :verification_strategy,
12
+ status: :status,
13
+ kind: :kind,
14
+ method: :method,
16
15
  created_at: :created_at,
17
16
  updated_at: :updated_at
18
17
  }.freeze
@@ -20,12 +19,11 @@ module WorkOS
20
19
  attr_accessor \
21
20
  :object,
22
21
  :id,
22
+ :agent_identity,
23
23
  :organization_id,
24
- :domain,
25
- :state,
26
- :verification_prefix,
27
- :verification_token,
28
- :verification_strategy,
24
+ :status,
25
+ :kind,
26
+ :method,
29
27
  :created_at,
30
28
  :updated_at
31
29
 
@@ -33,12 +31,11 @@ module WorkOS
33
31
  hash = self.class.normalize(json)
34
32
  @object = hash[:object]
35
33
  @id = hash[:id]
34
+ @agent_identity = hash[:agent_identity] ? WorkOS::AgentRegistrationCreatedDataAgentIdentity.new(hash[:agent_identity]) : nil
36
35
  @organization_id = hash[:organization_id]
37
- @domain = hash[:domain]
38
- @state = hash[:state]
39
- @verification_prefix = hash[:verification_prefix]
40
- @verification_token = hash[:verification_token]
41
- @verification_strategy = hash[:verification_strategy]
36
+ @status = hash[:status]
37
+ @kind = hash[:kind]
38
+ @method = hash[:method]
42
39
  @created_at = hash[:created_at]
43
40
  @updated_at = hash[:updated_at]
44
41
  end