harbor2_client 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (141) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +7 -0
  3. data/README.md +186 -0
  4. data/Rakefile +8 -0
  5. data/docs/AdditionLink.md +9 -0
  6. data/docs/AdditionLinks.md +7 -0
  7. data/docs/Annotations.md +7 -0
  8. data/docs/Artifact.md +25 -0
  9. data/docs/ArtifactApi.md +694 -0
  10. data/docs/AuditLog.md +13 -0
  11. data/docs/AuditlogApi.md +69 -0
  12. data/docs/CVEAllowlist.md +13 -0
  13. data/docs/CVEAllowlistItem.md +8 -0
  14. data/docs/Error.md +9 -0
  15. data/docs/Errors.md +8 -0
  16. data/docs/Execution.md +17 -0
  17. data/docs/ExtraAttrs.md +7 -0
  18. data/docs/Icon.md +9 -0
  19. data/docs/IconApi.md +66 -0
  20. data/docs/Instance.md +19 -0
  21. data/docs/Label.md +15 -0
  22. data/docs/Metadata.md +13 -0
  23. data/docs/Metrics.md +14 -0
  24. data/docs/NativeReportSummary.md +15 -0
  25. data/docs/Platform.md +12 -0
  26. data/docs/PreheatApi.md +1176 -0
  27. data/docs/PreheatPolicy.md +18 -0
  28. data/docs/Project.md +22 -0
  29. data/docs/ProjectApi.md +542 -0
  30. data/docs/ProjectDeletable.md +9 -0
  31. data/docs/ProjectMetadata.md +14 -0
  32. data/docs/ProjectReq.md +13 -0
  33. data/docs/ProjectSummary.md +16 -0
  34. data/docs/ProjectSummaryQuota.md +9 -0
  35. data/docs/ProviderUnderProject.md +11 -0
  36. data/docs/Reference.md +13 -0
  37. data/docs/Registry.md +17 -0
  38. data/docs/RegistryCredential.md +10 -0
  39. data/docs/Repository.md +15 -0
  40. data/docs/RepositoryApi.md +256 -0
  41. data/docs/ResourceList.md +7 -0
  42. data/docs/ScanApi.md +138 -0
  43. data/docs/ScanOverview.md +7 -0
  44. data/docs/Tag.md +15 -0
  45. data/docs/Task.md +17 -0
  46. data/docs/VulnerabilitySummary.md +10 -0
  47. data/git_push.sh +55 -0
  48. data/harbor2_client.gemspec +46 -0
  49. data/lib/harbor2_client.rb +81 -0
  50. data/lib/harbor2_client/api/artifact_api.rb +848 -0
  51. data/lib/harbor2_client/api/auditlog_api.rb +91 -0
  52. data/lib/harbor2_client/api/icon_api.rb +84 -0
  53. data/lib/harbor2_client/api/preheat_api.rb +1327 -0
  54. data/lib/harbor2_client/api/project_api.rb +601 -0
  55. data/lib/harbor2_client/api/repository_api.rb +302 -0
  56. data/lib/harbor2_client/api/scan_api.rb +174 -0
  57. data/lib/harbor2_client/api_client.rb +391 -0
  58. data/lib/harbor2_client/api_error.rb +38 -0
  59. data/lib/harbor2_client/configuration.rb +209 -0
  60. data/lib/harbor2_client/models/addition_link.rb +195 -0
  61. data/lib/harbor2_client/models/addition_links.rb +175 -0
  62. data/lib/harbor2_client/models/annotations.rb +175 -0
  63. data/lib/harbor2_client/models/artifact.rb +355 -0
  64. data/lib/harbor2_client/models/audit_log.rb +235 -0
  65. data/lib/harbor2_client/models/cve_allowlist.rb +237 -0
  66. data/lib/harbor2_client/models/cve_allowlist_item.rb +186 -0
  67. data/lib/harbor2_client/models/error.rb +196 -0
  68. data/lib/harbor2_client/models/errors.rb +187 -0
  69. data/lib/harbor2_client/models/execution.rb +273 -0
  70. data/lib/harbor2_client/models/extra_attrs.rb +175 -0
  71. data/lib/harbor2_client/models/icon.rb +195 -0
  72. data/lib/harbor2_client/models/instance.rb +297 -0
  73. data/lib/harbor2_client/models/label.rb +255 -0
  74. data/lib/harbor2_client/models/metadata.rb +237 -0
  75. data/lib/harbor2_client/models/metrics.rb +245 -0
  76. data/lib/harbor2_client/models/native_report_summary.rb +255 -0
  77. data/lib/harbor2_client/models/platform.rb +227 -0
  78. data/lib/harbor2_client/models/preheat_policy.rb +285 -0
  79. data/lib/harbor2_client/models/project.rb +327 -0
  80. data/lib/harbor2_client/models/project_deletable.rb +195 -0
  81. data/lib/harbor2_client/models/project_metadata.rb +245 -0
  82. data/lib/harbor2_client/models/project_req.rb +235 -0
  83. data/lib/harbor2_client/models/project_summary.rb +263 -0
  84. data/lib/harbor2_client/models/project_summary_quota.rb +195 -0
  85. data/lib/harbor2_client/models/provider_under_project.rb +211 -0
  86. data/lib/harbor2_client/models/reference.rb +235 -0
  87. data/lib/harbor2_client/models/registry.rb +274 -0
  88. data/lib/harbor2_client/models/registry_credential.rb +205 -0
  89. data/lib/harbor2_client/models/repository.rb +255 -0
  90. data/lib/harbor2_client/models/resource_list.rb +175 -0
  91. data/lib/harbor2_client/models/scan_overview.rb +176 -0
  92. data/lib/harbor2_client/models/tag.rb +255 -0
  93. data/lib/harbor2_client/models/task.rb +274 -0
  94. data/lib/harbor2_client/models/vulnerability_summary.rb +208 -0
  95. data/lib/harbor2_client/version.rb +15 -0
  96. data/spec/api/artifact_api_spec.rb +209 -0
  97. data/spec/api/auditlog_api_spec.rb +50 -0
  98. data/spec/api/icon_api_spec.rb +48 -0
  99. data/spec/api/preheat_api_spec.rb +311 -0
  100. data/spec/api/project_api_spec.rb +160 -0
  101. data/spec/api/repository_api_spec.rb +94 -0
  102. data/spec/api/scan_api_spec.rb +66 -0
  103. data/spec/api_client_spec.rb +243 -0
  104. data/spec/configuration_spec.rb +42 -0
  105. data/spec/models/addition_link_spec.rb +47 -0
  106. data/spec/models/addition_links_spec.rb +35 -0
  107. data/spec/models/annotations_spec.rb +35 -0
  108. data/spec/models/artifact_spec.rb +143 -0
  109. data/spec/models/audit_log_spec.rb +71 -0
  110. data/spec/models/cve_allowlist_item_spec.rb +41 -0
  111. data/spec/models/cve_allowlist_spec.rb +71 -0
  112. data/spec/models/error_spec.rb +47 -0
  113. data/spec/models/errors_spec.rb +41 -0
  114. data/spec/models/execution_spec.rb +95 -0
  115. data/spec/models/extra_attrs_spec.rb +35 -0
  116. data/spec/models/icon_spec.rb +47 -0
  117. data/spec/models/instance_spec.rb +107 -0
  118. data/spec/models/label_spec.rb +83 -0
  119. data/spec/models/metadata_spec.rb +71 -0
  120. data/spec/models/metrics_spec.rb +77 -0
  121. data/spec/models/native_report_summary_spec.rb +83 -0
  122. data/spec/models/platform_spec.rb +65 -0
  123. data/spec/models/preheat_policy_spec.rb +101 -0
  124. data/spec/models/project_deletable_spec.rb +47 -0
  125. data/spec/models/project_metadata_spec.rb +77 -0
  126. data/spec/models/project_req_spec.rb +71 -0
  127. data/spec/models/project_spec.rb +125 -0
  128. data/spec/models/project_summary_quota_spec.rb +47 -0
  129. data/spec/models/project_summary_spec.rb +89 -0
  130. data/spec/models/provider_under_project_spec.rb +59 -0
  131. data/spec/models/reference_spec.rb +71 -0
  132. data/spec/models/registry_credential_spec.rb +53 -0
  133. data/spec/models/registry_spec.rb +95 -0
  134. data/spec/models/repository_spec.rb +83 -0
  135. data/spec/models/resource_list_spec.rb +35 -0
  136. data/spec/models/scan_overview_spec.rb +35 -0
  137. data/spec/models/tag_spec.rb +83 -0
  138. data/spec/models/task_spec.rb +95 -0
  139. data/spec/models/vulnerability_summary_spec.rb +53 -0
  140. data/spec/spec_helper.rb +111 -0
  141. metadata +428 -0
@@ -0,0 +1,7 @@
1
+ # Harbor2Client::ScanOverview
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+
7
+
@@ -0,0 +1,15 @@
1
+ # Harbor2Client::Tag
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **id** | **Integer** | The ID of the tag | [optional]
7
+ **repository_id** | **Integer** | The ID of the repository that the tag belongs to | [optional]
8
+ **artifact_id** | **Integer** | The ID of the artifact that the tag attached to | [optional]
9
+ **name** | **String** | The name of the tag | [optional]
10
+ **push_time** | **DateTime** | The push time of the tag | [optional]
11
+ **pull_time** | **DateTime** | The latest pull time of the tag | [optional]
12
+ **immutable** | **BOOLEAN** | The immutable status of the tag | [optional]
13
+ **signed** | **BOOLEAN** | The attribute indicates whether the tag is signed or not | [optional]
14
+
15
+
@@ -0,0 +1,17 @@
1
+ # Harbor2Client::Task
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **id** | **Integer** | The ID of task | [optional]
7
+ **execution_id** | **Integer** | The ID of task execution | [optional]
8
+ **status** | **String** | The status of task | [optional]
9
+ **status_message** | **String** | The status message of task | [optional]
10
+ **run_count** | **Integer** | The count of task run | [optional]
11
+ **extra_attrs** | [**ExtraAttrs**](ExtraAttrs.md) | | [optional]
12
+ **creation_time** | **String** | The creation time of task | [optional]
13
+ **update_time** | **String** | The update time of task | [optional]
14
+ **start_time** | **String** | The start time of task | [optional]
15
+ **end_time** | **String** | The end time of task | [optional]
16
+
17
+
@@ -0,0 +1,10 @@
1
+ # Harbor2Client::VulnerabilitySummary
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **total** | **Integer** | The total number of the found vulnerabilities | [optional]
7
+ **fixable** | **Integer** | The number of the fixable vulnerabilities | [optional]
8
+ **summary** | **Hash<String, Integer>** | Numbers of the vulnerabilities with different severity | [optional]
9
+
10
+
@@ -0,0 +1,55 @@
1
+ #!/bin/sh
2
+ #
3
+ # Generated by: https://github.com/swagger-api/swagger-codegen.git
4
+ #
5
+ # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
6
+ #
7
+ # Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update"
8
+
9
+ git_user_id=$1
10
+ git_repo_id=$2
11
+ release_note=$3
12
+
13
+ if [ "$git_user_id" = "" ]; then
14
+ git_user_id=""
15
+ echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
16
+ fi
17
+
18
+ if [ "$git_repo_id" = "" ]; then
19
+ git_repo_id=""
20
+ echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
21
+ fi
22
+
23
+ if [ "$release_note" = "" ]; then
24
+ release_note=""
25
+ echo "[INFO] No command line input provided. Set \$release_note to $release_note"
26
+ fi
27
+
28
+ # Initialize the local directory as a Git repository
29
+ git init
30
+
31
+ # Adds the files in the local repository and stages them for commit.
32
+ git add .
33
+
34
+ # Commits the tracked changes and prepares them to be pushed to a remote repository.
35
+ git commit -m "$release_note"
36
+
37
+ # Sets the new remote
38
+ git_remote=`git remote`
39
+ if [ "$git_remote" = "" ]; then # git remote not defined
40
+
41
+ if [ "$GIT_TOKEN" = "" ]; then
42
+ echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
43
+ git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
44
+ else
45
+ git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
46
+ fi
47
+
48
+ fi
49
+
50
+ git pull origin master
51
+
52
+ # Pushes (Forces) the changes in the local repository up to the remote repository
53
+ echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
54
+ git push origin master 2>&1 | grep -v 'To https'
55
+
@@ -0,0 +1,46 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ =begin
4
+ #Harbor API
5
+
6
+ #These APIs provide services for manipulating Harbor project.
7
+
8
+ OpenAPI spec version: 2.0
9
+
10
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
11
+ Swagger Codegen version: 2.4.17
12
+
13
+ =end
14
+
15
+ $:.push File.expand_path("../lib", __FILE__)
16
+ require "harbor2_client/version"
17
+
18
+ Gem::Specification.new do |s|
19
+ s.name = "harbor2_client"
20
+ s.version = Harbor2Client::VERSION
21
+ s.platform = Gem::Platform::RUBY
22
+ s.authors = ["Richard Grainger", "Swagger-Codegen"]
23
+ s.email = [""]
24
+ s.homepage = "https://github.com/liger1978/ruby-harbor2_client/"
25
+ s.summary = "Harbor API Ruby Gem"
26
+ s.description = "These APIs provide services for manipulating Harbor projects."
27
+ s.license = "MIT"
28
+ s.required_ruby_version = ">= 1.9"
29
+
30
+ s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1'
31
+ s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0'
32
+ s.add_runtime_dependency 'addressable', '~> 2.3', '>= 2.3.0'
33
+
34
+ s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0'
35
+ s.add_development_dependency 'vcr', '~> 3.0', '>= 3.0.1'
36
+ s.add_development_dependency 'webmock', '~> 1.24', '>= 1.24.3'
37
+ s.add_development_dependency 'autotest', '~> 4.4', '>= 4.4.6'
38
+ s.add_development_dependency 'autotest-rails-pure', '~> 4.1', '>= 4.1.2'
39
+ s.add_development_dependency 'autotest-growl', '~> 0.2', '>= 0.2.16'
40
+ s.add_development_dependency 'autotest-fsevent', '~> 0.2', '>= 0.2.12'
41
+
42
+ s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? }
43
+ s.test_files = `find spec/*`.split("\n")
44
+ s.executables = []
45
+ s.require_paths = ["lib"]
46
+ end
@@ -0,0 +1,81 @@
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.17
10
+
11
+ =end
12
+
13
+ # Common files
14
+ require 'harbor2_client/api_client'
15
+ require 'harbor2_client/api_error'
16
+ require 'harbor2_client/version'
17
+ require 'harbor2_client/configuration'
18
+
19
+ # Models
20
+ require 'harbor2_client/models/addition_link'
21
+ require 'harbor2_client/models/addition_links'
22
+ require 'harbor2_client/models/annotations'
23
+ require 'harbor2_client/models/artifact'
24
+ require 'harbor2_client/models/audit_log'
25
+ require 'harbor2_client/models/cve_allowlist'
26
+ require 'harbor2_client/models/cve_allowlist_item'
27
+ require 'harbor2_client/models/error'
28
+ require 'harbor2_client/models/errors'
29
+ require 'harbor2_client/models/execution'
30
+ require 'harbor2_client/models/extra_attrs'
31
+ require 'harbor2_client/models/icon'
32
+ require 'harbor2_client/models/instance'
33
+ require 'harbor2_client/models/label'
34
+ require 'harbor2_client/models/metadata'
35
+ require 'harbor2_client/models/metrics'
36
+ require 'harbor2_client/models/native_report_summary'
37
+ require 'harbor2_client/models/platform'
38
+ require 'harbor2_client/models/preheat_policy'
39
+ require 'harbor2_client/models/project'
40
+ require 'harbor2_client/models/project_deletable'
41
+ require 'harbor2_client/models/project_metadata'
42
+ require 'harbor2_client/models/project_req'
43
+ require 'harbor2_client/models/project_summary'
44
+ require 'harbor2_client/models/project_summary_quota'
45
+ require 'harbor2_client/models/provider_under_project'
46
+ require 'harbor2_client/models/reference'
47
+ require 'harbor2_client/models/registry'
48
+ require 'harbor2_client/models/registry_credential'
49
+ require 'harbor2_client/models/repository'
50
+ require 'harbor2_client/models/resource_list'
51
+ require 'harbor2_client/models/scan_overview'
52
+ require 'harbor2_client/models/tag'
53
+ require 'harbor2_client/models/task'
54
+ require 'harbor2_client/models/vulnerability_summary'
55
+
56
+ # APIs
57
+ require 'harbor2_client/api/artifact_api'
58
+ require 'harbor2_client/api/auditlog_api'
59
+ require 'harbor2_client/api/icon_api'
60
+ require 'harbor2_client/api/preheat_api'
61
+ require 'harbor2_client/api/project_api'
62
+ require 'harbor2_client/api/repository_api'
63
+ require 'harbor2_client/api/scan_api'
64
+
65
+ module Harbor2Client
66
+ class << self
67
+ # Customize default settings for the SDK using block.
68
+ # Harbor2Client.configure do |config|
69
+ # config.username = "xxx"
70
+ # config.password = "xxx"
71
+ # end
72
+ # If no block given, return the default Configuration object.
73
+ def configure
74
+ if block_given?
75
+ yield(Configuration.default)
76
+ else
77
+ Configuration.default
78
+ end
79
+ end
80
+ end
81
+ end
@@ -0,0 +1,848 @@
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.17
10
+
11
+ =end
12
+
13
+ require 'uri'
14
+
15
+ module Harbor2Client
16
+ class ArtifactApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Add label to artifact
23
+ # Add label to the specified artiact.
24
+ # @param project_name The name of the project
25
+ # @param repository_name The name of the repository. If it contains slash, encode it with URL encoding. e.g. a/b -&gt; a%252Fb
26
+ # @param reference The reference of the artifact, can be digest or tag
27
+ # @param label The label that added to the artifact. Only the ID property is needed.
28
+ # @param [Hash] opts the optional parameters
29
+ # @option opts [String] :x_request_id An unique ID for the request
30
+ # @return [nil]
31
+ def add_label(project_name, repository_name, reference, label, opts = {})
32
+ add_label_with_http_info(project_name, repository_name, reference, label, opts)
33
+ nil
34
+ end
35
+
36
+ # Add label to artifact
37
+ # Add label to the specified artiact.
38
+ # @param project_name The name of the project
39
+ # @param repository_name The name of the repository. If it contains slash, encode it with URL encoding. e.g. a/b -&gt; a%252Fb
40
+ # @param reference The reference of the artifact, can be digest or tag
41
+ # @param label The label that added to the artifact. Only the ID property is needed.
42
+ # @param [Hash] opts the optional parameters
43
+ # @option opts [String] :x_request_id An unique ID for the request
44
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
45
+ def add_label_with_http_info(project_name, repository_name, reference, label, opts = {})
46
+ if @api_client.config.debugging
47
+ @api_client.config.logger.debug 'Calling API: ArtifactApi.add_label ...'
48
+ end
49
+ # verify the required parameter 'project_name' is set
50
+ if @api_client.config.client_side_validation && project_name.nil?
51
+ fail ArgumentError, "Missing the required parameter 'project_name' when calling ArtifactApi.add_label"
52
+ end
53
+ # verify the required parameter 'repository_name' is set
54
+ if @api_client.config.client_side_validation && repository_name.nil?
55
+ fail ArgumentError, "Missing the required parameter 'repository_name' when calling ArtifactApi.add_label"
56
+ end
57
+ # verify the required parameter 'reference' is set
58
+ if @api_client.config.client_side_validation && reference.nil?
59
+ fail ArgumentError, "Missing the required parameter 'reference' when calling ArtifactApi.add_label"
60
+ end
61
+ # verify the required parameter 'label' is set
62
+ if @api_client.config.client_side_validation && label.nil?
63
+ fail ArgumentError, "Missing the required parameter 'label' when calling ArtifactApi.add_label"
64
+ end
65
+ if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1
66
+ fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling ArtifactApi.add_label, the character length must be great than or equal to 1.'
67
+ end
68
+
69
+ # resource path
70
+ local_var_path = '/projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/labels'.sub('{' + 'project_name' + '}', project_name.to_s).sub('{' + 'repository_name' + '}', repository_name.to_s).sub('{' + 'reference' + '}', reference.to_s)
71
+
72
+ # query parameters
73
+ query_params = {}
74
+
75
+ # header parameters
76
+ header_params = {}
77
+ # HTTP header 'Accept' (if needed)
78
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
79
+ # HTTP header 'Content-Type'
80
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
81
+ header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil?
82
+
83
+ # form parameters
84
+ form_params = {}
85
+
86
+ # http body (model)
87
+ post_body = @api_client.object_to_http_body(label)
88
+ auth_names = ['basic']
89
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
90
+ :header_params => header_params,
91
+ :query_params => query_params,
92
+ :form_params => form_params,
93
+ :body => post_body,
94
+ :auth_names => auth_names)
95
+ if @api_client.config.debugging
96
+ @api_client.config.logger.debug "API called: ArtifactApi#add_label\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
97
+ end
98
+ return data, status_code, headers
99
+ end
100
+ # Copy artifact
101
+ # Copy the artifact specified in the \"from\" parameter to the repository.
102
+ # @param project_name The name of the project
103
+ # @param repository_name The name of the repository. If it contains slash, encode it with URL encoding. e.g. a/b -&gt; a%252Fb
104
+ # @param from The artifact from which the new artifact is copied from, the format should be \&quot;project/repository:tag\&quot; or \&quot;project/repository@digest\&quot;.
105
+ # @param [Hash] opts the optional parameters
106
+ # @option opts [String] :x_request_id An unique ID for the request
107
+ # @return [nil]
108
+ def copy_artifact(project_name, repository_name, from, opts = {})
109
+ copy_artifact_with_http_info(project_name, repository_name, from, opts)
110
+ nil
111
+ end
112
+
113
+ # Copy artifact
114
+ # Copy the artifact specified in the \&quot;from\&quot; parameter to the repository.
115
+ # @param project_name The name of the project
116
+ # @param repository_name The name of the repository. If it contains slash, encode it with URL encoding. e.g. a/b -&gt; a%252Fb
117
+ # @param from The artifact from which the new artifact is copied from, the format should be \&quot;project/repository:tag\&quot; or \&quot;project/repository@digest\&quot;.
118
+ # @param [Hash] opts the optional parameters
119
+ # @option opts [String] :x_request_id An unique ID for the request
120
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
121
+ def copy_artifact_with_http_info(project_name, repository_name, from, opts = {})
122
+ if @api_client.config.debugging
123
+ @api_client.config.logger.debug 'Calling API: ArtifactApi.copy_artifact ...'
124
+ end
125
+ # verify the required parameter 'project_name' is set
126
+ if @api_client.config.client_side_validation && project_name.nil?
127
+ fail ArgumentError, "Missing the required parameter 'project_name' when calling ArtifactApi.copy_artifact"
128
+ end
129
+ # verify the required parameter 'repository_name' is set
130
+ if @api_client.config.client_side_validation && repository_name.nil?
131
+ fail ArgumentError, "Missing the required parameter 'repository_name' when calling ArtifactApi.copy_artifact"
132
+ end
133
+ # verify the required parameter 'from' is set
134
+ if @api_client.config.client_side_validation && from.nil?
135
+ fail ArgumentError, "Missing the required parameter 'from' when calling ArtifactApi.copy_artifact"
136
+ end
137
+ if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1
138
+ fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling ArtifactApi.copy_artifact, the character length must be great than or equal to 1.'
139
+ end
140
+
141
+ # resource path
142
+ local_var_path = '/projects/{project_name}/repositories/{repository_name}/artifacts'.sub('{' + 'project_name' + '}', project_name.to_s).sub('{' + 'repository_name' + '}', repository_name.to_s)
143
+
144
+ # query parameters
145
+ query_params = {}
146
+ query_params[:'from'] = from
147
+
148
+ # header parameters
149
+ header_params = {}
150
+ # HTTP header 'Accept' (if needed)
151
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
152
+ # HTTP header 'Content-Type'
153
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
154
+ header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil?
155
+
156
+ # form parameters
157
+ form_params = {}
158
+
159
+ # http body (model)
160
+ post_body = nil
161
+ auth_names = ['basic']
162
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
163
+ :header_params => header_params,
164
+ :query_params => query_params,
165
+ :form_params => form_params,
166
+ :body => post_body,
167
+ :auth_names => auth_names)
168
+ if @api_client.config.debugging
169
+ @api_client.config.logger.debug "API called: ArtifactApi#copy_artifact\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
170
+ end
171
+ return data, status_code, headers
172
+ end
173
+ # Create tag
174
+ # Create a tag for the specified artifact
175
+ # @param project_name The name of the project
176
+ # @param repository_name The name of the repository. If it contains slash, encode it with URL encoding. e.g. a/b -&gt; a%252Fb
177
+ # @param reference The reference of the artifact, can be digest or tag
178
+ # @param tag The JSON object of tag.
179
+ # @param [Hash] opts the optional parameters
180
+ # @option opts [String] :x_request_id An unique ID for the request
181
+ # @return [nil]
182
+ def create_tag(project_name, repository_name, reference, tag, opts = {})
183
+ create_tag_with_http_info(project_name, repository_name, reference, tag, opts)
184
+ nil
185
+ end
186
+
187
+ # Create tag
188
+ # Create a tag for the specified artifact
189
+ # @param project_name The name of the project
190
+ # @param repository_name The name of the repository. If it contains slash, encode it with URL encoding. e.g. a/b -&gt; a%252Fb
191
+ # @param reference The reference of the artifact, can be digest or tag
192
+ # @param tag The JSON object of tag.
193
+ # @param [Hash] opts the optional parameters
194
+ # @option opts [String] :x_request_id An unique ID for the request
195
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
196
+ def create_tag_with_http_info(project_name, repository_name, reference, tag, opts = {})
197
+ if @api_client.config.debugging
198
+ @api_client.config.logger.debug 'Calling API: ArtifactApi.create_tag ...'
199
+ end
200
+ # verify the required parameter 'project_name' is set
201
+ if @api_client.config.client_side_validation && project_name.nil?
202
+ fail ArgumentError, "Missing the required parameter 'project_name' when calling ArtifactApi.create_tag"
203
+ end
204
+ # verify the required parameter 'repository_name' is set
205
+ if @api_client.config.client_side_validation && repository_name.nil?
206
+ fail ArgumentError, "Missing the required parameter 'repository_name' when calling ArtifactApi.create_tag"
207
+ end
208
+ # verify the required parameter 'reference' is set
209
+ if @api_client.config.client_side_validation && reference.nil?
210
+ fail ArgumentError, "Missing the required parameter 'reference' when calling ArtifactApi.create_tag"
211
+ end
212
+ # verify the required parameter 'tag' is set
213
+ if @api_client.config.client_side_validation && tag.nil?
214
+ fail ArgumentError, "Missing the required parameter 'tag' when calling ArtifactApi.create_tag"
215
+ end
216
+ if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1
217
+ fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling ArtifactApi.create_tag, the character length must be great than or equal to 1.'
218
+ end
219
+
220
+ # resource path
221
+ local_var_path = '/projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/tags'.sub('{' + 'project_name' + '}', project_name.to_s).sub('{' + 'repository_name' + '}', repository_name.to_s).sub('{' + 'reference' + '}', reference.to_s)
222
+
223
+ # query parameters
224
+ query_params = {}
225
+
226
+ # header parameters
227
+ header_params = {}
228
+ # HTTP header 'Accept' (if needed)
229
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
230
+ # HTTP header 'Content-Type'
231
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
232
+ header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil?
233
+
234
+ # form parameters
235
+ form_params = {}
236
+
237
+ # http body (model)
238
+ post_body = @api_client.object_to_http_body(tag)
239
+ auth_names = ['basic']
240
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
241
+ :header_params => header_params,
242
+ :query_params => query_params,
243
+ :form_params => form_params,
244
+ :body => post_body,
245
+ :auth_names => auth_names)
246
+ if @api_client.config.debugging
247
+ @api_client.config.logger.debug "API called: ArtifactApi#create_tag\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
248
+ end
249
+ return data, status_code, headers
250
+ end
251
+ # Delete the specific artifact
252
+ # Delete the artifact specified by the reference under the project and repository. The reference can be digest or tag
253
+ # @param project_name The name of the project
254
+ # @param repository_name The name of the repository. If it contains slash, encode it with URL encoding. e.g. a/b -&gt; a%252Fb
255
+ # @param reference The reference of the artifact, can be digest or tag
256
+ # @param [Hash] opts the optional parameters
257
+ # @option opts [String] :x_request_id An unique ID for the request
258
+ # @return [nil]
259
+ def delete_artifact(project_name, repository_name, reference, opts = {})
260
+ delete_artifact_with_http_info(project_name, repository_name, reference, opts)
261
+ nil
262
+ end
263
+
264
+ # Delete the specific artifact
265
+ # Delete the artifact specified by the reference under the project and repository. The reference can be digest or tag
266
+ # @param project_name The name of the project
267
+ # @param repository_name The name of the repository. If it contains slash, encode it with URL encoding. e.g. a/b -&gt; a%252Fb
268
+ # @param reference The reference of the artifact, can be digest or tag
269
+ # @param [Hash] opts the optional parameters
270
+ # @option opts [String] :x_request_id An unique ID for the request
271
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
272
+ def delete_artifact_with_http_info(project_name, repository_name, reference, opts = {})
273
+ if @api_client.config.debugging
274
+ @api_client.config.logger.debug 'Calling API: ArtifactApi.delete_artifact ...'
275
+ end
276
+ # verify the required parameter 'project_name' is set
277
+ if @api_client.config.client_side_validation && project_name.nil?
278
+ fail ArgumentError, "Missing the required parameter 'project_name' when calling ArtifactApi.delete_artifact"
279
+ end
280
+ # verify the required parameter 'repository_name' is set
281
+ if @api_client.config.client_side_validation && repository_name.nil?
282
+ fail ArgumentError, "Missing the required parameter 'repository_name' when calling ArtifactApi.delete_artifact"
283
+ end
284
+ # verify the required parameter 'reference' is set
285
+ if @api_client.config.client_side_validation && reference.nil?
286
+ fail ArgumentError, "Missing the required parameter 'reference' when calling ArtifactApi.delete_artifact"
287
+ end
288
+ if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1
289
+ fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling ArtifactApi.delete_artifact, the character length must be great than or equal to 1.'
290
+ end
291
+
292
+ # resource path
293
+ local_var_path = '/projects/{project_name}/repositories/{repository_name}/artifacts/{reference}'.sub('{' + 'project_name' + '}', project_name.to_s).sub('{' + 'repository_name' + '}', repository_name.to_s).sub('{' + 'reference' + '}', reference.to_s)
294
+
295
+ # query parameters
296
+ query_params = {}
297
+
298
+ # header parameters
299
+ header_params = {}
300
+ # HTTP header 'Accept' (if needed)
301
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
302
+ # HTTP header 'Content-Type'
303
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
304
+ header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil?
305
+
306
+ # form parameters
307
+ form_params = {}
308
+
309
+ # http body (model)
310
+ post_body = nil
311
+ auth_names = ['basic']
312
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
313
+ :header_params => header_params,
314
+ :query_params => query_params,
315
+ :form_params => form_params,
316
+ :body => post_body,
317
+ :auth_names => auth_names)
318
+ if @api_client.config.debugging
319
+ @api_client.config.logger.debug "API called: ArtifactApi#delete_artifact\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
320
+ end
321
+ return data, status_code, headers
322
+ end
323
+ # Delete tag
324
+ # Delete the tag of the specified artifact
325
+ # @param project_name The name of the project
326
+ # @param repository_name The name of the repository. If it contains slash, encode it with URL encoding. e.g. a/b -&gt; a%252Fb
327
+ # @param reference The reference of the artifact, can be digest or tag
328
+ # @param tag_name The name of the tag
329
+ # @param [Hash] opts the optional parameters
330
+ # @option opts [String] :x_request_id An unique ID for the request
331
+ # @return [nil]
332
+ def delete_tag(project_name, repository_name, reference, tag_name, opts = {})
333
+ delete_tag_with_http_info(project_name, repository_name, reference, tag_name, opts)
334
+ nil
335
+ end
336
+
337
+ # Delete tag
338
+ # Delete the tag of the specified artifact
339
+ # @param project_name The name of the project
340
+ # @param repository_name The name of the repository. If it contains slash, encode it with URL encoding. e.g. a/b -&gt; a%252Fb
341
+ # @param reference The reference of the artifact, can be digest or tag
342
+ # @param tag_name The name of the tag
343
+ # @param [Hash] opts the optional parameters
344
+ # @option opts [String] :x_request_id An unique ID for the request
345
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
346
+ def delete_tag_with_http_info(project_name, repository_name, reference, tag_name, opts = {})
347
+ if @api_client.config.debugging
348
+ @api_client.config.logger.debug 'Calling API: ArtifactApi.delete_tag ...'
349
+ end
350
+ # verify the required parameter 'project_name' is set
351
+ if @api_client.config.client_side_validation && project_name.nil?
352
+ fail ArgumentError, "Missing the required parameter 'project_name' when calling ArtifactApi.delete_tag"
353
+ end
354
+ # verify the required parameter 'repository_name' is set
355
+ if @api_client.config.client_side_validation && repository_name.nil?
356
+ fail ArgumentError, "Missing the required parameter 'repository_name' when calling ArtifactApi.delete_tag"
357
+ end
358
+ # verify the required parameter 'reference' is set
359
+ if @api_client.config.client_side_validation && reference.nil?
360
+ fail ArgumentError, "Missing the required parameter 'reference' when calling ArtifactApi.delete_tag"
361
+ end
362
+ # verify the required parameter 'tag_name' is set
363
+ if @api_client.config.client_side_validation && tag_name.nil?
364
+ fail ArgumentError, "Missing the required parameter 'tag_name' when calling ArtifactApi.delete_tag"
365
+ end
366
+ if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1
367
+ fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling ArtifactApi.delete_tag, the character length must be great than or equal to 1.'
368
+ end
369
+
370
+ # resource path
371
+ local_var_path = '/projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/tags/{tag_name}'.sub('{' + 'project_name' + '}', project_name.to_s).sub('{' + 'repository_name' + '}', repository_name.to_s).sub('{' + 'reference' + '}', reference.to_s).sub('{' + 'tag_name' + '}', tag_name.to_s)
372
+
373
+ # query parameters
374
+ query_params = {}
375
+
376
+ # header parameters
377
+ header_params = {}
378
+ # HTTP header 'Accept' (if needed)
379
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
380
+ # HTTP header 'Content-Type'
381
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
382
+ header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil?
383
+
384
+ # form parameters
385
+ form_params = {}
386
+
387
+ # http body (model)
388
+ post_body = nil
389
+ auth_names = ['basic']
390
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
391
+ :header_params => header_params,
392
+ :query_params => query_params,
393
+ :form_params => form_params,
394
+ :body => post_body,
395
+ :auth_names => auth_names)
396
+ if @api_client.config.debugging
397
+ @api_client.config.logger.debug "API called: ArtifactApi#delete_tag\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
398
+ end
399
+ return data, status_code, headers
400
+ end
401
+ # Get the addition of the specific artifact
402
+ # Get the addition of the artifact specified by the reference under the project and repository.
403
+ # @param project_name The name of the project
404
+ # @param repository_name The name of the repository. If it contains slash, encode it with URL encoding. e.g. a/b -&gt; a%252Fb
405
+ # @param reference The reference of the artifact, can be digest or tag
406
+ # @param addition The type of addition.
407
+ # @param [Hash] opts the optional parameters
408
+ # @option opts [String] :x_request_id An unique ID for the request
409
+ # @return [String]
410
+ def get_addition(project_name, repository_name, reference, addition, opts = {})
411
+ data, _status_code, _headers = get_addition_with_http_info(project_name, repository_name, reference, addition, opts)
412
+ data
413
+ end
414
+
415
+ # Get the addition of the specific artifact
416
+ # Get the addition of the artifact specified by the reference under the project and repository.
417
+ # @param project_name The name of the project
418
+ # @param repository_name The name of the repository. If it contains slash, encode it with URL encoding. e.g. a/b -&gt; a%252Fb
419
+ # @param reference The reference of the artifact, can be digest or tag
420
+ # @param addition The type of addition.
421
+ # @param [Hash] opts the optional parameters
422
+ # @option opts [String] :x_request_id An unique ID for the request
423
+ # @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
424
+ def get_addition_with_http_info(project_name, repository_name, reference, addition, opts = {})
425
+ if @api_client.config.debugging
426
+ @api_client.config.logger.debug 'Calling API: ArtifactApi.get_addition ...'
427
+ end
428
+ # verify the required parameter 'project_name' is set
429
+ if @api_client.config.client_side_validation && project_name.nil?
430
+ fail ArgumentError, "Missing the required parameter 'project_name' when calling ArtifactApi.get_addition"
431
+ end
432
+ # verify the required parameter 'repository_name' is set
433
+ if @api_client.config.client_side_validation && repository_name.nil?
434
+ fail ArgumentError, "Missing the required parameter 'repository_name' when calling ArtifactApi.get_addition"
435
+ end
436
+ # verify the required parameter 'reference' is set
437
+ if @api_client.config.client_side_validation && reference.nil?
438
+ fail ArgumentError, "Missing the required parameter 'reference' when calling ArtifactApi.get_addition"
439
+ end
440
+ # verify the required parameter 'addition' is set
441
+ if @api_client.config.client_side_validation && addition.nil?
442
+ fail ArgumentError, "Missing the required parameter 'addition' when calling ArtifactApi.get_addition"
443
+ end
444
+ # verify enum value
445
+ if @api_client.config.client_side_validation && !['build_history', 'values.yaml', 'readme.md', 'dependencies', 'vulnerabilities'].include?(addition)
446
+ fail ArgumentError, "invalid value for 'addition', must be one of build_history, values.yaml, readme.md, dependencies, vulnerabilities"
447
+ end
448
+ if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1
449
+ fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling ArtifactApi.get_addition, the character length must be great than or equal to 1.'
450
+ end
451
+
452
+ # resource path
453
+ local_var_path = '/projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/additions/{addition}'.sub('{' + 'project_name' + '}', project_name.to_s).sub('{' + 'repository_name' + '}', repository_name.to_s).sub('{' + 'reference' + '}', reference.to_s).sub('{' + 'addition' + '}', addition.to_s)
454
+
455
+ # query parameters
456
+ query_params = {}
457
+
458
+ # header parameters
459
+ header_params = {}
460
+ # HTTP header 'Accept' (if needed)
461
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
462
+ # HTTP header 'Content-Type'
463
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
464
+ header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil?
465
+
466
+ # form parameters
467
+ form_params = {}
468
+
469
+ # http body (model)
470
+ post_body = nil
471
+ auth_names = ['basic']
472
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
473
+ :header_params => header_params,
474
+ :query_params => query_params,
475
+ :form_params => form_params,
476
+ :body => post_body,
477
+ :auth_names => auth_names,
478
+ :return_type => 'String')
479
+ if @api_client.config.debugging
480
+ @api_client.config.logger.debug "API called: ArtifactApi#get_addition\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
481
+ end
482
+ return data, status_code, headers
483
+ end
484
+ # Get the specific artifact
485
+ # Get the artifact specified by the reference under the project and repository. The reference can be digest or tag.
486
+ # @param project_name The name of the project
487
+ # @param repository_name The name of the repository. If it contains slash, encode it with URL encoding. e.g. a/b -&gt; a%252Fb
488
+ # @param reference The reference of the artifact, can be digest or tag
489
+ # @param [Hash] opts the optional parameters
490
+ # @option opts [String] :x_request_id An unique ID for the request
491
+ # @option opts [Integer] :page The page number (default to 1)
492
+ # @option opts [Integer] :page_size The size of per page (default to 10)
493
+ # @option opts [BOOLEAN] :with_tag Specify whether the tags are inclued inside the returning artifacts (default to true)
494
+ # @option opts [BOOLEAN] :with_label Specify whether the labels are inclued inside the returning artifacts (default to false)
495
+ # @option opts [BOOLEAN] :with_scan_overview Specify whether the scan overview is inclued inside the returning artifacts (default to false)
496
+ # @option opts [BOOLEAN] :with_signature Specify whether the signature is inclued inside the returning artifacts (default to false)
497
+ # @option opts [BOOLEAN] :with_immutable_status Specify whether the immutable status is inclued inside the tags of the returning artifacts. Only works when setting \&quot;with_tag&#x3D;true\&quot; (default to false)
498
+ # @return [Artifact]
499
+ def get_artifact(project_name, repository_name, reference, opts = {})
500
+ data, _status_code, _headers = get_artifact_with_http_info(project_name, repository_name, reference, opts)
501
+ data
502
+ end
503
+
504
+ # Get the specific artifact
505
+ # Get the artifact specified by the reference under the project and repository. The reference can be digest or tag.
506
+ # @param project_name The name of the project
507
+ # @param repository_name The name of the repository. If it contains slash, encode it with URL encoding. e.g. a/b -&gt; a%252Fb
508
+ # @param reference The reference of the artifact, can be digest or tag
509
+ # @param [Hash] opts the optional parameters
510
+ # @option opts [String] :x_request_id An unique ID for the request
511
+ # @option opts [Integer] :page The page number
512
+ # @option opts [Integer] :page_size The size of per page
513
+ # @option opts [BOOLEAN] :with_tag Specify whether the tags are inclued inside the returning artifacts
514
+ # @option opts [BOOLEAN] :with_label Specify whether the labels are inclued inside the returning artifacts
515
+ # @option opts [BOOLEAN] :with_scan_overview Specify whether the scan overview is inclued inside the returning artifacts
516
+ # @option opts [BOOLEAN] :with_signature Specify whether the signature is inclued inside the returning artifacts
517
+ # @option opts [BOOLEAN] :with_immutable_status Specify whether the immutable status is inclued inside the tags of the returning artifacts. Only works when setting \&quot;with_tag&#x3D;true\&quot;
518
+ # @return [Array<(Artifact, Fixnum, Hash)>] Artifact data, response status code and response headers
519
+ def get_artifact_with_http_info(project_name, repository_name, reference, opts = {})
520
+ if @api_client.config.debugging
521
+ @api_client.config.logger.debug 'Calling API: ArtifactApi.get_artifact ...'
522
+ end
523
+ # verify the required parameter 'project_name' is set
524
+ if @api_client.config.client_side_validation && project_name.nil?
525
+ fail ArgumentError, "Missing the required parameter 'project_name' when calling ArtifactApi.get_artifact"
526
+ end
527
+ # verify the required parameter 'repository_name' is set
528
+ if @api_client.config.client_side_validation && repository_name.nil?
529
+ fail ArgumentError, "Missing the required parameter 'repository_name' when calling ArtifactApi.get_artifact"
530
+ end
531
+ # verify the required parameter 'reference' is set
532
+ if @api_client.config.client_side_validation && reference.nil?
533
+ fail ArgumentError, "Missing the required parameter 'reference' when calling ArtifactApi.get_artifact"
534
+ end
535
+ if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1
536
+ fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling ArtifactApi.get_artifact, the character length must be great than or equal to 1.'
537
+ end
538
+
539
+ if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100
540
+ fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ArtifactApi.get_artifact, must be smaller than or equal to 100.'
541
+ end
542
+
543
+ # resource path
544
+ local_var_path = '/projects/{project_name}/repositories/{repository_name}/artifacts/{reference}'.sub('{' + 'project_name' + '}', project_name.to_s).sub('{' + 'repository_name' + '}', repository_name.to_s).sub('{' + 'reference' + '}', reference.to_s)
545
+
546
+ # query parameters
547
+ query_params = {}
548
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
549
+ query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
550
+ query_params[:'with_tag'] = opts[:'with_tag'] if !opts[:'with_tag'].nil?
551
+ query_params[:'with_label'] = opts[:'with_label'] if !opts[:'with_label'].nil?
552
+ query_params[:'with_scan_overview'] = opts[:'with_scan_overview'] if !opts[:'with_scan_overview'].nil?
553
+ query_params[:'with_signature'] = opts[:'with_signature'] if !opts[:'with_signature'].nil?
554
+ query_params[:'with_immutable_status'] = opts[:'with_immutable_status'] if !opts[:'with_immutable_status'].nil?
555
+
556
+ # header parameters
557
+ header_params = {}
558
+ # HTTP header 'Accept' (if needed)
559
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
560
+ # HTTP header 'Content-Type'
561
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
562
+ header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil?
563
+
564
+ # form parameters
565
+ form_params = {}
566
+
567
+ # http body (model)
568
+ post_body = nil
569
+ auth_names = ['basic']
570
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
571
+ :header_params => header_params,
572
+ :query_params => query_params,
573
+ :form_params => form_params,
574
+ :body => post_body,
575
+ :auth_names => auth_names,
576
+ :return_type => 'Artifact')
577
+ if @api_client.config.debugging
578
+ @api_client.config.logger.debug "API called: ArtifactApi#get_artifact\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
579
+ end
580
+ return data, status_code, headers
581
+ end
582
+ # List artifacts
583
+ # List artifacts under the specific project and repository. Except the basic properties, the other supported queries in \"q\" includes \"tags=*\" to list only tagged artifacts, \"tags=nil\" to list only untagged artifacts, \"tags=~v\" to list artifacts whose tag fuzzy matches \"v\", \"tags=v\" to list artifact whose tag exactly matches \"v\", \"labels=(id1, id2)\" to list artifacts that both labels with id1 and id2 are added to
584
+ # @param project_name The name of the project
585
+ # @param repository_name The name of the repository. If it contains slash, encode it with URL encoding. e.g. a/b -&gt; a%252Fb
586
+ # @param [Hash] opts the optional parameters
587
+ # @option opts [String] :x_request_id An unique ID for the request
588
+ # @option opts [String] :q Query string to query resources. Supported query patterns are \&quot;exact match(k&#x3D;v)\&quot;, \&quot;fuzzy match(k&#x3D;~v)\&quot;, \&quot;range(k&#x3D;[min~max])\&quot;, \&quot;list with union releationship(k&#x3D;{v1 v2 v3})\&quot; and \&quot;list with intersetion relationship(k&#x3D;(v1 v2 v3))\&quot;. The value of range and list can be string(enclosed by \&quot; or &#39;), integer or time(in format \&quot;2020-04-09 02:36:00\&quot;). All of these query patterns should be put in the query string \&quot;q&#x3D;xxx\&quot; and splitted by \&quot;,\&quot;. e.g. q&#x3D;k1&#x3D;v1,k2&#x3D;~v2,k3&#x3D;[min~max]
589
+ # @option opts [Integer] :page The page number (default to 1)
590
+ # @option opts [Integer] :page_size The size of per page (default to 10)
591
+ # @option opts [BOOLEAN] :with_tag Specify whether the tags are included inside the returning artifacts (default to true)
592
+ # @option opts [BOOLEAN] :with_label Specify whether the labels are included inside the returning artifacts (default to false)
593
+ # @option opts [BOOLEAN] :with_scan_overview Specify whether the scan overview is included inside the returning artifacts (default to false)
594
+ # @option opts [BOOLEAN] :with_signature Specify whether the signature is included inside the tags of the returning artifacts. Only works when setting \&quot;with_tag&#x3D;true\&quot; (default to false)
595
+ # @option opts [BOOLEAN] :with_immutable_status Specify whether the immutable status is included inside the tags of the returning artifacts. Only works when setting \&quot;with_tag&#x3D;true\&quot; (default to false)
596
+ # @return [Array<Artifact>]
597
+ def list_artifacts(project_name, repository_name, opts = {})
598
+ data, _status_code, _headers = list_artifacts_with_http_info(project_name, repository_name, opts)
599
+ data
600
+ end
601
+
602
+ # List artifacts
603
+ # List artifacts under the specific project and repository. Except the basic properties, the other supported queries in \&quot;q\&quot; includes \&quot;tags&#x3D;*\&quot; to list only tagged artifacts, \&quot;tags&#x3D;nil\&quot; to list only untagged artifacts, \&quot;tags&#x3D;~v\&quot; to list artifacts whose tag fuzzy matches \&quot;v\&quot;, \&quot;tags&#x3D;v\&quot; to list artifact whose tag exactly matches \&quot;v\&quot;, \&quot;labels&#x3D;(id1, id2)\&quot; to list artifacts that both labels with id1 and id2 are added to
604
+ # @param project_name The name of the project
605
+ # @param repository_name The name of the repository. If it contains slash, encode it with URL encoding. e.g. a/b -&gt; a%252Fb
606
+ # @param [Hash] opts the optional parameters
607
+ # @option opts [String] :x_request_id An unique ID for the request
608
+ # @option opts [String] :q Query string to query resources. Supported query patterns are \&quot;exact match(k&#x3D;v)\&quot;, \&quot;fuzzy match(k&#x3D;~v)\&quot;, \&quot;range(k&#x3D;[min~max])\&quot;, \&quot;list with union releationship(k&#x3D;{v1 v2 v3})\&quot; and \&quot;list with intersetion relationship(k&#x3D;(v1 v2 v3))\&quot;. The value of range and list can be string(enclosed by \&quot; or &#39;), integer or time(in format \&quot;2020-04-09 02:36:00\&quot;). All of these query patterns should be put in the query string \&quot;q&#x3D;xxx\&quot; and splitted by \&quot;,\&quot;. e.g. q&#x3D;k1&#x3D;v1,k2&#x3D;~v2,k3&#x3D;[min~max]
609
+ # @option opts [Integer] :page The page number
610
+ # @option opts [Integer] :page_size The size of per page
611
+ # @option opts [BOOLEAN] :with_tag Specify whether the tags are included inside the returning artifacts
612
+ # @option opts [BOOLEAN] :with_label Specify whether the labels are included inside the returning artifacts
613
+ # @option opts [BOOLEAN] :with_scan_overview Specify whether the scan overview is included inside the returning artifacts
614
+ # @option opts [BOOLEAN] :with_signature Specify whether the signature is included inside the tags of the returning artifacts. Only works when setting \&quot;with_tag&#x3D;true\&quot;
615
+ # @option opts [BOOLEAN] :with_immutable_status Specify whether the immutable status is included inside the tags of the returning artifacts. Only works when setting \&quot;with_tag&#x3D;true\&quot;
616
+ # @return [Array<(Array<Artifact>, Fixnum, Hash)>] Array<Artifact> data, response status code and response headers
617
+ def list_artifacts_with_http_info(project_name, repository_name, opts = {})
618
+ if @api_client.config.debugging
619
+ @api_client.config.logger.debug 'Calling API: ArtifactApi.list_artifacts ...'
620
+ end
621
+ # verify the required parameter 'project_name' is set
622
+ if @api_client.config.client_side_validation && project_name.nil?
623
+ fail ArgumentError, "Missing the required parameter 'project_name' when calling ArtifactApi.list_artifacts"
624
+ end
625
+ # verify the required parameter 'repository_name' is set
626
+ if @api_client.config.client_side_validation && repository_name.nil?
627
+ fail ArgumentError, "Missing the required parameter 'repository_name' when calling ArtifactApi.list_artifacts"
628
+ end
629
+ if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1
630
+ fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling ArtifactApi.list_artifacts, the character length must be great than or equal to 1.'
631
+ end
632
+
633
+ if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100
634
+ fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ArtifactApi.list_artifacts, must be smaller than or equal to 100.'
635
+ end
636
+
637
+ # resource path
638
+ local_var_path = '/projects/{project_name}/repositories/{repository_name}/artifacts'.sub('{' + 'project_name' + '}', project_name.to_s).sub('{' + 'repository_name' + '}', repository_name.to_s)
639
+
640
+ # query parameters
641
+ query_params = {}
642
+ query_params[:'q'] = opts[:'q'] if !opts[:'q'].nil?
643
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
644
+ query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
645
+ query_params[:'with_tag'] = opts[:'with_tag'] if !opts[:'with_tag'].nil?
646
+ query_params[:'with_label'] = opts[:'with_label'] if !opts[:'with_label'].nil?
647
+ query_params[:'with_scan_overview'] = opts[:'with_scan_overview'] if !opts[:'with_scan_overview'].nil?
648
+ query_params[:'with_signature'] = opts[:'with_signature'] if !opts[:'with_signature'].nil?
649
+ query_params[:'with_immutable_status'] = opts[:'with_immutable_status'] if !opts[:'with_immutable_status'].nil?
650
+
651
+ # header parameters
652
+ header_params = {}
653
+ # HTTP header 'Accept' (if needed)
654
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
655
+ # HTTP header 'Content-Type'
656
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
657
+ header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil?
658
+
659
+ # form parameters
660
+ form_params = {}
661
+
662
+ # http body (model)
663
+ post_body = nil
664
+ auth_names = ['basic']
665
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
666
+ :header_params => header_params,
667
+ :query_params => query_params,
668
+ :form_params => form_params,
669
+ :body => post_body,
670
+ :auth_names => auth_names,
671
+ :return_type => 'Array<Artifact>')
672
+ if @api_client.config.debugging
673
+ @api_client.config.logger.debug "API called: ArtifactApi#list_artifacts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
674
+ end
675
+ return data, status_code, headers
676
+ end
677
+ # List tags
678
+ # List tags of the specific artifact
679
+ # @param project_name The name of the project
680
+ # @param repository_name The name of the repository. If it contains slash, encode it with URL encoding. e.g. a/b -&gt; a%252Fb
681
+ # @param reference The reference of the artifact, can be digest or tag
682
+ # @param [Hash] opts the optional parameters
683
+ # @option opts [String] :x_request_id An unique ID for the request
684
+ # @option opts [String] :q Query string to query resources. Supported query patterns are \&quot;exact match(k&#x3D;v)\&quot;, \&quot;fuzzy match(k&#x3D;~v)\&quot;, \&quot;range(k&#x3D;[min~max])\&quot;, \&quot;list with union releationship(k&#x3D;{v1 v2 v3})\&quot; and \&quot;list with intersetion relationship(k&#x3D;(v1 v2 v3))\&quot;. The value of range and list can be string(enclosed by \&quot; or &#39;), integer or time(in format \&quot;2020-04-09 02:36:00\&quot;). All of these query patterns should be put in the query string \&quot;q&#x3D;xxx\&quot; and splitted by \&quot;,\&quot;. e.g. q&#x3D;k1&#x3D;v1,k2&#x3D;~v2,k3&#x3D;[min~max]
685
+ # @option opts [Integer] :page The page number (default to 1)
686
+ # @option opts [Integer] :page_size The size of per page (default to 10)
687
+ # @option opts [BOOLEAN] :with_signature Specify whether the signature is included inside the returning tags (default to false)
688
+ # @option opts [BOOLEAN] :with_immutable_status Specify whether the immutable status is included inside the returning tags (default to false)
689
+ # @return [Array<Tag>]
690
+ def list_tags(project_name, repository_name, reference, opts = {})
691
+ data, _status_code, _headers = list_tags_with_http_info(project_name, repository_name, reference, opts)
692
+ data
693
+ end
694
+
695
+ # List tags
696
+ # List tags of the specific artifact
697
+ # @param project_name The name of the project
698
+ # @param repository_name The name of the repository. If it contains slash, encode it with URL encoding. e.g. a/b -&gt; a%252Fb
699
+ # @param reference The reference of the artifact, can be digest or tag
700
+ # @param [Hash] opts the optional parameters
701
+ # @option opts [String] :x_request_id An unique ID for the request
702
+ # @option opts [String] :q Query string to query resources. Supported query patterns are \&quot;exact match(k&#x3D;v)\&quot;, \&quot;fuzzy match(k&#x3D;~v)\&quot;, \&quot;range(k&#x3D;[min~max])\&quot;, \&quot;list with union releationship(k&#x3D;{v1 v2 v3})\&quot; and \&quot;list with intersetion relationship(k&#x3D;(v1 v2 v3))\&quot;. The value of range and list can be string(enclosed by \&quot; or &#39;), integer or time(in format \&quot;2020-04-09 02:36:00\&quot;). All of these query patterns should be put in the query string \&quot;q&#x3D;xxx\&quot; and splitted by \&quot;,\&quot;. e.g. q&#x3D;k1&#x3D;v1,k2&#x3D;~v2,k3&#x3D;[min~max]
703
+ # @option opts [Integer] :page The page number
704
+ # @option opts [Integer] :page_size The size of per page
705
+ # @option opts [BOOLEAN] :with_signature Specify whether the signature is included inside the returning tags
706
+ # @option opts [BOOLEAN] :with_immutable_status Specify whether the immutable status is included inside the returning tags
707
+ # @return [Array<(Array<Tag>, Fixnum, Hash)>] Array<Tag> data, response status code and response headers
708
+ def list_tags_with_http_info(project_name, repository_name, reference, opts = {})
709
+ if @api_client.config.debugging
710
+ @api_client.config.logger.debug 'Calling API: ArtifactApi.list_tags ...'
711
+ end
712
+ # verify the required parameter 'project_name' is set
713
+ if @api_client.config.client_side_validation && project_name.nil?
714
+ fail ArgumentError, "Missing the required parameter 'project_name' when calling ArtifactApi.list_tags"
715
+ end
716
+ # verify the required parameter 'repository_name' is set
717
+ if @api_client.config.client_side_validation && repository_name.nil?
718
+ fail ArgumentError, "Missing the required parameter 'repository_name' when calling ArtifactApi.list_tags"
719
+ end
720
+ # verify the required parameter 'reference' is set
721
+ if @api_client.config.client_side_validation && reference.nil?
722
+ fail ArgumentError, "Missing the required parameter 'reference' when calling ArtifactApi.list_tags"
723
+ end
724
+ if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1
725
+ fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling ArtifactApi.list_tags, the character length must be great than or equal to 1.'
726
+ end
727
+
728
+ if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100
729
+ fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ArtifactApi.list_tags, must be smaller than or equal to 100.'
730
+ end
731
+
732
+ # resource path
733
+ local_var_path = '/projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/tags'.sub('{' + 'project_name' + '}', project_name.to_s).sub('{' + 'repository_name' + '}', repository_name.to_s).sub('{' + 'reference' + '}', reference.to_s)
734
+
735
+ # query parameters
736
+ query_params = {}
737
+ query_params[:'q'] = opts[:'q'] if !opts[:'q'].nil?
738
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
739
+ query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
740
+ query_params[:'with_signature'] = opts[:'with_signature'] if !opts[:'with_signature'].nil?
741
+ query_params[:'with_immutable_status'] = opts[:'with_immutable_status'] if !opts[:'with_immutable_status'].nil?
742
+
743
+ # header parameters
744
+ header_params = {}
745
+ # HTTP header 'Accept' (if needed)
746
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
747
+ # HTTP header 'Content-Type'
748
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
749
+ header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil?
750
+
751
+ # form parameters
752
+ form_params = {}
753
+
754
+ # http body (model)
755
+ post_body = nil
756
+ auth_names = ['basic']
757
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
758
+ :header_params => header_params,
759
+ :query_params => query_params,
760
+ :form_params => form_params,
761
+ :body => post_body,
762
+ :auth_names => auth_names,
763
+ :return_type => 'Array<Tag>')
764
+ if @api_client.config.debugging
765
+ @api_client.config.logger.debug "API called: ArtifactApi#list_tags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
766
+ end
767
+ return data, status_code, headers
768
+ end
769
+ # Remove label from artifact
770
+ # Remove the label from the specified artiact.
771
+ # @param project_name The name of the project
772
+ # @param repository_name The name of the repository. If it contains slash, encode it with URL encoding. e.g. a/b -&gt; a%252Fb
773
+ # @param reference The reference of the artifact, can be digest or tag
774
+ # @param label_id The ID of the label that removed from the artifact.
775
+ # @param [Hash] opts the optional parameters
776
+ # @option opts [String] :x_request_id An unique ID for the request
777
+ # @return [nil]
778
+ def remove_label(project_name, repository_name, reference, label_id, opts = {})
779
+ remove_label_with_http_info(project_name, repository_name, reference, label_id, opts)
780
+ nil
781
+ end
782
+
783
+ # Remove label from artifact
784
+ # Remove the label from the specified artiact.
785
+ # @param project_name The name of the project
786
+ # @param repository_name The name of the repository. If it contains slash, encode it with URL encoding. e.g. a/b -&gt; a%252Fb
787
+ # @param reference The reference of the artifact, can be digest or tag
788
+ # @param label_id The ID of the label that removed from the artifact.
789
+ # @param [Hash] opts the optional parameters
790
+ # @option opts [String] :x_request_id An unique ID for the request
791
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
792
+ def remove_label_with_http_info(project_name, repository_name, reference, label_id, opts = {})
793
+ if @api_client.config.debugging
794
+ @api_client.config.logger.debug 'Calling API: ArtifactApi.remove_label ...'
795
+ end
796
+ # verify the required parameter 'project_name' is set
797
+ if @api_client.config.client_side_validation && project_name.nil?
798
+ fail ArgumentError, "Missing the required parameter 'project_name' when calling ArtifactApi.remove_label"
799
+ end
800
+ # verify the required parameter 'repository_name' is set
801
+ if @api_client.config.client_side_validation && repository_name.nil?
802
+ fail ArgumentError, "Missing the required parameter 'repository_name' when calling ArtifactApi.remove_label"
803
+ end
804
+ # verify the required parameter 'reference' is set
805
+ if @api_client.config.client_side_validation && reference.nil?
806
+ fail ArgumentError, "Missing the required parameter 'reference' when calling ArtifactApi.remove_label"
807
+ end
808
+ # verify the required parameter 'label_id' is set
809
+ if @api_client.config.client_side_validation && label_id.nil?
810
+ fail ArgumentError, "Missing the required parameter 'label_id' when calling ArtifactApi.remove_label"
811
+ end
812
+ if @api_client.config.client_side_validation && !opts[:'x_request_id'].nil? && opts[:'x_request_id'].to_s.length < 1
813
+ fail ArgumentError, 'invalid value for "opts[:"x_request_id"]" when calling ArtifactApi.remove_label, the character length must be great than or equal to 1.'
814
+ end
815
+
816
+ # resource path
817
+ local_var_path = '/projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/labels/{label_id}'.sub('{' + 'project_name' + '}', project_name.to_s).sub('{' + 'repository_name' + '}', repository_name.to_s).sub('{' + 'reference' + '}', reference.to_s).sub('{' + 'label_id' + '}', label_id.to_s)
818
+
819
+ # query parameters
820
+ query_params = {}
821
+
822
+ # header parameters
823
+ header_params = {}
824
+ # HTTP header 'Accept' (if needed)
825
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
826
+ # HTTP header 'Content-Type'
827
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
828
+ header_params[:'X-Request-Id'] = opts[:'x_request_id'] if !opts[:'x_request_id'].nil?
829
+
830
+ # form parameters
831
+ form_params = {}
832
+
833
+ # http body (model)
834
+ post_body = nil
835
+ auth_names = ['basic']
836
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
837
+ :header_params => header_params,
838
+ :query_params => query_params,
839
+ :form_params => form_params,
840
+ :body => post_body,
841
+ :auth_names => auth_names)
842
+ if @api_client.config.debugging
843
+ @api_client.config.logger.debug "API called: ArtifactApi#remove_label\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
844
+ end
845
+ return data, status_code, headers
846
+ end
847
+ end
848
+ end