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,196 @@
|
|
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
|
+
# The style of the resource filter
|
17
|
+
class RegistryEndpoint
|
18
|
+
# The endpoint key
|
19
|
+
attr_accessor :key
|
20
|
+
|
21
|
+
# The endpoint value
|
22
|
+
attr_accessor :value
|
23
|
+
|
24
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
25
|
+
def self.attribute_map
|
26
|
+
{
|
27
|
+
:'key' => :'key',
|
28
|
+
:'value' => :'value'
|
29
|
+
}
|
30
|
+
end
|
31
|
+
|
32
|
+
# Attribute type mapping.
|
33
|
+
def self.swagger_types
|
34
|
+
{
|
35
|
+
:'key' => :'String',
|
36
|
+
:'value' => :'String'
|
37
|
+
}
|
38
|
+
end
|
39
|
+
|
40
|
+
# Initializes the object
|
41
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
42
|
+
def initialize(attributes = {})
|
43
|
+
return unless attributes.is_a?(Hash)
|
44
|
+
|
45
|
+
# convert string to symbol for hash key
|
46
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
47
|
+
|
48
|
+
if attributes.has_key?(:'key')
|
49
|
+
self.key = attributes[:'key']
|
50
|
+
end
|
51
|
+
|
52
|
+
if attributes.has_key?(:'value')
|
53
|
+
self.value = attributes[:'value']
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
58
|
+
# @return Array for valid properties with the reasons
|
59
|
+
def list_invalid_properties
|
60
|
+
invalid_properties = Array.new
|
61
|
+
invalid_properties
|
62
|
+
end
|
63
|
+
|
64
|
+
# Check to see if the all the properties in the model are valid
|
65
|
+
# @return true if the model is valid
|
66
|
+
def valid?
|
67
|
+
true
|
68
|
+
end
|
69
|
+
|
70
|
+
# Checks equality by comparing each attribute.
|
71
|
+
# @param [Object] Object to be compared
|
72
|
+
def ==(o)
|
73
|
+
return true if self.equal?(o)
|
74
|
+
self.class == o.class &&
|
75
|
+
key == o.key &&
|
76
|
+
value == o.value
|
77
|
+
end
|
78
|
+
|
79
|
+
# @see the `==` method
|
80
|
+
# @param [Object] Object to be compared
|
81
|
+
def eql?(o)
|
82
|
+
self == o
|
83
|
+
end
|
84
|
+
|
85
|
+
# Calculates hash code according to all attributes.
|
86
|
+
# @return [Fixnum] Hash code
|
87
|
+
def hash
|
88
|
+
[key, value].hash
|
89
|
+
end
|
90
|
+
|
91
|
+
# Builds the object from hash
|
92
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
93
|
+
# @return [Object] Returns the model itself
|
94
|
+
def build_from_hash(attributes)
|
95
|
+
return nil unless attributes.is_a?(Hash)
|
96
|
+
self.class.swagger_types.each_pair do |key, type|
|
97
|
+
if type =~ /\AArray<(.*)>/i
|
98
|
+
# check to ensure the input is an array given that the attribute
|
99
|
+
# is documented as an array but the input is not
|
100
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
101
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
102
|
+
end
|
103
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
104
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
105
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
106
|
+
end
|
107
|
+
|
108
|
+
self
|
109
|
+
end
|
110
|
+
|
111
|
+
# Deserializes the data based on type
|
112
|
+
# @param string type Data type
|
113
|
+
# @param string value Value to be deserialized
|
114
|
+
# @return [Object] Deserialized data
|
115
|
+
def _deserialize(type, value)
|
116
|
+
case type.to_sym
|
117
|
+
when :DateTime
|
118
|
+
DateTime.parse(value)
|
119
|
+
when :Date
|
120
|
+
Date.parse(value)
|
121
|
+
when :String
|
122
|
+
value.to_s
|
123
|
+
when :Integer
|
124
|
+
value.to_i
|
125
|
+
when :Float
|
126
|
+
value.to_f
|
127
|
+
when :BOOLEAN
|
128
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
129
|
+
true
|
130
|
+
else
|
131
|
+
false
|
132
|
+
end
|
133
|
+
when :Object
|
134
|
+
# generic object (usually a Hash), return directly
|
135
|
+
value
|
136
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
137
|
+
inner_type = Regexp.last_match[:inner_type]
|
138
|
+
value.map { |v| _deserialize(inner_type, v) }
|
139
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
140
|
+
k_type = Regexp.last_match[:k_type]
|
141
|
+
v_type = Regexp.last_match[:v_type]
|
142
|
+
{}.tap do |hash|
|
143
|
+
value.each do |k, v|
|
144
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
145
|
+
end
|
146
|
+
end
|
147
|
+
else # model
|
148
|
+
temp_model = Harbor2Client.const_get(type).new
|
149
|
+
temp_model.build_from_hash(value)
|
150
|
+
end
|
151
|
+
end
|
152
|
+
|
153
|
+
# Returns the string representation of the object
|
154
|
+
# @return [String] String presentation of the object
|
155
|
+
def to_s
|
156
|
+
to_hash.to_s
|
157
|
+
end
|
158
|
+
|
159
|
+
# to_body is an alias to to_hash (backward compatibility)
|
160
|
+
# @return [Hash] Returns the object in the form of hash
|
161
|
+
def to_body
|
162
|
+
to_hash
|
163
|
+
end
|
164
|
+
|
165
|
+
# Returns the object in the form of hash
|
166
|
+
# @return [Hash] Returns the object in the form of hash
|
167
|
+
def to_hash
|
168
|
+
hash = {}
|
169
|
+
self.class.attribute_map.each_pair do |attr, param|
|
170
|
+
value = self.send(attr)
|
171
|
+
next if value.nil?
|
172
|
+
hash[param] = _to_hash(value)
|
173
|
+
end
|
174
|
+
hash
|
175
|
+
end
|
176
|
+
|
177
|
+
# Outputs non-array value in the form of hash
|
178
|
+
# For object, use to_hash. Otherwise, just return the value
|
179
|
+
# @param [Object] value Any valid value
|
180
|
+
# @return [Hash] Returns the value in the form of hash
|
181
|
+
def _to_hash(value)
|
182
|
+
if value.is_a?(Array)
|
183
|
+
value.compact.map { |v| _to_hash(v) }
|
184
|
+
elsif value.is_a?(Hash)
|
185
|
+
{}.tap do |hash|
|
186
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
187
|
+
end
|
188
|
+
elsif value.respond_to? :to_hash
|
189
|
+
value.to_hash
|
190
|
+
else
|
191
|
+
value
|
192
|
+
end
|
193
|
+
end
|
194
|
+
|
195
|
+
end
|
196
|
+
end
|
@@ -0,0 +1,220 @@
|
|
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
|
+
# The registry info contains the base info and capability declarations of the registry
|
17
|
+
class RegistryInfo
|
18
|
+
# The registry type
|
19
|
+
attr_accessor :type
|
20
|
+
|
21
|
+
# The description
|
22
|
+
attr_accessor :description
|
23
|
+
|
24
|
+
# The filters that the registry supports
|
25
|
+
attr_accessor :supported_resource_filters
|
26
|
+
|
27
|
+
# The triggers that the registry supports
|
28
|
+
attr_accessor :supported_triggers
|
29
|
+
|
30
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
31
|
+
def self.attribute_map
|
32
|
+
{
|
33
|
+
:'type' => :'type',
|
34
|
+
:'description' => :'description',
|
35
|
+
:'supported_resource_filters' => :'supported_resource_filters',
|
36
|
+
:'supported_triggers' => :'supported_triggers'
|
37
|
+
}
|
38
|
+
end
|
39
|
+
|
40
|
+
# Attribute type mapping.
|
41
|
+
def self.swagger_types
|
42
|
+
{
|
43
|
+
:'type' => :'String',
|
44
|
+
:'description' => :'String',
|
45
|
+
:'supported_resource_filters' => :'Array<FilterStyle>',
|
46
|
+
:'supported_triggers' => :'Array<String>'
|
47
|
+
}
|
48
|
+
end
|
49
|
+
|
50
|
+
# Initializes the object
|
51
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
52
|
+
def initialize(attributes = {})
|
53
|
+
return unless attributes.is_a?(Hash)
|
54
|
+
|
55
|
+
# convert string to symbol for hash key
|
56
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
57
|
+
|
58
|
+
if attributes.has_key?(:'type')
|
59
|
+
self.type = attributes[:'type']
|
60
|
+
end
|
61
|
+
|
62
|
+
if attributes.has_key?(:'description')
|
63
|
+
self.description = attributes[:'description']
|
64
|
+
end
|
65
|
+
|
66
|
+
if attributes.has_key?(:'supported_resource_filters')
|
67
|
+
if (value = attributes[:'supported_resource_filters']).is_a?(Array)
|
68
|
+
self.supported_resource_filters = value
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
if attributes.has_key?(:'supported_triggers')
|
73
|
+
if (value = attributes[:'supported_triggers']).is_a?(Array)
|
74
|
+
self.supported_triggers = value
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
80
|
+
# @return Array for valid properties with the reasons
|
81
|
+
def list_invalid_properties
|
82
|
+
invalid_properties = Array.new
|
83
|
+
invalid_properties
|
84
|
+
end
|
85
|
+
|
86
|
+
# Check to see if the all the properties in the model are valid
|
87
|
+
# @return true if the model is valid
|
88
|
+
def valid?
|
89
|
+
true
|
90
|
+
end
|
91
|
+
|
92
|
+
# Checks equality by comparing each attribute.
|
93
|
+
# @param [Object] Object to be compared
|
94
|
+
def ==(o)
|
95
|
+
return true if self.equal?(o)
|
96
|
+
self.class == o.class &&
|
97
|
+
type == o.type &&
|
98
|
+
description == o.description &&
|
99
|
+
supported_resource_filters == o.supported_resource_filters &&
|
100
|
+
supported_triggers == o.supported_triggers
|
101
|
+
end
|
102
|
+
|
103
|
+
# @see the `==` method
|
104
|
+
# @param [Object] Object to be compared
|
105
|
+
def eql?(o)
|
106
|
+
self == o
|
107
|
+
end
|
108
|
+
|
109
|
+
# Calculates hash code according to all attributes.
|
110
|
+
# @return [Fixnum] Hash code
|
111
|
+
def hash
|
112
|
+
[type, description, supported_resource_filters, supported_triggers].hash
|
113
|
+
end
|
114
|
+
|
115
|
+
# Builds the object from hash
|
116
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
117
|
+
# @return [Object] Returns the model itself
|
118
|
+
def build_from_hash(attributes)
|
119
|
+
return nil unless attributes.is_a?(Hash)
|
120
|
+
self.class.swagger_types.each_pair do |key, type|
|
121
|
+
if type =~ /\AArray<(.*)>/i
|
122
|
+
# check to ensure the input is an array given that the attribute
|
123
|
+
# is documented as an array but the input is not
|
124
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
125
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
126
|
+
end
|
127
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
128
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
129
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
130
|
+
end
|
131
|
+
|
132
|
+
self
|
133
|
+
end
|
134
|
+
|
135
|
+
# Deserializes the data based on type
|
136
|
+
# @param string type Data type
|
137
|
+
# @param string value Value to be deserialized
|
138
|
+
# @return [Object] Deserialized data
|
139
|
+
def _deserialize(type, value)
|
140
|
+
case type.to_sym
|
141
|
+
when :DateTime
|
142
|
+
DateTime.parse(value)
|
143
|
+
when :Date
|
144
|
+
Date.parse(value)
|
145
|
+
when :String
|
146
|
+
value.to_s
|
147
|
+
when :Integer
|
148
|
+
value.to_i
|
149
|
+
when :Float
|
150
|
+
value.to_f
|
151
|
+
when :BOOLEAN
|
152
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
153
|
+
true
|
154
|
+
else
|
155
|
+
false
|
156
|
+
end
|
157
|
+
when :Object
|
158
|
+
# generic object (usually a Hash), return directly
|
159
|
+
value
|
160
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
161
|
+
inner_type = Regexp.last_match[:inner_type]
|
162
|
+
value.map { |v| _deserialize(inner_type, v) }
|
163
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
164
|
+
k_type = Regexp.last_match[:k_type]
|
165
|
+
v_type = Regexp.last_match[:v_type]
|
166
|
+
{}.tap do |hash|
|
167
|
+
value.each do |k, v|
|
168
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
169
|
+
end
|
170
|
+
end
|
171
|
+
else # model
|
172
|
+
temp_model = Harbor2Client.const_get(type).new
|
173
|
+
temp_model.build_from_hash(value)
|
174
|
+
end
|
175
|
+
end
|
176
|
+
|
177
|
+
# Returns the string representation of the object
|
178
|
+
# @return [String] String presentation of the object
|
179
|
+
def to_s
|
180
|
+
to_hash.to_s
|
181
|
+
end
|
182
|
+
|
183
|
+
# to_body is an alias to to_hash (backward compatibility)
|
184
|
+
# @return [Hash] Returns the object in the form of hash
|
185
|
+
def to_body
|
186
|
+
to_hash
|
187
|
+
end
|
188
|
+
|
189
|
+
# Returns the object in the form of hash
|
190
|
+
# @return [Hash] Returns the object in the form of hash
|
191
|
+
def to_hash
|
192
|
+
hash = {}
|
193
|
+
self.class.attribute_map.each_pair do |attr, param|
|
194
|
+
value = self.send(attr)
|
195
|
+
next if value.nil?
|
196
|
+
hash[param] = _to_hash(value)
|
197
|
+
end
|
198
|
+
hash
|
199
|
+
end
|
200
|
+
|
201
|
+
# Outputs non-array value in the form of hash
|
202
|
+
# For object, use to_hash. Otherwise, just return the value
|
203
|
+
# @param [Object] value Any valid value
|
204
|
+
# @return [Hash] Returns the value in the form of hash
|
205
|
+
def _to_hash(value)
|
206
|
+
if value.is_a?(Array)
|
207
|
+
value.compact.map { |v| _to_hash(v) }
|
208
|
+
elsif value.is_a?(Hash)
|
209
|
+
{}.tap do |hash|
|
210
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
211
|
+
end
|
212
|
+
elsif value.respond_to? :to_hash
|
213
|
+
value.to_hash
|
214
|
+
else
|
215
|
+
value
|
216
|
+
end
|
217
|
+
end
|
218
|
+
|
219
|
+
end
|
220
|
+
end
|
@@ -0,0 +1,245 @@
|
|
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 RegistryPing
|
17
|
+
# The registry ID.
|
18
|
+
attr_accessor :id
|
19
|
+
|
20
|
+
# Type of the registry, e.g. 'harbor'.
|
21
|
+
attr_accessor :type
|
22
|
+
|
23
|
+
# The registry URL.
|
24
|
+
attr_accessor :url
|
25
|
+
|
26
|
+
# Credential type of the registry, e.g. 'basic'.
|
27
|
+
attr_accessor :credential_type
|
28
|
+
|
29
|
+
# The registry access key.
|
30
|
+
attr_accessor :access_key
|
31
|
+
|
32
|
+
# The registry access secret.
|
33
|
+
attr_accessor :access_secret
|
34
|
+
|
35
|
+
# Whether or not the certificate will be verified when Harbor tries to access the server.
|
36
|
+
attr_accessor :insecure
|
37
|
+
|
38
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
39
|
+
def self.attribute_map
|
40
|
+
{
|
41
|
+
:'id' => :'id',
|
42
|
+
:'type' => :'type',
|
43
|
+
:'url' => :'url',
|
44
|
+
:'credential_type' => :'credential_type',
|
45
|
+
:'access_key' => :'access_key',
|
46
|
+
:'access_secret' => :'access_secret',
|
47
|
+
:'insecure' => :'insecure'
|
48
|
+
}
|
49
|
+
end
|
50
|
+
|
51
|
+
# Attribute type mapping.
|
52
|
+
def self.swagger_types
|
53
|
+
{
|
54
|
+
:'id' => :'Integer',
|
55
|
+
:'type' => :'String',
|
56
|
+
:'url' => :'String',
|
57
|
+
:'credential_type' => :'String',
|
58
|
+
:'access_key' => :'String',
|
59
|
+
:'access_secret' => :'String',
|
60
|
+
:'insecure' => :'BOOLEAN'
|
61
|
+
}
|
62
|
+
end
|
63
|
+
|
64
|
+
# Initializes the object
|
65
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
66
|
+
def initialize(attributes = {})
|
67
|
+
return unless attributes.is_a?(Hash)
|
68
|
+
|
69
|
+
# convert string to symbol for hash key
|
70
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
71
|
+
|
72
|
+
if attributes.has_key?(:'id')
|
73
|
+
self.id = attributes[:'id']
|
74
|
+
end
|
75
|
+
|
76
|
+
if attributes.has_key?(:'type')
|
77
|
+
self.type = attributes[:'type']
|
78
|
+
end
|
79
|
+
|
80
|
+
if attributes.has_key?(:'url')
|
81
|
+
self.url = attributes[:'url']
|
82
|
+
end
|
83
|
+
|
84
|
+
if attributes.has_key?(:'credential_type')
|
85
|
+
self.credential_type = attributes[:'credential_type']
|
86
|
+
end
|
87
|
+
|
88
|
+
if attributes.has_key?(:'access_key')
|
89
|
+
self.access_key = attributes[:'access_key']
|
90
|
+
end
|
91
|
+
|
92
|
+
if attributes.has_key?(:'access_secret')
|
93
|
+
self.access_secret = attributes[:'access_secret']
|
94
|
+
end
|
95
|
+
|
96
|
+
if attributes.has_key?(:'insecure')
|
97
|
+
self.insecure = attributes[:'insecure']
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
102
|
+
# @return Array for valid properties with the reasons
|
103
|
+
def list_invalid_properties
|
104
|
+
invalid_properties = Array.new
|
105
|
+
invalid_properties
|
106
|
+
end
|
107
|
+
|
108
|
+
# Check to see if the all the properties in the model are valid
|
109
|
+
# @return true if the model is valid
|
110
|
+
def valid?
|
111
|
+
true
|
112
|
+
end
|
113
|
+
|
114
|
+
# Checks equality by comparing each attribute.
|
115
|
+
# @param [Object] Object to be compared
|
116
|
+
def ==(o)
|
117
|
+
return true if self.equal?(o)
|
118
|
+
self.class == o.class &&
|
119
|
+
id == o.id &&
|
120
|
+
type == o.type &&
|
121
|
+
url == o.url &&
|
122
|
+
credential_type == o.credential_type &&
|
123
|
+
access_key == o.access_key &&
|
124
|
+
access_secret == o.access_secret &&
|
125
|
+
insecure == o.insecure
|
126
|
+
end
|
127
|
+
|
128
|
+
# @see the `==` method
|
129
|
+
# @param [Object] Object to be compared
|
130
|
+
def eql?(o)
|
131
|
+
self == o
|
132
|
+
end
|
133
|
+
|
134
|
+
# Calculates hash code according to all attributes.
|
135
|
+
# @return [Fixnum] Hash code
|
136
|
+
def hash
|
137
|
+
[id, type, url, credential_type, access_key, access_secret, insecure].hash
|
138
|
+
end
|
139
|
+
|
140
|
+
# Builds the object from hash
|
141
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
142
|
+
# @return [Object] Returns the model itself
|
143
|
+
def build_from_hash(attributes)
|
144
|
+
return nil unless attributes.is_a?(Hash)
|
145
|
+
self.class.swagger_types.each_pair do |key, type|
|
146
|
+
if type =~ /\AArray<(.*)>/i
|
147
|
+
# check to ensure the input is an array given that the attribute
|
148
|
+
# is documented as an array but the input is not
|
149
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
150
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
151
|
+
end
|
152
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
153
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
154
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
155
|
+
end
|
156
|
+
|
157
|
+
self
|
158
|
+
end
|
159
|
+
|
160
|
+
# Deserializes the data based on type
|
161
|
+
# @param string type Data type
|
162
|
+
# @param string value Value to be deserialized
|
163
|
+
# @return [Object] Deserialized data
|
164
|
+
def _deserialize(type, value)
|
165
|
+
case type.to_sym
|
166
|
+
when :DateTime
|
167
|
+
DateTime.parse(value)
|
168
|
+
when :Date
|
169
|
+
Date.parse(value)
|
170
|
+
when :String
|
171
|
+
value.to_s
|
172
|
+
when :Integer
|
173
|
+
value.to_i
|
174
|
+
when :Float
|
175
|
+
value.to_f
|
176
|
+
when :BOOLEAN
|
177
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
178
|
+
true
|
179
|
+
else
|
180
|
+
false
|
181
|
+
end
|
182
|
+
when :Object
|
183
|
+
# generic object (usually a Hash), return directly
|
184
|
+
value
|
185
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
186
|
+
inner_type = Regexp.last_match[:inner_type]
|
187
|
+
value.map { |v| _deserialize(inner_type, v) }
|
188
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
189
|
+
k_type = Regexp.last_match[:k_type]
|
190
|
+
v_type = Regexp.last_match[:v_type]
|
191
|
+
{}.tap do |hash|
|
192
|
+
value.each do |k, v|
|
193
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
194
|
+
end
|
195
|
+
end
|
196
|
+
else # model
|
197
|
+
temp_model = Harbor2Client.const_get(type).new
|
198
|
+
temp_model.build_from_hash(value)
|
199
|
+
end
|
200
|
+
end
|
201
|
+
|
202
|
+
# Returns the string representation of the object
|
203
|
+
# @return [String] String presentation of the object
|
204
|
+
def to_s
|
205
|
+
to_hash.to_s
|
206
|
+
end
|
207
|
+
|
208
|
+
# to_body is an alias to to_hash (backward compatibility)
|
209
|
+
# @return [Hash] Returns the object in the form of hash
|
210
|
+
def to_body
|
211
|
+
to_hash
|
212
|
+
end
|
213
|
+
|
214
|
+
# Returns the object in the form of hash
|
215
|
+
# @return [Hash] Returns the object in the form of hash
|
216
|
+
def to_hash
|
217
|
+
hash = {}
|
218
|
+
self.class.attribute_map.each_pair do |attr, param|
|
219
|
+
value = self.send(attr)
|
220
|
+
next if value.nil?
|
221
|
+
hash[param] = _to_hash(value)
|
222
|
+
end
|
223
|
+
hash
|
224
|
+
end
|
225
|
+
|
226
|
+
# Outputs non-array value in the form of hash
|
227
|
+
# For object, use to_hash. Otherwise, just return the value
|
228
|
+
# @param [Object] value Any valid value
|
229
|
+
# @return [Hash] Returns the value in the form of hash
|
230
|
+
def _to_hash(value)
|
231
|
+
if value.is_a?(Array)
|
232
|
+
value.compact.map { |v| _to_hash(v) }
|
233
|
+
elsif value.is_a?(Hash)
|
234
|
+
{}.tap do |hash|
|
235
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
236
|
+
end
|
237
|
+
elsif value.respond_to? :to_hash
|
238
|
+
value.to_hash
|
239
|
+
else
|
240
|
+
value
|
241
|
+
end
|
242
|
+
end
|
243
|
+
|
244
|
+
end
|
245
|
+
end
|