pulp_container_client 2.0.0b3 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (156) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +69 -57
  3. data/docs/{ContainerBlob.md → ContainerBlobResponse.md} +2 -2
  4. data/docs/ContainerContainerDistribution.md +6 -12
  5. data/docs/ContainerContainerDistributionResponse.md +31 -0
  6. data/docs/ContainerContainerPushRepository.md +4 -10
  7. data/docs/ContainerContainerPushRepositoryResponse.md +29 -0
  8. data/docs/ContainerContainerRemote.md +8 -12
  9. data/docs/ContainerContainerRemoteResponse.md +49 -0
  10. data/docs/ContainerContainerRepository.md +4 -10
  11. data/docs/ContainerContainerRepositoryResponse.md +29 -0
  12. data/docs/ContainerContentRedirectContentGuard.md +1 -5
  13. data/docs/ContainerContentRedirectContentGuardResponse.md +23 -0
  14. data/docs/{ContainerManifest.md → ContainerManifestResponse.md} +2 -2
  15. data/docs/{ContainerTag.md → ContainerTagResponse.md} +2 -4
  16. data/docs/ContentBlobsApi.md +24 -24
  17. data/docs/ContentManifestsApi.md +24 -24
  18. data/docs/ContentSummary.md +3 -3
  19. data/docs/ContentSummaryResponse.md +21 -0
  20. data/docs/ContentTagsApi.md +26 -26
  21. data/docs/ContentguardsContentRedirectApi.md +55 -55
  22. data/docs/DistributionsContainerApi.md +108 -60
  23. data/docs/InlineResponse200.md +3 -3
  24. data/docs/InlineResponse2001.md +3 -3
  25. data/docs/InlineResponse2002.md +3 -3
  26. data/docs/InlineResponse2003.md +3 -3
  27. data/docs/InlineResponse2004.md +3 -3
  28. data/docs/InlineResponse2005.md +3 -3
  29. data/docs/InlineResponse2006.md +3 -3
  30. data/docs/InlineResponse2007.md +3 -3
  31. data/docs/InlineResponse2008.md +3 -3
  32. data/docs/ManifestCopy.md +1 -1
  33. data/docs/OCIBuildImage.md +23 -0
  34. data/docs/PatchedcontainerContainerDistribution.md +25 -0
  35. data/docs/PatchedcontainerContainerRemote.md +43 -0
  36. data/docs/PatchedcontainerContainerRepository.md +21 -0
  37. data/docs/PatchedcontainerContentRedirectContentGuard.md +19 -0
  38. data/docs/PolicyEnum.md +16 -0
  39. data/docs/RecursiveManage.md +1 -1
  40. data/docs/RemotesContainerApi.md +125 -65
  41. data/docs/RepositoriesContainerApi.md +158 -134
  42. data/docs/RepositoriesContainerPushApi.md +44 -148
  43. data/docs/RepositoriesContainerVersionsApi.md +190 -126
  44. data/docs/RepositorySyncURL.md +1 -1
  45. data/docs/RepositoryVersion.md +1 -9
  46. data/docs/RepositoryVersionResponse.md +25 -0
  47. data/docs/TagCopy.md +1 -1
  48. data/docs/TokenApi.md +8 -16
  49. data/lib/pulp_container_client/api/content_blobs_api.rb +38 -34
  50. data/lib/pulp_container_client/api/content_manifests_api.rb +38 -34
  51. data/lib/pulp_container_client/api/content_tags_api.rb +41 -37
  52. data/lib/pulp_container_client/api/contentguards_content_redirect_api.rb +90 -90
  53. data/lib/pulp_container_client/api/distributions_container_api.rb +153 -90
  54. data/lib/pulp_container_client/api/remotes_container_api.rb +181 -100
  55. data/lib/pulp_container_client/api/repositories_container_api.rb +245 -222
  56. data/lib/pulp_container_client/api/repositories_container_push_api.rb +66 -197
  57. data/lib/pulp_container_client/api/repositories_container_versions_api.rb +278 -188
  58. data/lib/pulp_container_client/api/token_api.rb +8 -14
  59. data/lib/pulp_container_client/api_client.rb +2 -2
  60. data/lib/pulp_container_client/api_error.rb +2 -2
  61. data/lib/pulp_container_client/configuration.rb +3 -3
  62. data/lib/pulp_container_client/models/async_operation_response.rb +3 -2
  63. data/lib/pulp_container_client/models/{container_blob.rb → container_blob_response.rb} +6 -43
  64. data/lib/pulp_container_client/models/container_container_distribution.rb +29 -110
  65. data/lib/pulp_container_client/models/container_container_distribution_response.rb +289 -0
  66. data/lib/pulp_container_client/models/container_container_push_repository.rb +18 -78
  67. data/lib/pulp_container_client/models/container_container_push_repository_response.rb +271 -0
  68. data/lib/pulp_container_client/models/container_container_remote.rb +29 -227
  69. data/lib/pulp_container_client/models/container_container_remote_response.rb +409 -0
  70. data/lib/pulp_container_client/models/container_container_repository.rb +18 -78
  71. data/lib/pulp_container_client/models/container_container_repository_response.rb +271 -0
  72. data/lib/pulp_container_client/models/container_content_redirect_content_guard.rb +4 -56
  73. data/lib/pulp_container_client/models/container_content_redirect_content_guard_response.rb +243 -0
  74. data/lib/pulp_container_client/models/{container_manifest.rb → container_manifest_response.rb} +6 -43
  75. data/lib/pulp_container_client/models/{container_tag.rb → container_tag_response.rb} +7 -40
  76. data/lib/pulp_container_client/models/content_summary.rb +9 -15
  77. data/lib/pulp_container_client/models/content_summary_response.rb +240 -0
  78. data/lib/pulp_container_client/models/inline_response200.rb +3 -13
  79. data/lib/pulp_container_client/models/inline_response2001.rb +3 -13
  80. data/lib/pulp_container_client/models/inline_response2002.rb +3 -13
  81. data/lib/pulp_container_client/models/inline_response2003.rb +3 -13
  82. data/lib/pulp_container_client/models/inline_response2004.rb +3 -13
  83. data/lib/pulp_container_client/models/inline_response2005.rb +3 -13
  84. data/lib/pulp_container_client/models/inline_response2006.rb +3 -13
  85. data/lib/pulp_container_client/models/inline_response2007.rb +3 -13
  86. data/lib/pulp_container_client/models/inline_response2008.rb +3 -13
  87. data/lib/pulp_container_client/models/manifest_copy.rb +4 -3
  88. data/lib/pulp_container_client/models/oci_build_image.rb +240 -0
  89. data/lib/pulp_container_client/models/patchedcontainer_container_distribution.rb +250 -0
  90. data/lib/pulp_container_client/models/patchedcontainer_container_remote.rb +365 -0
  91. data/lib/pulp_container_client/models/patchedcontainer_container_repository.rb +229 -0
  92. data/lib/pulp_container_client/models/patchedcontainer_content_redirect_content_guard.rb +219 -0
  93. data/lib/pulp_container_client/models/policy_enum.rb +37 -0
  94. data/lib/pulp_container_client/models/recursive_manage.rb +4 -3
  95. data/lib/pulp_container_client/models/repository_sync_url.rb +3 -8
  96. data/lib/pulp_container_client/models/repository_version.rb +7 -43
  97. data/lib/pulp_container_client/models/repository_version_response.rb +246 -0
  98. data/lib/pulp_container_client/models/tag_copy.rb +4 -3
  99. data/lib/pulp_container_client/models/tag_image.rb +3 -40
  100. data/lib/pulp_container_client/models/un_tag_image.rb +3 -21
  101. data/lib/pulp_container_client/version.rb +3 -3
  102. data/lib/pulp_container_client.rb +18 -5
  103. data/pulp_container_client.gemspec +4 -4
  104. data/spec/api/content_blobs_api_spec.rb +11 -11
  105. data/spec/api/content_manifests_api_spec.rb +11 -11
  106. data/spec/api/content_tags_api_spec.rb +12 -12
  107. data/spec/api/contentguards_content_redirect_api_spec.rb +17 -17
  108. data/spec/api/distributions_container_api_spec.rb +39 -18
  109. data/spec/api/remotes_container_api_spec.rb +48 -21
  110. data/spec/api/repositories_container_api_spec.rb +41 -32
  111. data/spec/api/repositories_container_push_api_spec.rb +17 -40
  112. data/spec/api/repositories_container_versions_api_spec.rb +76 -46
  113. data/spec/api/token_api_spec.rb +4 -6
  114. data/spec/api_client_spec.rb +2 -2
  115. data/spec/configuration_spec.rb +2 -2
  116. data/spec/models/async_operation_response_spec.rb +2 -2
  117. data/spec/models/{container_blob_spec.rb → container_blob_response_spec.rb} +8 -8
  118. data/spec/models/container_container_distribution_response_spec.rb +83 -0
  119. data/spec/models/container_container_distribution_spec.rb +5 -23
  120. data/spec/models/container_container_push_repository_response_spec.rb +77 -0
  121. data/spec/models/container_container_push_repository_spec.rb +5 -23
  122. data/spec/models/container_container_remote_response_spec.rb +137 -0
  123. data/spec/models/container_container_remote_spec.rb +7 -23
  124. data/spec/models/container_container_repository_response_spec.rb +77 -0
  125. data/spec/models/container_container_repository_spec.rb +5 -23
  126. data/spec/models/container_content_redirect_content_guard_response_spec.rb +59 -0
  127. data/spec/models/container_content_redirect_content_guard_spec.rb +2 -14
  128. data/spec/models/{container_manifest_spec.rb → container_manifest_response_spec.rb} +8 -8
  129. data/spec/models/{container_tag_spec.rb → container_tag_response_spec.rb} +8 -14
  130. data/spec/models/content_summary_response_spec.rb +53 -0
  131. data/spec/models/content_summary_spec.rb +2 -2
  132. data/spec/models/inline_response2001_spec.rb +2 -2
  133. data/spec/models/inline_response2002_spec.rb +2 -2
  134. data/spec/models/inline_response2003_spec.rb +2 -2
  135. data/spec/models/inline_response2004_spec.rb +2 -2
  136. data/spec/models/inline_response2005_spec.rb +2 -2
  137. data/spec/models/inline_response2006_spec.rb +2 -2
  138. data/spec/models/inline_response2007_spec.rb +2 -2
  139. data/spec/models/inline_response2008_spec.rb +2 -2
  140. data/spec/models/inline_response200_spec.rb +2 -2
  141. data/spec/models/manifest_copy_spec.rb +2 -2
  142. data/spec/models/oci_build_image_spec.rb +59 -0
  143. data/spec/models/patchedcontainer_container_distribution_spec.rb +65 -0
  144. data/spec/models/patchedcontainer_container_remote_spec.rb +119 -0
  145. data/spec/models/patchedcontainer_container_repository_spec.rb +53 -0
  146. data/spec/models/patchedcontainer_content_redirect_content_guard_spec.rb +47 -0
  147. data/spec/models/policy_enum_spec.rb +35 -0
  148. data/spec/models/recursive_manage_spec.rb +2 -2
  149. data/spec/models/repository_sync_url_spec.rb +2 -2
  150. data/spec/models/repository_version_response_spec.rb +65 -0
  151. data/spec/models/repository_version_spec.rb +2 -26
  152. data/spec/models/tag_copy_spec.rb +2 -2
  153. data/spec/models/tag_image_spec.rb +2 -2
  154. data/spec/models/un_tag_image_spec.rb +2 -2
  155. data/spec/spec_helper.rb +2 -2
  156. metadata +93 -41
@@ -0,0 +1,250 @@
1
+ =begin
2
+ #Pulp 3 API
3
+
4
+ #Fetch, Upload, Organize, and Distribute Software Packages
5
+
6
+ The version of the OpenAPI document: v3
7
+ Contact: pulp-list@redhat.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.2.3
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module PulpContainerClient
16
+ # A serializer for ContainerDistribution.
17
+ class PatchedcontainerContainerDistribution
18
+ # The base (relative) path component of the published url. Avoid paths that overlap with other distribution base paths (e.g. \"foo\" and \"foo/bar\")
19
+ attr_accessor :base_path
20
+
21
+ # RepositoryVersion to be served
22
+ attr_accessor :repository_version
23
+
24
+ # An optional content-guard. If none is specified, a default one will be used.
25
+ attr_accessor :content_guard
26
+
27
+ # The latest RepositoryVersion for this Repository will be served.
28
+ attr_accessor :repository
29
+
30
+ # A unique name. Ex, `rawhide` and `stable`.
31
+ attr_accessor :name
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+ :'base_path' => :'base_path',
37
+ :'repository_version' => :'repository_version',
38
+ :'content_guard' => :'content_guard',
39
+ :'repository' => :'repository',
40
+ :'name' => :'name'
41
+ }
42
+ end
43
+
44
+ # Attribute type mapping.
45
+ def self.openapi_types
46
+ {
47
+ :'base_path' => :'String',
48
+ :'repository_version' => :'String',
49
+ :'content_guard' => :'String',
50
+ :'repository' => :'String',
51
+ :'name' => :'String'
52
+ }
53
+ end
54
+
55
+ # List of attributes with nullable: true
56
+ def self.openapi_nullable
57
+ Set.new([
58
+ :'repository_version',
59
+ :'repository',
60
+ ])
61
+ end
62
+
63
+ # Initializes the object
64
+ # @param [Hash] attributes Model attributes in the form of hash
65
+ def initialize(attributes = {})
66
+ if (!attributes.is_a?(Hash))
67
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpContainerClient::PatchedcontainerContainerDistribution` initialize method"
68
+ end
69
+
70
+ # check to see if the attribute exists and convert string to symbol for hash key
71
+ attributes = attributes.each_with_object({}) { |(k, v), h|
72
+ if (!self.class.attribute_map.key?(k.to_sym))
73
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpContainerClient::PatchedcontainerContainerDistribution`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
74
+ end
75
+ h[k.to_sym] = v
76
+ }
77
+
78
+ if attributes.key?(:'base_path')
79
+ self.base_path = attributes[:'base_path']
80
+ end
81
+
82
+ if attributes.key?(:'repository_version')
83
+ self.repository_version = attributes[:'repository_version']
84
+ end
85
+
86
+ if attributes.key?(:'content_guard')
87
+ self.content_guard = attributes[:'content_guard']
88
+ end
89
+
90
+ if attributes.key?(:'repository')
91
+ self.repository = attributes[:'repository']
92
+ end
93
+
94
+ if attributes.key?(:'name')
95
+ self.name = attributes[:'name']
96
+ end
97
+ end
98
+
99
+ # Show invalid properties with the reasons. Usually used together with valid?
100
+ # @return Array for valid properties with the reasons
101
+ def list_invalid_properties
102
+ invalid_properties = Array.new
103
+ invalid_properties
104
+ end
105
+
106
+ # Check to see if the all the properties in the model are valid
107
+ # @return true if the model is valid
108
+ def valid?
109
+ true
110
+ end
111
+
112
+ # Checks equality by comparing each attribute.
113
+ # @param [Object] Object to be compared
114
+ def ==(o)
115
+ return true if self.equal?(o)
116
+ self.class == o.class &&
117
+ base_path == o.base_path &&
118
+ repository_version == o.repository_version &&
119
+ content_guard == o.content_guard &&
120
+ repository == o.repository &&
121
+ name == o.name
122
+ end
123
+
124
+ # @see the `==` method
125
+ # @param [Object] Object to be compared
126
+ def eql?(o)
127
+ self == o
128
+ end
129
+
130
+ # Calculates hash code according to all attributes.
131
+ # @return [Integer] Hash code
132
+ def hash
133
+ [base_path, repository_version, content_guard, repository, name].hash
134
+ end
135
+
136
+ # Builds the object from hash
137
+ # @param [Hash] attributes Model attributes in the form of hash
138
+ # @return [Object] Returns the model itself
139
+ def self.build_from_hash(attributes)
140
+ new.build_from_hash(attributes)
141
+ end
142
+
143
+ # Builds the object from hash
144
+ # @param [Hash] attributes Model attributes in the form of hash
145
+ # @return [Object] Returns the model itself
146
+ def build_from_hash(attributes)
147
+ return nil unless attributes.is_a?(Hash)
148
+ self.class.openapi_types.each_pair do |key, type|
149
+ if type =~ /\AArray<(.*)>/i
150
+ # check to ensure the input is an array given that the attribute
151
+ # is documented as an array but the input is not
152
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
153
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
154
+ end
155
+ elsif !attributes[self.class.attribute_map[key]].nil?
156
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
157
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
158
+ end
159
+
160
+ self
161
+ end
162
+
163
+ # Deserializes the data based on type
164
+ # @param string type Data type
165
+ # @param string value Value to be deserialized
166
+ # @return [Object] Deserialized data
167
+ def _deserialize(type, value)
168
+ case type.to_sym
169
+ when :DateTime
170
+ DateTime.parse(value)
171
+ when :Date
172
+ Date.parse(value)
173
+ when :String
174
+ value.to_s
175
+ when :Integer
176
+ value.to_i
177
+ when :Float
178
+ value.to_f
179
+ when :Boolean
180
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
181
+ true
182
+ else
183
+ false
184
+ end
185
+ when :Object
186
+ # generic object (usually a Hash), return directly
187
+ value
188
+ when /\AArray<(?<inner_type>.+)>\z/
189
+ inner_type = Regexp.last_match[:inner_type]
190
+ value.map { |v| _deserialize(inner_type, v) }
191
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
192
+ k_type = Regexp.last_match[:k_type]
193
+ v_type = Regexp.last_match[:v_type]
194
+ {}.tap do |hash|
195
+ value.each do |k, v|
196
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
197
+ end
198
+ end
199
+ else # model
200
+ PulpContainerClient.const_get(type).build_from_hash(value)
201
+ end
202
+ end
203
+
204
+ # Returns the string representation of the object
205
+ # @return [String] String presentation of the object
206
+ def to_s
207
+ to_hash.to_s
208
+ end
209
+
210
+ # to_body is an alias to to_hash (backward compatibility)
211
+ # @return [Hash] Returns the object in the form of hash
212
+ def to_body
213
+ to_hash
214
+ end
215
+
216
+ # Returns the object in the form of hash
217
+ # @return [Hash] Returns the object in the form of hash
218
+ def to_hash
219
+ hash = {}
220
+ self.class.attribute_map.each_pair do |attr, param|
221
+ value = self.send(attr)
222
+ if value.nil?
223
+ is_nullable = self.class.openapi_nullable.include?(attr)
224
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
225
+ end
226
+
227
+ hash[param] = _to_hash(value)
228
+ end
229
+ hash
230
+ end
231
+
232
+ # Outputs non-array value in the form of hash
233
+ # For object, use to_hash. Otherwise, just return the value
234
+ # @param [Object] value Any valid value
235
+ # @return [Hash] Returns the value in the form of hash
236
+ def _to_hash(value)
237
+ if value.is_a?(Array)
238
+ value.compact.map { |v| _to_hash(v) }
239
+ elsif value.is_a?(Hash)
240
+ {}.tap do |hash|
241
+ value.each { |k, v| hash[k] = _to_hash(v) }
242
+ end
243
+ elsif value.respond_to? :to_hash
244
+ value.to_hash
245
+ else
246
+ value
247
+ end
248
+ end
249
+ end
250
+ end
@@ -0,0 +1,365 @@
1
+ =begin
2
+ #Pulp 3 API
3
+
4
+ #Fetch, Upload, Organize, and Distribute Software Packages
5
+
6
+ The version of the OpenAPI document: v3
7
+ Contact: pulp-list@redhat.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.2.3
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module PulpContainerClient
16
+ # A Serializer for ContainerRemote.
17
+ class PatchedcontainerContainerRemote
18
+ # A unique name for this remote.
19
+ attr_accessor :name
20
+
21
+ # The URL of an external content source.
22
+ attr_accessor :url
23
+
24
+ # A PEM encoded CA certificate used to validate the server certificate presented by the remote server.
25
+ attr_accessor :ca_cert
26
+
27
+ # A PEM encoded client certificate used for authentication.
28
+ attr_accessor :client_cert
29
+
30
+ # A PEM encoded private key used for authentication.
31
+ attr_accessor :client_key
32
+
33
+ # If True, TLS peer validation must be performed.
34
+ attr_accessor :tls_validation
35
+
36
+ # The proxy URL. Format: scheme://user:password@host:port
37
+ attr_accessor :proxy_url
38
+
39
+ # The username to be used for authentication when syncing.
40
+ attr_accessor :username
41
+
42
+ # The password to be used for authentication when syncing.
43
+ attr_accessor :password
44
+
45
+ # Total number of simultaneous connections.
46
+ attr_accessor :download_concurrency
47
+
48
+ # immediate - All manifests and blobs are downloaded and saved during a sync. on_demand - Only tags and manifests are downloaded. Blobs are not downloaded until they are requested for the first time by a client. streamed - Blobs are streamed to the client with every request and never saved.
49
+ attr_accessor :policy
50
+
51
+ # Name of the upstream repository
52
+ attr_accessor :upstream_name
53
+
54
+ # A list of tags to include during sync. Wildcards *, ? are recognized. 'include_tags' is evaluated before 'exclude_tags'.
55
+ attr_accessor :include_tags
56
+
57
+ # A list of tags to exclude during sync. Wildcards *, ? are recognized. 'exclude_tags' is evaluated after 'include_tags'.
58
+ attr_accessor :exclude_tags
59
+
60
+ # Attribute mapping from ruby-style variable name to JSON key.
61
+ def self.attribute_map
62
+ {
63
+ :'name' => :'name',
64
+ :'url' => :'url',
65
+ :'ca_cert' => :'ca_cert',
66
+ :'client_cert' => :'client_cert',
67
+ :'client_key' => :'client_key',
68
+ :'tls_validation' => :'tls_validation',
69
+ :'proxy_url' => :'proxy_url',
70
+ :'username' => :'username',
71
+ :'password' => :'password',
72
+ :'download_concurrency' => :'download_concurrency',
73
+ :'policy' => :'policy',
74
+ :'upstream_name' => :'upstream_name',
75
+ :'include_tags' => :'include_tags',
76
+ :'exclude_tags' => :'exclude_tags'
77
+ }
78
+ end
79
+
80
+ # Attribute type mapping.
81
+ def self.openapi_types
82
+ {
83
+ :'name' => :'String',
84
+ :'url' => :'String',
85
+ :'ca_cert' => :'String',
86
+ :'client_cert' => :'String',
87
+ :'client_key' => :'String',
88
+ :'tls_validation' => :'Boolean',
89
+ :'proxy_url' => :'String',
90
+ :'username' => :'String',
91
+ :'password' => :'String',
92
+ :'download_concurrency' => :'Integer',
93
+ :'policy' => :'PolicyEnum',
94
+ :'upstream_name' => :'String',
95
+ :'include_tags' => :'Array<String>',
96
+ :'exclude_tags' => :'Array<String>'
97
+ }
98
+ end
99
+
100
+ # List of attributes with nullable: true
101
+ def self.openapi_nullable
102
+ Set.new([
103
+ :'ca_cert',
104
+ :'client_cert',
105
+ :'client_key',
106
+ :'proxy_url',
107
+ :'username',
108
+ :'password',
109
+ :'include_tags',
110
+ :'exclude_tags'
111
+ ])
112
+ end
113
+
114
+ # Initializes the object
115
+ # @param [Hash] attributes Model attributes in the form of hash
116
+ def initialize(attributes = {})
117
+ if (!attributes.is_a?(Hash))
118
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpContainerClient::PatchedcontainerContainerRemote` initialize method"
119
+ end
120
+
121
+ # check to see if the attribute exists and convert string to symbol for hash key
122
+ attributes = attributes.each_with_object({}) { |(k, v), h|
123
+ if (!self.class.attribute_map.key?(k.to_sym))
124
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpContainerClient::PatchedcontainerContainerRemote`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
125
+ end
126
+ h[k.to_sym] = v
127
+ }
128
+
129
+ if attributes.key?(:'name')
130
+ self.name = attributes[:'name']
131
+ end
132
+
133
+ if attributes.key?(:'url')
134
+ self.url = attributes[:'url']
135
+ end
136
+
137
+ if attributes.key?(:'ca_cert')
138
+ self.ca_cert = attributes[:'ca_cert']
139
+ end
140
+
141
+ if attributes.key?(:'client_cert')
142
+ self.client_cert = attributes[:'client_cert']
143
+ end
144
+
145
+ if attributes.key?(:'client_key')
146
+ self.client_key = attributes[:'client_key']
147
+ end
148
+
149
+ if attributes.key?(:'tls_validation')
150
+ self.tls_validation = attributes[:'tls_validation']
151
+ end
152
+
153
+ if attributes.key?(:'proxy_url')
154
+ self.proxy_url = attributes[:'proxy_url']
155
+ end
156
+
157
+ if attributes.key?(:'username')
158
+ self.username = attributes[:'username']
159
+ end
160
+
161
+ if attributes.key?(:'password')
162
+ self.password = attributes[:'password']
163
+ end
164
+
165
+ if attributes.key?(:'download_concurrency')
166
+ self.download_concurrency = attributes[:'download_concurrency']
167
+ end
168
+
169
+ if attributes.key?(:'policy')
170
+ self.policy = attributes[:'policy']
171
+ end
172
+
173
+ if attributes.key?(:'upstream_name')
174
+ self.upstream_name = attributes[:'upstream_name']
175
+ end
176
+
177
+ if attributes.key?(:'include_tags')
178
+ if (value = attributes[:'include_tags']).is_a?(Array)
179
+ self.include_tags = value
180
+ end
181
+ end
182
+
183
+ if attributes.key?(:'exclude_tags')
184
+ if (value = attributes[:'exclude_tags']).is_a?(Array)
185
+ self.exclude_tags = value
186
+ end
187
+ end
188
+ end
189
+
190
+ # Show invalid properties with the reasons. Usually used together with valid?
191
+ # @return Array for valid properties with the reasons
192
+ def list_invalid_properties
193
+ invalid_properties = Array.new
194
+ if !@download_concurrency.nil? && @download_concurrency < 1
195
+ invalid_properties.push('invalid value for "download_concurrency", must be greater than or equal to 1.')
196
+ end
197
+
198
+ invalid_properties
199
+ end
200
+
201
+ # Check to see if the all the properties in the model are valid
202
+ # @return true if the model is valid
203
+ def valid?
204
+ return false if !@download_concurrency.nil? && @download_concurrency < 1
205
+ true
206
+ end
207
+
208
+ # Custom attribute writer method with validation
209
+ # @param [Object] download_concurrency Value to be assigned
210
+ def download_concurrency=(download_concurrency)
211
+ if !download_concurrency.nil? && download_concurrency < 1
212
+ fail ArgumentError, 'invalid value for "download_concurrency", must be greater than or equal to 1.'
213
+ end
214
+
215
+ @download_concurrency = download_concurrency
216
+ end
217
+
218
+ # Checks equality by comparing each attribute.
219
+ # @param [Object] Object to be compared
220
+ def ==(o)
221
+ return true if self.equal?(o)
222
+ self.class == o.class &&
223
+ name == o.name &&
224
+ url == o.url &&
225
+ ca_cert == o.ca_cert &&
226
+ client_cert == o.client_cert &&
227
+ client_key == o.client_key &&
228
+ tls_validation == o.tls_validation &&
229
+ proxy_url == o.proxy_url &&
230
+ username == o.username &&
231
+ password == o.password &&
232
+ download_concurrency == o.download_concurrency &&
233
+ policy == o.policy &&
234
+ upstream_name == o.upstream_name &&
235
+ include_tags == o.include_tags &&
236
+ exclude_tags == o.exclude_tags
237
+ end
238
+
239
+ # @see the `==` method
240
+ # @param [Object] Object to be compared
241
+ def eql?(o)
242
+ self == o
243
+ end
244
+
245
+ # Calculates hash code according to all attributes.
246
+ # @return [Integer] Hash code
247
+ def hash
248
+ [name, url, ca_cert, client_cert, client_key, tls_validation, proxy_url, username, password, download_concurrency, policy, upstream_name, include_tags, exclude_tags].hash
249
+ end
250
+
251
+ # Builds the object from hash
252
+ # @param [Hash] attributes Model attributes in the form of hash
253
+ # @return [Object] Returns the model itself
254
+ def self.build_from_hash(attributes)
255
+ new.build_from_hash(attributes)
256
+ end
257
+
258
+ # Builds the object from hash
259
+ # @param [Hash] attributes Model attributes in the form of hash
260
+ # @return [Object] Returns the model itself
261
+ def build_from_hash(attributes)
262
+ return nil unless attributes.is_a?(Hash)
263
+ self.class.openapi_types.each_pair do |key, type|
264
+ if type =~ /\AArray<(.*)>/i
265
+ # check to ensure the input is an array given that the attribute
266
+ # is documented as an array but the input is not
267
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
268
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
269
+ end
270
+ elsif !attributes[self.class.attribute_map[key]].nil?
271
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
272
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
273
+ end
274
+
275
+ self
276
+ end
277
+
278
+ # Deserializes the data based on type
279
+ # @param string type Data type
280
+ # @param string value Value to be deserialized
281
+ # @return [Object] Deserialized data
282
+ def _deserialize(type, value)
283
+ case type.to_sym
284
+ when :DateTime
285
+ DateTime.parse(value)
286
+ when :Date
287
+ Date.parse(value)
288
+ when :String
289
+ value.to_s
290
+ when :Integer
291
+ value.to_i
292
+ when :Float
293
+ value.to_f
294
+ when :Boolean
295
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
296
+ true
297
+ else
298
+ false
299
+ end
300
+ when :Object
301
+ # generic object (usually a Hash), return directly
302
+ value
303
+ when /\AArray<(?<inner_type>.+)>\z/
304
+ inner_type = Regexp.last_match[:inner_type]
305
+ value.map { |v| _deserialize(inner_type, v) }
306
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
307
+ k_type = Regexp.last_match[:k_type]
308
+ v_type = Regexp.last_match[:v_type]
309
+ {}.tap do |hash|
310
+ value.each do |k, v|
311
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
312
+ end
313
+ end
314
+ else # model
315
+ PulpContainerClient.const_get(type).build_from_hash(value)
316
+ end
317
+ end
318
+
319
+ # Returns the string representation of the object
320
+ # @return [String] String presentation of the object
321
+ def to_s
322
+ to_hash.to_s
323
+ end
324
+
325
+ # to_body is an alias to to_hash (backward compatibility)
326
+ # @return [Hash] Returns the object in the form of hash
327
+ def to_body
328
+ to_hash
329
+ end
330
+
331
+ # Returns the object in the form of hash
332
+ # @return [Hash] Returns the object in the form of hash
333
+ def to_hash
334
+ hash = {}
335
+ self.class.attribute_map.each_pair do |attr, param|
336
+ value = self.send(attr)
337
+ if value.nil?
338
+ is_nullable = self.class.openapi_nullable.include?(attr)
339
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
340
+ end
341
+
342
+ hash[param] = _to_hash(value)
343
+ end
344
+ hash
345
+ end
346
+
347
+ # Outputs non-array value in the form of hash
348
+ # For object, use to_hash. Otherwise, just return the value
349
+ # @param [Object] value Any valid value
350
+ # @return [Hash] Returns the value in the form of hash
351
+ def _to_hash(value)
352
+ if value.is_a?(Array)
353
+ value.compact.map { |v| _to_hash(v) }
354
+ elsif value.is_a?(Hash)
355
+ {}.tap do |hash|
356
+ value.each { |k, v| hash[k] = _to_hash(v) }
357
+ end
358
+ elsif value.respond_to? :to_hash
359
+ value.to_hash
360
+ else
361
+ value
362
+ end
363
+ end
364
+ end
365
+ end