workos 10.2.1 → 10.3.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.
- checksums.yaml +4 -4
- data/.last-synced-sha +1 -1
- data/.oagen-manifest.json +311 -0
- data/.release-please-manifest.json +1 -1
- data/CHANGELOG.md +154 -0
- data/Gemfile.lock +2 -2
- data/lib/workos/agents/agent_blueprint.rb +43 -0
- data/lib/workos/agents/agent_blueprint_invocable_by.rb +7 -0
- data/lib/workos/agents/agent_blueprint_session_setting.rb +25 -0
- data/lib/workos/agents/agent_blueprints_create_request.rb +31 -0
- data/lib/workos/agents/agent_blueprints_create_request_invocable_by.rb +22 -0
- data/lib/workos/agents/agent_blueprints_create_request_session_setting.rb +7 -0
- data/lib/workos/agents/agent_blueprints_token_mint_token_request.rb +34 -0
- data/lib/workos/agents/agent_blueprints_token_validate_token_request.rb +18 -0
- data/lib/workos/agents/agent_blueprints_update_request.rb +31 -0
- data/lib/workos/agents/agent_blueprints_update_request_invocable_by.rb +7 -0
- data/lib/workos/agents/agent_blueprints_update_request_session_setting.rb +25 -0
- data/lib/workos/agents/agent_instance.rb +40 -0
- data/lib/workos/agents/agent_instance_session.rb +40 -0
- data/lib/workos/agents/agent_token.rb +40 -0
- data/lib/workos/agents/agent_token_validation.rb +40 -0
- data/lib/workos/agents.rb +395 -0
- data/lib/workos/api_keys/validate_api_key.rb +1 -12
- data/lib/workos/audit_logs.rb +23 -5
- data/lib/workos/authorization.rb +3 -3
- data/lib/workos/client.rb +4 -0
- data/lib/workos/inflections.rb +15 -0
- data/lib/workos/organizations/create_it_contact.rb +18 -0
- data/lib/workos/organizations/invite_it_contact.rb +18 -0
- data/lib/workos/organizations/it_contact.rb +31 -0
- data/lib/workos/organizations/it_contact_list.rb +25 -0
- data/lib/workos/organizations/organization_input.rb +10 -1
- data/lib/workos/organizations/update_audit_logs_retention.rb +13 -1
- data/lib/workos/organizations.rb +110 -1
- data/lib/workos/platform_teams/create_team.rb +22 -0
- data/lib/workos/platform_teams/team.rb +37 -0
- data/lib/workos/platform_teams.rb +58 -0
- data/lib/workos/shared/agent_blueprint_created.rb +34 -0
- data/lib/workos/shared/agent_blueprint_created_data.rb +43 -0
- data/lib/workos/shared/agent_blueprint_created_data_invocable_by.rb +22 -0
- data/lib/workos/shared/agent_blueprint_created_data_session_setting.rb +25 -0
- data/lib/workos/shared/agent_blueprint_deleted.rb +34 -0
- data/lib/workos/shared/agent_blueprint_deleted_data.rb +31 -0
- data/lib/workos/shared/agent_blueprint_updated.rb +34 -0
- data/lib/workos/shared/agent_blueprint_updated_data.rb +7 -0
- data/lib/workos/shared/agent_blueprint_updated_data_invocable_by.rb +7 -0
- data/lib/workos/shared/agent_blueprint_updated_data_session_setting.rb +7 -0
- data/lib/workos/shared/agent_instance_created.rb +34 -0
- data/lib/workos/shared/agent_instance_created_data.rb +40 -0
- data/lib/workos/shared/agent_instance_deleted.rb +34 -0
- data/lib/workos/shared/agent_instance_deleted_data.rb +40 -0
- data/lib/workos/shared/agent_instance_session_created.rb +34 -0
- data/lib/workos/shared/agent_instance_session_created_data.rb +43 -0
- data/lib/workos/shared/agent_instance_session_revoked.rb +34 -0
- data/lib/workos/shared/agent_instance_session_revoked_data.rb +40 -0
- data/lib/workos/shared/resource_export_completed.rb +34 -0
- data/lib/workos/shared/resource_export_completed_data.rb +22 -0
- data/lib/workos/shared/resource_export_created.rb +34 -0
- data/lib/workos/shared/resource_export_created_data.rb +22 -0
- data/lib/workos/shared/resource_export_downloaded.rb +34 -0
- data/lib/workos/shared/resource_export_downloaded_data.rb +22 -0
- data/lib/workos/shared/resource_export_failed.rb +34 -0
- data/lib/workos/shared/resource_export_failed_data.rb +22 -0
- data/lib/workos/shared/waitlist_user.rb +8 -5
- data/lib/workos/sso/create_connection.rb +37 -0
- data/lib/workos/sso/create_connection_attribute_maps.rb +22 -0
- data/lib/workos/sso/create_connection_key_pair.rb +22 -0
- data/lib/workos/sso/create_connection_oidc_options.rb +43 -0
- data/lib/workos/sso/create_connection_saml_options.rb +40 -0
- data/lib/workos/sso/create_connection_standard_attributes.rb +34 -0
- data/lib/workos/sso/create_saml_idp_signing_certificate.rb +18 -0
- data/lib/workos/sso/patch_connection.rb +34 -0
- data/lib/workos/sso/patch_connection_attribute_maps.rb +22 -0
- data/lib/workos/sso/patch_connection_oidc_options.rb +40 -0
- data/lib/workos/sso/patch_connection_saml_options.rb +31 -0
- data/lib/workos/sso/patch_connection_standard_attributes.rb +7 -0
- data/lib/workos/sso/saml_idp_signing_certificate.rb +34 -0
- data/lib/workos/sso/saml_idp_signing_certificate_list.rb +22 -0
- data/lib/workos/sso/saml_sp_encryption_certificate.rb +34 -0
- data/lib/workos/sso/saml_sp_encryption_certificate_list.rb +22 -0
- data/lib/workos/sso/saml_sp_signing_certificate.rb +34 -0
- data/lib/workos/sso/token_query.rb +11 -2
- data/lib/workos/sso.rb +305 -4
- data/lib/workos/types/agent_blueprints_token_mint_token_request_type.rb +15 -0
- data/lib/workos/types/agent_instance_created_data_type.rb +13 -0
- data/lib/workos/types/agent_instance_deleted_data_type.rb +9 -0
- data/lib/workos/types/agent_instance_session_status.rb +14 -0
- data/lib/workos/types/agent_instance_type.rb +9 -0
- data/lib/workos/types/authenticate_response_authentication_method.rb +1 -4
- data/lib/workos/types/connection_activated_data_connection_type.rb +1 -4
- data/lib/workos/types/connection_type.rb +1 -4
- data/lib/workos/types/connections_connection_type.rb +1 -4
- data/lib/workos/types/create_connection_oidc_options_id_token_signature_algorithm.rb +24 -0
- data/lib/workos/types/create_connection_oidc_options_token_authentication_method.rb +14 -0
- data/lib/workos/types/create_webhook_endpoint_events.rb +8 -1
- data/lib/workos/types/invite_it_contact_intents.rb +16 -0
- data/lib/workos/types/patch_connection_oidc_options_id_token_signature_algorithm.rb +9 -0
- data/lib/workos/types/patch_connection_oidc_options_token_authentication_method.rb +9 -0
- data/lib/workos/types/resource_export_completed_data_resource_type.rb +16 -0
- data/lib/workos/types/resource_export_created_data_resource_type.rb +9 -0
- data/lib/workos/types/resource_export_downloaded_data_resource_type.rb +9 -0
- data/lib/workos/types/resource_export_failed_data_resource_type.rb +9 -0
- data/lib/workos/types/session_created_data_status.rb +1 -6
- data/lib/workos/types/session_revoked_data_status.rb +1 -1
- data/lib/workos/types/sso_grant_type.rb +13 -0
- data/lib/workos/types/team_production_state.rb +15 -0
- data/lib/workos/types/token_query_grant_type.rb +9 -0
- data/lib/workos/types/update_audit_logs_retention_retention_period.rb +32 -0
- data/lib/workos/types/user_identities_get_item_provider.rb +1 -4
- data/lib/workos/types/user_management_waitlists_state.rb +14 -0
- data/lib/workos/types/user_sessions_status.rb +1 -1
- data/lib/workos/types/waitlist_entry_state.rb +9 -0
- data/lib/workos/types/waitlist_user_state.rb +1 -6
- data/lib/workos/user_management/authentication_oauth_failed_data.rb +5 -2
- data/lib/workos/user_management/authentication_oauth_succeeded_data.rb +5 -2
- data/lib/workos/user_management/create_password_reset_token.rb +1 -12
- data/lib/workos/user_management/create_waitlist_entry.rb +25 -0
- data/lib/workos/user_management/email_completion_session_authenticate_request.rb +43 -0
- data/lib/workos/user_management/waitlist.rb +28 -0
- data/lib/workos/user_management/waitlist_entry.rb +43 -0
- data/lib/workos/user_management.rb +176 -0
- data/lib/workos/version.rb +1 -1
- data/lib/workos.rb +1 -0
- data/rbi/workos/agent_blueprint.rbi +72 -0
- data/rbi/workos/agent_blueprint_created.rbi +54 -0
- data/rbi/workos/agent_blueprint_created_data.rbi +72 -0
- data/rbi/workos/agent_blueprint_created_data_invocable_by.rbi +30 -0
- data/rbi/workos/agent_blueprint_created_data_session_setting.rbi +36 -0
- data/rbi/workos/agent_blueprint_deleted.rbi +54 -0
- data/rbi/workos/agent_blueprint_deleted_data.rbi +48 -0
- data/rbi/workos/agent_blueprint_invocable_by.rbi +30 -0
- data/rbi/workos/agent_blueprint_session_setting.rbi +36 -0
- data/rbi/workos/agent_blueprint_updated.rbi +54 -0
- data/rbi/workos/agent_blueprint_updated_data.rbi +72 -0
- data/rbi/workos/agent_blueprint_updated_data_invocable_by.rbi +30 -0
- data/rbi/workos/agent_blueprint_updated_data_session_setting.rbi +36 -0
- data/rbi/workos/agent_blueprints_create_request.rbi +48 -0
- data/rbi/workos/agent_blueprints_create_request_invocable_by.rbi +30 -0
- data/rbi/workos/agent_blueprints_create_request_session_setting.rbi +36 -0
- data/rbi/workos/agent_blueprints_token_mint_token_request.rbi +54 -0
- data/rbi/workos/agent_blueprints_token_validate_token_request.rbi +24 -0
- data/rbi/workos/agent_blueprints_update_request.rbi +48 -0
- data/rbi/workos/agent_blueprints_update_request_invocable_by.rbi +30 -0
- data/rbi/workos/agent_blueprints_update_request_session_setting.rbi +36 -0
- data/rbi/workos/agent_instance.rbi +66 -0
- data/rbi/workos/agent_instance_created.rbi +54 -0
- data/rbi/workos/agent_instance_created_data.rbi +66 -0
- data/rbi/workos/agent_instance_deleted.rbi +54 -0
- data/rbi/workos/agent_instance_deleted_data.rbi +66 -0
- data/rbi/workos/agent_instance_session.rbi +66 -0
- data/rbi/workos/agent_instance_session_created.rbi +54 -0
- data/rbi/workos/agent_instance_session_created_data.rbi +72 -0
- data/rbi/workos/agent_instance_session_revoked.rbi +54 -0
- data/rbi/workos/agent_instance_session_revoked_data.rbi +66 -0
- data/rbi/workos/agent_token.rbi +66 -0
- data/rbi/workos/agent_token_validation.rbi +66 -0
- data/rbi/workos/agents.rbi +133 -0
- data/rbi/workos/audit_logs.rbi +26 -2
- data/rbi/workos/authentication_oauth_failed_data.rbi +6 -0
- data/rbi/workos/authentication_oauth_succeeded_data.rbi +6 -0
- data/rbi/workos/client.rbi +3 -0
- data/rbi/workos/create_connection.rbi +60 -0
- data/rbi/workos/create_connection_attribute_maps.rbi +30 -0
- data/rbi/workos/create_connection_key_pair.rbi +30 -0
- data/rbi/workos/create_connection_oidc_options.rbi +72 -0
- data/rbi/workos/create_connection_saml_options.rbi +66 -0
- data/rbi/workos/create_connection_standard_attributes.rbi +54 -0
- data/rbi/workos/create_it_contact.rbi +24 -0
- data/rbi/workos/create_saml_idp_signing_certificate.rbi +24 -0
- data/rbi/workos/create_team.rbi +30 -0
- data/rbi/workos/create_waitlist_entry.rbi +36 -0
- data/rbi/workos/email_completion_session_authenticate_request.rbi +72 -0
- data/rbi/workos/invite_it_contact.rbi +24 -0
- data/rbi/workos/it_contact.rbi +48 -0
- data/rbi/workos/organizations.rbi +45 -0
- data/rbi/workos/patch_connection.rbi +54 -0
- data/rbi/workos/patch_connection_attribute_maps.rbi +30 -0
- data/rbi/workos/patch_connection_oidc_options.rbi +66 -0
- data/rbi/workos/patch_connection_saml_options.rbi +48 -0
- data/rbi/workos/patch_connection_standard_attributes.rbi +54 -0
- data/rbi/workos/platform_teams.rbi +30 -0
- data/rbi/workos/resource_export_completed.rbi +54 -0
- data/rbi/workos/resource_export_completed_data.rbi +30 -0
- data/rbi/workos/resource_export_created.rbi +54 -0
- data/rbi/workos/resource_export_created_data.rbi +30 -0
- data/rbi/workos/resource_export_downloaded.rbi +54 -0
- data/rbi/workos/resource_export_downloaded_data.rbi +30 -0
- data/rbi/workos/resource_export_failed.rbi +54 -0
- data/rbi/workos/resource_export_failed_data.rbi +30 -0
- data/rbi/workos/saml_idp_signing_certificate.rbi +54 -0
- data/rbi/workos/saml_idp_signing_certificate_list.rbi +30 -0
- data/rbi/workos/saml_sp_encryption_certificate.rbi +54 -0
- data/rbi/workos/saml_sp_encryption_certificate_list.rbi +30 -0
- data/rbi/workos/saml_sp_signing_certificate.rbi +54 -0
- data/rbi/workos/sso.rbi +155 -2
- data/rbi/workos/team.rbi +60 -0
- data/rbi/workos/token_query.rbi +20 -2
- data/rbi/workos/update_audit_logs_retention.rbi +8 -2
- data/rbi/workos/user_management.rbi +64 -0
- data/rbi/workos/waitlist.rbi +42 -0
- data/rbi/workos/waitlist_entry.rbi +72 -0
- data/rbi/workos/waitlist_user.rbi +12 -6
- data/test/workos/test_agents.rb +105 -1
- data/test/workos/test_agents_model_round_trip.rb +245 -0
- data/test/workos/test_audit_logs.rb +11 -2
- data/test/workos/test_authorization.rb +6 -6
- data/test/workos/test_organizations.rb +41 -1
- data/test/workos/test_organizations_model_round_trip.rb +40 -1
- data/test/workos/test_platform_teams.rb +41 -0
- data/test/workos/test_platform_teams_model_round_trip.rb +41 -0
- data/test/workos/test_shared_model_round_trip.rb +449 -2
- data/test/workos/test_sso.rb +108 -2
- data/test/workos/test_sso_model_round_trip.rb +262 -2
- data/test/workos/test_user_management.rb +56 -0
- data/test/workos/test_user_management_model_round_trip.rb +78 -2
- metadata +160 -1
|
@@ -463,6 +463,70 @@ module WorkOS
|
|
|
463
463
|
end
|
|
464
464
|
def delete_user_authorized_application(application_id:, user_id:, request_options:); end
|
|
465
465
|
|
|
466
|
+
sig do
|
|
467
|
+
params(
|
|
468
|
+
id: String,
|
|
469
|
+
request_options: T::Hash[Symbol, T.untyped]
|
|
470
|
+
).returns(NilClass)
|
|
471
|
+
end
|
|
472
|
+
def delete_waitlist_entry(id:, request_options:); end
|
|
473
|
+
|
|
474
|
+
sig do
|
|
475
|
+
params(
|
|
476
|
+
id: String,
|
|
477
|
+
request_options: T::Hash[Symbol, T.untyped]
|
|
478
|
+
).returns(WorkOS::WaitlistEntry)
|
|
479
|
+
end
|
|
480
|
+
def create_waitlist_entry_approve(id:, request_options:); end
|
|
481
|
+
|
|
482
|
+
sig do
|
|
483
|
+
params(
|
|
484
|
+
id: String,
|
|
485
|
+
request_options: T::Hash[Symbol, T.untyped]
|
|
486
|
+
).returns(WorkOS::WaitlistEntry)
|
|
487
|
+
end
|
|
488
|
+
def create_waitlist_entry_deny(id:, request_options:); end
|
|
489
|
+
|
|
490
|
+
sig do
|
|
491
|
+
params(
|
|
492
|
+
request_options: T::Hash[Symbol, T.untyped]
|
|
493
|
+
).returns(T::Array[WorkOS::Waitlist])
|
|
494
|
+
end
|
|
495
|
+
def list_waitlists(request_options:); end
|
|
496
|
+
|
|
497
|
+
sig do
|
|
498
|
+
params(
|
|
499
|
+
id: String,
|
|
500
|
+
request_options: T::Hash[Symbol, T.untyped]
|
|
501
|
+
).returns(WorkOS::Waitlist)
|
|
502
|
+
end
|
|
503
|
+
def get_waitlist(id:, request_options:); end
|
|
504
|
+
|
|
505
|
+
sig do
|
|
506
|
+
params(
|
|
507
|
+
id: String,
|
|
508
|
+
before: T.nilable(String),
|
|
509
|
+
after: T.nilable(String),
|
|
510
|
+
limit: T.nilable(Integer),
|
|
511
|
+
order: T.nilable(String),
|
|
512
|
+
state: T.nilable(String),
|
|
513
|
+
email: T.nilable(String),
|
|
514
|
+
request_options: T::Hash[Symbol, T.untyped]
|
|
515
|
+
).returns(T::Array[WorkOS::WaitlistEntry])
|
|
516
|
+
end
|
|
517
|
+
def list_waitlist_entries(id:, before:, after:, limit:, order:, state:, email:, request_options:); end
|
|
518
|
+
|
|
519
|
+
sig do
|
|
520
|
+
params(
|
|
521
|
+
id: String,
|
|
522
|
+
email: String,
|
|
523
|
+
additional_fields: T.nilable(T::Hash[String, String]),
|
|
524
|
+
send_confirmation_email: T.nilable(T::Boolean),
|
|
525
|
+
request_options: T::Hash[Symbol, T.untyped]
|
|
526
|
+
).returns(WorkOS::WaitlistEntry)
|
|
527
|
+
end
|
|
528
|
+
def create_waitlist_entry(id:, email:, additional_fields:, send_confirmation_email:, request_options:); end
|
|
529
|
+
|
|
466
530
|
sig do
|
|
467
531
|
params(
|
|
468
532
|
user_id: String,
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# This file is auto-generated by oagen. Do not edit.
|
|
4
|
+
|
|
5
|
+
# typed: strong
|
|
6
|
+
|
|
7
|
+
module WorkOS
|
|
8
|
+
class Waitlist
|
|
9
|
+
sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void }
|
|
10
|
+
def initialize(json); end
|
|
11
|
+
|
|
12
|
+
sig { returns(String) }
|
|
13
|
+
def object; end
|
|
14
|
+
|
|
15
|
+
sig { params(value: String).returns(String) }
|
|
16
|
+
def object=(value); end
|
|
17
|
+
|
|
18
|
+
sig { returns(String) }
|
|
19
|
+
def id; end
|
|
20
|
+
|
|
21
|
+
sig { params(value: String).returns(String) }
|
|
22
|
+
def id=(value); end
|
|
23
|
+
|
|
24
|
+
sig { returns(String) }
|
|
25
|
+
def created_at; end
|
|
26
|
+
|
|
27
|
+
sig { params(value: String).returns(String) }
|
|
28
|
+
def created_at=(value); end
|
|
29
|
+
|
|
30
|
+
sig { returns(String) }
|
|
31
|
+
def updated_at; end
|
|
32
|
+
|
|
33
|
+
sig { params(value: String).returns(String) }
|
|
34
|
+
def updated_at=(value); end
|
|
35
|
+
|
|
36
|
+
sig { returns(T::Hash[Symbol, T.untyped]) }
|
|
37
|
+
def to_h; end
|
|
38
|
+
|
|
39
|
+
sig { params(args: T.untyped).returns(String) }
|
|
40
|
+
def to_json(*args); end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# This file is auto-generated by oagen. Do not edit.
|
|
4
|
+
|
|
5
|
+
# typed: strong
|
|
6
|
+
|
|
7
|
+
module WorkOS
|
|
8
|
+
class WaitlistEntry
|
|
9
|
+
sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void }
|
|
10
|
+
def initialize(json); end
|
|
11
|
+
|
|
12
|
+
sig { returns(String) }
|
|
13
|
+
def id; end
|
|
14
|
+
|
|
15
|
+
sig { params(value: String).returns(String) }
|
|
16
|
+
def id=(value); end
|
|
17
|
+
|
|
18
|
+
sig { returns(String) }
|
|
19
|
+
def email; end
|
|
20
|
+
|
|
21
|
+
sig { params(value: String).returns(String) }
|
|
22
|
+
def email=(value); end
|
|
23
|
+
|
|
24
|
+
sig { returns(String) }
|
|
25
|
+
def state; end
|
|
26
|
+
|
|
27
|
+
sig { params(value: String).returns(String) }
|
|
28
|
+
def state=(value); end
|
|
29
|
+
|
|
30
|
+
sig { returns(T.nilable(String)) }
|
|
31
|
+
def approved_at; end
|
|
32
|
+
|
|
33
|
+
sig { params(value: T.nilable(String)).returns(T.nilable(String)) }
|
|
34
|
+
def approved_at=(value); end
|
|
35
|
+
|
|
36
|
+
sig { returns(T.nilable(T::Hash[String, String])) }
|
|
37
|
+
def additional_fields; end
|
|
38
|
+
|
|
39
|
+
sig { params(value: T.nilable(T::Hash[String, String])).returns(T.nilable(T::Hash[String, String])) }
|
|
40
|
+
def additional_fields=(value); end
|
|
41
|
+
|
|
42
|
+
sig { returns(T.nilable(String)) }
|
|
43
|
+
def waitlist_id; end
|
|
44
|
+
|
|
45
|
+
sig { params(value: T.nilable(String)).returns(T.nilable(String)) }
|
|
46
|
+
def waitlist_id=(value); end
|
|
47
|
+
|
|
48
|
+
sig { returns(String) }
|
|
49
|
+
def created_at; end
|
|
50
|
+
|
|
51
|
+
sig { params(value: String).returns(String) }
|
|
52
|
+
def created_at=(value); end
|
|
53
|
+
|
|
54
|
+
sig { returns(String) }
|
|
55
|
+
def updated_at; end
|
|
56
|
+
|
|
57
|
+
sig { params(value: String).returns(String) }
|
|
58
|
+
def updated_at=(value); end
|
|
59
|
+
|
|
60
|
+
sig { returns(String) }
|
|
61
|
+
def object; end
|
|
62
|
+
|
|
63
|
+
sig { params(value: String).returns(String) }
|
|
64
|
+
def object=(value); end
|
|
65
|
+
|
|
66
|
+
sig { returns(T::Hash[Symbol, T.untyped]) }
|
|
67
|
+
def to_h; end
|
|
68
|
+
|
|
69
|
+
sig { params(args: T.untyped).returns(String) }
|
|
70
|
+
def to_json(*args); end
|
|
71
|
+
end
|
|
72
|
+
end
|
|
@@ -9,12 +9,6 @@ module WorkOS
|
|
|
9
9
|
sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void }
|
|
10
10
|
def initialize(json); end
|
|
11
11
|
|
|
12
|
-
sig { returns(String) }
|
|
13
|
-
def object; end
|
|
14
|
-
|
|
15
|
-
sig { params(value: String).returns(String) }
|
|
16
|
-
def object=(value); end
|
|
17
|
-
|
|
18
12
|
sig { returns(String) }
|
|
19
13
|
def id; end
|
|
20
14
|
|
|
@@ -39,6 +33,12 @@ module WorkOS
|
|
|
39
33
|
sig { params(value: T.nilable(String)).returns(T.nilable(String)) }
|
|
40
34
|
def approved_at=(value); end
|
|
41
35
|
|
|
36
|
+
sig { returns(T.nilable(T::Hash[String, String])) }
|
|
37
|
+
def additional_fields; end
|
|
38
|
+
|
|
39
|
+
sig { params(value: T.nilable(T::Hash[String, String])).returns(T.nilable(T::Hash[String, String])) }
|
|
40
|
+
def additional_fields=(value); end
|
|
41
|
+
|
|
42
42
|
sig { returns(T.nilable(String)) }
|
|
43
43
|
def waitlist_id; end
|
|
44
44
|
|
|
@@ -57,6 +57,12 @@ module WorkOS
|
|
|
57
57
|
sig { params(value: String).returns(String) }
|
|
58
58
|
def updated_at=(value); end
|
|
59
59
|
|
|
60
|
+
sig { returns(String) }
|
|
61
|
+
def object; end
|
|
62
|
+
|
|
63
|
+
sig { params(value: String).returns(String) }
|
|
64
|
+
def object=(value); end
|
|
65
|
+
|
|
60
66
|
sig { returns(T::Hash[Symbol, T.untyped]) }
|
|
61
67
|
def to_h; end
|
|
62
68
|
|
data/test/workos/test_agents.rb
CHANGED
|
@@ -11,6 +11,55 @@ class AgentsTest < Minitest::Test
|
|
|
11
11
|
@client = WorkOS::Client.new(api_key: "sk_test_123")
|
|
12
12
|
end
|
|
13
13
|
|
|
14
|
+
def test_list_blueprints_returns_expected_result
|
|
15
|
+
stub_request(:get, %r{\Ahttps://api\.workos\.com/agents/blueprints(\?|\z)})
|
|
16
|
+
.to_return(body: '{"data": [], "list_metadata": {}}', status: 200)
|
|
17
|
+
result = @client.agents.list_blueprints
|
|
18
|
+
assert_kind_of WorkOS::Types::ListStruct, result
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def test_create_blueprint_returns_expected_result
|
|
22
|
+
stub_request(:post, %r{\Ahttps://api\.workos\.com/agents/blueprints(\?|\z)})
|
|
23
|
+
.to_return(body: "{}", status: 200)
|
|
24
|
+
result = @client.agents.create_blueprint(name: "stub")
|
|
25
|
+
refute_nil result
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def test_get_blueprint_returns_expected_result
|
|
29
|
+
stub_request(:get, %r{\Ahttps://api\.workos\.com/agents/blueprints/stub(\?|\z)})
|
|
30
|
+
.to_return(body: "{}", status: 200)
|
|
31
|
+
result = @client.agents.get_blueprint(agent_blueprint_id: "stub")
|
|
32
|
+
refute_nil result
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def test_update_blueprint_returns_expected_result
|
|
36
|
+
stub_request(:patch, %r{\Ahttps://api\.workos\.com/agents/blueprints/stub(\?|\z)})
|
|
37
|
+
.to_return(body: "{}", status: 200)
|
|
38
|
+
result = @client.agents.update_blueprint(agent_blueprint_id: "stub")
|
|
39
|
+
refute_nil result
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def test_delete_blueprint_returns_expected_result
|
|
43
|
+
stub_request(:delete, %r{\Ahttps://api\.workos\.com/agents/blueprints/stub(\?|\z)})
|
|
44
|
+
.to_return(body: "{}", status: 200)
|
|
45
|
+
result = @client.agents.delete_blueprint(agent_blueprint_id: "stub")
|
|
46
|
+
assert_nil result
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def test_create_blueprint_token_returns_expected_result
|
|
50
|
+
stub_request(:post, %r{\Ahttps://api\.workos\.com/agents/blueprints/stub/tokens(\?|\z)})
|
|
51
|
+
.to_return(body: "{}", status: 200)
|
|
52
|
+
result = @client.agents.create_blueprint_token(agent_blueprint_id: "stub", type: "stub")
|
|
53
|
+
refute_nil result
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
def test_validate_blueprint_token_returns_expected_result
|
|
57
|
+
stub_request(:post, %r{\Ahttps://api\.workos\.com/agents/blueprints/stub/tokens/validate(\?|\z)})
|
|
58
|
+
.to_return(body: "{}", status: 200)
|
|
59
|
+
result = @client.agents.validate_blueprint_token(agent_blueprint_id: "stub", agent_access_token: "stub")
|
|
60
|
+
refute_nil result
|
|
61
|
+
end
|
|
62
|
+
|
|
14
63
|
def test_update_attempts_returns_expected_result
|
|
15
64
|
stub_request(:patch, %r{\Ahttps://api\.workos\.com/agents/claims/attempts(\?|\z)})
|
|
16
65
|
.to_return(body: "{}", status: 200)
|
|
@@ -32,11 +81,66 @@ class AgentsTest < Minitest::Test
|
|
|
32
81
|
refute_nil result
|
|
33
82
|
end
|
|
34
83
|
|
|
84
|
+
def test_list_instances_returns_expected_result
|
|
85
|
+
stub_request(:get, %r{\Ahttps://api\.workos\.com/agents/instances(\?|\z)})
|
|
86
|
+
.to_return(body: '{"data": [], "list_metadata": {}}', status: 200)
|
|
87
|
+
result = @client.agents.list_instances
|
|
88
|
+
assert_kind_of WorkOS::Types::ListStruct, result
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
def test_get_instance_returns_expected_result
|
|
92
|
+
stub_request(:get, %r{\Ahttps://api\.workos\.com/agents/instances/stub(\?|\z)})
|
|
93
|
+
.to_return(body: "{}", status: 200)
|
|
94
|
+
result = @client.agents.get_instance(agent_instance_id: "stub")
|
|
95
|
+
refute_nil result
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
def test_delete_instance_returns_expected_result
|
|
99
|
+
stub_request(:delete, %r{\Ahttps://api\.workos\.com/agents/instances/stub(\?|\z)})
|
|
100
|
+
.to_return(body: "{}", status: 200)
|
|
101
|
+
result = @client.agents.delete_instance(agent_instance_id: "stub")
|
|
102
|
+
assert_nil result
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
def test_list_sessions_returns_expected_result
|
|
106
|
+
stub_request(:get, %r{\Ahttps://api\.workos\.com/agents/sessions(\?|\z)})
|
|
107
|
+
.to_return(body: '{"data": [], "list_metadata": {}}', status: 200)
|
|
108
|
+
result = @client.agents.list_sessions
|
|
109
|
+
assert_kind_of WorkOS::Types::ListStruct, result
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
def test_get_session_returns_expected_result
|
|
113
|
+
stub_request(:get, %r{\Ahttps://api\.workos\.com/agents/sessions/stub(\?|\z)})
|
|
114
|
+
.to_return(body: "{}", status: 200)
|
|
115
|
+
result = @client.agents.get_session(agent_instance_session_id: "stub")
|
|
116
|
+
refute_nil result
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
def test_revoke_session_returns_expected_result
|
|
120
|
+
stub_request(:post, %r{\Ahttps://api\.workos\.com/agents/sessions/stub/revoke(\?|\z)})
|
|
121
|
+
.to_return(body: "{}", status: 200)
|
|
122
|
+
result = @client.agents.revoke_session(agent_instance_session_id: "stub")
|
|
123
|
+
refute_nil result
|
|
124
|
+
end
|
|
125
|
+
|
|
35
126
|
# Parameterized authentication error tests (one per endpoint).
|
|
36
127
|
[
|
|
128
|
+
{name: :list_blueprints, verb: :get, url: %r{\Ahttps://api\.workos\.com/agents/blueprints(\?|\z)}},
|
|
129
|
+
{name: :create_blueprint, verb: :post, url: %r{\Ahttps://api\.workos\.com/agents/blueprints(\?|\z)}, args: {name: "stub"}},
|
|
130
|
+
{name: :get_blueprint, verb: :get, url: %r{\Ahttps://api\.workos\.com/agents/blueprints/stub(\?|\z)}, args: {agent_blueprint_id: "stub"}},
|
|
131
|
+
{name: :update_blueprint, verb: :patch, url: %r{\Ahttps://api\.workos\.com/agents/blueprints/stub(\?|\z)}, args: {agent_blueprint_id: "stub"}},
|
|
132
|
+
{name: :delete_blueprint, verb: :delete, url: %r{\Ahttps://api\.workos\.com/agents/blueprints/stub(\?|\z)}, args: {agent_blueprint_id: "stub"}},
|
|
133
|
+
{name: :create_blueprint_token, verb: :post, url: %r{\Ahttps://api\.workos\.com/agents/blueprints/stub/tokens(\?|\z)}, args: {agent_blueprint_id: "stub", type: "stub"}},
|
|
134
|
+
{name: :validate_blueprint_token, verb: :post, url: %r{\Ahttps://api\.workos\.com/agents/blueprints/stub/tokens/validate(\?|\z)}, args: {agent_blueprint_id: "stub", agent_access_token: "stub"}},
|
|
37
135
|
{name: :update_attempts, verb: :patch, url: %r{\Ahttps://api\.workos\.com/agents/claims/attempts(\?|\z)}, args: {type: "link_external_user", claim_attempt_token: "stub", user: {}}},
|
|
38
136
|
{name: :create_validate, verb: :post, url: %r{\Ahttps://api\.workos\.com/agents/credentials/validate(\?|\z)}, args: {type: "stub", credential: "stub"}},
|
|
39
|
-
{name: :get_registration, verb: :get, url: %r{\Ahttps://api\.workos\.com/agents/registrations/stub(\?|\z)}, args: {id: "stub"}}
|
|
137
|
+
{name: :get_registration, verb: :get, url: %r{\Ahttps://api\.workos\.com/agents/registrations/stub(\?|\z)}, args: {id: "stub"}},
|
|
138
|
+
{name: :list_instances, verb: :get, url: %r{\Ahttps://api\.workos\.com/agents/instances(\?|\z)}},
|
|
139
|
+
{name: :get_instance, verb: :get, url: %r{\Ahttps://api\.workos\.com/agents/instances/stub(\?|\z)}, args: {agent_instance_id: "stub"}},
|
|
140
|
+
{name: :delete_instance, verb: :delete, url: %r{\Ahttps://api\.workos\.com/agents/instances/stub(\?|\z)}, args: {agent_instance_id: "stub"}},
|
|
141
|
+
{name: :list_sessions, verb: :get, url: %r{\Ahttps://api\.workos\.com/agents/sessions(\?|\z)}},
|
|
142
|
+
{name: :get_session, verb: :get, url: %r{\Ahttps://api\.workos\.com/agents/sessions/stub(\?|\z)}, args: {agent_instance_session_id: "stub"}},
|
|
143
|
+
{name: :revoke_session, verb: :post, url: %r{\Ahttps://api\.workos\.com/agents/sessions/stub/revoke(\?|\z)}, args: {agent_instance_session_id: "stub"}}
|
|
40
144
|
].each do |spec|
|
|
41
145
|
define_method("test_#{spec[:name]}_raises_authentication_error_on_401") do
|
|
42
146
|
stub_request(spec[:verb], spec[:url])
|
|
@@ -56,6 +56,147 @@ class AgentsModelRoundTripTest < Minitest::Test
|
|
|
56
56
|
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
57
57
|
end
|
|
58
58
|
|
|
59
|
+
def test_agent_blueprint_round_trip
|
|
60
|
+
fixture = {
|
|
61
|
+
"object" => "agent_blueprint",
|
|
62
|
+
"id" => "stub",
|
|
63
|
+
"name" => "stub",
|
|
64
|
+
"description" => nil,
|
|
65
|
+
"permissions" => [],
|
|
66
|
+
"invocable_by" => {},
|
|
67
|
+
"session_settings" => {},
|
|
68
|
+
"created_at" => "stub",
|
|
69
|
+
"updated_at" => "stub"
|
|
70
|
+
}
|
|
71
|
+
model = WorkOS::AgentBlueprint.new(fixture.to_json)
|
|
72
|
+
json = model.to_h
|
|
73
|
+
assert_kind_of Hash, json
|
|
74
|
+
assert_equal fixture["id"], json[:id]
|
|
75
|
+
assert_equal fixture["name"], json[:name]
|
|
76
|
+
assert_nil json[:description]
|
|
77
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
78
|
+
assert_equal fixture["updated_at"], json[:updated_at]
|
|
79
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
def test_agent_instance_round_trip
|
|
83
|
+
fixture = {
|
|
84
|
+
"object" => "agent_instance",
|
|
85
|
+
"id" => "stub",
|
|
86
|
+
"agent_blueprint_id" => "stub",
|
|
87
|
+
"organization_id" => "stub",
|
|
88
|
+
"organization_membership_id" => nil,
|
|
89
|
+
"type" => "stub",
|
|
90
|
+
"created_at" => "stub",
|
|
91
|
+
"updated_at" => "stub"
|
|
92
|
+
}
|
|
93
|
+
model = WorkOS::AgentInstance.new(fixture.to_json)
|
|
94
|
+
json = model.to_h
|
|
95
|
+
assert_kind_of Hash, json
|
|
96
|
+
assert_equal fixture["id"], json[:id]
|
|
97
|
+
assert_equal fixture["agent_blueprint_id"], json[:agent_blueprint_id]
|
|
98
|
+
assert_equal fixture["organization_id"], json[:organization_id]
|
|
99
|
+
assert_nil json[:organization_membership_id]
|
|
100
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
101
|
+
assert_equal fixture["updated_at"], json[:updated_at]
|
|
102
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
def test_agent_token_round_trip
|
|
106
|
+
fixture = {
|
|
107
|
+
"access_token" => "stub",
|
|
108
|
+
"token_type" => "Bearer",
|
|
109
|
+
"expires_in" => 1,
|
|
110
|
+
"refresh_token" => "stub",
|
|
111
|
+
"agent_instance_id" => "stub",
|
|
112
|
+
"new_instance" => true,
|
|
113
|
+
"agent_instance_session_id" => "stub",
|
|
114
|
+
"permissions" => []
|
|
115
|
+
}
|
|
116
|
+
model = WorkOS::AgentToken.new(fixture.to_json)
|
|
117
|
+
json = model.to_h
|
|
118
|
+
assert_kind_of Hash, json
|
|
119
|
+
assert_equal fixture["access_token"], json[:access_token]
|
|
120
|
+
assert_equal fixture["expires_in"], json[:expires_in]
|
|
121
|
+
assert_equal fixture["refresh_token"], json[:refresh_token]
|
|
122
|
+
assert_equal fixture["agent_instance_id"], json[:agent_instance_id]
|
|
123
|
+
assert_equal fixture["new_instance"], json[:new_instance]
|
|
124
|
+
assert_equal fixture["agent_instance_session_id"], json[:agent_instance_session_id]
|
|
125
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
def test_agent_token_validation_round_trip
|
|
129
|
+
fixture = {
|
|
130
|
+
"valid" => true,
|
|
131
|
+
"agent_instance_id" => "stub",
|
|
132
|
+
"agent_instance_session_id" => "stub",
|
|
133
|
+
"organization_id" => "stub",
|
|
134
|
+
"permissions" => [],
|
|
135
|
+
"intent" => nil,
|
|
136
|
+
"acting_user_id" => nil,
|
|
137
|
+
"session_expires_at" => "stub"
|
|
138
|
+
}
|
|
139
|
+
model = WorkOS::AgentTokenValidation.new(fixture.to_json)
|
|
140
|
+
json = model.to_h
|
|
141
|
+
assert_kind_of Hash, json
|
|
142
|
+
assert_equal fixture["agent_instance_id"], json[:agent_instance_id]
|
|
143
|
+
assert_equal fixture["agent_instance_session_id"], json[:agent_instance_session_id]
|
|
144
|
+
assert_equal fixture["organization_id"], json[:organization_id]
|
|
145
|
+
assert_nil json[:intent]
|
|
146
|
+
assert_nil json[:acting_user_id]
|
|
147
|
+
assert_equal fixture["session_expires_at"], json[:session_expires_at]
|
|
148
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
def test_agent_instance_session_round_trip
|
|
152
|
+
fixture = {
|
|
153
|
+
"object" => "agent_instance_session",
|
|
154
|
+
"id" => "stub",
|
|
155
|
+
"agent_instance_id" => "stub",
|
|
156
|
+
"status" => "stub",
|
|
157
|
+
"expires_at" => "stub",
|
|
158
|
+
"revoked_at" => nil,
|
|
159
|
+
"created_at" => "stub",
|
|
160
|
+
"updated_at" => "stub"
|
|
161
|
+
}
|
|
162
|
+
model = WorkOS::AgentInstanceSession.new(fixture.to_json)
|
|
163
|
+
json = model.to_h
|
|
164
|
+
assert_kind_of Hash, json
|
|
165
|
+
assert_equal fixture["id"], json[:id]
|
|
166
|
+
assert_equal fixture["agent_instance_id"], json[:agent_instance_id]
|
|
167
|
+
assert_equal fixture["expires_at"], json[:expires_at]
|
|
168
|
+
assert_nil json[:revoked_at]
|
|
169
|
+
assert_equal fixture["created_at"], json[:created_at]
|
|
170
|
+
assert_equal fixture["updated_at"], json[:updated_at]
|
|
171
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
def test_agent_blueprint_invocable_by_round_trip
|
|
175
|
+
fixture = {
|
|
176
|
+
"role_slugs" => [],
|
|
177
|
+
"organization_ids" => []
|
|
178
|
+
}
|
|
179
|
+
model = WorkOS::AgentBlueprintInvocableBy.new(fixture.to_json)
|
|
180
|
+
json = model.to_h
|
|
181
|
+
assert_kind_of Hash, json
|
|
182
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
def test_agent_blueprint_session_setting_round_trip
|
|
186
|
+
fixture = {
|
|
187
|
+
"max_age_seconds" => 1,
|
|
188
|
+
"access_token_ttl_seconds" => 1,
|
|
189
|
+
"refresh_token_ttl_seconds" => 1
|
|
190
|
+
}
|
|
191
|
+
model = WorkOS::AgentBlueprintSessionSetting.new(fixture.to_json)
|
|
192
|
+
json = model.to_h
|
|
193
|
+
assert_kind_of Hash, json
|
|
194
|
+
assert_equal fixture["max_age_seconds"], json[:max_age_seconds]
|
|
195
|
+
assert_equal fixture["access_token_ttl_seconds"], json[:access_token_ttl_seconds]
|
|
196
|
+
assert_equal fixture["refresh_token_ttl_seconds"], json[:refresh_token_ttl_seconds]
|
|
197
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
198
|
+
end
|
|
199
|
+
|
|
59
200
|
def test_claim_view_response_organization_round_trip
|
|
60
201
|
fixture = {
|
|
61
202
|
"id" => "stub",
|
|
@@ -104,6 +245,110 @@ class AgentsModelRoundTripTest < Minitest::Test
|
|
|
104
245
|
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
105
246
|
end
|
|
106
247
|
|
|
248
|
+
def test_agent_blueprints_create_request_round_trip
|
|
249
|
+
fixture = {
|
|
250
|
+
"name" => "stub",
|
|
251
|
+
"description" => "stub",
|
|
252
|
+
"permissions" => [],
|
|
253
|
+
"invocable_by" => {},
|
|
254
|
+
"session_settings" => {}
|
|
255
|
+
}
|
|
256
|
+
model = WorkOS::AgentBlueprintsCreateRequest.new(fixture.to_json)
|
|
257
|
+
json = model.to_h
|
|
258
|
+
assert_kind_of Hash, json
|
|
259
|
+
assert_equal fixture["name"], json[:name]
|
|
260
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
261
|
+
end
|
|
262
|
+
|
|
263
|
+
def test_agent_blueprints_create_request_invocable_by_round_trip
|
|
264
|
+
fixture = {
|
|
265
|
+
"role_slugs" => [],
|
|
266
|
+
"organization_ids" => []
|
|
267
|
+
}
|
|
268
|
+
model = WorkOS::AgentBlueprintsCreateRequestInvocableBy.new(fixture.to_json)
|
|
269
|
+
json = model.to_h
|
|
270
|
+
assert_kind_of Hash, json
|
|
271
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
272
|
+
end
|
|
273
|
+
|
|
274
|
+
def test_agent_blueprints_create_request_session_setting_round_trip
|
|
275
|
+
fixture = {
|
|
276
|
+
"max_age_seconds" => 1,
|
|
277
|
+
"access_token_ttl_seconds" => 1,
|
|
278
|
+
"refresh_token_ttl_seconds" => 1
|
|
279
|
+
}
|
|
280
|
+
model = WorkOS::AgentBlueprintsCreateRequestSessionSetting.new(fixture.to_json)
|
|
281
|
+
json = model.to_h
|
|
282
|
+
assert_kind_of Hash, json
|
|
283
|
+
assert_equal fixture["max_age_seconds"], json[:max_age_seconds]
|
|
284
|
+
assert_equal fixture["access_token_ttl_seconds"], json[:access_token_ttl_seconds]
|
|
285
|
+
assert_equal fixture["refresh_token_ttl_seconds"], json[:refresh_token_ttl_seconds]
|
|
286
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
287
|
+
end
|
|
288
|
+
|
|
289
|
+
def test_agent_blueprints_update_request_round_trip
|
|
290
|
+
fixture = {
|
|
291
|
+
"name" => "stub",
|
|
292
|
+
"description" => nil,
|
|
293
|
+
"permissions" => [],
|
|
294
|
+
"invocable_by" => {},
|
|
295
|
+
"session_settings" => {}
|
|
296
|
+
}
|
|
297
|
+
model = WorkOS::AgentBlueprintsUpdateRequest.new(fixture.to_json)
|
|
298
|
+
json = model.to_h
|
|
299
|
+
assert_kind_of Hash, json
|
|
300
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
301
|
+
end
|
|
302
|
+
|
|
303
|
+
def test_agent_blueprints_update_request_invocable_by_round_trip
|
|
304
|
+
fixture = {
|
|
305
|
+
"role_slugs" => [],
|
|
306
|
+
"organization_ids" => []
|
|
307
|
+
}
|
|
308
|
+
model = WorkOS::AgentBlueprintsUpdateRequestInvocableBy.new(fixture.to_json)
|
|
309
|
+
json = model.to_h
|
|
310
|
+
assert_kind_of Hash, json
|
|
311
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
312
|
+
end
|
|
313
|
+
|
|
314
|
+
def test_agent_blueprints_update_request_session_setting_round_trip
|
|
315
|
+
fixture = {
|
|
316
|
+
"max_age_seconds" => 1,
|
|
317
|
+
"access_token_ttl_seconds" => 1,
|
|
318
|
+
"refresh_token_ttl_seconds" => 1
|
|
319
|
+
}
|
|
320
|
+
model = WorkOS::AgentBlueprintsUpdateRequestSessionSetting.new(fixture.to_json)
|
|
321
|
+
json = model.to_h
|
|
322
|
+
assert_kind_of Hash, json
|
|
323
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
324
|
+
end
|
|
325
|
+
|
|
326
|
+
def test_agent_blueprints_token_mint_token_request_round_trip
|
|
327
|
+
fixture = {
|
|
328
|
+
"type" => "stub",
|
|
329
|
+
"user_access_token" => "stub",
|
|
330
|
+
"intent" => "stub",
|
|
331
|
+
"organization_id" => "stub",
|
|
332
|
+
"agent_access_token" => "stub",
|
|
333
|
+
"refresh_token" => "stub"
|
|
334
|
+
}
|
|
335
|
+
model = WorkOS::AgentBlueprintsTokenMintTokenRequest.new(fixture.to_json)
|
|
336
|
+
json = model.to_h
|
|
337
|
+
assert_kind_of Hash, json
|
|
338
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
339
|
+
end
|
|
340
|
+
|
|
341
|
+
def test_agent_blueprints_token_validate_token_request_round_trip
|
|
342
|
+
fixture = {
|
|
343
|
+
"agent_access_token" => "stub"
|
|
344
|
+
}
|
|
345
|
+
model = WorkOS::AgentBlueprintsTokenValidateTokenRequest.new(fixture.to_json)
|
|
346
|
+
json = model.to_h
|
|
347
|
+
assert_kind_of Hash, json
|
|
348
|
+
assert_equal fixture["agent_access_token"], json[:agent_access_token]
|
|
349
|
+
fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" }
|
|
350
|
+
end
|
|
351
|
+
|
|
107
352
|
def test_agent_admin_link_claim_attempt_to_external_user_request_round_trip
|
|
108
353
|
fixture = {
|
|
109
354
|
"type" => "link_external_user",
|
|
@@ -20,8 +20,17 @@ class AuditLogsTest < Minitest::Test
|
|
|
20
20
|
|
|
21
21
|
def test_update_organization_audit_logs_retention_returns_expected_result
|
|
22
22
|
stub_request(:put, %r{\Ahttps://api\.workos\.com/organizations/stub/audit_logs_retention(\?|\z)})
|
|
23
|
+
.with(body: hash_including("retention_period" => "stub"))
|
|
23
24
|
.to_return(body: "{}", status: 200)
|
|
24
|
-
result = @client.audit_logs.update_organization_audit_logs_retention(id: "stub",
|
|
25
|
+
result = @client.audit_logs.update_organization_audit_logs_retention(id: "stub", retention: WorkOS::AuditLogs::RetentionPeriod.new(retention_period: "stub"))
|
|
26
|
+
refute_nil result
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def test_update_organization_audit_logs_retention_with_retention_period_in_days_returns_expected_result
|
|
30
|
+
stub_request(:put, %r{\Ahttps://api\.workos\.com/organizations/stub/audit_logs_retention(\?|\z)})
|
|
31
|
+
.with(body: hash_including("retention_period_in_days" => 1))
|
|
32
|
+
.to_return(body: "{}", status: 200)
|
|
33
|
+
result = @client.audit_logs.update_organization_audit_logs_retention(id: "stub", retention: WorkOS::AuditLogs::RetentionPeriodInDays.new(retention_period_in_days: 1))
|
|
25
34
|
refute_nil result
|
|
26
35
|
end
|
|
27
36
|
|
|
@@ -70,7 +79,7 @@ class AuditLogsTest < Minitest::Test
|
|
|
70
79
|
# Parameterized authentication error tests (one per endpoint).
|
|
71
80
|
[
|
|
72
81
|
{name: :get_organization_audit_logs_retention, verb: :get, url: %r{\Ahttps://api\.workos\.com/organizations/stub/audit_logs_retention(\?|\z)}, args: {id: "stub"}},
|
|
73
|
-
{name: :update_organization_audit_logs_retention, verb: :put, url: %r{\Ahttps://api\.workos\.com/organizations/stub/audit_logs_retention(\?|\z)}, args: {id: "stub",
|
|
82
|
+
{name: :update_organization_audit_logs_retention, verb: :put, url: %r{\Ahttps://api\.workos\.com/organizations/stub/audit_logs_retention(\?|\z)}, args: {id: "stub", retention: WorkOS::AuditLogs::RetentionPeriod.new(retention_period: "stub")}},
|
|
74
83
|
{name: :list_actions, verb: :get, url: %r{\Ahttps://api\.workos\.com/audit_logs/actions(\?|\z)}},
|
|
75
84
|
{name: :list_action_schemas, verb: :get, url: %r{\Ahttps://api\.workos\.com/audit_logs/actions/stub/schemas(\?|\z)}, args: {action_name: "stub"}},
|
|
76
85
|
{name: :create_schema, verb: :post, url: %r{\Ahttps://api\.workos\.com/audit_logs/actions/stub/schemas(\?|\z)}, args: {action_name: "stub", targets: [{}]}},
|
|
@@ -214,9 +214,9 @@ class AuthorizationTest < Minitest::Test
|
|
|
214
214
|
|
|
215
215
|
def test_update_resource_by_external_id_with_parent_resource_by_external_id_returns_expected_result
|
|
216
216
|
stub_request(:patch, %r{\Ahttps://api\.workos\.com/authorization/organizations/stub/resources/stub/stub(\?|\z)})
|
|
217
|
-
.with(body: hash_including("
|
|
217
|
+
.with(body: hash_including("parent_resource_type_slug" => "stub", "parent_resource_external_id" => "stub"))
|
|
218
218
|
.to_return(body: "{}", status: 200)
|
|
219
|
-
result = @client.authorization.update_resource_by_external_id(organization_id: "stub", resource_type_slug: "stub", external_id: "stub", parent_resource: WorkOS::Authorization::ParentResourceByExternalId.new(
|
|
219
|
+
result = @client.authorization.update_resource_by_external_id(organization_id: "stub", resource_type_slug: "stub", external_id: "stub", parent_resource: WorkOS::Authorization::ParentResourceByExternalId.new(parent_resource_type_slug: "stub", parent_resource_external_id: "stub"))
|
|
220
220
|
refute_nil result
|
|
221
221
|
end
|
|
222
222
|
|
|
@@ -265,9 +265,9 @@ class AuthorizationTest < Minitest::Test
|
|
|
265
265
|
|
|
266
266
|
def test_create_resource_with_parent_resource_by_external_id_returns_expected_result
|
|
267
267
|
stub_request(:post, %r{\Ahttps://api\.workos\.com/authorization/resources(\?|\z)})
|
|
268
|
-
.with(body: hash_including("external_id" => "stub", "name" => "stub", "resource_type_slug" => "stub", "organization_id" => "stub", "
|
|
268
|
+
.with(body: hash_including("external_id" => "stub", "name" => "stub", "resource_type_slug" => "stub", "organization_id" => "stub", "parent_resource_type_slug" => "stub", "parent_resource_external_id" => "stub"))
|
|
269
269
|
.to_return(body: "{}", status: 200)
|
|
270
|
-
result = @client.authorization.create_resource(external_id: "stub", name: "stub", resource_type_slug: "stub", organization_id: "stub", parent_resource: WorkOS::Authorization::ParentResourceByExternalId.new(
|
|
270
|
+
result = @client.authorization.create_resource(external_id: "stub", name: "stub", resource_type_slug: "stub", organization_id: "stub", parent_resource: WorkOS::Authorization::ParentResourceByExternalId.new(parent_resource_type_slug: "stub", parent_resource_external_id: "stub"))
|
|
271
271
|
refute_nil result
|
|
272
272
|
end
|
|
273
273
|
|
|
@@ -288,9 +288,9 @@ class AuthorizationTest < Minitest::Test
|
|
|
288
288
|
|
|
289
289
|
def test_update_resource_with_parent_resource_by_external_id_returns_expected_result
|
|
290
290
|
stub_request(:patch, %r{\Ahttps://api\.workos\.com/authorization/resources/stub(\?|\z)})
|
|
291
|
-
.with(body: hash_including("
|
|
291
|
+
.with(body: hash_including("parent_resource_type_slug" => "stub", "parent_resource_external_id" => "stub"))
|
|
292
292
|
.to_return(body: "{}", status: 200)
|
|
293
|
-
result = @client.authorization.update_resource(resource_id: "stub", parent_resource: WorkOS::Authorization::ParentResourceByExternalId.new(
|
|
293
|
+
result = @client.authorization.update_resource(resource_id: "stub", parent_resource: WorkOS::Authorization::ParentResourceByExternalId.new(parent_resource_type_slug: "stub", parent_resource_external_id: "stub"))
|
|
294
294
|
refute_nil result
|
|
295
295
|
end
|
|
296
296
|
|