comet_backup_ruby_sdk 2.43.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.rubocop.yml +0 -0
- data/CHANGELOG.md +35 -0
- data/Gemfile +0 -0
- data/LICENSE +0 -0
- data/README.md +0 -0
- data/RELEASING.md +7 -7
- data/Rakefile +0 -0
- data/comet_backup_ruby_sdk.gemspec +2 -3
- data/lib/comet/api_response_error.rb +1 -1
- data/lib/comet/comet_server.rb +824 -90
- data/lib/comet/definitions.rb +409 -125
- data/lib/comet/models/add_bucket_response_message.rb +1 -1
- data/lib/comet/models/admin_account_apitoken_create_response.rb +102 -0
- data/lib/comet/models/admin_account_apitoken_list_response.rb +98 -0
- data/lib/comet/models/admin_account_properties_response.rb +38 -1
- data/lib/comet/models/admin_apitoken.rb +139 -0
- data/lib/comet/models/admin_apitoken_info.rb +117 -0
- data/lib/comet/models/admin_email_options.rb +1 -1
- data/lib/comet/models/admin_options.rb +1 -1
- data/lib/comet/models/admin_resource_response.rb +1 -1
- data/lib/comet/models/admin_security_options.rb +1 -1
- data/lib/comet/models/admin_u2fregistration.rb +1 -1
- data/lib/comet/models/admin_user_permissions.rb +20 -1
- data/lib/comet/models/admin_web_authn_registration.rb +1 -1
- data/lib/comet/models/allowed_admin_user.rb +19 -1
- data/lib/comet/models/amazon_awsvirtual_storage_role_settings.rb +1 -1
- data/lib/comet/models/attributed_content_measurement.rb +146 -0
- data/lib/comet/models/attributed_content_measurement_component.rb +105 -0
- data/lib/comet/models/authentication_role_options.rb +2 -4
- data/lib/comet/models/available_download.rb +1 -1
- data/lib/comet/models/azure_destination_location.rb +1 -1
- data/lib/comet/models/b2destination_location.rb +1 -1
- data/lib/comet/models/b2storage_extra_info.rb +1 -1
- data/lib/comet/models/b2transaction_totals.rb +1 -1
- data/lib/comet/models/b2virtual_storage_role_settings.rb +1 -1
- data/lib/comet/models/backup_job_advanced_options.rb +15 -1
- data/lib/comet/models/backup_job_detail.rb +14 -2
- data/lib/comet/models/backup_job_progress.rb +1 -1
- data/lib/comet/models/backup_rule_config.rb +43 -1
- data/lib/comet/models/backup_rule_event_triggers.rb +1 -1
- data/lib/comet/models/branding_options.rb +184 -1
- data/lib/comet/models/branding_properties.rb +184 -1
- data/lib/comet/models/browse_disk_drives_response.rb +1 -1
- data/lib/comet/models/browse_edbresponse.rb +1 -1
- data/lib/comet/models/browse_hvresponse.rb +1 -1
- data/lib/comet/models/browse_office_365list_virtual_accounts_response.rb +1 -1
- data/lib/comet/models/browse_office_365objects_response.rb +1 -1
- data/lib/comet/models/browse_proxmox_nodes_response.rb +1 -1
- data/lib/comet/models/browse_proxmox_response.rb +16 -1
- data/lib/comet/models/browse_proxmox_storage_response.rb +1 -1
- data/lib/comet/models/browse_sqlserver_response.rb +1 -1
- data/lib/comet/models/browse_vmware_datacenters_response.rb +1 -1
- data/lib/comet/models/browse_vmware_datastores_response.rb +1 -1
- data/lib/comet/models/browse_vmware_hosts_response.rb +1 -1
- data/lib/comet/models/browse_vmware_networks_response.rb +1 -1
- data/lib/comet/models/browse_vmware_response.rb +1 -1
- data/lib/comet/models/browse_vssresponse.rb +1 -1
- data/lib/comet/models/bucket_properties.rb +1 -1
- data/lib/comet/models/bucket_usage_info.rb +1 -1
- data/lib/comet/models/comet_apiresponse_message.rb +1 -1
- data/lib/comet/models/comet_destination_location.rb +1 -1
- data/lib/comet/models/constellation_check_report.rb +1 -1
- data/lib/comet/models/constellation_role_options.rb +1 -1
- data/lib/comet/models/constellation_stats.rb +1 -1
- data/lib/comet/models/constellation_status_apiresponse.rb +1 -1
- data/lib/comet/models/content_measurement.rb +1 -1
- data/lib/comet/models/content_measurement_component.rb +3 -3
- data/lib/comet/models/count_jobs_response.rb +1 -1
- data/lib/comet/models/create_group_policy_response.rb +1 -1
- data/lib/comet/models/create_user_group_response.rb +1 -1
- data/lib/comet/models/custom_branding_item.rb +143 -0
- data/lib/comet/models/custom_branding_options.rb +79 -0
- data/lib/comet/models/custom_branding_origin.rb +76 -0
- data/lib/comet/models/custom_remote_bucket_settings.rb +1 -1
- data/lib/comet/models/days_of_week_config.rb +1 -1
- data/lib/comet/models/default_email_report_policy.rb +1 -1
- data/lib/comet/models/default_source_with_osrestriction.rb +1 -1
- data/lib/comet/models/destination_config.rb +43 -5
- data/lib/comet/models/destination_location.rb +11 -2
- data/lib/comet/models/destination_statistics.rb +1 -1
- data/lib/comet/models/device_config.rb +42 -1
- data/lib/comet/models/device_identity_response.rb +82 -0
- data/lib/comet/models/disk_drive.rb +1 -1
- data/lib/comet/models/dispatch_with_job_idresponse.rb +1 -1
- data/lib/comet/models/dispatcher_admin_sources_response.rb +1 -1
- data/lib/comet/models/dispatcher_list_snapshot_virtual_machines_response.rb +1 -1
- data/lib/comet/models/dispatcher_stored_objects_response.rb +1 -1
- data/lib/comet/models/dispatcher_vault_snapshots_response.rb +1 -1
- data/lib/comet/models/dispatcher_windisk_snapshot_response.rb +1 -1
- data/lib/comet/models/dnscache_options.rb +94 -0
- data/lib/comet/models/edbfile_info.rb +1 -1
- data/lib/comet/models/email_options.rb +14 -1
- data/lib/comet/models/email_report_config.rb +15 -1
- data/lib/comet/models/email_report_generated_preview.rb +1 -1
- data/lib/comet/models/email_reporting_option.rb +1 -1
- data/lib/comet/models/external_authentication_source.rb +1 -1
- data/lib/comet/models/external_authentication_source_display.rb +1 -1
- data/lib/comet/models/external_authentication_source_response.rb +1 -1
- data/lib/comet/models/external_ldapauthentication_source_server.rb +1 -1
- data/lib/comet/models/external_ldapauthentication_source_settings.rb +1 -1
- data/lib/comet/models/extra_file_exclusion.rb +1 -1
- data/lib/comet/models/file_option.rb +1 -1
- data/lib/comet/models/ftpdestination_location.rb +1 -1
- data/lib/comet/models/get_group_policy_response.rb +1 -1
- data/lib/comet/models/get_profile_and_hash_response_message.rb +1 -1
- data/lib/comet/models/get_profile_hash_response_message.rb +1 -1
- data/lib/comet/models/get_shared_storage_quota_response.rb +110 -0
- data/lib/comet/models/get_user_group_response.rb +1 -1
- data/lib/comet/models/get_user_group_with_users_response.rb +1 -1
- data/lib/comet/models/global_override_options.rb +1 -1
- data/lib/comet/models/group_policy.rb +1 -1
- data/lib/comet/models/hour_sched_config.rb +1 -1
- data/lib/comet/models/httpconnector_options.rb +1 -1
- data/lib/comet/models/hyper_vmachine_info.rb +1 -1
- data/lib/comet/models/hyper_vrestore_target_options.rb +1 -1
- data/lib/comet/models/impossible_cloud_iamtemplate_settings.rb +1 -1
- data/lib/comet/models/impossible_cloud_partner_template_settings.rb +1 -1
- data/lib/comet/models/install_creds.rb +1 -1
- data/lib/comet/models/install_token.rb +8 -8
- data/lib/comet/models/install_token_response.rb +1 -1
- data/lib/comet/models/job_entry.rb +1 -1
- data/lib/comet/models/license_limits.rb +1 -1
- data/lib/comet/models/license_options.rb +1 -1
- data/lib/comet/models/linux_rpm_code_sign_properties.rb +115 -0
- data/lib/comet/models/list_shared_storage_quota_response.rb +98 -0
- data/lib/comet/models/live_user_connection.rb +1 -1
- data/lib/comet/models/local_destination_location.rb +2 -2
- data/lib/comet/models/local_storage_directory.rb +1 -1
- data/lib/comet/models/login_protection_options.rb +1 -1
- data/lib/comet/models/mac_oscode_sign_properties.rb +1 -1
- data/lib/comet/models/mongo_dbconnection.rb +4 -1
- data/lib/comet/models/mssqlconnection.rb +1 -1
- data/lib/comet/models/mssqllogin_args.rb +1 -1
- data/lib/comet/models/my_sqlconnection.rb +1 -1
- data/lib/comet/models/new_bucket_detail.rb +1 -1
- data/lib/comet/models/news_entry.rb +1 -1
- data/lib/comet/models/nfsdestination_location.rb +132 -0
- data/lib/comet/models/ninja_one_auth_callback_response.rb +82 -0
- data/lib/comet/models/ninja_one_config.rb +130 -0
- data/lib/comet/models/ninja_one_organization.rb +91 -0
- data/lib/comet/models/node.rb +80 -0
- data/lib/comet/models/object_lock_storage_template_settings.rb +1 -1
- data/lib/comet/models/office_365connection.rb +1 -1
- data/lib/comet/models/office_365convert_selection_response.rb +102 -0
- data/lib/comet/models/office_365credential.rb +1 -1
- data/lib/comet/models/office_365custom_setting.rb +1 -1
- data/lib/comet/models/office_365custom_setting_v2.rb +23 -1
- data/lib/comet/models/office_365effective_selection.rb +109 -0
- data/lib/comet/models/office_365effective_selection_account.rb +101 -0
- data/lib/comet/models/office_365evaluate_selection_rules_response.rb +95 -0
- data/lib/comet/models/office_365mixed_virtual_account.rb +1 -1
- data/lib/comet/models/office_365object_info.rb +1 -1
- data/lib/comet/models/office_365selection_rule.rb +182 -0
- data/lib/comet/models/office_365service_rule_decision.rb +93 -0
- data/lib/comet/models/oidc_claim.rb +1 -1
- data/lib/comet/models/oidc_config.rb +1 -1
- data/lib/comet/models/organization.rb +1 -1
- data/lib/comet/models/organization_login_urlresponse.rb +1 -1
- data/lib/comet/models/organization_response.rb +1 -1
- data/lib/comet/models/osinfo.rb +1 -1
- data/lib/comet/models/partition.rb +1 -1
- data/lib/comet/models/partition_conflict.rb +1 -1
- data/lib/comet/models/pkcs_11allowed_driver.rb +75 -0
- data/lib/comet/models/pkcs_11allowlist_options.rb +90 -0
- data/lib/comet/models/policy_options.rb +1 -1
- data/lib/comet/models/postgre_sqlconnection.rb +151 -0
- data/lib/comet/models/private_branding_properties.rb +184 -1
- data/lib/comet/models/protected_item_engine_type_policy.rb +1 -1
- data/lib/comet/models/protected_item_with_backup_rules_response.rb +1 -1
- data/lib/comet/models/proxmox_connection.rb +1 -1
- data/lib/comet/models/proxmox_restore_target_options.rb +1 -1
- data/lib/comet/models/psaconfig.rb +26 -1
- data/lib/comet/models/psaconfig_connect_wise.rb +130 -0
- data/lib/comet/models/psagrouped_by.rb +1 -1
- data/lib/comet/models/public_branding_properties.rb +1 -1
- data/lib/comet/models/pvebackup_disk.rb +1 -1
- data/lib/comet/models/pvebackup_node.rb +1 -1
- data/lib/comet/models/pvebackup_vm.rb +1 -1
- data/lib/comet/models/pvedisk.rb +1 -1
- data/lib/comet/models/pveparams.rb +2 -4
- data/lib/comet/models/pvestorage_name.rb +17 -1
- data/lib/comet/models/pvevm.rb +8 -1
- data/lib/comet/models/ratelimit_options.rb +1 -1
- data/lib/comet/models/ratelimit_rule.rb +1 -1
- data/lib/comet/models/register_office_application_begin_response.rb +1 -1
- data/lib/comet/models/register_office_application_check_response.rb +1 -1
- data/lib/comet/models/registration_lobby_connection.rb +1 -1
- data/lib/comet/models/remote_server_address.rb +1 -1
- data/lib/comet/models/remote_storage_option.rb +10 -1
- data/lib/comet/models/replica_server.rb +1 -1
- data/lib/comet/models/replicator_state_apiresponse.rb +1 -1
- data/lib/comet/models/request_storage_vault_response_message.rb +1 -1
- data/lib/comet/models/restore_job_advanced_options.rb +66 -10
- data/lib/comet/models/retention_policy.rb +1 -1
- data/lib/comet/models/retention_range.rb +1 -1
- data/lib/comet/models/s3destination_location.rb +1 -1
- data/lib/comet/models/s3generic_virtual_storage_role.rb +1 -1
- data/lib/comet/models/schedule_config.rb +1 -1
- data/lib/comet/models/search_clause.rb +1 -1
- data/lib/comet/models/search_result_file_info.rb +1 -1
- data/lib/comet/models/search_snapshots_response.rb +1 -1
- data/lib/comet/models/self_backup_event_data.rb +135 -0
- data/lib/comet/models/self_backup_export_options.rb +1 -1
- data/lib/comet/models/self_backup_options.rb +1 -1
- data/lib/comet/models/self_backup_statistics.rb +1 -1
- data/lib/comet/models/self_backup_target.rb +1 -1
- data/lib/comet/models/server_config_options.rb +76 -1
- data/lib/comet/models/server_config_options_and_hash_response.rb +103 -0
- data/lib/comet/models/server_config_options_branding_fragment.rb +1 -1
- data/lib/comet/models/server_config_options_hash_response.rb +95 -0
- data/lib/comet/models/server_config_options_software_build_role_fragment.rb +1 -1
- data/lib/comet/models/server_meta_branding_properties.rb +20 -1
- data/lib/comet/models/server_meta_version_info.rb +1 -1
- data/lib/comet/models/session_key_regenerated_response.rb +1 -1
- data/lib/comet/models/session_options.rb +1 -1
- data/lib/comet/models/set_shared_storage_quota_response.rb +92 -0
- data/lib/comet/models/sftpdestination_location.rb +1 -1
- data/lib/comet/models/shared_storage_quota.rb +94 -0
- data/lib/comet/models/single_field_source.rb +2 -2
- data/lib/comet/models/size_measurement.rb +1 -1
- data/lib/comet/models/smbdestination_location.rb +1 -1
- data/lib/comet/models/smtpoauth_options.rb +154 -0
- data/lib/comet/models/software_build_role_options.rb +1 -1
- data/lib/comet/models/software_update_news_response.rb +1 -1
- data/lib/comet/models/source_basic_info.rb +10 -1
- data/lib/comet/models/source_config.rb +69 -4
- data/lib/comet/models/source_include_pattern.rb +1 -1
- data/lib/comet/models/source_statistics.rb +1 -1
- data/lib/comet/models/spanned_destination_location.rb +1 -1
- data/lib/comet/models/spanned_storage_extra_info.rb +1 -1
- data/lib/comet/models/speed_limit_time_window.rb +114 -0
- data/lib/comet/models/sshconnection.rb +1 -1
- data/lib/comet/models/stat_result.rb +1 -1
- data/lib/comet/models/storage_free_space_info.rb +1 -1
- data/lib/comet/models/storage_role_options.rb +1 -1
- data/lib/comet/models/storage_vault_provider_policy.rb +1 -1
- data/lib/comet/models/stored_object.rb +1 -1
- data/lib/comet/models/storj_destination_location.rb +1 -1
- data/lib/comet/models/storj_virtual_storage_role_setting.rb +1 -1
- data/lib/comet/models/streamable_event.rb +1 -1
- data/lib/comet/models/swift_destination_location.rb +1 -1
- data/lib/comet/models/test_response.rb +1 -1
- data/lib/comet/models/time_span.rb +1 -1
- data/lib/comet/models/totp_regenerated_response.rb +1 -1
- data/lib/comet/models/u2fregister_request.rb +1 -1
- data/lib/comet/models/u2fregistered_key.rb +1 -1
- data/lib/comet/models/u2fregistration_challenge_response.rb +1 -1
- data/lib/comet/models/u2fsign_request.rb +1 -1
- data/lib/comet/models/u2fsign_response.rb +1 -1
- data/lib/comet/models/uninstall_config.rb +1 -1
- data/lib/comet/models/update_campaign_device_status.rb +9 -1
- data/lib/comet/models/update_campaign_options.rb +1 -1
- data/lib/comet/models/update_campaign_properties.rb +1 -1
- data/lib/comet/models/update_campaign_skip_detail.rb +100 -0
- data/lib/comet/models/update_campaign_status.rb +1 -1
- data/lib/comet/models/update_campaign_status_device_entry.rb +9 -1
- data/lib/comet/models/user_custom_email_settings.rb +1 -1
- data/lib/comet/models/user_group.rb +1 -1
- data/lib/comet/models/user_on_server.rb +1 -1
- data/lib/comet/models/user_policy.rb +18 -1
- data/lib/comet/models/user_profile_config.rb +82 -8
- data/lib/comet/models/user_profile_fragment.rb +1 -1
- data/lib/comet/models/user_server_config.rb +1 -1
- data/lib/comet/models/vault_snapshot.rb +1 -1
- data/lib/comet/models/vmdisk_info.rb +1 -1
- data/lib/comet/models/vmdksnapshot_view_options.rb +1 -1
- data/lib/comet/models/vminfo.rb +1 -1
- data/lib/comet/models/vminfo_list.rb +1 -1
- data/lib/comet/models/vmware_connection.rb +1 -1
- data/lib/comet/models/vmware_datacenter_info.rb +1 -1
- data/lib/comet/models/vmware_datastore_info.rb +1 -1
- data/lib/comet/models/vmware_host_info.rb +1 -1
- data/lib/comet/models/vmware_machine_info.rb +1 -1
- data/lib/comet/models/vmware_network_info.rb +1 -1
- data/lib/comet/models/vmware_restore_target_options.rb +1 -1
- data/lib/comet/models/vsphere_connection.rb +1 -1
- data/lib/comet/models/vsscomponent.rb +1 -1
- data/lib/comet/models/vsswriter_info.rb +1 -1
- data/lib/comet/models/wasabi_virtual_storage_role_settings.rb +1 -1
- data/lib/comet/models/web_authn_authenticator_selection.rb +1 -1
- data/lib/comet/models/web_authn_credential.rb +1 -1
- data/lib/comet/models/web_authn_credential_assertion.rb +1 -1
- data/lib/comet/models/web_authn_credential_descriptor.rb +1 -1
- data/lib/comet/models/web_authn_credential_entity.rb +1 -1
- data/lib/comet/models/web_authn_credential_parameter.rb +1 -1
- data/lib/comet/models/web_authn_public_key_credential_creation_options.rb +2 -4
- data/lib/comet/models/web_authn_public_key_credential_request_options.rb +1 -1
- data/lib/comet/models/web_authn_registration_challenge_response.rb +1 -1
- data/lib/comet/models/web_authn_relying_party_entity.rb +1 -1
- data/lib/comet/models/web_authn_sign_request.rb +1 -1
- data/lib/comet/models/web_authn_sign_response.rb +1 -1
- data/lib/comet/models/web_authn_user_entity.rb +1 -1
- data/lib/comet/models/web_dav_destination_location.rb +1 -1
- data/lib/comet/models/web_interface_branding_properties.rb +1 -1
- data/lib/comet/models/webhook_awsoptions.rb +96 -0
- data/lib/comet/models/webhook_option.rb +49 -2
- data/lib/comet/models/win_smbauth.rb +3 -3
- data/lib/comet/models/windows_code_sign_properties.rb +176 -1
- data/lib/comet_backup_ruby_sdk.rb +39 -1
- metadata +43 -23
- data/Gemfile.lock +0 -43
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Copyright (c) 2020-2026 Comet Licensing Ltd.
|
|
4
|
+
# Please see the LICENSE file for usage information.
|
|
5
|
+
#
|
|
6
|
+
# SPDX-License-Identifier: MIT
|
|
7
|
+
|
|
8
|
+
require 'json'
|
|
9
|
+
|
|
10
|
+
module Comet
|
|
11
|
+
|
|
12
|
+
# AdminAccountAPITokenCreateResponse is a typed class wrapper around the underlying Comet Server API data structure.
|
|
13
|
+
class AdminAccountAPITokenCreateResponse
|
|
14
|
+
|
|
15
|
+
# If the operation was successful, the status will be in the 200-299 range.
|
|
16
|
+
# @type [Number] status
|
|
17
|
+
attr_accessor :status
|
|
18
|
+
|
|
19
|
+
# @type [String] message
|
|
20
|
+
attr_accessor :message
|
|
21
|
+
|
|
22
|
+
# @type [Comet::AdminAPITokenInfo] token_info
|
|
23
|
+
attr_accessor :token_info
|
|
24
|
+
|
|
25
|
+
# The full token value, e.g. "bkup_...". This is the only time it is ever returned by the server;
|
|
26
|
+
# store it securely.
|
|
27
|
+
# @type [String] plaintext_token
|
|
28
|
+
attr_accessor :plaintext_token
|
|
29
|
+
|
|
30
|
+
# @type [Hash] Hidden storage to preserve future properties for non-destructive roundtrip operations
|
|
31
|
+
attr_accessor :unknown_json_fields
|
|
32
|
+
|
|
33
|
+
def initialize
|
|
34
|
+
clear
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
def clear
|
|
38
|
+
@status = 0
|
|
39
|
+
@message = ''
|
|
40
|
+
@token_info = Comet::AdminAPITokenInfo.new
|
|
41
|
+
@plaintext_token = ''
|
|
42
|
+
@unknown_json_fields = {}
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# @param [String] json_string The complete object in JSON format
|
|
46
|
+
def from_json(json_string)
|
|
47
|
+
raise TypeError, "'json_string' expected String, got #{json_string.class}" unless json_string.is_a? String
|
|
48
|
+
|
|
49
|
+
from_hash(JSON.parse(json_string))
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# @param [Hash] obj The complete object as a Ruby hash
|
|
53
|
+
def from_hash(obj)
|
|
54
|
+
raise TypeError, "'obj' expected Hash, got #{obj.class}" unless obj.is_a? Hash
|
|
55
|
+
|
|
56
|
+
obj.each do |k, v|
|
|
57
|
+
case k
|
|
58
|
+
when 'Status'
|
|
59
|
+
raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
|
|
60
|
+
|
|
61
|
+
@status = v
|
|
62
|
+
when 'Message'
|
|
63
|
+
raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
|
|
64
|
+
|
|
65
|
+
@message = v
|
|
66
|
+
when 'TokenInfo'
|
|
67
|
+
@token_info = Comet::AdminAPITokenInfo.new
|
|
68
|
+
@token_info.from_hash(v)
|
|
69
|
+
when 'PlaintextToken'
|
|
70
|
+
raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
|
|
71
|
+
|
|
72
|
+
@plaintext_token = v
|
|
73
|
+
else
|
|
74
|
+
@unknown_json_fields[k] = v
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# @return [Hash] The complete object as a Ruby hash
|
|
80
|
+
def to_hash
|
|
81
|
+
ret = {}
|
|
82
|
+
ret['Status'] = @status
|
|
83
|
+
ret['Message'] = @message
|
|
84
|
+
ret['TokenInfo'] = @token_info
|
|
85
|
+
ret['PlaintextToken'] = @plaintext_token
|
|
86
|
+
@unknown_json_fields.each do |k, v|
|
|
87
|
+
ret[k] = v
|
|
88
|
+
end
|
|
89
|
+
ret
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
# @return [Hash] The complete object as a Ruby hash
|
|
93
|
+
def to_h
|
|
94
|
+
to_hash
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# @return [String] The complete object as a JSON string
|
|
98
|
+
def to_json(options = {})
|
|
99
|
+
to_hash.to_json(options)
|
|
100
|
+
end
|
|
101
|
+
end
|
|
102
|
+
end
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Copyright (c) 2020-2026 Comet Licensing Ltd.
|
|
4
|
+
# Please see the LICENSE file for usage information.
|
|
5
|
+
#
|
|
6
|
+
# SPDX-License-Identifier: MIT
|
|
7
|
+
|
|
8
|
+
require 'json'
|
|
9
|
+
|
|
10
|
+
module Comet
|
|
11
|
+
|
|
12
|
+
# AdminAccountAPITokenListResponse is a typed class wrapper around the underlying Comet Server API data structure.
|
|
13
|
+
class AdminAccountAPITokenListResponse
|
|
14
|
+
|
|
15
|
+
# If the operation was successful, the status will be in the 200-299 range.
|
|
16
|
+
# @type [Number] status
|
|
17
|
+
attr_accessor :status
|
|
18
|
+
|
|
19
|
+
# @type [String] message
|
|
20
|
+
attr_accessor :message
|
|
21
|
+
|
|
22
|
+
# @type [Array<Comet::AdminAPITokenInfo>] tokens
|
|
23
|
+
attr_accessor :tokens
|
|
24
|
+
|
|
25
|
+
# @type [Hash] Hidden storage to preserve future properties for non-destructive roundtrip operations
|
|
26
|
+
attr_accessor :unknown_json_fields
|
|
27
|
+
|
|
28
|
+
def initialize
|
|
29
|
+
clear
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def clear
|
|
33
|
+
@status = 0
|
|
34
|
+
@message = ''
|
|
35
|
+
@tokens = []
|
|
36
|
+
@unknown_json_fields = {}
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# @param [String] json_string The complete object in JSON format
|
|
40
|
+
def from_json(json_string)
|
|
41
|
+
raise TypeError, "'json_string' expected String, got #{json_string.class}" unless json_string.is_a? String
|
|
42
|
+
|
|
43
|
+
from_hash(JSON.parse(json_string))
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# @param [Hash] obj The complete object as a Ruby hash
|
|
47
|
+
def from_hash(obj)
|
|
48
|
+
raise TypeError, "'obj' expected Hash, got #{obj.class}" unless obj.is_a? Hash
|
|
49
|
+
|
|
50
|
+
obj.each do |k, v|
|
|
51
|
+
case k
|
|
52
|
+
when 'Status'
|
|
53
|
+
raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
|
|
54
|
+
|
|
55
|
+
@status = v
|
|
56
|
+
when 'Message'
|
|
57
|
+
raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
|
|
58
|
+
|
|
59
|
+
@message = v
|
|
60
|
+
when 'Tokens'
|
|
61
|
+
if v.nil?
|
|
62
|
+
@tokens = []
|
|
63
|
+
else
|
|
64
|
+
@tokens = Array.new(v.length)
|
|
65
|
+
v.each_with_index do |v1, i1|
|
|
66
|
+
@tokens[i1] = Comet::AdminAPITokenInfo.new
|
|
67
|
+
@tokens[i1].from_hash(v1)
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
else
|
|
71
|
+
@unknown_json_fields[k] = v
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# @return [Hash] The complete object as a Ruby hash
|
|
77
|
+
def to_hash
|
|
78
|
+
ret = {}
|
|
79
|
+
ret['Status'] = @status
|
|
80
|
+
ret['Message'] = @message
|
|
81
|
+
ret['Tokens'] = @tokens
|
|
82
|
+
@unknown_json_fields.each do |k, v|
|
|
83
|
+
ret[k] = v
|
|
84
|
+
end
|
|
85
|
+
ret
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# @return [Hash] The complete object as a Ruby hash
|
|
89
|
+
def to_h
|
|
90
|
+
to_hash
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# @return [String] The complete object as a JSON string
|
|
94
|
+
def to_json(options = {})
|
|
95
|
+
to_hash.to_json(options)
|
|
96
|
+
end
|
|
97
|
+
end
|
|
98
|
+
end
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Copyright (c) 2020-
|
|
3
|
+
# Copyright (c) 2020-2026 Comet Licensing Ltd.
|
|
4
4
|
# Please see the LICENSE file for usage information.
|
|
5
5
|
#
|
|
6
6
|
# SPDX-License-Identifier: MIT
|
|
@@ -22,6 +22,31 @@ module Comet
|
|
|
22
22
|
# @type [Comet::AdminSecurityOptions] security
|
|
23
23
|
attr_accessor :security
|
|
24
24
|
|
|
25
|
+
# True if this server and this admin account permit creating personal API tokens
|
|
26
|
+
# This field is available in Comet 26.8.4 and later.
|
|
27
|
+
# @type [Boolean] allow_apitokens
|
|
28
|
+
attr_accessor :allow_apitokens
|
|
29
|
+
|
|
30
|
+
# True if AdminAccountAPITokenCreate requires the account's current password to be re-supplied. This
|
|
31
|
+
# is the case whenever the caller is not already authenticating with a password, unless the account
|
|
32
|
+
# is managed by an external authentication source and so has no local password to confirm.
|
|
33
|
+
# This field is available in Comet 26.8.4 and later.
|
|
34
|
+
# @type [Boolean] apitoken_create_requires_password
|
|
35
|
+
attr_accessor :apitoken_create_requires_password
|
|
36
|
+
|
|
37
|
+
# True if this account logs in via an external OpenID Connect identity provider (single sign-on).
|
|
38
|
+
# The identity provider may enforce its own multi-factor authentication.
|
|
39
|
+
# This field is available in Comet 26.11.2 and later.
|
|
40
|
+
# @type [Boolean] external_source_is_oidc
|
|
41
|
+
attr_accessor :external_source_is_oidc
|
|
42
|
+
|
|
43
|
+
# True if this account logs in via an external authentication source that is configured to skip
|
|
44
|
+
# Comet multi-factor authentication. In that case, the account's TOTP and WebAuthn settings are not
|
|
45
|
+
# enforced at login.
|
|
46
|
+
# This field is available in Comet 26.11.2 and later.
|
|
47
|
+
# @type [Boolean] external_source_skips_mfa
|
|
48
|
+
attr_accessor :external_source_skips_mfa
|
|
49
|
+
|
|
25
50
|
# @type [Hash] Hidden storage to preserve future properties for non-destructive roundtrip operations
|
|
26
51
|
attr_accessor :unknown_json_fields
|
|
27
52
|
|
|
@@ -59,6 +84,14 @@ module Comet
|
|
|
59
84
|
when 'Security'
|
|
60
85
|
@security = Comet::AdminSecurityOptions.new
|
|
61
86
|
@security.from_hash(v)
|
|
87
|
+
when 'AllowAPITokens'
|
|
88
|
+
@allow_apitokens = v
|
|
89
|
+
when 'APITokenCreateRequiresPassword'
|
|
90
|
+
@apitoken_create_requires_password = v
|
|
91
|
+
when 'ExternalSourceIsOIDC'
|
|
92
|
+
@external_source_is_oidc = v
|
|
93
|
+
when 'ExternalSourceSkipsMFA'
|
|
94
|
+
@external_source_skips_mfa = v
|
|
62
95
|
else
|
|
63
96
|
@unknown_json_fields[k] = v
|
|
64
97
|
end
|
|
@@ -71,6 +104,10 @@ module Comet
|
|
|
71
104
|
ret['OrganizationID'] = @organization_id
|
|
72
105
|
ret['Permissions'] = @permissions
|
|
73
106
|
ret['Security'] = @security
|
|
107
|
+
ret['AllowAPITokens'] = @allow_apitokens
|
|
108
|
+
ret['APITokenCreateRequiresPassword'] = @apitoken_create_requires_password
|
|
109
|
+
ret['ExternalSourceIsOIDC'] = @external_source_is_oidc
|
|
110
|
+
ret['ExternalSourceSkipsMFA'] = @external_source_skips_mfa
|
|
74
111
|
@unknown_json_fields.each do |k, v|
|
|
75
112
|
ret[k] = v
|
|
76
113
|
end
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Copyright (c) 2020-2026 Comet Licensing Ltd.
|
|
4
|
+
# Please see the LICENSE file for usage information.
|
|
5
|
+
#
|
|
6
|
+
# SPDX-License-Identifier: MIT
|
|
7
|
+
|
|
8
|
+
require 'json'
|
|
9
|
+
|
|
10
|
+
module Comet
|
|
11
|
+
|
|
12
|
+
# AdminAPIToken is a typed class wrapper around the underlying Comet Server API data structure.
|
|
13
|
+
# This type is available in Comet 26.8.4 and later.
|
|
14
|
+
class AdminAPIToken
|
|
15
|
+
|
|
16
|
+
# Random identifier embedded in the plaintext token, used to locate this record during
|
|
17
|
+
# authentication
|
|
18
|
+
# @type [String] token_id
|
|
19
|
+
attr_accessor :token_id
|
|
20
|
+
|
|
21
|
+
# Human-readable label chosen at creation time
|
|
22
|
+
# @type [String] description
|
|
23
|
+
attr_accessor :description
|
|
24
|
+
|
|
25
|
+
# Unix timestamp, in seconds
|
|
26
|
+
# @type [Number] created_time
|
|
27
|
+
attr_accessor :created_time
|
|
28
|
+
|
|
29
|
+
# Unix timestamp, in seconds. Zero means the token never expires
|
|
30
|
+
# @type [Number] expire_time
|
|
31
|
+
attr_accessor :expire_time
|
|
32
|
+
|
|
33
|
+
# Unix timestamp, in seconds. Persisted at most once per hour
|
|
34
|
+
# @type [Number] last_used_time
|
|
35
|
+
attr_accessor :last_used_time
|
|
36
|
+
|
|
37
|
+
# One of the PASSWORD_FORMAT_ constants
|
|
38
|
+
# @type [Number] secret_format
|
|
39
|
+
attr_accessor :secret_format
|
|
40
|
+
|
|
41
|
+
# @type [String] secret_hash
|
|
42
|
+
attr_accessor :secret_hash
|
|
43
|
+
|
|
44
|
+
# @type [Hash] Hidden storage to preserve future properties for non-destructive roundtrip operations
|
|
45
|
+
attr_accessor :unknown_json_fields
|
|
46
|
+
|
|
47
|
+
def initialize
|
|
48
|
+
clear
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def clear
|
|
52
|
+
@token_id = ''
|
|
53
|
+
@description = ''
|
|
54
|
+
@created_time = 0
|
|
55
|
+
@expire_time = 0
|
|
56
|
+
@last_used_time = 0
|
|
57
|
+
@secret_format = 0
|
|
58
|
+
@secret_hash = ''
|
|
59
|
+
@unknown_json_fields = {}
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# @param [String] json_string The complete object in JSON format
|
|
63
|
+
def from_json(json_string)
|
|
64
|
+
raise TypeError, "'json_string' expected String, got #{json_string.class}" unless json_string.is_a? String
|
|
65
|
+
|
|
66
|
+
from_hash(JSON.parse(json_string))
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# @param [Hash] obj The complete object as a Ruby hash
|
|
70
|
+
def from_hash(obj)
|
|
71
|
+
raise TypeError, "'obj' expected Hash, got #{obj.class}" unless obj.is_a? Hash
|
|
72
|
+
|
|
73
|
+
obj.each do |k, v|
|
|
74
|
+
case k
|
|
75
|
+
when 'TokenID'
|
|
76
|
+
raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
|
|
77
|
+
|
|
78
|
+
@token_id = v
|
|
79
|
+
when 'Description'
|
|
80
|
+
raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
|
|
81
|
+
|
|
82
|
+
@description = v
|
|
83
|
+
when 'CreatedTime'
|
|
84
|
+
raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
|
|
85
|
+
|
|
86
|
+
@created_time = v
|
|
87
|
+
when 'ExpireTime'
|
|
88
|
+
raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
|
|
89
|
+
|
|
90
|
+
@expire_time = v
|
|
91
|
+
when 'LastUsedTime'
|
|
92
|
+
raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
|
|
93
|
+
|
|
94
|
+
@last_used_time = v
|
|
95
|
+
when 'SecretFormat'
|
|
96
|
+
raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
|
|
97
|
+
|
|
98
|
+
@secret_format = v
|
|
99
|
+
when 'SecretHash'
|
|
100
|
+
raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
|
|
101
|
+
|
|
102
|
+
@secret_hash = v
|
|
103
|
+
else
|
|
104
|
+
@unknown_json_fields[k] = v
|
|
105
|
+
end
|
|
106
|
+
end
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# @return [Hash] The complete object as a Ruby hash
|
|
110
|
+
def to_hash
|
|
111
|
+
ret = {}
|
|
112
|
+
ret['TokenID'] = @token_id
|
|
113
|
+
ret['Description'] = @description
|
|
114
|
+
ret['CreatedTime'] = @created_time
|
|
115
|
+
unless @expire_time.nil?
|
|
116
|
+
ret['ExpireTime'] = @expire_time
|
|
117
|
+
end
|
|
118
|
+
unless @last_used_time.nil?
|
|
119
|
+
ret['LastUsedTime'] = @last_used_time
|
|
120
|
+
end
|
|
121
|
+
ret['SecretFormat'] = @secret_format
|
|
122
|
+
ret['SecretHash'] = @secret_hash
|
|
123
|
+
@unknown_json_fields.each do |k, v|
|
|
124
|
+
ret[k] = v
|
|
125
|
+
end
|
|
126
|
+
ret
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
# @return [Hash] The complete object as a Ruby hash
|
|
130
|
+
def to_h
|
|
131
|
+
to_hash
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
# @return [String] The complete object as a JSON string
|
|
135
|
+
def to_json(options = {})
|
|
136
|
+
to_hash.to_json(options)
|
|
137
|
+
end
|
|
138
|
+
end
|
|
139
|
+
end
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Copyright (c) 2020-2026 Comet Licensing Ltd.
|
|
4
|
+
# Please see the LICENSE file for usage information.
|
|
5
|
+
#
|
|
6
|
+
# SPDX-License-Identifier: MIT
|
|
7
|
+
|
|
8
|
+
require 'json'
|
|
9
|
+
|
|
10
|
+
module Comet
|
|
11
|
+
|
|
12
|
+
# AdminAPITokenInfo is a typed class wrapper around the underlying Comet Server API data structure.
|
|
13
|
+
class AdminAPITokenInfo
|
|
14
|
+
|
|
15
|
+
# @type [String] token_id
|
|
16
|
+
attr_accessor :token_id
|
|
17
|
+
|
|
18
|
+
# @type [String] description
|
|
19
|
+
attr_accessor :description
|
|
20
|
+
|
|
21
|
+
# Unix timestamp, in seconds
|
|
22
|
+
# @type [Number] created_time
|
|
23
|
+
attr_accessor :created_time
|
|
24
|
+
|
|
25
|
+
# Unix timestamp, in seconds. Zero means the token never expires
|
|
26
|
+
# @type [Number] expire_time
|
|
27
|
+
attr_accessor :expire_time
|
|
28
|
+
|
|
29
|
+
# Unix timestamp, in seconds. Zero if never used. Persisted at most once per hour, so it may be up
|
|
30
|
+
# to an hour stale after a server restart
|
|
31
|
+
# @type [Number] last_used_time
|
|
32
|
+
attr_accessor :last_used_time
|
|
33
|
+
|
|
34
|
+
# @type [Hash] Hidden storage to preserve future properties for non-destructive roundtrip operations
|
|
35
|
+
attr_accessor :unknown_json_fields
|
|
36
|
+
|
|
37
|
+
def initialize
|
|
38
|
+
clear
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def clear
|
|
42
|
+
@token_id = ''
|
|
43
|
+
@description = ''
|
|
44
|
+
@created_time = 0
|
|
45
|
+
@expire_time = 0
|
|
46
|
+
@last_used_time = 0
|
|
47
|
+
@unknown_json_fields = {}
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# @param [String] json_string The complete object in JSON format
|
|
51
|
+
def from_json(json_string)
|
|
52
|
+
raise TypeError, "'json_string' expected String, got #{json_string.class}" unless json_string.is_a? String
|
|
53
|
+
|
|
54
|
+
from_hash(JSON.parse(json_string))
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# @param [Hash] obj The complete object as a Ruby hash
|
|
58
|
+
def from_hash(obj)
|
|
59
|
+
raise TypeError, "'obj' expected Hash, got #{obj.class}" unless obj.is_a? Hash
|
|
60
|
+
|
|
61
|
+
obj.each do |k, v|
|
|
62
|
+
case k
|
|
63
|
+
when 'TokenID'
|
|
64
|
+
raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
|
|
65
|
+
|
|
66
|
+
@token_id = v
|
|
67
|
+
when 'Description'
|
|
68
|
+
raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
|
|
69
|
+
|
|
70
|
+
@description = v
|
|
71
|
+
when 'CreatedTime'
|
|
72
|
+
raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
|
|
73
|
+
|
|
74
|
+
@created_time = v
|
|
75
|
+
when 'ExpireTime'
|
|
76
|
+
raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
|
|
77
|
+
|
|
78
|
+
@expire_time = v
|
|
79
|
+
when 'LastUsedTime'
|
|
80
|
+
raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
|
|
81
|
+
|
|
82
|
+
@last_used_time = v
|
|
83
|
+
else
|
|
84
|
+
@unknown_json_fields[k] = v
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
# @return [Hash] The complete object as a Ruby hash
|
|
90
|
+
def to_hash
|
|
91
|
+
ret = {}
|
|
92
|
+
ret['TokenID'] = @token_id
|
|
93
|
+
ret['Description'] = @description
|
|
94
|
+
ret['CreatedTime'] = @created_time
|
|
95
|
+
unless @expire_time.nil?
|
|
96
|
+
ret['ExpireTime'] = @expire_time
|
|
97
|
+
end
|
|
98
|
+
unless @last_used_time.nil?
|
|
99
|
+
ret['LastUsedTime'] = @last_used_time
|
|
100
|
+
end
|
|
101
|
+
@unknown_json_fields.each do |k, v|
|
|
102
|
+
ret[k] = v
|
|
103
|
+
end
|
|
104
|
+
ret
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
# @return [Hash] The complete object as a Ruby hash
|
|
108
|
+
def to_h
|
|
109
|
+
to_hash
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
# @return [String] The complete object as a JSON string
|
|
113
|
+
def to_json(options = {})
|
|
114
|
+
to_hash.to_json(options)
|
|
115
|
+
end
|
|
116
|
+
end
|
|
117
|
+
end
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Copyright (c) 2020-
|
|
3
|
+
# Copyright (c) 2020-2026 Comet Licensing Ltd.
|
|
4
4
|
# Please see the LICENSE file for usage information.
|
|
5
5
|
#
|
|
6
6
|
# SPDX-License-Identifier: MIT
|
|
@@ -79,6 +79,15 @@ module Comet
|
|
|
79
79
|
# @type [Boolean] deny_software_build_role
|
|
80
80
|
attr_accessor :deny_software_build_role
|
|
81
81
|
|
|
82
|
+
# This field is available in Comet 26.8.2 and later.
|
|
83
|
+
# @type [Boolean] prevent_write_actions
|
|
84
|
+
attr_accessor :prevent_write_actions
|
|
85
|
+
|
|
86
|
+
# If true, this admin cannot create personal API tokens or authenticate using existing ones
|
|
87
|
+
# This field is available in Comet 26.8.4 and later.
|
|
88
|
+
# @type [Boolean] prevent_apitokens
|
|
89
|
+
attr_accessor :prevent_apitokens
|
|
90
|
+
|
|
82
91
|
# @type [Hash] Hidden storage to preserve future properties for non-destructive roundtrip operations
|
|
83
92
|
attr_accessor :unknown_json_fields
|
|
84
93
|
|
|
@@ -161,6 +170,10 @@ module Comet
|
|
|
161
170
|
end
|
|
162
171
|
when 'DenySoftwareBuildRole'
|
|
163
172
|
@deny_software_build_role = v
|
|
173
|
+
when 'PreventWriteActions'
|
|
174
|
+
@prevent_write_actions = v
|
|
175
|
+
when 'PreventAPITokens'
|
|
176
|
+
@prevent_apitokens = v
|
|
164
177
|
else
|
|
165
178
|
@unknown_json_fields[k] = v
|
|
166
179
|
end
|
|
@@ -227,6 +240,12 @@ module Comet
|
|
|
227
240
|
unless @deny_software_build_role.nil?
|
|
228
241
|
ret['DenySoftwareBuildRole'] = @deny_software_build_role
|
|
229
242
|
end
|
|
243
|
+
unless @prevent_write_actions.nil?
|
|
244
|
+
ret['PreventWriteActions'] = @prevent_write_actions
|
|
245
|
+
end
|
|
246
|
+
unless @prevent_apitokens.nil?
|
|
247
|
+
ret['PreventAPITokens'] = @prevent_apitokens
|
|
248
|
+
end
|
|
230
249
|
@unknown_json_fields.each do |k, v|
|
|
231
250
|
ret[k] = v
|
|
232
251
|
end
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Copyright (c) 2020-
|
|
3
|
+
# Copyright (c) 2020-2026 Comet Licensing Ltd.
|
|
4
4
|
# Please see the LICENSE file for usage information.
|
|
5
5
|
#
|
|
6
6
|
# SPDX-License-Identifier: MIT
|
|
@@ -67,6 +67,10 @@ module Comet
|
|
|
67
67
|
# @type [Comet::AdminUserPermissions] permissions
|
|
68
68
|
attr_accessor :permissions
|
|
69
69
|
|
|
70
|
+
# This field is available in Comet 26.8.4 and later.
|
|
71
|
+
# @type [Array<Comet::AdminAPIToken>] apitokens
|
|
72
|
+
attr_accessor :apitokens
|
|
73
|
+
|
|
70
74
|
# @type [Hash] Hidden storage to preserve future properties for non-destructive roundtrip operations
|
|
71
75
|
attr_accessor :unknown_json_fields
|
|
72
76
|
|
|
@@ -86,6 +90,7 @@ module Comet
|
|
|
86
90
|
@totpkey = ''
|
|
87
91
|
@ipwhitelist = ''
|
|
88
92
|
@permissions = Comet::AdminUserPermissions.new
|
|
93
|
+
@apitokens = []
|
|
89
94
|
@unknown_json_fields = {}
|
|
90
95
|
end
|
|
91
96
|
|
|
@@ -167,6 +172,16 @@ module Comet
|
|
|
167
172
|
when 'Permissions'
|
|
168
173
|
@permissions = Comet::AdminUserPermissions.new
|
|
169
174
|
@permissions.from_hash(v)
|
|
175
|
+
when 'APITokens'
|
|
176
|
+
if v.nil?
|
|
177
|
+
@apitokens = []
|
|
178
|
+
else
|
|
179
|
+
@apitokens = Array.new(v.length)
|
|
180
|
+
v.each_with_index do |v1, i1|
|
|
181
|
+
@apitokens[i1] = Comet::AdminAPIToken.new
|
|
182
|
+
@apitokens[i1].from_hash(v1)
|
|
183
|
+
end
|
|
184
|
+
end
|
|
170
185
|
else
|
|
171
186
|
@unknown_json_fields[k] = v
|
|
172
187
|
end
|
|
@@ -204,6 +219,9 @@ module Comet
|
|
|
204
219
|
ret['IPWhitelist'] = @ipwhitelist
|
|
205
220
|
end
|
|
206
221
|
ret['Permissions'] = @permissions
|
|
222
|
+
unless @apitokens.nil?
|
|
223
|
+
ret['APITokens'] = @apitokens
|
|
224
|
+
end
|
|
207
225
|
@unknown_json_fields.each do |k, v|
|
|
208
226
|
ret[k] = v
|
|
209
227
|
end
|