harbor2_client 0.1.0 → 2.3.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +241 -13
- data/build_scripts/generate.sh +8 -0
- data/build_scripts/swagger-codegen-cli-ruby-config.json +12 -0
- data/docs/Access.md +10 -0
- data/docs/ArtifactApi.md +76 -2
- data/docs/AuditlogApi.md +3 -1
- data/docs/AuthproxySetting.md +12 -0
- data/docs/Body.md +8 -0
- data/docs/Body1.md +8 -0
- data/docs/BoolConfigItem.md +9 -0
- data/docs/ChartMetadata.md +18 -0
- data/docs/ChartVersion.md +23 -0
- data/docs/ComponentHealthStatus.md +10 -0
- data/docs/Configurations.md +62 -0
- data/docs/ConfigurationsResponse.md +60 -0
- data/docs/ConfigurationsResponseScanAllPolicy.md +9 -0
- data/docs/ConfigurationsResponseScanAllPolicyParameter.md +8 -0
- data/docs/ConfigureApi.md +175 -0
- data/docs/Endpoint.md +9 -0
- data/docs/EventType.md +7 -0
- data/docs/FilterStyle.md +10 -0
- data/docs/GCHistory.md +16 -0
- data/docs/GcApi.md +356 -0
- data/docs/GeneralInfo.md +20 -0
- data/docs/HealthApi.md +63 -0
- data/docs/ImmutableApi.md +261 -0
- data/docs/ImmutableRule.md +15 -0
- data/docs/ImmutableSelector.md +11 -0
- data/docs/IntegerConfigItem.md +9 -0
- data/docs/InternalConfigurationsResponse.md +7 -0
- data/docs/IsDefault.md +8 -0
- data/docs/LabelApi.md +309 -0
- data/docs/LdapApi.md +238 -0
- data/docs/LdapConf.md +16 -0
- data/docs/LdapFailedImportUser.md +9 -0
- data/docs/LdapImportUsers.md +8 -0
- data/docs/LdapPingResult.md +9 -0
- data/docs/LdapUser.md +10 -0
- data/docs/MemberApi.md +322 -0
- data/docs/NativeReportSummary.md +1 -0
- data/docs/NotifyType.md +7 -0
- data/docs/OIDCCliSecretReq.md +8 -0
- data/docs/OIDCUserInfo.md +13 -0
- data/docs/OidcApi.md +65 -0
- data/docs/OverallHealthStatus.md +9 -0
- data/docs/PasswordReq.md +9 -0
- data/docs/Permission.md +9 -0
- data/docs/PingApi.md +63 -0
- data/docs/PreheatApi.md +12 -4
- data/docs/ProjectApi.md +237 -27
- data/docs/ProjectMember.md +10 -0
- data/docs/ProjectMemberEntity.md +14 -0
- data/docs/ProjectMetadataApi.md +318 -0
- data/docs/ProjectScanner.md +8 -0
- data/docs/Quota.md +13 -0
- data/docs/QuotaApi.md +191 -0
- data/docs/QuotaRefObject.md +7 -0
- data/docs/QuotaUpdateReq.md +8 -0
- data/docs/Registry.md +2 -2
- data/docs/RegistryApi.md +530 -0
- data/docs/RegistryEndpoint.md +9 -0
- data/docs/RegistryInfo.md +11 -0
- data/docs/RegistryPing.md +14 -0
- data/docs/RegistryProviderCredentialPattern.md +11 -0
- data/docs/RegistryProviderEndpointPattern.md +9 -0
- data/docs/RegistryProviderInfo.md +9 -0
- data/docs/RegistryUpdate.md +14 -0
- data/docs/ReplicationApi.md +673 -0
- data/docs/ReplicationExecution.md +19 -0
- data/docs/ReplicationFilter.md +9 -0
- data/docs/ReplicationPolicy.md +22 -0
- data/docs/ReplicationTask.md +17 -0
- data/docs/ReplicationTrigger.md +9 -0
- data/docs/ReplicationTriggerSettings.md +8 -0
- data/docs/RepositoryApi.md +66 -1
- data/docs/RetentionApi.md +609 -0
- data/docs/RetentionExecution.md +14 -0
- data/docs/RetentionExecutionTask.md +18 -0
- data/docs/RetentionMetadata.md +10 -0
- data/docs/RetentionPolicy.md +12 -0
- data/docs/RetentionPolicyScope.md +9 -0
- data/docs/RetentionRule.md +15 -0
- data/docs/RetentionRuleMetadata.md +11 -0
- data/docs/RetentionRuleParamMetadata.md +10 -0
- data/docs/RetentionRuleTrigger.md +10 -0
- data/docs/RetentionSelector.md +11 -0
- data/docs/RetentionSelectorMetadata.md +10 -0
- data/docs/Robot.md +19 -0
- data/docs/RobotApi.md +365 -0
- data/docs/RobotCreate.md +14 -0
- data/docs/RobotCreateV1.md +11 -0
- data/docs/RobotCreated.md +12 -0
- data/docs/RobotPermission.md +10 -0
- data/docs/RobotSec.md +8 -0
- data/docs/Robotv1Api.md +329 -0
- data/docs/RoleRequest.md +8 -0
- data/docs/ScanAllApi.md +287 -0
- data/docs/Scanner.md +10 -0
- data/docs/ScannerAdapterMetadata.md +10 -0
- data/docs/ScannerApi.md +479 -0
- data/docs/ScannerCapability.md +9 -0
- data/docs/ScannerRegistration.md +23 -0
- data/docs/ScannerRegistrationReq.md +15 -0
- data/docs/ScannerRegistrationSettings.md +11 -0
- data/docs/Schedule.md +13 -0
- data/docs/ScheduleObj.md +9 -0
- data/docs/Search.md +10 -0
- data/docs/SearchApi.md +66 -0
- data/docs/SearchRepository.md +13 -0
- data/docs/SearchResult.md +10 -0
- data/docs/StartReplicationExecution.md +8 -0
- data/docs/Statistic.md +14 -0
- data/docs/StatisticApi.md +63 -0
- data/docs/Stats.md +12 -0
- data/docs/Storage.md +9 -0
- data/docs/StringConfigItem.md +9 -0
- data/docs/SupportedWebhookEventTypes.md +9 -0
- data/docs/SystemCVEAllowlistApi.md +119 -0
- data/docs/SystemInfo.md +8 -0
- data/docs/SysteminfoApi.md +173 -0
- data/docs/UserApi.md +647 -0
- data/docs/UserCreationReq.md +12 -0
- data/docs/UserEntity.md +9 -0
- data/docs/UserGroup.md +11 -0
- data/docs/UserProfile.md +10 -0
- data/docs/UserResp.md +17 -0
- data/docs/UserSearch.md +9 -0
- data/docs/UserSearchRespItem.md +9 -0
- data/docs/UserSysAdminFlag.md +8 -0
- data/docs/UsergroupApi.md +293 -0
- data/docs/WebhookApi.md +448 -0
- data/docs/WebhookJob.md +15 -0
- data/docs/WebhookLastTrigger.md +12 -0
- data/docs/WebhookPolicy.md +17 -0
- data/docs/WebhookTargetObject.md +11 -0
- data/docs/WebhookjobApi.md +81 -0
- data/git_push.sh +3 -3
- data/harbor2_client.gemspec +7 -7
- data/lib/harbor2_client/api/artifact_api.rb +91 -3
- data/lib/harbor2_client/api/auditlog_api.rb +4 -1
- data/lib/harbor2_client/api/configure_api.rb +193 -0
- data/lib/harbor2_client/api/gc_api.rb +391 -0
- data/lib/harbor2_client/api/health_api.rb +78 -0
- data/lib/harbor2_client/api/icon_api.rb +1 -1
- data/lib/harbor2_client/api/immutable_api.rb +312 -0
- data/lib/harbor2_client/api/label_api.rb +350 -0
- data/lib/harbor2_client/api/ldap_api.rb +259 -0
- data/lib/harbor2_client/api/member_api.rb +373 -0
- data/lib/harbor2_client/api/oidc_api.rb +83 -0
- data/lib/harbor2_client/api/ping_api.rb +78 -0
- data/lib/harbor2_client/api/preheat_api.rb +13 -1
- data/lib/harbor2_client/api/project_api.rb +289 -46
- data/lib/harbor2_client/api/project_metadata_api.rb +362 -0
- data/lib/harbor2_client/api/quota_api.rb +224 -0
- data/lib/harbor2_client/api/registry_api.rb +575 -0
- data/lib/harbor2_client/api/replication_api.rb +749 -0
- data/lib/harbor2_client/api/repository_api.rb +75 -1
- data/lib/harbor2_client/api/retention_api.rb +676 -0
- data/lib/harbor2_client/api/robot_api.rb +409 -0
- data/lib/harbor2_client/api/robotv1_api.rb +387 -0
- data/lib/harbor2_client/api/scan_all_api.rb +308 -0
- data/lib/harbor2_client/api/scan_api.rb +1 -1
- data/lib/harbor2_client/api/scanner_api.rb +529 -0
- data/lib/harbor2_client/api/search_api.rb +85 -0
- data/lib/harbor2_client/api/statistic_api.rb +78 -0
- data/lib/harbor2_client/api/system_cve_allowlist_api.rb +134 -0
- data/lib/harbor2_client/api/systeminfo_api.rb +188 -0
- data/lib/harbor2_client/api/user_api.rb +715 -0
- data/lib/harbor2_client/api/usergroup_api.rb +317 -0
- data/lib/harbor2_client/api/webhook_api.rb +514 -0
- data/lib/harbor2_client/api/webhookjob_api.rb +113 -0
- data/lib/harbor2_client/api_client.rb +2 -2
- data/lib/harbor2_client/api_error.rb +1 -1
- data/lib/harbor2_client/configuration.rb +1 -1
- data/lib/harbor2_client/models/access.rb +205 -0
- data/lib/harbor2_client/models/addition_link.rb +1 -1
- data/lib/harbor2_client/models/addition_links.rb +1 -1
- data/lib/harbor2_client/models/annotations.rb +1 -1
- data/lib/harbor2_client/models/artifact.rb +1 -1
- data/lib/harbor2_client/models/audit_log.rb +1 -1
- data/lib/harbor2_client/models/authproxy_setting.rb +225 -0
- data/lib/harbor2_client/models/body.rb +184 -0
- data/lib/harbor2_client/models/body_1.rb +184 -0
- data/lib/harbor2_client/models/bool_config_item.rb +195 -0
- data/lib/harbor2_client/models/chart_metadata.rb +320 -0
- data/lib/harbor2_client/models/chart_version.rb +374 -0
- data/lib/harbor2_client/models/component_health_status.rb +206 -0
- data/lib/harbor2_client/models/configurations.rb +725 -0
- data/lib/harbor2_client/models/configurations_response.rb +704 -0
- data/lib/harbor2_client/models/configurations_response_scan_all_policy.rb +194 -0
- data/lib/harbor2_client/models/configurations_response_scan_all_policy_parameter.rb +186 -0
- data/lib/harbor2_client/models/cve_allowlist.rb +1 -1
- data/lib/harbor2_client/models/cve_allowlist_item.rb +1 -1
- data/lib/harbor2_client/models/endpoint.rb +195 -0
- data/lib/harbor2_client/models/error.rb +1 -1
- data/lib/harbor2_client/models/errors.rb +1 -1
- data/lib/harbor2_client/models/event_type.rb +176 -0
- data/lib/harbor2_client/models/execution.rb +1 -1
- data/lib/harbor2_client/models/extra_attrs.rb +1 -1
- data/lib/harbor2_client/models/filter_style.rb +208 -0
- data/lib/harbor2_client/models/gc_history.rb +264 -0
- data/lib/harbor2_client/models/general_info.rb +305 -0
- data/lib/harbor2_client/models/icon.rb +1 -1
- data/lib/harbor2_client/models/immutable_rule.rb +253 -0
- data/lib/harbor2_client/models/immutable_selector.rb +211 -0
- data/lib/harbor2_client/models/instance.rb +1 -1
- data/lib/harbor2_client/models/integer_config_item.rb +195 -0
- data/lib/harbor2_client/models/internal_configurations_response.rb +175 -0
- data/lib/harbor2_client/models/is_default.rb +185 -0
- data/lib/harbor2_client/models/label.rb +1 -1
- data/lib/harbor2_client/models/ldap_conf.rb +266 -0
- data/lib/harbor2_client/models/ldap_failed_import_user.rb +195 -0
- data/lib/harbor2_client/models/ldap_import_users.rb +187 -0
- data/lib/harbor2_client/models/ldap_ping_result.rb +196 -0
- data/lib/harbor2_client/models/ldap_user.rb +205 -0
- data/lib/harbor2_client/models/metadata.rb +1 -1
- data/lib/harbor2_client/models/metrics.rb +1 -1
- data/lib/harbor2_client/models/native_report_summary.rb +14 -5
- data/lib/harbor2_client/models/notify_type.rb +176 -0
- data/lib/harbor2_client/models/oidc_cli_secret_req.rb +185 -0
- data/lib/harbor2_client/models/oidc_user_info.rb +235 -0
- data/lib/harbor2_client/models/overall_health_status.rb +197 -0
- data/lib/harbor2_client/models/password_req.rb +195 -0
- data/lib/harbor2_client/models/permission.rb +195 -0
- data/lib/harbor2_client/models/platform.rb +7 -7
- data/lib/harbor2_client/models/preheat_policy.rb +1 -1
- data/lib/harbor2_client/models/project.rb +1 -1
- data/lib/harbor2_client/models/project_deletable.rb +1 -1
- data/lib/harbor2_client/models/project_member.rb +203 -0
- data/lib/harbor2_client/models/project_member_entity.rb +245 -0
- data/lib/harbor2_client/models/project_metadata.rb +1 -1
- data/lib/harbor2_client/models/project_req.rb +16 -1
- data/lib/harbor2_client/models/project_scanner.rb +190 -0
- data/lib/harbor2_client/models/project_summary.rb +1 -1
- data/lib/harbor2_client/models/project_summary_quota.rb +1 -1
- data/lib/harbor2_client/models/provider_under_project.rb +1 -1
- data/lib/harbor2_client/models/quota.rb +236 -0
- data/lib/harbor2_client/models/quota_ref_object.rb +175 -0
- data/lib/harbor2_client/models/quota_update_req.rb +185 -0
- data/lib/harbor2_client/models/reference.rb +1 -1
- data/lib/harbor2_client/models/registry.rb +3 -3
- data/lib/harbor2_client/models/registry_credential.rb +1 -1
- data/lib/harbor2_client/models/registry_endpoint.rb +196 -0
- data/lib/harbor2_client/models/registry_info.rb +220 -0
- data/lib/harbor2_client/models/registry_ping.rb +245 -0
- data/lib/harbor2_client/models/registry_provider_credential_pattern.rb +216 -0
- data/lib/harbor2_client/models/registry_provider_endpoint_pattern.rb +198 -0
- data/lib/harbor2_client/models/registry_provider_info.rb +196 -0
- data/lib/harbor2_client/models/registry_update.rb +245 -0
- data/lib/harbor2_client/models/replication_execution.rb +296 -0
- data/lib/harbor2_client/models/replication_filter.rb +195 -0
- data/lib/harbor2_client/models/replication_policy.rb +326 -0
- data/lib/harbor2_client/models/replication_task.rb +276 -0
- data/lib/harbor2_client/models/replication_trigger.rb +194 -0
- data/lib/harbor2_client/models/replication_trigger_settings.rb +185 -0
- data/lib/harbor2_client/models/repository.rb +1 -1
- data/lib/harbor2_client/models/resource_list.rb +1 -1
- data/lib/harbor2_client/models/retention_execution.rb +238 -0
- data/lib/harbor2_client/models/retention_execution_task.rb +274 -0
- data/lib/harbor2_client/models/retention_metadata.rb +212 -0
- data/lib/harbor2_client/models/retention_policy.rb +223 -0
- data/lib/harbor2_client/models/retention_policy_scope.rb +193 -0
- data/lib/harbor2_client/models/retention_rule.rb +253 -0
- data/lib/harbor2_client/models/retention_rule_metadata.rb +218 -0
- data/lib/harbor2_client/models/retention_rule_param_metadata.rb +203 -0
- data/lib/harbor2_client/models/retention_rule_trigger.rb +202 -0
- data/lib/harbor2_client/models/retention_selector.rb +211 -0
- data/lib/harbor2_client/models/retention_selector_metadata.rb +205 -0
- data/lib/harbor2_client/models/robot.rb +296 -0
- data/lib/harbor2_client/models/robot_create.rb +247 -0
- data/lib/harbor2_client/models/robot_create_v1.rb +217 -0
- data/lib/harbor2_client/models/robot_created.rb +226 -0
- data/lib/harbor2_client/models/robot_permission.rb +206 -0
- data/lib/harbor2_client/models/robot_sec.rb +186 -0
- data/lib/harbor2_client/models/role_request.rb +185 -0
- data/lib/harbor2_client/models/scan_overview.rb +1 -1
- data/lib/harbor2_client/models/scanner.rb +205 -0
- data/lib/harbor2_client/models/scanner_adapter_metadata.rb +207 -0
- data/lib/harbor2_client/models/scanner_capability.rb +197 -0
- data/lib/harbor2_client/models/scanner_registration.rb +348 -0
- data/lib/harbor2_client/models/scanner_registration_req.rb +271 -0
- data/lib/harbor2_client/models/scanner_registration_settings.rb +227 -0
- data/lib/harbor2_client/models/schedule.rb +236 -0
- data/lib/harbor2_client/models/schedule_obj.rb +229 -0
- data/lib/harbor2_client/models/search.rb +211 -0
- data/lib/harbor2_client/models/search_repository.rb +235 -0
- data/lib/harbor2_client/models/search_result.rb +205 -0
- data/lib/harbor2_client/models/start_replication_execution.rb +185 -0
- data/lib/harbor2_client/models/statistic.rb +245 -0
- data/lib/harbor2_client/models/stats.rb +262 -0
- data/lib/harbor2_client/models/storage.rb +195 -0
- data/lib/harbor2_client/models/string_config_item.rb +195 -0
- data/lib/harbor2_client/models/supported_webhook_event_types.rb +198 -0
- data/lib/harbor2_client/models/system_info.rb +187 -0
- data/lib/harbor2_client/models/tag.rb +1 -1
- data/lib/harbor2_client/models/task.rb +1 -1
- data/lib/harbor2_client/models/user_creation_req.rb +250 -0
- data/lib/harbor2_client/models/user_entity.rb +195 -0
- data/lib/harbor2_client/models/user_group.rb +215 -0
- data/lib/harbor2_client/models/user_profile.rb +202 -0
- data/lib/harbor2_client/models/user_resp.rb +268 -0
- data/lib/harbor2_client/models/user_search.rb +194 -0
- data/lib/harbor2_client/models/user_search_resp_item.rb +194 -0
- data/lib/harbor2_client/models/user_sys_admin_flag.rb +185 -0
- data/lib/harbor2_client/models/vulnerability_summary.rb +1 -1
- data/lib/harbor2_client/models/webhook_job.rb +256 -0
- data/lib/harbor2_client/models/webhook_last_trigger.rb +226 -0
- data/lib/harbor2_client/models/webhook_policy.rb +278 -0
- data/lib/harbor2_client/models/webhook_target_object.rb +216 -0
- data/lib/harbor2_client/version.rb +2 -2
- data/lib/harbor2_client.rb +127 -1
- data/spec/api/artifact_api_spec.rb +21 -1
- data/spec/api/auditlog_api_spec.rb +2 -1
- data/spec/api/configure_api_spec.rb +72 -0
- data/spec/api/gc_api_spec.rb +115 -0
- data/spec/api/health_api_spec.rb +47 -0
- data/spec/api/icon_api_spec.rb +1 -1
- data/spec/api/immutable_api_spec.rb +97 -0
- data/spec/api/label_api_spec.rb +107 -0
- data/spec/api/ldap_api_spec.rb +88 -0
- data/spec/api/member_api_spec.rb +112 -0
- data/spec/api/oidc_api_spec.rb +48 -0
- data/spec/api/ping_api_spec.rb +47 -0
- data/spec/api/preheat_api_spec.rb +5 -1
- data/spec/api/project_api_spec.rb +63 -6
- data/spec/api/project_metadata_api_spec.rb +110 -0
- data/spec/api/quota_api_spec.rb +79 -0
- data/spec/api/registry_api_spec.rb +155 -0
- data/spec/api/replication_api_spec.rb +194 -0
- data/spec/api/repository_api_spec.rb +18 -1
- data/spec/api/retention_api_spec.rb +175 -0
- data/spec/api/robot_api_spec.rb +118 -0
- data/spec/api/robotv1_api_spec.rb +114 -0
- data/spec/api/scan_all_api_spec.rb +97 -0
- data/spec/api/scan_api_spec.rb +1 -1
- data/spec/api/scanner_api_spec.rb +144 -0
- data/spec/api/search_api_spec.rb +48 -0
- data/spec/api/statistic_api_spec.rb +47 -0
- data/spec/api/system_cve_allowlist_api_spec.rb +60 -0
- data/spec/api/systeminfo_api_spec.rb +71 -0
- data/spec/api/user_api_spec.rb +181 -0
- data/spec/api/usergroup_api_spec.rb +100 -0
- data/spec/api/webhook_api_spec.rb +142 -0
- data/spec/api/webhookjob_api_spec.rb +55 -0
- data/spec/api_client_spec.rb +1 -1
- data/spec/configuration_spec.rb +1 -1
- data/spec/models/access_spec.rb +53 -0
- data/spec/models/addition_link_spec.rb +1 -1
- data/spec/models/addition_links_spec.rb +1 -1
- data/spec/models/annotations_spec.rb +1 -1
- data/spec/models/artifact_spec.rb +1 -1
- data/spec/models/audit_log_spec.rb +1 -1
- data/spec/models/authproxy_setting_spec.rb +65 -0
- data/spec/models/body_1_spec.rb +41 -0
- data/spec/models/body_spec.rb +41 -0
- data/spec/models/bool_config_item_spec.rb +47 -0
- data/spec/models/chart_metadata_spec.rb +101 -0
- data/spec/models/chart_version_spec.rb +131 -0
- data/spec/models/component_health_status_spec.rb +53 -0
- data/spec/models/configurations_response_scan_all_policy_parameter_spec.rb +41 -0
- data/spec/models/configurations_response_scan_all_policy_spec.rb +47 -0
- data/spec/models/configurations_response_spec.rb +353 -0
- data/spec/models/configurations_spec.rb +365 -0
- data/spec/models/cve_allowlist_item_spec.rb +1 -1
- data/spec/models/cve_allowlist_spec.rb +1 -1
- data/spec/models/endpoint_spec.rb +47 -0
- data/spec/models/error_spec.rb +1 -1
- data/spec/models/errors_spec.rb +1 -1
- data/spec/models/event_type_spec.rb +35 -0
- data/spec/models/execution_spec.rb +1 -1
- data/spec/models/extra_attrs_spec.rb +1 -1
- data/spec/models/filter_style_spec.rb +53 -0
- data/spec/models/gc_history_spec.rb +89 -0
- data/spec/models/general_info_spec.rb +113 -0
- data/spec/models/icon_spec.rb +1 -1
- data/spec/models/immutable_rule_spec.rb +83 -0
- data/spec/models/immutable_selector_spec.rb +59 -0
- data/spec/models/instance_spec.rb +1 -1
- data/spec/models/integer_config_item_spec.rb +47 -0
- data/spec/models/internal_configurations_response_spec.rb +35 -0
- data/spec/models/is_default_spec.rb +41 -0
- data/spec/models/label_spec.rb +1 -1
- data/spec/models/ldap_conf_spec.rb +89 -0
- data/spec/models/ldap_failed_import_user_spec.rb +47 -0
- data/spec/models/ldap_import_users_spec.rb +41 -0
- data/spec/models/ldap_ping_result_spec.rb +47 -0
- data/spec/models/ldap_user_spec.rb +53 -0
- data/spec/models/metadata_spec.rb +1 -1
- data/spec/models/metrics_spec.rb +1 -1
- data/spec/models/native_report_summary_spec.rb +7 -1
- data/spec/models/notify_type_spec.rb +35 -0
- data/spec/models/oidc_cli_secret_req_spec.rb +41 -0
- data/spec/models/oidc_user_info_spec.rb +71 -0
- data/spec/models/overall_health_status_spec.rb +47 -0
- data/spec/models/password_req_spec.rb +47 -0
- data/spec/models/permission_spec.rb +47 -0
- data/spec/models/platform_spec.rb +1 -1
- data/spec/models/preheat_policy_spec.rb +1 -1
- data/spec/models/project_deletable_spec.rb +1 -1
- data/spec/models/project_member_entity_spec.rb +77 -0
- data/spec/models/project_member_spec.rb +53 -0
- data/spec/models/project_metadata_spec.rb +1 -1
- data/spec/models/project_req_spec.rb +1 -1
- data/spec/models/project_scanner_spec.rb +41 -0
- data/spec/models/project_spec.rb +1 -1
- data/spec/models/project_summary_quota_spec.rb +1 -1
- data/spec/models/project_summary_spec.rb +1 -1
- data/spec/models/provider_under_project_spec.rb +1 -1
- data/spec/models/quota_ref_object_spec.rb +35 -0
- data/spec/models/quota_spec.rb +71 -0
- data/spec/models/quota_update_req_spec.rb +41 -0
- data/spec/models/reference_spec.rb +1 -1
- data/spec/models/registry_credential_spec.rb +1 -1
- data/spec/models/registry_endpoint_spec.rb +47 -0
- data/spec/models/registry_info_spec.rb +59 -0
- data/spec/models/registry_ping_spec.rb +77 -0
- data/spec/models/registry_provider_credential_pattern_spec.rb +59 -0
- data/spec/models/registry_provider_endpoint_pattern_spec.rb +47 -0
- data/spec/models/registry_provider_info_spec.rb +47 -0
- data/spec/models/registry_spec.rb +1 -1
- data/spec/models/registry_update_spec.rb +77 -0
- data/spec/models/replication_execution_spec.rb +107 -0
- data/spec/models/replication_filter_spec.rb +47 -0
- data/spec/models/replication_policy_spec.rb +125 -0
- data/spec/models/replication_task_spec.rb +95 -0
- data/spec/models/replication_trigger_settings_spec.rb +41 -0
- data/spec/models/replication_trigger_spec.rb +47 -0
- data/spec/models/repository_spec.rb +1 -1
- data/spec/models/resource_list_spec.rb +1 -1
- data/spec/models/retention_execution_spec.rb +77 -0
- data/spec/models/retention_execution_task_spec.rb +101 -0
- data/spec/models/retention_metadata_spec.rb +53 -0
- data/spec/models/retention_policy_scope_spec.rb +47 -0
- data/spec/models/retention_policy_spec.rb +65 -0
- data/spec/models/retention_rule_metadata_spec.rb +59 -0
- data/spec/models/retention_rule_param_metadata_spec.rb +53 -0
- data/spec/models/retention_rule_spec.rb +83 -0
- data/spec/models/retention_rule_trigger_spec.rb +53 -0
- data/spec/models/retention_selector_metadata_spec.rb +53 -0
- data/spec/models/retention_selector_spec.rb +59 -0
- data/spec/models/robot_create_spec.rb +77 -0
- data/spec/models/robot_create_v1_spec.rb +59 -0
- data/spec/models/robot_created_spec.rb +65 -0
- data/spec/models/robot_permission_spec.rb +53 -0
- data/spec/models/robot_sec_spec.rb +41 -0
- data/spec/models/robot_spec.rb +107 -0
- data/spec/models/role_request_spec.rb +41 -0
- data/spec/models/scan_overview_spec.rb +1 -1
- data/spec/models/scanner_adapter_metadata_spec.rb +53 -0
- data/spec/models/scanner_capability_spec.rb +47 -0
- data/spec/models/scanner_registration_req_spec.rb +83 -0
- data/spec/models/scanner_registration_settings_spec.rb +59 -0
- data/spec/models/scanner_registration_spec.rb +131 -0
- data/spec/models/scanner_spec.rb +53 -0
- data/spec/models/schedule_obj_spec.rb +51 -0
- data/spec/models/schedule_spec.rb +71 -0
- data/spec/models/search_repository_spec.rb +71 -0
- data/spec/models/search_result_spec.rb +53 -0
- data/spec/models/search_spec.rb +53 -0
- data/spec/models/start_replication_execution_spec.rb +41 -0
- data/spec/models/statistic_spec.rb +77 -0
- data/spec/models/stats_spec.rb +69 -0
- data/spec/models/storage_spec.rb +47 -0
- data/spec/models/string_config_item_spec.rb +47 -0
- data/spec/models/supported_webhook_event_types_spec.rb +47 -0
- data/spec/models/system_info_spec.rb +41 -0
- data/spec/models/tag_spec.rb +1 -1
- data/spec/models/task_spec.rb +1 -1
- data/spec/models/user_creation_req_spec.rb +65 -0
- data/spec/models/user_entity_spec.rb +47 -0
- data/spec/models/user_group_spec.rb +59 -0
- data/spec/models/user_profile_spec.rb +53 -0
- data/spec/models/user_resp_spec.rb +95 -0
- data/spec/models/user_search_resp_item_spec.rb +47 -0
- data/spec/models/user_search_spec.rb +47 -0
- data/spec/models/user_sys_admin_flag_spec.rb +41 -0
- data/spec/models/vulnerability_summary_spec.rb +1 -1
- data/spec/models/webhook_job_spec.rb +83 -0
- data/spec/models/webhook_last_trigger_spec.rb +65 -0
- data/spec/models/webhook_policy_spec.rb +95 -0
- data/spec/models/webhook_target_object_spec.rb +59 -0
- data/spec/spec_helper.rb +1 -1
- metadata +512 -7
@@ -0,0 +1,305 @@
|
|
1
|
+
=begin
|
2
|
+
#Harbor API
|
3
|
+
|
4
|
+
#These APIs provide services for manipulating Harbor project.
|
5
|
+
|
6
|
+
OpenAPI spec version: 2.0
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.4.22
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module Harbor2Client
|
16
|
+
class GeneralInfo
|
17
|
+
# If the Harbor instance is deployed with nested notary.
|
18
|
+
attr_accessor :with_notary
|
19
|
+
|
20
|
+
# If the Harbor instance is deployed with nested chartmuseum.
|
21
|
+
attr_accessor :with_chartmuseum
|
22
|
+
|
23
|
+
# The url of registry against which the docker command should be issued.
|
24
|
+
attr_accessor :registry_url
|
25
|
+
|
26
|
+
# The external URL of Harbor, with protocol.
|
27
|
+
attr_accessor :external_url
|
28
|
+
|
29
|
+
# The auth mode of current Harbor instance.
|
30
|
+
attr_accessor :auth_mode
|
31
|
+
|
32
|
+
# Indicate who can create projects, it could be 'adminonly' or 'everyone'.
|
33
|
+
attr_accessor :project_creation_restriction
|
34
|
+
|
35
|
+
# Indicate whether the Harbor instance enable user to register himself.
|
36
|
+
attr_accessor :self_registration
|
37
|
+
|
38
|
+
# Indicate whether there is a ca root cert file ready for download in the file system.
|
39
|
+
attr_accessor :has_ca_root
|
40
|
+
|
41
|
+
# The build version of Harbor.
|
42
|
+
attr_accessor :harbor_version
|
43
|
+
|
44
|
+
# The storage provider's name of Harbor registry
|
45
|
+
attr_accessor :registry_storage_provider_name
|
46
|
+
|
47
|
+
# The flag to indicate whether Harbor is in readonly mode.
|
48
|
+
attr_accessor :read_only
|
49
|
+
|
50
|
+
# The flag to indicate whether notification mechanism is enabled on Harbor instance.
|
51
|
+
attr_accessor :notification_enable
|
52
|
+
|
53
|
+
# The setting of auth proxy this is only available when Harbor relies on authproxy for authentication.
|
54
|
+
attr_accessor :authproxy_settings
|
55
|
+
|
56
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
57
|
+
def self.attribute_map
|
58
|
+
{
|
59
|
+
:'with_notary' => :'with_notary',
|
60
|
+
:'with_chartmuseum' => :'with_chartmuseum',
|
61
|
+
:'registry_url' => :'registry_url',
|
62
|
+
:'external_url' => :'external_url',
|
63
|
+
:'auth_mode' => :'auth_mode',
|
64
|
+
:'project_creation_restriction' => :'project_creation_restriction',
|
65
|
+
:'self_registration' => :'self_registration',
|
66
|
+
:'has_ca_root' => :'has_ca_root',
|
67
|
+
:'harbor_version' => :'harbor_version',
|
68
|
+
:'registry_storage_provider_name' => :'registry_storage_provider_name',
|
69
|
+
:'read_only' => :'read_only',
|
70
|
+
:'notification_enable' => :'notification_enable',
|
71
|
+
:'authproxy_settings' => :'authproxy_settings'
|
72
|
+
}
|
73
|
+
end
|
74
|
+
|
75
|
+
# Attribute type mapping.
|
76
|
+
def self.swagger_types
|
77
|
+
{
|
78
|
+
:'with_notary' => :'BOOLEAN',
|
79
|
+
:'with_chartmuseum' => :'BOOLEAN',
|
80
|
+
:'registry_url' => :'String',
|
81
|
+
:'external_url' => :'String',
|
82
|
+
:'auth_mode' => :'String',
|
83
|
+
:'project_creation_restriction' => :'String',
|
84
|
+
:'self_registration' => :'BOOLEAN',
|
85
|
+
:'has_ca_root' => :'BOOLEAN',
|
86
|
+
:'harbor_version' => :'String',
|
87
|
+
:'registry_storage_provider_name' => :'String',
|
88
|
+
:'read_only' => :'BOOLEAN',
|
89
|
+
:'notification_enable' => :'BOOLEAN',
|
90
|
+
:'authproxy_settings' => :'AuthproxySetting'
|
91
|
+
}
|
92
|
+
end
|
93
|
+
|
94
|
+
# Initializes the object
|
95
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
96
|
+
def initialize(attributes = {})
|
97
|
+
return unless attributes.is_a?(Hash)
|
98
|
+
|
99
|
+
# convert string to symbol for hash key
|
100
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
101
|
+
|
102
|
+
if attributes.has_key?(:'with_notary')
|
103
|
+
self.with_notary = attributes[:'with_notary']
|
104
|
+
end
|
105
|
+
|
106
|
+
if attributes.has_key?(:'with_chartmuseum')
|
107
|
+
self.with_chartmuseum = attributes[:'with_chartmuseum']
|
108
|
+
end
|
109
|
+
|
110
|
+
if attributes.has_key?(:'registry_url')
|
111
|
+
self.registry_url = attributes[:'registry_url']
|
112
|
+
end
|
113
|
+
|
114
|
+
if attributes.has_key?(:'external_url')
|
115
|
+
self.external_url = attributes[:'external_url']
|
116
|
+
end
|
117
|
+
|
118
|
+
if attributes.has_key?(:'auth_mode')
|
119
|
+
self.auth_mode = attributes[:'auth_mode']
|
120
|
+
end
|
121
|
+
|
122
|
+
if attributes.has_key?(:'project_creation_restriction')
|
123
|
+
self.project_creation_restriction = attributes[:'project_creation_restriction']
|
124
|
+
end
|
125
|
+
|
126
|
+
if attributes.has_key?(:'self_registration')
|
127
|
+
self.self_registration = attributes[:'self_registration']
|
128
|
+
end
|
129
|
+
|
130
|
+
if attributes.has_key?(:'has_ca_root')
|
131
|
+
self.has_ca_root = attributes[:'has_ca_root']
|
132
|
+
end
|
133
|
+
|
134
|
+
if attributes.has_key?(:'harbor_version')
|
135
|
+
self.harbor_version = attributes[:'harbor_version']
|
136
|
+
end
|
137
|
+
|
138
|
+
if attributes.has_key?(:'registry_storage_provider_name')
|
139
|
+
self.registry_storage_provider_name = attributes[:'registry_storage_provider_name']
|
140
|
+
end
|
141
|
+
|
142
|
+
if attributes.has_key?(:'read_only')
|
143
|
+
self.read_only = attributes[:'read_only']
|
144
|
+
end
|
145
|
+
|
146
|
+
if attributes.has_key?(:'notification_enable')
|
147
|
+
self.notification_enable = attributes[:'notification_enable']
|
148
|
+
end
|
149
|
+
|
150
|
+
if attributes.has_key?(:'authproxy_settings')
|
151
|
+
self.authproxy_settings = attributes[:'authproxy_settings']
|
152
|
+
end
|
153
|
+
end
|
154
|
+
|
155
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
156
|
+
# @return Array for valid properties with the reasons
|
157
|
+
def list_invalid_properties
|
158
|
+
invalid_properties = Array.new
|
159
|
+
invalid_properties
|
160
|
+
end
|
161
|
+
|
162
|
+
# Check to see if the all the properties in the model are valid
|
163
|
+
# @return true if the model is valid
|
164
|
+
def valid?
|
165
|
+
true
|
166
|
+
end
|
167
|
+
|
168
|
+
# Checks equality by comparing each attribute.
|
169
|
+
# @param [Object] Object to be compared
|
170
|
+
def ==(o)
|
171
|
+
return true if self.equal?(o)
|
172
|
+
self.class == o.class &&
|
173
|
+
with_notary == o.with_notary &&
|
174
|
+
with_chartmuseum == o.with_chartmuseum &&
|
175
|
+
registry_url == o.registry_url &&
|
176
|
+
external_url == o.external_url &&
|
177
|
+
auth_mode == o.auth_mode &&
|
178
|
+
project_creation_restriction == o.project_creation_restriction &&
|
179
|
+
self_registration == o.self_registration &&
|
180
|
+
has_ca_root == o.has_ca_root &&
|
181
|
+
harbor_version == o.harbor_version &&
|
182
|
+
registry_storage_provider_name == o.registry_storage_provider_name &&
|
183
|
+
read_only == o.read_only &&
|
184
|
+
notification_enable == o.notification_enable &&
|
185
|
+
authproxy_settings == o.authproxy_settings
|
186
|
+
end
|
187
|
+
|
188
|
+
# @see the `==` method
|
189
|
+
# @param [Object] Object to be compared
|
190
|
+
def eql?(o)
|
191
|
+
self == o
|
192
|
+
end
|
193
|
+
|
194
|
+
# Calculates hash code according to all attributes.
|
195
|
+
# @return [Fixnum] Hash code
|
196
|
+
def hash
|
197
|
+
[with_notary, with_chartmuseum, registry_url, external_url, auth_mode, project_creation_restriction, self_registration, has_ca_root, harbor_version, registry_storage_provider_name, read_only, notification_enable, authproxy_settings].hash
|
198
|
+
end
|
199
|
+
|
200
|
+
# Builds the object from hash
|
201
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
202
|
+
# @return [Object] Returns the model itself
|
203
|
+
def build_from_hash(attributes)
|
204
|
+
return nil unless attributes.is_a?(Hash)
|
205
|
+
self.class.swagger_types.each_pair do |key, type|
|
206
|
+
if type =~ /\AArray<(.*)>/i
|
207
|
+
# check to ensure the input is an array given that the attribute
|
208
|
+
# is documented as an array but the input is not
|
209
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
210
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
211
|
+
end
|
212
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
213
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
214
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
215
|
+
end
|
216
|
+
|
217
|
+
self
|
218
|
+
end
|
219
|
+
|
220
|
+
# Deserializes the data based on type
|
221
|
+
# @param string type Data type
|
222
|
+
# @param string value Value to be deserialized
|
223
|
+
# @return [Object] Deserialized data
|
224
|
+
def _deserialize(type, value)
|
225
|
+
case type.to_sym
|
226
|
+
when :DateTime
|
227
|
+
DateTime.parse(value)
|
228
|
+
when :Date
|
229
|
+
Date.parse(value)
|
230
|
+
when :String
|
231
|
+
value.to_s
|
232
|
+
when :Integer
|
233
|
+
value.to_i
|
234
|
+
when :Float
|
235
|
+
value.to_f
|
236
|
+
when :BOOLEAN
|
237
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
238
|
+
true
|
239
|
+
else
|
240
|
+
false
|
241
|
+
end
|
242
|
+
when :Object
|
243
|
+
# generic object (usually a Hash), return directly
|
244
|
+
value
|
245
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
246
|
+
inner_type = Regexp.last_match[:inner_type]
|
247
|
+
value.map { |v| _deserialize(inner_type, v) }
|
248
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
249
|
+
k_type = Regexp.last_match[:k_type]
|
250
|
+
v_type = Regexp.last_match[:v_type]
|
251
|
+
{}.tap do |hash|
|
252
|
+
value.each do |k, v|
|
253
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
254
|
+
end
|
255
|
+
end
|
256
|
+
else # model
|
257
|
+
temp_model = Harbor2Client.const_get(type).new
|
258
|
+
temp_model.build_from_hash(value)
|
259
|
+
end
|
260
|
+
end
|
261
|
+
|
262
|
+
# Returns the string representation of the object
|
263
|
+
# @return [String] String presentation of the object
|
264
|
+
def to_s
|
265
|
+
to_hash.to_s
|
266
|
+
end
|
267
|
+
|
268
|
+
# to_body is an alias to to_hash (backward compatibility)
|
269
|
+
# @return [Hash] Returns the object in the form of hash
|
270
|
+
def to_body
|
271
|
+
to_hash
|
272
|
+
end
|
273
|
+
|
274
|
+
# Returns the object in the form of hash
|
275
|
+
# @return [Hash] Returns the object in the form of hash
|
276
|
+
def to_hash
|
277
|
+
hash = {}
|
278
|
+
self.class.attribute_map.each_pair do |attr, param|
|
279
|
+
value = self.send(attr)
|
280
|
+
next if value.nil?
|
281
|
+
hash[param] = _to_hash(value)
|
282
|
+
end
|
283
|
+
hash
|
284
|
+
end
|
285
|
+
|
286
|
+
# Outputs non-array value in the form of hash
|
287
|
+
# For object, use to_hash. Otherwise, just return the value
|
288
|
+
# @param [Object] value Any valid value
|
289
|
+
# @return [Hash] Returns the value in the form of hash
|
290
|
+
def _to_hash(value)
|
291
|
+
if value.is_a?(Array)
|
292
|
+
value.compact.map { |v| _to_hash(v) }
|
293
|
+
elsif value.is_a?(Hash)
|
294
|
+
{}.tap do |hash|
|
295
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
296
|
+
end
|
297
|
+
elsif value.respond_to? :to_hash
|
298
|
+
value.to_hash
|
299
|
+
else
|
300
|
+
value
|
301
|
+
end
|
302
|
+
end
|
303
|
+
|
304
|
+
end
|
305
|
+
end
|
@@ -0,0 +1,253 @@
|
|
1
|
+
=begin
|
2
|
+
#Harbor API
|
3
|
+
|
4
|
+
#These APIs provide services for manipulating Harbor project.
|
5
|
+
|
6
|
+
OpenAPI spec version: 2.0
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.4.22
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module Harbor2Client
|
16
|
+
class ImmutableRule
|
17
|
+
attr_accessor :id
|
18
|
+
|
19
|
+
attr_accessor :priority
|
20
|
+
|
21
|
+
attr_accessor :disabled
|
22
|
+
|
23
|
+
attr_accessor :action
|
24
|
+
|
25
|
+
attr_accessor :template
|
26
|
+
|
27
|
+
attr_accessor :params
|
28
|
+
|
29
|
+
attr_accessor :tag_selectors
|
30
|
+
|
31
|
+
attr_accessor :scope_selectors
|
32
|
+
|
33
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
34
|
+
def self.attribute_map
|
35
|
+
{
|
36
|
+
:'id' => :'id',
|
37
|
+
:'priority' => :'priority',
|
38
|
+
:'disabled' => :'disabled',
|
39
|
+
:'action' => :'action',
|
40
|
+
:'template' => :'template',
|
41
|
+
:'params' => :'params',
|
42
|
+
:'tag_selectors' => :'tag_selectors',
|
43
|
+
:'scope_selectors' => :'scope_selectors'
|
44
|
+
}
|
45
|
+
end
|
46
|
+
|
47
|
+
# Attribute type mapping.
|
48
|
+
def self.swagger_types
|
49
|
+
{
|
50
|
+
:'id' => :'Integer',
|
51
|
+
:'priority' => :'Integer',
|
52
|
+
:'disabled' => :'BOOLEAN',
|
53
|
+
:'action' => :'String',
|
54
|
+
:'template' => :'String',
|
55
|
+
:'params' => :'Hash<String, Object>',
|
56
|
+
:'tag_selectors' => :'Array<ImmutableSelector>',
|
57
|
+
:'scope_selectors' => :'Hash<String, Array<ImmutableSelector>>'
|
58
|
+
}
|
59
|
+
end
|
60
|
+
|
61
|
+
# Initializes the object
|
62
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
63
|
+
def initialize(attributes = {})
|
64
|
+
return unless attributes.is_a?(Hash)
|
65
|
+
|
66
|
+
# convert string to symbol for hash key
|
67
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
68
|
+
|
69
|
+
if attributes.has_key?(:'id')
|
70
|
+
self.id = attributes[:'id']
|
71
|
+
end
|
72
|
+
|
73
|
+
if attributes.has_key?(:'priority')
|
74
|
+
self.priority = attributes[:'priority']
|
75
|
+
end
|
76
|
+
|
77
|
+
if attributes.has_key?(:'disabled')
|
78
|
+
self.disabled = attributes[:'disabled']
|
79
|
+
end
|
80
|
+
|
81
|
+
if attributes.has_key?(:'action')
|
82
|
+
self.action = attributes[:'action']
|
83
|
+
end
|
84
|
+
|
85
|
+
if attributes.has_key?(:'template')
|
86
|
+
self.template = attributes[:'template']
|
87
|
+
end
|
88
|
+
|
89
|
+
if attributes.has_key?(:'params')
|
90
|
+
if (value = attributes[:'params']).is_a?(Hash)
|
91
|
+
self.params = value
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
if attributes.has_key?(:'tag_selectors')
|
96
|
+
if (value = attributes[:'tag_selectors']).is_a?(Array)
|
97
|
+
self.tag_selectors = value
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
if attributes.has_key?(:'scope_selectors')
|
102
|
+
if (value = attributes[:'scope_selectors']).is_a?(Hash)
|
103
|
+
self.scope_selectors = value
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
109
|
+
# @return Array for valid properties with the reasons
|
110
|
+
def list_invalid_properties
|
111
|
+
invalid_properties = Array.new
|
112
|
+
invalid_properties
|
113
|
+
end
|
114
|
+
|
115
|
+
# Check to see if the all the properties in the model are valid
|
116
|
+
# @return true if the model is valid
|
117
|
+
def valid?
|
118
|
+
true
|
119
|
+
end
|
120
|
+
|
121
|
+
# Checks equality by comparing each attribute.
|
122
|
+
# @param [Object] Object to be compared
|
123
|
+
def ==(o)
|
124
|
+
return true if self.equal?(o)
|
125
|
+
self.class == o.class &&
|
126
|
+
id == o.id &&
|
127
|
+
priority == o.priority &&
|
128
|
+
disabled == o.disabled &&
|
129
|
+
action == o.action &&
|
130
|
+
template == o.template &&
|
131
|
+
params == o.params &&
|
132
|
+
tag_selectors == o.tag_selectors &&
|
133
|
+
scope_selectors == o.scope_selectors
|
134
|
+
end
|
135
|
+
|
136
|
+
# @see the `==` method
|
137
|
+
# @param [Object] Object to be compared
|
138
|
+
def eql?(o)
|
139
|
+
self == o
|
140
|
+
end
|
141
|
+
|
142
|
+
# Calculates hash code according to all attributes.
|
143
|
+
# @return [Fixnum] Hash code
|
144
|
+
def hash
|
145
|
+
[id, priority, disabled, action, template, params, tag_selectors, scope_selectors].hash
|
146
|
+
end
|
147
|
+
|
148
|
+
# Builds the object from hash
|
149
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
150
|
+
# @return [Object] Returns the model itself
|
151
|
+
def build_from_hash(attributes)
|
152
|
+
return nil unless attributes.is_a?(Hash)
|
153
|
+
self.class.swagger_types.each_pair do |key, type|
|
154
|
+
if type =~ /\AArray<(.*)>/i
|
155
|
+
# check to ensure the input is an array given that the attribute
|
156
|
+
# is documented as an array but the input is not
|
157
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
158
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
159
|
+
end
|
160
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
161
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
162
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
163
|
+
end
|
164
|
+
|
165
|
+
self
|
166
|
+
end
|
167
|
+
|
168
|
+
# Deserializes the data based on type
|
169
|
+
# @param string type Data type
|
170
|
+
# @param string value Value to be deserialized
|
171
|
+
# @return [Object] Deserialized data
|
172
|
+
def _deserialize(type, value)
|
173
|
+
case type.to_sym
|
174
|
+
when :DateTime
|
175
|
+
DateTime.parse(value)
|
176
|
+
when :Date
|
177
|
+
Date.parse(value)
|
178
|
+
when :String
|
179
|
+
value.to_s
|
180
|
+
when :Integer
|
181
|
+
value.to_i
|
182
|
+
when :Float
|
183
|
+
value.to_f
|
184
|
+
when :BOOLEAN
|
185
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
186
|
+
true
|
187
|
+
else
|
188
|
+
false
|
189
|
+
end
|
190
|
+
when :Object
|
191
|
+
# generic object (usually a Hash), return directly
|
192
|
+
value
|
193
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
194
|
+
inner_type = Regexp.last_match[:inner_type]
|
195
|
+
value.map { |v| _deserialize(inner_type, v) }
|
196
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
197
|
+
k_type = Regexp.last_match[:k_type]
|
198
|
+
v_type = Regexp.last_match[:v_type]
|
199
|
+
{}.tap do |hash|
|
200
|
+
value.each do |k, v|
|
201
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
202
|
+
end
|
203
|
+
end
|
204
|
+
else # model
|
205
|
+
temp_model = Harbor2Client.const_get(type).new
|
206
|
+
temp_model.build_from_hash(value)
|
207
|
+
end
|
208
|
+
end
|
209
|
+
|
210
|
+
# Returns the string representation of the object
|
211
|
+
# @return [String] String presentation of the object
|
212
|
+
def to_s
|
213
|
+
to_hash.to_s
|
214
|
+
end
|
215
|
+
|
216
|
+
# to_body is an alias to to_hash (backward compatibility)
|
217
|
+
# @return [Hash] Returns the object in the form of hash
|
218
|
+
def to_body
|
219
|
+
to_hash
|
220
|
+
end
|
221
|
+
|
222
|
+
# Returns the object in the form of hash
|
223
|
+
# @return [Hash] Returns the object in the form of hash
|
224
|
+
def to_hash
|
225
|
+
hash = {}
|
226
|
+
self.class.attribute_map.each_pair do |attr, param|
|
227
|
+
value = self.send(attr)
|
228
|
+
next if value.nil?
|
229
|
+
hash[param] = _to_hash(value)
|
230
|
+
end
|
231
|
+
hash
|
232
|
+
end
|
233
|
+
|
234
|
+
# Outputs non-array value in the form of hash
|
235
|
+
# For object, use to_hash. Otherwise, just return the value
|
236
|
+
# @param [Object] value Any valid value
|
237
|
+
# @return [Hash] Returns the value in the form of hash
|
238
|
+
def _to_hash(value)
|
239
|
+
if value.is_a?(Array)
|
240
|
+
value.compact.map { |v| _to_hash(v) }
|
241
|
+
elsif value.is_a?(Hash)
|
242
|
+
{}.tap do |hash|
|
243
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
244
|
+
end
|
245
|
+
elsif value.respond_to? :to_hash
|
246
|
+
value.to_hash
|
247
|
+
else
|
248
|
+
value
|
249
|
+
end
|
250
|
+
end
|
251
|
+
|
252
|
+
end
|
253
|
+
end
|