workos 10.2.1 → 10.4.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 (292) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +2 -2
  3. data/.github/workflows/docs.yml +3 -3
  4. data/.github/workflows/lint.yml +2 -2
  5. data/.github/workflows/release-please.yml +3 -3
  6. data/.github/workflows/release.yml +2 -2
  7. data/.last-synced-sha +1 -1
  8. data/.oagen-manifest.json +393 -4
  9. data/.release-please-manifest.json +1 -1
  10. data/.ruby-version +1 -1
  11. data/CHANGELOG.md +328 -0
  12. data/Gemfile.lock +14 -14
  13. data/README.md +23 -0
  14. data/lib/workos/admin_portal.rb +2 -2
  15. data/lib/workos/agents/agent_blueprint.rb +43 -0
  16. data/lib/workos/agents/agent_blueprint_invocable_by.rb +7 -0
  17. data/lib/workos/agents/agent_blueprint_session_setting.rb +25 -0
  18. data/lib/workos/agents/agent_blueprints_create_request.rb +31 -0
  19. data/lib/workos/agents/agent_blueprints_create_request_invocable_by.rb +22 -0
  20. data/lib/workos/agents/agent_blueprints_create_request_session_setting.rb +7 -0
  21. data/lib/workos/agents/agent_blueprints_token_mint_token_request.rb +34 -0
  22. data/lib/workos/agents/agent_blueprints_token_validate_token_request.rb +18 -0
  23. data/lib/workos/agents/agent_blueprints_update_request.rb +31 -0
  24. data/lib/workos/agents/agent_blueprints_update_request_invocable_by.rb +7 -0
  25. data/lib/workos/agents/agent_blueprints_update_request_session_setting.rb +25 -0
  26. data/lib/workos/agents/agent_instance.rb +40 -0
  27. data/lib/workos/agents/agent_instance_session.rb +40 -0
  28. data/lib/workos/agents/agent_token.rb +40 -0
  29. data/lib/workos/agents/agent_token_validation.rb +40 -0
  30. data/lib/workos/agents.rb +399 -0
  31. data/lib/workos/audit_logs.rb +23 -5
  32. data/lib/workos/authorization.rb +3 -3
  33. data/lib/workos/base_client.rb +6 -2
  34. data/lib/workos/client.rb +4 -0
  35. data/lib/workos/configuration.rb +3 -2
  36. data/lib/workos/inflections.rb +17 -0
  37. data/lib/workos/multi_factor_auth.rb +1 -1
  38. data/lib/workos/organizations/create_it_contact.rb +18 -0
  39. data/lib/workos/organizations/invite_it_contact.rb +18 -0
  40. data/lib/workos/organizations/it_contact.rb +31 -0
  41. data/lib/workos/organizations/it_contact_list.rb +25 -0
  42. data/lib/workos/organizations/organization_input.rb +10 -1
  43. data/lib/workos/organizations/update_audit_logs_retention.rb +13 -1
  44. data/lib/workos/organizations.rb +110 -1
  45. data/lib/workos/pipes/connected_account.rb +9 -0
  46. data/lib/workos/pipes/create_data_integration.rb +3 -0
  47. data/lib/workos/pipes/data_integration.rb +3 -0
  48. data/lib/workos/pipes/data_integration_installation.rb +9 -0
  49. data/lib/workos/pipes/data_integrations_get_data_integration_authorize_url_request.rb +3 -0
  50. data/lib/workos/pipes/data_integrations_get_user_token_request.rb +11 -2
  51. data/lib/workos/pipes/data_integrations_list_response_data.rb +18 -3
  52. data/lib/workos/pipes/data_integrations_list_response_data_connected_account.rb +9 -0
  53. data/lib/workos/pipes/data_integrations_upsert_api_key_request.rb +25 -1
  54. data/lib/workos/pipes/data_integrations_upsert_client_credentials_request.rb +6 -0
  55. data/lib/workos/pipes/data_integrations_vend_credentials_request.rb +11 -2
  56. data/lib/workos/pipes.rb +324 -17
  57. data/lib/workos/platform_teams/create_team.rb +22 -0
  58. data/lib/workos/platform_teams/team.rb +37 -0
  59. data/lib/workos/platform_teams.rb +58 -0
  60. data/lib/workos/session_manager.rb +11 -6
  61. data/lib/workos/shared/account_selection_required_error.rb +22 -0
  62. data/lib/workos/shared/agent_blueprint_created.rb +34 -0
  63. data/lib/workos/shared/agent_blueprint_created_data.rb +43 -0
  64. data/lib/workos/shared/agent_blueprint_created_data_invocable_by.rb +22 -0
  65. data/lib/workos/shared/agent_blueprint_created_data_session_setting.rb +25 -0
  66. data/lib/workos/shared/agent_blueprint_deleted.rb +34 -0
  67. data/lib/workos/shared/agent_blueprint_deleted_data.rb +31 -0
  68. data/lib/workos/shared/agent_blueprint_updated.rb +34 -0
  69. data/lib/workos/shared/agent_blueprint_updated_data.rb +7 -0
  70. data/lib/workos/shared/agent_blueprint_updated_data_invocable_by.rb +7 -0
  71. data/lib/workos/shared/agent_blueprint_updated_data_session_setting.rb +7 -0
  72. data/lib/workos/shared/agent_instance_created.rb +34 -0
  73. data/lib/workos/shared/agent_instance_created_data.rb +40 -0
  74. data/lib/workos/shared/agent_instance_deleted.rb +34 -0
  75. data/lib/workos/shared/agent_instance_deleted_data.rb +40 -0
  76. data/lib/workos/shared/agent_instance_session_created.rb +34 -0
  77. data/lib/workos/shared/agent_instance_session_created_data.rb +43 -0
  78. data/lib/workos/shared/agent_instance_session_revoked.rb +34 -0
  79. data/lib/workos/shared/agent_instance_session_revoked_data.rb +40 -0
  80. data/lib/workos/shared/pipe_connected_account.rb +15 -0
  81. data/lib/workos/shared/pipes_account_connection_add_failed.rb +34 -0
  82. data/lib/workos/shared/pipes_account_connection_add_failed_data.rb +49 -0
  83. data/lib/workos/shared/pipes_account_connection_connected.rb +34 -0
  84. data/lib/workos/shared/pipes_account_connection_connection_failed.rb +34 -0
  85. data/lib/workos/shared/pipes_account_connection_connection_failed_data.rb +7 -0
  86. data/lib/workos/shared/pipes_account_connection_disconnected.rb +34 -0
  87. data/lib/workos/shared/pipes_account_connection_reauthorization_needed.rb +34 -0
  88. data/lib/workos/shared/pipes_connected_account_connection_failed_data.rb +1 -40
  89. data/lib/workos/shared/resource_export_completed.rb +34 -0
  90. data/lib/workos/shared/resource_export_completed_data.rb +22 -0
  91. data/lib/workos/shared/resource_export_created.rb +34 -0
  92. data/lib/workos/shared/resource_export_created_data.rb +22 -0
  93. data/lib/workos/shared/resource_export_downloaded.rb +34 -0
  94. data/lib/workos/shared/resource_export_downloaded_data.rb +22 -0
  95. data/lib/workos/shared/resource_export_failed.rb +34 -0
  96. data/lib/workos/shared/resource_export_failed_data.rb +22 -0
  97. data/lib/workos/shared/waitlist_user.rb +8 -5
  98. data/lib/workos/sso/create_connection.rb +37 -0
  99. data/lib/workos/sso/create_connection_attribute_maps.rb +22 -0
  100. data/lib/workos/sso/create_connection_key_pair.rb +22 -0
  101. data/lib/workos/sso/create_connection_oidc_options.rb +43 -0
  102. data/lib/workos/sso/create_connection_saml_options.rb +40 -0
  103. data/lib/workos/sso/create_connection_standard_attributes.rb +34 -0
  104. data/lib/workos/sso/create_saml_idp_signing_certificate.rb +18 -0
  105. data/lib/workos/sso/patch_connection.rb +34 -0
  106. data/lib/workos/sso/patch_connection_attribute_maps.rb +22 -0
  107. data/lib/workos/sso/patch_connection_oidc_options.rb +40 -0
  108. data/lib/workos/sso/patch_connection_saml_options.rb +31 -0
  109. data/lib/workos/sso/patch_connection_standard_attributes.rb +7 -0
  110. data/lib/workos/sso/saml_idp_signing_certificate.rb +34 -0
  111. data/lib/workos/sso/saml_idp_signing_certificate_list.rb +22 -0
  112. data/lib/workos/sso/saml_sp_encryption_certificate.rb +34 -0
  113. data/lib/workos/sso/saml_sp_encryption_certificate_list.rb +22 -0
  114. data/lib/workos/sso/saml_sp_signing_certificate.rb +34 -0
  115. data/lib/workos/sso/token_query.rb +11 -2
  116. data/lib/workos/sso.rb +305 -4
  117. data/lib/workos/types/agent_blueprints_token_mint_token_request_type.rb +15 -0
  118. data/lib/workos/types/agent_instance_created_data_type.rb +13 -0
  119. data/lib/workos/types/agent_instance_deleted_data_type.rb +9 -0
  120. data/lib/workos/types/agent_instance_session_status.rb +14 -0
  121. data/lib/workos/types/agent_instance_type.rb +9 -0
  122. data/lib/workos/types/authenticate_response_authentication_method.rb +1 -4
  123. data/lib/workos/types/connected_account_connection_role.rb +13 -0
  124. data/lib/workos/types/connection_activated_data_connection_type.rb +1 -4
  125. data/lib/workos/types/connection_type.rb +1 -4
  126. data/lib/workos/types/connections_connection_type.rb +1 -4
  127. data/lib/workos/types/create_connection_oidc_options_id_token_signature_algorithm.rb +24 -0
  128. data/lib/workos/types/create_connection_oidc_options_token_authentication_method.rb +14 -0
  129. data/lib/workos/types/create_data_integration_ownership.rb +13 -0
  130. data/lib/workos/types/create_webhook_endpoint_events.rb +13 -1
  131. data/lib/workos/types/data_integration_installation_connection_role.rb +9 -0
  132. data/lib/workos/types/data_integration_ownership.rb +9 -0
  133. data/lib/workos/types/data_integrations_get_data_integration_authorize_url_request_connection_owner.rb +9 -0
  134. data/lib/workos/types/data_integrations_get_user_token_request_connection_owner.rb +9 -0
  135. data/lib/workos/types/data_integrations_list_response_data_connected_account_connection_role.rb +9 -0
  136. data/lib/workos/types/data_integrations_list_response_data_connection_owner.rb +9 -0
  137. data/lib/workos/types/data_integrations_upsert_api_key_request_connection_owner.rb +9 -0
  138. data/lib/workos/types/data_integrations_upsert_client_credentials_request_connection_owner.rb +9 -0
  139. data/lib/workos/types/data_integrations_vend_credentials_request_connection_owner.rb +9 -0
  140. data/lib/workos/types/invite_it_contact_intents.rb +16 -0
  141. data/lib/workos/types/patch_connection_oidc_options_id_token_signature_algorithm.rb +9 -0
  142. data/lib/workos/types/patch_connection_oidc_options_token_authentication_method.rb +9 -0
  143. data/lib/workos/types/pipe_connected_account_auth_method.rb +9 -0
  144. data/lib/workos/types/pipe_connected_account_connection_role.rb +9 -0
  145. data/lib/workos/types/pipes_ownership.rb +9 -0
  146. data/lib/workos/types/resource_export_completed_data_resource_type.rb +18 -0
  147. data/lib/workos/types/resource_export_created_data_resource_type.rb +9 -0
  148. data/lib/workos/types/resource_export_downloaded_data_resource_type.rb +9 -0
  149. data/lib/workos/types/resource_export_failed_data_resource_type.rb +9 -0
  150. data/lib/workos/types/session_created_data_status.rb +1 -6
  151. data/lib/workos/types/session_revoked_data_status.rb +1 -1
  152. data/lib/workos/types/sso_grant_type.rb +13 -0
  153. data/lib/workos/types/team_production_state.rb +15 -0
  154. data/lib/workos/types/token_query_grant_type.rb +9 -0
  155. data/lib/workos/types/update_audit_logs_retention_retention_period.rb +32 -0
  156. data/lib/workos/types/user_identities_get_item_provider.rb +1 -4
  157. data/lib/workos/types/user_management_waitlists_state.rb +14 -0
  158. data/lib/workos/types/user_sessions_status.rb +1 -1
  159. data/lib/workos/types/waitlist_entry_state.rb +9 -0
  160. data/lib/workos/types/waitlist_user_state.rb +1 -6
  161. data/lib/workos/user_management/authentication_oauth_failed_data.rb +5 -2
  162. data/lib/workos/user_management/authentication_oauth_succeeded_data.rb +5 -2
  163. data/lib/workos/user_management/authkit_oauth_resource.rb +34 -0
  164. data/lib/workos/user_management/create_authkit_oauth_resource.rb +22 -0
  165. data/lib/workos/user_management/create_password_reset_token.rb +1 -12
  166. data/lib/workos/user_management/create_waitlist_entry.rb +25 -0
  167. data/lib/workos/user_management/email_completion_session_authenticate_request.rb +43 -0
  168. data/lib/workos/user_management/waitlist.rb +28 -0
  169. data/lib/workos/user_management/waitlist_entry.rb +43 -0
  170. data/lib/workos/user_management.rb +263 -0
  171. data/lib/workos/version.rb +1 -1
  172. data/lib/workos.rb +1 -0
  173. data/rbi/workos/account_selection_required_error.rbi +30 -0
  174. data/rbi/workos/agent_blueprint.rbi +72 -0
  175. data/rbi/workos/agent_blueprint_created.rbi +54 -0
  176. data/rbi/workos/agent_blueprint_created_data.rbi +72 -0
  177. data/rbi/workos/agent_blueprint_created_data_invocable_by.rbi +30 -0
  178. data/rbi/workos/agent_blueprint_created_data_session_setting.rbi +36 -0
  179. data/rbi/workos/agent_blueprint_deleted.rbi +54 -0
  180. data/rbi/workos/agent_blueprint_deleted_data.rbi +48 -0
  181. data/rbi/workos/agent_blueprint_invocable_by.rbi +30 -0
  182. data/rbi/workos/agent_blueprint_session_setting.rbi +36 -0
  183. data/rbi/workos/agent_blueprint_updated.rbi +54 -0
  184. data/rbi/workos/agent_blueprint_updated_data.rbi +72 -0
  185. data/rbi/workos/agent_blueprint_updated_data_invocable_by.rbi +30 -0
  186. data/rbi/workos/agent_blueprint_updated_data_session_setting.rbi +36 -0
  187. data/rbi/workos/agent_blueprints_create_request.rbi +48 -0
  188. data/rbi/workos/agent_blueprints_create_request_invocable_by.rbi +30 -0
  189. data/rbi/workos/agent_blueprints_create_request_session_setting.rbi +36 -0
  190. data/rbi/workos/agent_blueprints_token_mint_token_request.rbi +54 -0
  191. data/rbi/workos/agent_blueprints_token_validate_token_request.rbi +24 -0
  192. data/rbi/workos/agent_blueprints_update_request.rbi +48 -0
  193. data/rbi/workos/agent_blueprints_update_request_invocable_by.rbi +30 -0
  194. data/rbi/workos/agent_blueprints_update_request_session_setting.rbi +36 -0
  195. data/rbi/workos/agent_instance.rbi +66 -0
  196. data/rbi/workos/agent_instance_created.rbi +54 -0
  197. data/rbi/workos/agent_instance_created_data.rbi +66 -0
  198. data/rbi/workos/agent_instance_deleted.rbi +54 -0
  199. data/rbi/workos/agent_instance_deleted_data.rbi +66 -0
  200. data/rbi/workos/agent_instance_session.rbi +66 -0
  201. data/rbi/workos/agent_instance_session_created.rbi +54 -0
  202. data/rbi/workos/agent_instance_session_created_data.rbi +72 -0
  203. data/rbi/workos/agent_instance_session_revoked.rbi +54 -0
  204. data/rbi/workos/agent_instance_session_revoked_data.rbi +66 -0
  205. data/rbi/workos/agent_token.rbi +66 -0
  206. data/rbi/workos/agent_token_validation.rbi +66 -0
  207. data/rbi/workos/agents.rbi +134 -0
  208. data/rbi/workos/audit_logs.rbi +26 -2
  209. data/rbi/workos/authentication_oauth_failed_data.rbi +6 -0
  210. data/rbi/workos/authentication_oauth_succeeded_data.rbi +6 -0
  211. data/rbi/workos/authkit_oauth_resource.rbi +54 -0
  212. data/rbi/workos/client.rbi +3 -0
  213. data/rbi/workos/connected_account.rbi +18 -0
  214. data/rbi/workos/create_authkit_oauth_resource.rbi +30 -0
  215. data/rbi/workos/create_connection.rbi +60 -0
  216. data/rbi/workos/create_connection_attribute_maps.rbi +30 -0
  217. data/rbi/workos/create_connection_key_pair.rbi +30 -0
  218. data/rbi/workos/create_connection_oidc_options.rbi +72 -0
  219. data/rbi/workos/create_connection_saml_options.rbi +66 -0
  220. data/rbi/workos/create_connection_standard_attributes.rbi +54 -0
  221. data/rbi/workos/create_data_integration.rbi +6 -0
  222. data/rbi/workos/create_it_contact.rbi +24 -0
  223. data/rbi/workos/create_saml_idp_signing_certificate.rbi +24 -0
  224. data/rbi/workos/create_team.rbi +30 -0
  225. data/rbi/workos/create_waitlist_entry.rbi +36 -0
  226. data/rbi/workos/data_integration.rbi +6 -0
  227. data/rbi/workos/data_integration_installation.rbi +19 -1
  228. data/rbi/workos/data_integrations_get_data_integration_authorize_url_request.rbi +6 -0
  229. data/rbi/workos/data_integrations_get_user_token_request.rbi +18 -0
  230. data/rbi/workos/data_integrations_list_response_data.rbi +12 -0
  231. data/rbi/workos/data_integrations_list_response_data_connected_account.rbi +18 -0
  232. data/rbi/workos/data_integrations_upsert_api_key_request.rbi +12 -0
  233. data/rbi/workos/data_integrations_upsert_client_credentials_request.rbi +12 -0
  234. data/rbi/workos/data_integrations_vend_credentials_request.rbi +18 -0
  235. data/rbi/workos/email_completion_session_authenticate_request.rbi +72 -0
  236. data/rbi/workos/invite_it_contact.rbi +24 -0
  237. data/rbi/workos/it_contact.rbi +48 -0
  238. data/rbi/workos/organizations.rbi +45 -0
  239. data/rbi/workos/patch_connection.rbi +54 -0
  240. data/rbi/workos/patch_connection_attribute_maps.rbi +30 -0
  241. data/rbi/workos/patch_connection_oidc_options.rbi +66 -0
  242. data/rbi/workos/patch_connection_saml_options.rbi +48 -0
  243. data/rbi/workos/patch_connection_standard_attributes.rbi +54 -0
  244. data/rbi/workos/pipe_connected_account.rbi +30 -0
  245. data/rbi/workos/pipes.rbi +122 -11
  246. data/rbi/workos/pipes_account_connection_add_failed.rbi +54 -0
  247. data/rbi/workos/pipes_account_connection_add_failed_data.rbi +84 -0
  248. data/rbi/workos/pipes_account_connection_connected.rbi +54 -0
  249. data/rbi/workos/pipes_account_connection_connection_failed.rbi +54 -0
  250. data/rbi/workos/pipes_account_connection_connection_failed_data.rbi +84 -0
  251. data/rbi/workos/pipes_account_connection_disconnected.rbi +54 -0
  252. data/rbi/workos/pipes_account_connection_reauthorization_needed.rbi +54 -0
  253. data/rbi/workos/pipes_connected_account_connection_failed_data.rbi +6 -0
  254. data/rbi/workos/platform_teams.rbi +30 -0
  255. data/rbi/workos/resource_export_completed.rbi +54 -0
  256. data/rbi/workos/resource_export_completed_data.rbi +30 -0
  257. data/rbi/workos/resource_export_created.rbi +54 -0
  258. data/rbi/workos/resource_export_created_data.rbi +30 -0
  259. data/rbi/workos/resource_export_downloaded.rbi +54 -0
  260. data/rbi/workos/resource_export_downloaded_data.rbi +30 -0
  261. data/rbi/workos/resource_export_failed.rbi +54 -0
  262. data/rbi/workos/resource_export_failed_data.rbi +30 -0
  263. data/rbi/workos/saml_idp_signing_certificate.rbi +54 -0
  264. data/rbi/workos/saml_idp_signing_certificate_list.rbi +30 -0
  265. data/rbi/workos/saml_sp_encryption_certificate.rbi +54 -0
  266. data/rbi/workos/saml_sp_encryption_certificate_list.rbi +30 -0
  267. data/rbi/workos/saml_sp_signing_certificate.rbi +54 -0
  268. data/rbi/workos/sso.rbi +155 -2
  269. data/rbi/workos/team.rbi +60 -0
  270. data/rbi/workos/token_query.rbi +20 -2
  271. data/rbi/workos/update_audit_logs_retention.rbi +8 -2
  272. data/rbi/workos/user_management.rbi +92 -0
  273. data/rbi/workos/waitlist.rbi +42 -0
  274. data/rbi/workos/waitlist_entry.rbi +72 -0
  275. data/rbi/workos/waitlist_user.rbi +12 -6
  276. data/test/workos/test_agents.rb +105 -1
  277. data/test/workos/test_agents_model_round_trip.rb +245 -0
  278. data/test/workos/test_audit_logs.rb +11 -2
  279. data/test/workos/test_authorization.rb +6 -6
  280. data/test/workos/test_organizations.rb +41 -1
  281. data/test/workos/test_organizations_model_round_trip.rb +40 -1
  282. data/test/workos/test_pipes.rb +64 -0
  283. data/test/workos/test_pipes_model_round_trip.rb +35 -5
  284. data/test/workos/test_platform_teams.rb +41 -0
  285. data/test/workos/test_platform_teams_model_round_trip.rb +41 -0
  286. data/test/workos/test_session.rb +63 -0
  287. data/test/workos/test_shared_model_round_trip.rb +610 -2
  288. data/test/workos/test_sso.rb +108 -2
  289. data/test/workos/test_sso_model_round_trip.rb +262 -2
  290. data/test/workos/test_user_management.rb +80 -0
  291. data/test/workos/test_user_management_model_round_trip.rb +110 -2
  292. metadata +194 -1
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module WorkOS
6
+ class AgentBlueprintsTokenValidateTokenRequest < WorkOS::Types::BaseModel
7
+ HASH_ATTRS = {
8
+ agent_access_token: :agent_access_token
9
+ }.freeze
10
+
11
+ attr_accessor :agent_access_token
12
+
13
+ def initialize(json)
14
+ hash = self.class.normalize(json)
15
+ @agent_access_token = hash[:agent_access_token]
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module WorkOS
6
+ class AgentBlueprintsUpdateRequest < WorkOS::Types::BaseModel
7
+ HASH_ATTRS = {
8
+ name: :name,
9
+ description: :description,
10
+ permissions: :permissions,
11
+ invocable_by: :invocable_by,
12
+ session_settings: :session_settings
13
+ }.freeze
14
+
15
+ attr_accessor \
16
+ :name,
17
+ :description,
18
+ :permissions,
19
+ :invocable_by,
20
+ :session_settings
21
+
22
+ def initialize(json)
23
+ hash = self.class.normalize(json)
24
+ @name = hash[:name]
25
+ @description = hash[:description]
26
+ @permissions = hash[:permissions] || []
27
+ @invocable_by = hash[:invocable_by] ? WorkOS::AgentBlueprintsUpdateRequestInvocableBy.new(hash[:invocable_by]) : nil
28
+ @session_settings = hash[:session_settings] ? WorkOS::AgentBlueprintsUpdateRequestSessionSetting.new(hash[:session_settings]) : nil
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module WorkOS
6
+ AgentBlueprintsUpdateRequestInvocableBy = AgentBlueprintsCreateRequestInvocableBy
7
+ end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated by oagen. Do not edit.
4
+
5
+ module WorkOS
6
+ class AgentBlueprintsUpdateRequestSessionSetting < WorkOS::Types::BaseModel
7
+ HASH_ATTRS = {
8
+ max_age_seconds: :max_age_seconds,
9
+ access_token_ttl_seconds: :access_token_ttl_seconds,
10
+ refresh_token_ttl_seconds: :refresh_token_ttl_seconds
11
+ }.freeze
12
+
13
+ attr_accessor \
14
+ :max_age_seconds,
15
+ :access_token_ttl_seconds,
16
+ :refresh_token_ttl_seconds
17
+
18
+ def initialize(json)
19
+ hash = self.class.normalize(json)
20
+ @max_age_seconds = hash[:max_age_seconds]
21
+ @access_token_ttl_seconds = hash[:access_token_ttl_seconds]
22
+ @refresh_token_ttl_seconds = hash[:refresh_token_ttl_seconds]
23
+ end
24
+ end
25
+ 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 AgentInstance < WorkOS::Types::BaseModel
7
+ HASH_ATTRS = {
8
+ object: :object,
9
+ id: :id,
10
+ agent_blueprint_id: :agent_blueprint_id,
11
+ organization_id: :organization_id,
12
+ organization_membership_id: :organization_membership_id,
13
+ type: :type,
14
+ created_at: :created_at,
15
+ updated_at: :updated_at
16
+ }.freeze
17
+
18
+ attr_accessor \
19
+ :object,
20
+ :id,
21
+ :agent_blueprint_id,
22
+ :organization_id,
23
+ :organization_membership_id,
24
+ :type,
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_blueprint_id = hash[:agent_blueprint_id]
33
+ @organization_id = hash[:organization_id]
34
+ @organization_membership_id = hash[:organization_membership_id]
35
+ @type = hash[:type]
36
+ @created_at = hash[:created_at]
37
+ @updated_at = hash[:updated_at]
38
+ end
39
+ end
40
+ 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 AgentInstanceSession < WorkOS::Types::BaseModel
7
+ HASH_ATTRS = {
8
+ object: :object,
9
+ id: :id,
10
+ agent_instance_id: :agent_instance_id,
11
+ status: :status,
12
+ expires_at: :expires_at,
13
+ revoked_at: :revoked_at,
14
+ created_at: :created_at,
15
+ updated_at: :updated_at
16
+ }.freeze
17
+
18
+ attr_accessor \
19
+ :object,
20
+ :id,
21
+ :agent_instance_id,
22
+ :status,
23
+ :expires_at,
24
+ :revoked_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_instance_id = hash[:agent_instance_id]
33
+ @status = hash[:status]
34
+ @expires_at = hash[:expires_at]
35
+ @revoked_at = hash[:revoked_at]
36
+ @created_at = hash[:created_at]
37
+ @updated_at = hash[:updated_at]
38
+ end
39
+ end
40
+ 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 AgentToken < WorkOS::Types::BaseModel
7
+ HASH_ATTRS = {
8
+ access_token: :access_token,
9
+ token_type: :token_type,
10
+ expires_in: :expires_in,
11
+ refresh_token: :refresh_token,
12
+ agent_instance_id: :agent_instance_id,
13
+ new_instance: :new_instance,
14
+ agent_instance_session_id: :agent_instance_session_id,
15
+ permissions: :permissions
16
+ }.freeze
17
+
18
+ attr_accessor \
19
+ :access_token,
20
+ :token_type,
21
+ :expires_in,
22
+ :refresh_token,
23
+ :agent_instance_id,
24
+ :new_instance,
25
+ :agent_instance_session_id,
26
+ :permissions
27
+
28
+ def initialize(json)
29
+ hash = self.class.normalize(json)
30
+ @access_token = hash[:access_token]
31
+ @token_type = hash[:token_type]
32
+ @expires_in = hash[:expires_in]
33
+ @refresh_token = hash[:refresh_token]
34
+ @agent_instance_id = hash[:agent_instance_id]
35
+ @new_instance = hash[:new_instance]
36
+ @agent_instance_session_id = hash[:agent_instance_session_id]
37
+ @permissions = hash[:permissions] || []
38
+ end
39
+ end
40
+ 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 AgentTokenValidation < WorkOS::Types::BaseModel
7
+ HASH_ATTRS = {
8
+ valid: :valid,
9
+ agent_instance_id: :agent_instance_id,
10
+ agent_instance_session_id: :agent_instance_session_id,
11
+ organization_id: :organization_id,
12
+ permissions: :permissions,
13
+ intent: :intent,
14
+ acting_user_id: :acting_user_id,
15
+ session_expires_at: :session_expires_at
16
+ }.freeze
17
+
18
+ attr_accessor \
19
+ :valid,
20
+ :agent_instance_id,
21
+ :agent_instance_session_id,
22
+ :organization_id,
23
+ :permissions,
24
+ :intent,
25
+ :acting_user_id,
26
+ :session_expires_at
27
+
28
+ def initialize(json)
29
+ hash = self.class.normalize(json)
30
+ @valid = hash[:valid]
31
+ @agent_instance_id = hash[:agent_instance_id]
32
+ @agent_instance_session_id = hash[:agent_instance_session_id]
33
+ @organization_id = hash[:organization_id]
34
+ @permissions = hash[:permissions] || []
35
+ @intent = hash[:intent]
36
+ @acting_user_id = hash[:acting_user_id]
37
+ @session_expires_at = hash[:session_expires_at]
38
+ end
39
+ end
40
+ end
data/lib/workos/agents.rb CHANGED
@@ -10,6 +10,223 @@ module WorkOS
10
10
  @client = client
11
11
  end
12
12
 
13
+ # List agent blueprints
14
+ # @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `before="obj_123"` to fetch a new batch of objects before `"obj_123"`.
15
+ # @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `after="obj_123"` to fetch a new batch of objects after `"obj_123"`.
16
+ # @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
17
+ # @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records).
18
+ # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
19
+ # @return [WorkOS::Types::ListStruct<WorkOS::AgentBlueprint>]
20
+ def list_blueprints(
21
+ before: nil,
22
+ after: nil,
23
+ limit: 10,
24
+ order: "desc",
25
+ request_options: {}
26
+ )
27
+ params = {
28
+ "before" => before,
29
+ "after" => after,
30
+ "limit" => limit,
31
+ "order" => order
32
+ }.compact
33
+ response = @client.request(
34
+ method: :get,
35
+ path: "/agents/blueprints",
36
+ auth: true,
37
+ params: params,
38
+ request_options: request_options
39
+ )
40
+ fetch_next = ->(cursor) {
41
+ list_blueprints(
42
+ before: before,
43
+ after: cursor,
44
+ limit: limit,
45
+ order: order,
46
+ request_options: request_options
47
+ )
48
+ }
49
+ WorkOS::Types::ListStruct.from_response(
50
+ response,
51
+ model: WorkOS::AgentBlueprint,
52
+ filters: {before: before, limit: limit, order: order},
53
+ fetch_next: fetch_next
54
+ )
55
+ end
56
+
57
+ # Create an agent blueprint
58
+ # @param name [String] Human-readable name of the agent blueprint.
59
+ # @param description [String, nil] Human-readable description of the agent blueprint.
60
+ # @param permissions [Array<String>, nil] Permission slugs forming the ceiling on what sessions minted from this blueprint may do. Each slug must exist in the environment.
61
+ # @param invocable_by [WorkOS::AgentBlueprintsCreateRequestInvocableBy, nil] Who may mint sessions from this blueprint.
62
+ # @param session_settings [WorkOS::AgentBlueprintsCreateRequestSessionSetting, nil] Token and session lifetimes for sessions minted from this blueprint.
63
+ # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
64
+ # @return [WorkOS::AgentBlueprint]
65
+ def create_blueprint(
66
+ name:,
67
+ description: nil,
68
+ permissions: nil,
69
+ invocable_by: nil,
70
+ session_settings: nil,
71
+ request_options: {}
72
+ )
73
+ body = {
74
+ "name" => name,
75
+ "description" => description,
76
+ "permissions" => permissions,
77
+ "invocable_by" => invocable_by,
78
+ "session_settings" => session_settings
79
+ }.compact
80
+ response = @client.request(
81
+ method: :post,
82
+ path: "/agents/blueprints",
83
+ auth: true,
84
+ body: body,
85
+ request_options: request_options
86
+ )
87
+ result = WorkOS::AgentBlueprint.new(response.body)
88
+ result.last_response = WorkOS::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"])
89
+ result
90
+ end
91
+
92
+ # Get an agent blueprint
93
+ # @param agent_blueprint_id [String] The unique ID of the agent blueprint.
94
+ # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
95
+ # @return [WorkOS::AgentBlueprint]
96
+ def get_blueprint(
97
+ agent_blueprint_id:,
98
+ request_options: {}
99
+ )
100
+ response = @client.request(
101
+ method: :get,
102
+ path: "/agents/blueprints/#{WorkOS::Util.encode_path(agent_blueprint_id)}",
103
+ auth: true,
104
+ request_options: request_options
105
+ )
106
+ result = WorkOS::AgentBlueprint.new(response.body)
107
+ result.last_response = WorkOS::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"])
108
+ result
109
+ end
110
+
111
+ # Update an agent blueprint
112
+ # @param agent_blueprint_id [String] The unique ID of the agent blueprint.
113
+ # @param name [String, nil] Human-readable name of the agent blueprint.
114
+ # @param description [String, nil] Human-readable description of the agent blueprint. Pass `null` to clear it.
115
+ # @param permissions [Array<String>, nil] Permission slugs forming the ceiling on what sessions minted from this blueprint may do. Each slug must exist in the environment.
116
+ # @param invocable_by [WorkOS::AgentBlueprintsUpdateRequestInvocableBy, nil] Who may mint sessions from this blueprint. Omitted lists are left unchanged.
117
+ # @param session_settings [WorkOS::AgentBlueprintsUpdateRequestSessionSetting, nil] Token and session lifetimes for sessions minted from this blueprint. Omitted fields are left unchanged.
118
+ # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
119
+ # @return [WorkOS::AgentBlueprint]
120
+ def update_blueprint(
121
+ agent_blueprint_id:,
122
+ name: nil,
123
+ description: WorkOS::OMIT,
124
+ permissions: nil,
125
+ invocable_by: nil,
126
+ session_settings: nil,
127
+ request_options: {}
128
+ )
129
+ body = {
130
+ "name" => name,
131
+ "permissions" => permissions,
132
+ "invocable_by" => invocable_by,
133
+ "session_settings" => session_settings
134
+ }.compact
135
+ body["description"] = description unless description.equal?(WorkOS::OMIT)
136
+ response = @client.request(
137
+ method: :patch,
138
+ path: "/agents/blueprints/#{WorkOS::Util.encode_path(agent_blueprint_id)}",
139
+ auth: true,
140
+ body: body,
141
+ request_options: request_options
142
+ )
143
+ result = WorkOS::AgentBlueprint.new(response.body)
144
+ result.last_response = WorkOS::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"])
145
+ result
146
+ end
147
+
148
+ # Delete an agent blueprint
149
+ # @param agent_blueprint_id [String] The unique ID of the agent blueprint.
150
+ # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
151
+ # @return [void]
152
+ def delete_blueprint(
153
+ agent_blueprint_id:,
154
+ request_options: {}
155
+ )
156
+ @client.request(
157
+ method: :delete,
158
+ path: "/agents/blueprints/#{WorkOS::Util.encode_path(agent_blueprint_id)}",
159
+ auth: true,
160
+ request_options: request_options
161
+ )
162
+ nil
163
+ end
164
+
165
+ # Mint an agent token
166
+ # @param agent_blueprint_id [String] The unique ID of the agent blueprint.
167
+ # @param type [WorkOS::Types::AgentBlueprintsTokenMintTokenRequestType] How the session is minted: `user_delegated`, `autonomous`, `agent_delegated`, or `refresh`.
168
+ # @param user_access_token [String, nil] The access token of the user delegating to the agent. The token identifies the user and organization; effective permissions are resolved server-side.
169
+ # @param intent [String, nil] Optional caller-supplied context, echoed as an object with a `text` field in the `intent` claim of the minted access token.
170
+ # @param organization_id [String, nil] The organization the agent acts within when operating as itself.
171
+ # @param agent_access_token [String, nil] The agent's own access token to exchange for a new session on the same instance. The token must have been minted from this blueprint; permissions are re-derived from current authority.
172
+ # @param refresh_token [String, nil] The refresh token issued with a previous agent access token. Refresh tokens are single-use: each refresh rotates it.
173
+ # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
174
+ # @return [WorkOS::AgentToken]
175
+ def create_blueprint_token(
176
+ agent_blueprint_id:,
177
+ type:,
178
+ user_access_token: nil,
179
+ intent: nil,
180
+ organization_id: nil,
181
+ agent_access_token: nil,
182
+ refresh_token: nil,
183
+ request_options: {}
184
+ )
185
+ body = {
186
+ "type" => type,
187
+ "user_access_token" => user_access_token,
188
+ "intent" => intent,
189
+ "organization_id" => organization_id,
190
+ "agent_access_token" => agent_access_token,
191
+ "refresh_token" => refresh_token
192
+ }.compact
193
+ response = @client.request(
194
+ method: :post,
195
+ path: "/agents/blueprints/#{WorkOS::Util.encode_path(agent_blueprint_id)}/tokens",
196
+ auth: true,
197
+ body: body,
198
+ request_options: request_options
199
+ )
200
+ result = WorkOS::AgentToken.new(response.body)
201
+ result.last_response = WorkOS::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"])
202
+ result
203
+ end
204
+
205
+ # Validate an agent token
206
+ # @param agent_blueprint_id [String] The unique ID of the agent blueprint.
207
+ # @param agent_access_token [String] The agent access token (a JWT) to validate.
208
+ # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
209
+ # @return [WorkOS::AgentTokenValidation]
210
+ def validate_blueprint_token(
211
+ agent_blueprint_id:,
212
+ agent_access_token:,
213
+ request_options: {}
214
+ )
215
+ body = {
216
+ "agent_access_token" => agent_access_token
217
+ }
218
+ response = @client.request(
219
+ method: :post,
220
+ path: "/agents/blueprints/#{WorkOS::Util.encode_path(agent_blueprint_id)}/tokens/validate",
221
+ auth: true,
222
+ body: body,
223
+ request_options: request_options
224
+ )
225
+ result = WorkOS::AgentTokenValidation.new(response.body)
226
+ result.last_response = WorkOS::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"])
227
+ result
228
+ end
229
+
13
230
  # Link a claim attempt to an external user
14
231
  # @param type [String] The operation to perform on the claim attempt. Currently only `link_external_user` is supported.
15
232
  # @param claim_attempt_token [String] The token identifying the claim attempt.
@@ -89,5 +306,187 @@ module WorkOS
89
306
  result.last_response = WorkOS::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"])
90
307
  result
91
308
  end
309
+
310
+ # List agent instances
311
+ # @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `before="obj_123"` to fetch a new batch of objects before `"obj_123"`.
312
+ # @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `after="obj_123"` to fetch a new batch of objects after `"obj_123"`.
313
+ # @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
314
+ # @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records).
315
+ # @param organization_id [String, nil] Only return instances acting within this organization.
316
+ # @param agent_blueprint_id [String, nil] Only return instances minted from this blueprint.
317
+ # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
318
+ # @return [WorkOS::Types::ListStruct<WorkOS::AgentInstance>]
319
+ def list_instances(
320
+ before: nil,
321
+ after: nil,
322
+ limit: 10,
323
+ order: "desc",
324
+ organization_id: nil,
325
+ agent_blueprint_id: nil,
326
+ request_options: {}
327
+ )
328
+ params = {
329
+ "before" => before,
330
+ "after" => after,
331
+ "limit" => limit,
332
+ "order" => order,
333
+ "organization_id" => organization_id,
334
+ "agent_blueprint_id" => agent_blueprint_id
335
+ }.compact
336
+ response = @client.request(
337
+ method: :get,
338
+ path: "/agents/instances",
339
+ auth: true,
340
+ params: params,
341
+ request_options: request_options
342
+ )
343
+ fetch_next = ->(cursor) {
344
+ list_instances(
345
+ before: before,
346
+ after: cursor,
347
+ limit: limit,
348
+ order: order,
349
+ organization_id: organization_id,
350
+ agent_blueprint_id: agent_blueprint_id,
351
+ request_options: request_options
352
+ )
353
+ }
354
+ WorkOS::Types::ListStruct.from_response(
355
+ response,
356
+ model: WorkOS::AgentInstance,
357
+ filters: {before: before, limit: limit, order: order, organization_id: organization_id, agent_blueprint_id: agent_blueprint_id},
358
+ fetch_next: fetch_next
359
+ )
360
+ end
361
+
362
+ # Get an agent instance
363
+ # @param agent_instance_id [String] The unique ID of the agent instance.
364
+ # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
365
+ # @return [WorkOS::AgentInstance]
366
+ def get_instance(
367
+ agent_instance_id:,
368
+ request_options: {}
369
+ )
370
+ response = @client.request(
371
+ method: :get,
372
+ path: "/agents/instances/#{WorkOS::Util.encode_path(agent_instance_id)}",
373
+ auth: true,
374
+ request_options: request_options
375
+ )
376
+ result = WorkOS::AgentInstance.new(response.body)
377
+ result.last_response = WorkOS::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"])
378
+ result
379
+ end
380
+
381
+ # Delete an agent instance
382
+ # @param agent_instance_id [String] The unique ID of the agent instance.
383
+ # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
384
+ # @return [void]
385
+ def delete_instance(
386
+ agent_instance_id:,
387
+ request_options: {}
388
+ )
389
+ @client.request(
390
+ method: :delete,
391
+ path: "/agents/instances/#{WorkOS::Util.encode_path(agent_instance_id)}",
392
+ auth: true,
393
+ request_options: request_options
394
+ )
395
+ nil
396
+ end
397
+
398
+ # List agent instance sessions
399
+ # @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `before="obj_123"` to fetch a new batch of objects before `"obj_123"`.
400
+ # @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `after="obj_123"` to fetch a new batch of objects after `"obj_123"`.
401
+ # @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`.
402
+ # @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records).
403
+ # @param organization_id [String, nil] Only return sessions of instances acting within this organization.
404
+ # @param agent_blueprint_id [String, nil] Only return sessions of instances minted from this blueprint.
405
+ # @param agent_instance_id [String, nil] Only return sessions belonging to this agent instance.
406
+ # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
407
+ # @return [WorkOS::Types::ListStruct<WorkOS::AgentInstanceSession>]
408
+ def list_sessions(
409
+ before: nil,
410
+ after: nil,
411
+ limit: 10,
412
+ order: "desc",
413
+ organization_id: nil,
414
+ agent_blueprint_id: nil,
415
+ agent_instance_id: nil,
416
+ request_options: {}
417
+ )
418
+ params = {
419
+ "before" => before,
420
+ "after" => after,
421
+ "limit" => limit,
422
+ "order" => order,
423
+ "organization_id" => organization_id,
424
+ "agent_blueprint_id" => agent_blueprint_id,
425
+ "agent_instance_id" => agent_instance_id
426
+ }.compact
427
+ response = @client.request(
428
+ method: :get,
429
+ path: "/agents/sessions",
430
+ auth: true,
431
+ params: params,
432
+ request_options: request_options
433
+ )
434
+ fetch_next = ->(cursor) {
435
+ list_sessions(
436
+ before: before,
437
+ after: cursor,
438
+ limit: limit,
439
+ order: order,
440
+ organization_id: organization_id,
441
+ agent_blueprint_id: agent_blueprint_id,
442
+ agent_instance_id: agent_instance_id,
443
+ request_options: request_options
444
+ )
445
+ }
446
+ WorkOS::Types::ListStruct.from_response(
447
+ response,
448
+ model: WorkOS::AgentInstanceSession,
449
+ filters: {before: before, limit: limit, order: order, organization_id: organization_id, agent_blueprint_id: agent_blueprint_id, agent_instance_id: agent_instance_id},
450
+ fetch_next: fetch_next
451
+ )
452
+ end
453
+
454
+ # Get an agent instance session
455
+ # @param agent_instance_session_id [String] The unique ID of the agent instance session.
456
+ # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
457
+ # @return [WorkOS::AgentInstanceSession]
458
+ def get_session(
459
+ agent_instance_session_id:,
460
+ request_options: {}
461
+ )
462
+ response = @client.request(
463
+ method: :get,
464
+ path: "/agents/sessions/#{WorkOS::Util.encode_path(agent_instance_session_id)}",
465
+ auth: true,
466
+ request_options: request_options
467
+ )
468
+ result = WorkOS::AgentInstanceSession.new(response.body)
469
+ result.last_response = WorkOS::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"])
470
+ result
471
+ end
472
+
473
+ # Revoke an agent instance session
474
+ # @param agent_instance_session_id [String] The unique ID of the agent instance session.
475
+ # @param request_options [Hash] (see WorkOS::Types::RequestOptions)
476
+ # @return [WorkOS::AgentInstanceSession]
477
+ def revoke_session(
478
+ agent_instance_session_id:,
479
+ request_options: {}
480
+ )
481
+ response = @client.request(
482
+ method: :post,
483
+ path: "/agents/sessions/#{WorkOS::Util.encode_path(agent_instance_session_id)}/revoke",
484
+ auth: true,
485
+ request_options: request_options
486
+ )
487
+ result = WorkOS::AgentInstanceSession.new(response.body)
488
+ result.last_response = WorkOS::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"])
489
+ result
490
+ end
92
491
  end
93
492
  end