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.
- checksums.yaml +4 -4
- data/README.md +69 -57
- data/docs/{ContainerBlob.md → ContainerBlobResponse.md} +2 -2
- data/docs/ContainerContainerDistribution.md +6 -12
- data/docs/ContainerContainerDistributionResponse.md +31 -0
- data/docs/ContainerContainerPushRepository.md +4 -10
- data/docs/ContainerContainerPushRepositoryResponse.md +29 -0
- data/docs/ContainerContainerRemote.md +8 -12
- data/docs/ContainerContainerRemoteResponse.md +49 -0
- data/docs/ContainerContainerRepository.md +4 -10
- data/docs/ContainerContainerRepositoryResponse.md +29 -0
- data/docs/ContainerContentRedirectContentGuard.md +1 -5
- data/docs/ContainerContentRedirectContentGuardResponse.md +23 -0
- data/docs/{ContainerManifest.md → ContainerManifestResponse.md} +2 -2
- data/docs/{ContainerTag.md → ContainerTagResponse.md} +2 -4
- data/docs/ContentBlobsApi.md +24 -24
- data/docs/ContentManifestsApi.md +24 -24
- data/docs/ContentSummary.md +3 -3
- data/docs/ContentSummaryResponse.md +21 -0
- data/docs/ContentTagsApi.md +26 -26
- data/docs/ContentguardsContentRedirectApi.md +55 -55
- data/docs/DistributionsContainerApi.md +108 -60
- data/docs/InlineResponse200.md +3 -3
- data/docs/InlineResponse2001.md +3 -3
- data/docs/InlineResponse2002.md +3 -3
- data/docs/InlineResponse2003.md +3 -3
- data/docs/InlineResponse2004.md +3 -3
- data/docs/InlineResponse2005.md +3 -3
- data/docs/InlineResponse2006.md +3 -3
- data/docs/InlineResponse2007.md +3 -3
- data/docs/InlineResponse2008.md +3 -3
- data/docs/ManifestCopy.md +1 -1
- data/docs/OCIBuildImage.md +23 -0
- data/docs/PatchedcontainerContainerDistribution.md +25 -0
- data/docs/PatchedcontainerContainerRemote.md +43 -0
- data/docs/PatchedcontainerContainerRepository.md +21 -0
- data/docs/PatchedcontainerContentRedirectContentGuard.md +19 -0
- data/docs/PolicyEnum.md +16 -0
- data/docs/RecursiveManage.md +1 -1
- data/docs/RemotesContainerApi.md +125 -65
- data/docs/RepositoriesContainerApi.md +158 -134
- data/docs/RepositoriesContainerPushApi.md +44 -148
- data/docs/RepositoriesContainerVersionsApi.md +190 -126
- data/docs/RepositorySyncURL.md +1 -1
- data/docs/RepositoryVersion.md +1 -9
- data/docs/RepositoryVersionResponse.md +25 -0
- data/docs/TagCopy.md +1 -1
- data/docs/TokenApi.md +8 -16
- data/lib/pulp_container_client/api/content_blobs_api.rb +38 -34
- data/lib/pulp_container_client/api/content_manifests_api.rb +38 -34
- data/lib/pulp_container_client/api/content_tags_api.rb +41 -37
- data/lib/pulp_container_client/api/contentguards_content_redirect_api.rb +90 -90
- data/lib/pulp_container_client/api/distributions_container_api.rb +153 -90
- data/lib/pulp_container_client/api/remotes_container_api.rb +181 -100
- data/lib/pulp_container_client/api/repositories_container_api.rb +245 -222
- data/lib/pulp_container_client/api/repositories_container_push_api.rb +66 -197
- data/lib/pulp_container_client/api/repositories_container_versions_api.rb +278 -188
- data/lib/pulp_container_client/api/token_api.rb +8 -14
- data/lib/pulp_container_client/api_client.rb +2 -2
- data/lib/pulp_container_client/api_error.rb +2 -2
- data/lib/pulp_container_client/configuration.rb +3 -3
- data/lib/pulp_container_client/models/async_operation_response.rb +3 -2
- data/lib/pulp_container_client/models/{container_blob.rb → container_blob_response.rb} +6 -43
- data/lib/pulp_container_client/models/container_container_distribution.rb +29 -110
- data/lib/pulp_container_client/models/container_container_distribution_response.rb +289 -0
- data/lib/pulp_container_client/models/container_container_push_repository.rb +18 -78
- data/lib/pulp_container_client/models/container_container_push_repository_response.rb +271 -0
- data/lib/pulp_container_client/models/container_container_remote.rb +29 -227
- data/lib/pulp_container_client/models/container_container_remote_response.rb +409 -0
- data/lib/pulp_container_client/models/container_container_repository.rb +18 -78
- data/lib/pulp_container_client/models/container_container_repository_response.rb +271 -0
- data/lib/pulp_container_client/models/container_content_redirect_content_guard.rb +4 -56
- data/lib/pulp_container_client/models/container_content_redirect_content_guard_response.rb +243 -0
- data/lib/pulp_container_client/models/{container_manifest.rb → container_manifest_response.rb} +6 -43
- data/lib/pulp_container_client/models/{container_tag.rb → container_tag_response.rb} +7 -40
- data/lib/pulp_container_client/models/content_summary.rb +9 -15
- data/lib/pulp_container_client/models/content_summary_response.rb +240 -0
- data/lib/pulp_container_client/models/inline_response200.rb +3 -13
- data/lib/pulp_container_client/models/inline_response2001.rb +3 -13
- data/lib/pulp_container_client/models/inline_response2002.rb +3 -13
- data/lib/pulp_container_client/models/inline_response2003.rb +3 -13
- data/lib/pulp_container_client/models/inline_response2004.rb +3 -13
- data/lib/pulp_container_client/models/inline_response2005.rb +3 -13
- data/lib/pulp_container_client/models/inline_response2006.rb +3 -13
- data/lib/pulp_container_client/models/inline_response2007.rb +3 -13
- data/lib/pulp_container_client/models/inline_response2008.rb +3 -13
- data/lib/pulp_container_client/models/manifest_copy.rb +4 -3
- data/lib/pulp_container_client/models/oci_build_image.rb +240 -0
- data/lib/pulp_container_client/models/patchedcontainer_container_distribution.rb +250 -0
- data/lib/pulp_container_client/models/patchedcontainer_container_remote.rb +365 -0
- data/lib/pulp_container_client/models/patchedcontainer_container_repository.rb +229 -0
- data/lib/pulp_container_client/models/patchedcontainer_content_redirect_content_guard.rb +219 -0
- data/lib/pulp_container_client/models/policy_enum.rb +37 -0
- data/lib/pulp_container_client/models/recursive_manage.rb +4 -3
- data/lib/pulp_container_client/models/repository_sync_url.rb +3 -8
- data/lib/pulp_container_client/models/repository_version.rb +7 -43
- data/lib/pulp_container_client/models/repository_version_response.rb +246 -0
- data/lib/pulp_container_client/models/tag_copy.rb +4 -3
- data/lib/pulp_container_client/models/tag_image.rb +3 -40
- data/lib/pulp_container_client/models/un_tag_image.rb +3 -21
- data/lib/pulp_container_client/version.rb +3 -3
- data/lib/pulp_container_client.rb +18 -5
- data/pulp_container_client.gemspec +4 -4
- data/spec/api/content_blobs_api_spec.rb +11 -11
- data/spec/api/content_manifests_api_spec.rb +11 -11
- data/spec/api/content_tags_api_spec.rb +12 -12
- data/spec/api/contentguards_content_redirect_api_spec.rb +17 -17
- data/spec/api/distributions_container_api_spec.rb +39 -18
- data/spec/api/remotes_container_api_spec.rb +48 -21
- data/spec/api/repositories_container_api_spec.rb +41 -32
- data/spec/api/repositories_container_push_api_spec.rb +17 -40
- data/spec/api/repositories_container_versions_api_spec.rb +76 -46
- data/spec/api/token_api_spec.rb +4 -6
- data/spec/api_client_spec.rb +2 -2
- data/spec/configuration_spec.rb +2 -2
- data/spec/models/async_operation_response_spec.rb +2 -2
- data/spec/models/{container_blob_spec.rb → container_blob_response_spec.rb} +8 -8
- data/spec/models/container_container_distribution_response_spec.rb +83 -0
- data/spec/models/container_container_distribution_spec.rb +5 -23
- data/spec/models/container_container_push_repository_response_spec.rb +77 -0
- data/spec/models/container_container_push_repository_spec.rb +5 -23
- data/spec/models/container_container_remote_response_spec.rb +137 -0
- data/spec/models/container_container_remote_spec.rb +7 -23
- data/spec/models/container_container_repository_response_spec.rb +77 -0
- data/spec/models/container_container_repository_spec.rb +5 -23
- data/spec/models/container_content_redirect_content_guard_response_spec.rb +59 -0
- data/spec/models/container_content_redirect_content_guard_spec.rb +2 -14
- data/spec/models/{container_manifest_spec.rb → container_manifest_response_spec.rb} +8 -8
- data/spec/models/{container_tag_spec.rb → container_tag_response_spec.rb} +8 -14
- data/spec/models/content_summary_response_spec.rb +53 -0
- data/spec/models/content_summary_spec.rb +2 -2
- data/spec/models/inline_response2001_spec.rb +2 -2
- data/spec/models/inline_response2002_spec.rb +2 -2
- data/spec/models/inline_response2003_spec.rb +2 -2
- data/spec/models/inline_response2004_spec.rb +2 -2
- data/spec/models/inline_response2005_spec.rb +2 -2
- data/spec/models/inline_response2006_spec.rb +2 -2
- data/spec/models/inline_response2007_spec.rb +2 -2
- data/spec/models/inline_response2008_spec.rb +2 -2
- data/spec/models/inline_response200_spec.rb +2 -2
- data/spec/models/manifest_copy_spec.rb +2 -2
- data/spec/models/oci_build_image_spec.rb +59 -0
- data/spec/models/patchedcontainer_container_distribution_spec.rb +65 -0
- data/spec/models/patchedcontainer_container_remote_spec.rb +119 -0
- data/spec/models/patchedcontainer_container_repository_spec.rb +53 -0
- data/spec/models/patchedcontainer_content_redirect_content_guard_spec.rb +47 -0
- data/spec/models/policy_enum_spec.rb +35 -0
- data/spec/models/recursive_manage_spec.rb +2 -2
- data/spec/models/repository_sync_url_spec.rb +2 -2
- data/spec/models/repository_version_response_spec.rb +65 -0
- data/spec/models/repository_version_spec.rb +2 -26
- data/spec/models/tag_copy_spec.rb +2 -2
- data/spec/models/tag_image_spec.rb +2 -2
- data/spec/models/un_tag_image_spec.rb +2 -2
- data/spec/spec_helper.rb +2 -2
- metadata +93 -41
@@ -0,0 +1,271 @@
|
|
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
|
+
# Serializer for Container Repositories.
|
17
|
+
class ContainerContainerRepositoryResponse
|
18
|
+
attr_accessor :pulp_href
|
19
|
+
|
20
|
+
# Timestamp of creation.
|
21
|
+
attr_accessor :pulp_created
|
22
|
+
|
23
|
+
attr_accessor :versions_href
|
24
|
+
|
25
|
+
attr_accessor :latest_version_href
|
26
|
+
|
27
|
+
# A unique name for this repository.
|
28
|
+
attr_accessor :name
|
29
|
+
|
30
|
+
# An optional description.
|
31
|
+
attr_accessor :description
|
32
|
+
|
33
|
+
attr_accessor :remote
|
34
|
+
|
35
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
36
|
+
def self.attribute_map
|
37
|
+
{
|
38
|
+
:'pulp_href' => :'pulp_href',
|
39
|
+
:'pulp_created' => :'pulp_created',
|
40
|
+
:'versions_href' => :'versions_href',
|
41
|
+
:'latest_version_href' => :'latest_version_href',
|
42
|
+
:'name' => :'name',
|
43
|
+
:'description' => :'description',
|
44
|
+
:'remote' => :'remote'
|
45
|
+
}
|
46
|
+
end
|
47
|
+
|
48
|
+
# Attribute type mapping.
|
49
|
+
def self.openapi_types
|
50
|
+
{
|
51
|
+
:'pulp_href' => :'String',
|
52
|
+
:'pulp_created' => :'DateTime',
|
53
|
+
:'versions_href' => :'String',
|
54
|
+
:'latest_version_href' => :'String',
|
55
|
+
:'name' => :'String',
|
56
|
+
:'description' => :'String',
|
57
|
+
:'remote' => :'String'
|
58
|
+
}
|
59
|
+
end
|
60
|
+
|
61
|
+
# List of attributes with nullable: true
|
62
|
+
def self.openapi_nullable
|
63
|
+
Set.new([
|
64
|
+
:'description',
|
65
|
+
:'remote'
|
66
|
+
])
|
67
|
+
end
|
68
|
+
|
69
|
+
# Initializes the object
|
70
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
71
|
+
def initialize(attributes = {})
|
72
|
+
if (!attributes.is_a?(Hash))
|
73
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `PulpContainerClient::ContainerContainerRepositoryResponse` initialize method"
|
74
|
+
end
|
75
|
+
|
76
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
77
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
78
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
79
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `PulpContainerClient::ContainerContainerRepositoryResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
80
|
+
end
|
81
|
+
h[k.to_sym] = v
|
82
|
+
}
|
83
|
+
|
84
|
+
if attributes.key?(:'pulp_href')
|
85
|
+
self.pulp_href = attributes[:'pulp_href']
|
86
|
+
end
|
87
|
+
|
88
|
+
if attributes.key?(:'pulp_created')
|
89
|
+
self.pulp_created = attributes[:'pulp_created']
|
90
|
+
end
|
91
|
+
|
92
|
+
if attributes.key?(:'versions_href')
|
93
|
+
self.versions_href = attributes[:'versions_href']
|
94
|
+
end
|
95
|
+
|
96
|
+
if attributes.key?(:'latest_version_href')
|
97
|
+
self.latest_version_href = attributes[:'latest_version_href']
|
98
|
+
end
|
99
|
+
|
100
|
+
if attributes.key?(:'name')
|
101
|
+
self.name = attributes[:'name']
|
102
|
+
end
|
103
|
+
|
104
|
+
if attributes.key?(:'description')
|
105
|
+
self.description = attributes[:'description']
|
106
|
+
end
|
107
|
+
|
108
|
+
if attributes.key?(:'remote')
|
109
|
+
self.remote = attributes[:'remote']
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
113
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
114
|
+
# @return Array for valid properties with the reasons
|
115
|
+
def list_invalid_properties
|
116
|
+
invalid_properties = Array.new
|
117
|
+
if @name.nil?
|
118
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
119
|
+
end
|
120
|
+
|
121
|
+
invalid_properties
|
122
|
+
end
|
123
|
+
|
124
|
+
# Check to see if the all the properties in the model are valid
|
125
|
+
# @return true if the model is valid
|
126
|
+
def valid?
|
127
|
+
return false if @name.nil?
|
128
|
+
true
|
129
|
+
end
|
130
|
+
|
131
|
+
# Checks equality by comparing each attribute.
|
132
|
+
# @param [Object] Object to be compared
|
133
|
+
def ==(o)
|
134
|
+
return true if self.equal?(o)
|
135
|
+
self.class == o.class &&
|
136
|
+
pulp_href == o.pulp_href &&
|
137
|
+
pulp_created == o.pulp_created &&
|
138
|
+
versions_href == o.versions_href &&
|
139
|
+
latest_version_href == o.latest_version_href &&
|
140
|
+
name == o.name &&
|
141
|
+
description == o.description &&
|
142
|
+
remote == o.remote
|
143
|
+
end
|
144
|
+
|
145
|
+
# @see the `==` method
|
146
|
+
# @param [Object] Object to be compared
|
147
|
+
def eql?(o)
|
148
|
+
self == o
|
149
|
+
end
|
150
|
+
|
151
|
+
# Calculates hash code according to all attributes.
|
152
|
+
# @return [Integer] Hash code
|
153
|
+
def hash
|
154
|
+
[pulp_href, pulp_created, versions_href, latest_version_href, name, description, remote].hash
|
155
|
+
end
|
156
|
+
|
157
|
+
# Builds the object from hash
|
158
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
159
|
+
# @return [Object] Returns the model itself
|
160
|
+
def self.build_from_hash(attributes)
|
161
|
+
new.build_from_hash(attributes)
|
162
|
+
end
|
163
|
+
|
164
|
+
# Builds the object from hash
|
165
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
166
|
+
# @return [Object] Returns the model itself
|
167
|
+
def build_from_hash(attributes)
|
168
|
+
return nil unless attributes.is_a?(Hash)
|
169
|
+
self.class.openapi_types.each_pair do |key, type|
|
170
|
+
if type =~ /\AArray<(.*)>/i
|
171
|
+
# check to ensure the input is an array given that the attribute
|
172
|
+
# is documented as an array but the input is not
|
173
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
174
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
175
|
+
end
|
176
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
177
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
178
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
179
|
+
end
|
180
|
+
|
181
|
+
self
|
182
|
+
end
|
183
|
+
|
184
|
+
# Deserializes the data based on type
|
185
|
+
# @param string type Data type
|
186
|
+
# @param string value Value to be deserialized
|
187
|
+
# @return [Object] Deserialized data
|
188
|
+
def _deserialize(type, value)
|
189
|
+
case type.to_sym
|
190
|
+
when :DateTime
|
191
|
+
DateTime.parse(value)
|
192
|
+
when :Date
|
193
|
+
Date.parse(value)
|
194
|
+
when :String
|
195
|
+
value.to_s
|
196
|
+
when :Integer
|
197
|
+
value.to_i
|
198
|
+
when :Float
|
199
|
+
value.to_f
|
200
|
+
when :Boolean
|
201
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
202
|
+
true
|
203
|
+
else
|
204
|
+
false
|
205
|
+
end
|
206
|
+
when :Object
|
207
|
+
# generic object (usually a Hash), return directly
|
208
|
+
value
|
209
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
210
|
+
inner_type = Regexp.last_match[:inner_type]
|
211
|
+
value.map { |v| _deserialize(inner_type, v) }
|
212
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
213
|
+
k_type = Regexp.last_match[:k_type]
|
214
|
+
v_type = Regexp.last_match[:v_type]
|
215
|
+
{}.tap do |hash|
|
216
|
+
value.each do |k, v|
|
217
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
218
|
+
end
|
219
|
+
end
|
220
|
+
else # model
|
221
|
+
PulpContainerClient.const_get(type).build_from_hash(value)
|
222
|
+
end
|
223
|
+
end
|
224
|
+
|
225
|
+
# Returns the string representation of the object
|
226
|
+
# @return [String] String presentation of the object
|
227
|
+
def to_s
|
228
|
+
to_hash.to_s
|
229
|
+
end
|
230
|
+
|
231
|
+
# to_body is an alias to to_hash (backward compatibility)
|
232
|
+
# @return [Hash] Returns the object in the form of hash
|
233
|
+
def to_body
|
234
|
+
to_hash
|
235
|
+
end
|
236
|
+
|
237
|
+
# Returns the object in the form of hash
|
238
|
+
# @return [Hash] Returns the object in the form of hash
|
239
|
+
def to_hash
|
240
|
+
hash = {}
|
241
|
+
self.class.attribute_map.each_pair do |attr, param|
|
242
|
+
value = self.send(attr)
|
243
|
+
if value.nil?
|
244
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
245
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
246
|
+
end
|
247
|
+
|
248
|
+
hash[param] = _to_hash(value)
|
249
|
+
end
|
250
|
+
hash
|
251
|
+
end
|
252
|
+
|
253
|
+
# Outputs non-array value in the form of hash
|
254
|
+
# For object, use to_hash. Otherwise, just return the value
|
255
|
+
# @param [Object] value Any valid value
|
256
|
+
# @return [Hash] Returns the value in the form of hash
|
257
|
+
def _to_hash(value)
|
258
|
+
if value.is_a?(Array)
|
259
|
+
value.compact.map { |v| _to_hash(v) }
|
260
|
+
elsif value.is_a?(Hash)
|
261
|
+
{}.tap do |hash|
|
262
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
263
|
+
end
|
264
|
+
elsif value.respond_to? :to_hash
|
265
|
+
value.to_hash
|
266
|
+
else
|
267
|
+
value
|
268
|
+
end
|
269
|
+
end
|
270
|
+
end
|
271
|
+
end
|
@@ -1,10 +1,10 @@
|
|
1
1
|
=begin
|
2
2
|
#Pulp 3 API
|
3
3
|
|
4
|
-
#
|
4
|
+
#Fetch, Upload, Organize, and Distribute Software Packages
|
5
5
|
|
6
6
|
The version of the OpenAPI document: v3
|
7
|
-
|
7
|
+
Contact: pulp-list@redhat.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
9
|
OpenAPI Generator version: 4.2.3
|
10
10
|
|
@@ -13,12 +13,8 @@ OpenAPI Generator version: 4.2.3
|
|
13
13
|
require 'date'
|
14
14
|
|
15
15
|
module PulpContainerClient
|
16
|
+
# A serializer for ContentRedirectContentGuard.
|
16
17
|
class ContainerContentRedirectContentGuard
|
17
|
-
attr_accessor :pulp_href
|
18
|
-
|
19
|
-
# Timestamp of creation.
|
20
|
-
attr_accessor :pulp_created
|
21
|
-
|
22
18
|
# The unique name.
|
23
19
|
attr_accessor :name
|
24
20
|
|
@@ -28,8 +24,6 @@ module PulpContainerClient
|
|
28
24
|
# Attribute mapping from ruby-style variable name to JSON key.
|
29
25
|
def self.attribute_map
|
30
26
|
{
|
31
|
-
:'pulp_href' => :'pulp_href',
|
32
|
-
:'pulp_created' => :'pulp_created',
|
33
27
|
:'name' => :'name',
|
34
28
|
:'description' => :'description'
|
35
29
|
}
|
@@ -38,8 +32,6 @@ module PulpContainerClient
|
|
38
32
|
# Attribute type mapping.
|
39
33
|
def self.openapi_types
|
40
34
|
{
|
41
|
-
:'pulp_href' => :'String',
|
42
|
-
:'pulp_created' => :'DateTime',
|
43
35
|
:'name' => :'String',
|
44
36
|
:'description' => :'String'
|
45
37
|
}
|
@@ -67,14 +59,6 @@ module PulpContainerClient
|
|
67
59
|
h[k.to_sym] = v
|
68
60
|
}
|
69
61
|
|
70
|
-
if attributes.key?(:'pulp_href')
|
71
|
-
self.pulp_href = attributes[:'pulp_href']
|
72
|
-
end
|
73
|
-
|
74
|
-
if attributes.key?(:'pulp_created')
|
75
|
-
self.pulp_created = attributes[:'pulp_created']
|
76
|
-
end
|
77
|
-
|
78
62
|
if attributes.key?(:'name')
|
79
63
|
self.name = attributes[:'name']
|
80
64
|
end
|
@@ -92,14 +76,6 @@ module PulpContainerClient
|
|
92
76
|
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
93
77
|
end
|
94
78
|
|
95
|
-
if @name.to_s.length < 1
|
96
|
-
invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
|
97
|
-
end
|
98
|
-
|
99
|
-
if !@description.nil? && @description.to_s.length < 1
|
100
|
-
invalid_properties.push('invalid value for "description", the character length must be great than or equal to 1.')
|
101
|
-
end
|
102
|
-
|
103
79
|
invalid_properties
|
104
80
|
end
|
105
81
|
|
@@ -107,42 +83,14 @@ module PulpContainerClient
|
|
107
83
|
# @return true if the model is valid
|
108
84
|
def valid?
|
109
85
|
return false if @name.nil?
|
110
|
-
return false if @name.to_s.length < 1
|
111
|
-
return false if !@description.nil? && @description.to_s.length < 1
|
112
86
|
true
|
113
87
|
end
|
114
88
|
|
115
|
-
# Custom attribute writer method with validation
|
116
|
-
# @param [Object] name Value to be assigned
|
117
|
-
def name=(name)
|
118
|
-
if name.nil?
|
119
|
-
fail ArgumentError, 'name cannot be nil'
|
120
|
-
end
|
121
|
-
|
122
|
-
if name.to_s.length < 1
|
123
|
-
fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
|
124
|
-
end
|
125
|
-
|
126
|
-
@name = name
|
127
|
-
end
|
128
|
-
|
129
|
-
# Custom attribute writer method with validation
|
130
|
-
# @param [Object] description Value to be assigned
|
131
|
-
def description=(description)
|
132
|
-
if !description.nil? && description.to_s.length < 1
|
133
|
-
fail ArgumentError, 'invalid value for "description", the character length must be great than or equal to 1.'
|
134
|
-
end
|
135
|
-
|
136
|
-
@description = description
|
137
|
-
end
|
138
|
-
|
139
89
|
# Checks equality by comparing each attribute.
|
140
90
|
# @param [Object] Object to be compared
|
141
91
|
def ==(o)
|
142
92
|
return true if self.equal?(o)
|
143
93
|
self.class == o.class &&
|
144
|
-
pulp_href == o.pulp_href &&
|
145
|
-
pulp_created == o.pulp_created &&
|
146
94
|
name == o.name &&
|
147
95
|
description == o.description
|
148
96
|
end
|
@@ -156,7 +104,7 @@ module PulpContainerClient
|
|
156
104
|
# Calculates hash code according to all attributes.
|
157
105
|
# @return [Integer] Hash code
|
158
106
|
def hash
|
159
|
-
[
|
107
|
+
[name, description].hash
|
160
108
|
end
|
161
109
|
|
162
110
|
# Builds the object from hash
|
@@ -0,0 +1,243 @@
|
|
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 ContentRedirectContentGuard.
|
17
|
+
class ContainerContentRedirectContentGuardResponse
|
18
|
+
attr_accessor :pulp_href
|
19
|
+
|
20
|
+
# Timestamp of creation.
|
21
|
+
attr_accessor :pulp_created
|
22
|
+
|
23
|
+
# The unique name.
|
24
|
+
attr_accessor :name
|
25
|
+
|
26
|
+
# An optional description.
|
27
|
+
attr_accessor :description
|
28
|
+
|
29
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
30
|
+
def self.attribute_map
|
31
|
+
{
|
32
|
+
:'pulp_href' => :'pulp_href',
|
33
|
+
:'pulp_created' => :'pulp_created',
|
34
|
+
:'name' => :'name',
|
35
|
+
:'description' => :'description'
|
36
|
+
}
|
37
|
+
end
|
38
|
+
|
39
|
+
# Attribute type mapping.
|
40
|
+
def self.openapi_types
|
41
|
+
{
|
42
|
+
:'pulp_href' => :'String',
|
43
|
+
:'pulp_created' => :'DateTime',
|
44
|
+
:'name' => :'String',
|
45
|
+
:'description' => :'String'
|
46
|
+
}
|
47
|
+
end
|
48
|
+
|
49
|
+
# List of attributes with nullable: true
|
50
|
+
def self.openapi_nullable
|
51
|
+
Set.new([
|
52
|
+
:'description'
|
53
|
+
])
|
54
|
+
end
|
55
|
+
|
56
|
+
# Initializes the object
|
57
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
58
|
+
def initialize(attributes = {})
|
59
|
+
if (!attributes.is_a?(Hash))
|
60
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `PulpContainerClient::ContainerContentRedirectContentGuardResponse` initialize method"
|
61
|
+
end
|
62
|
+
|
63
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
64
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
65
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
66
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `PulpContainerClient::ContainerContentRedirectContentGuardResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
67
|
+
end
|
68
|
+
h[k.to_sym] = v
|
69
|
+
}
|
70
|
+
|
71
|
+
if attributes.key?(:'pulp_href')
|
72
|
+
self.pulp_href = attributes[:'pulp_href']
|
73
|
+
end
|
74
|
+
|
75
|
+
if attributes.key?(:'pulp_created')
|
76
|
+
self.pulp_created = attributes[:'pulp_created']
|
77
|
+
end
|
78
|
+
|
79
|
+
if attributes.key?(:'name')
|
80
|
+
self.name = attributes[:'name']
|
81
|
+
end
|
82
|
+
|
83
|
+
if attributes.key?(:'description')
|
84
|
+
self.description = attributes[:'description']
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
89
|
+
# @return Array for valid properties with the reasons
|
90
|
+
def list_invalid_properties
|
91
|
+
invalid_properties = Array.new
|
92
|
+
if @name.nil?
|
93
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
94
|
+
end
|
95
|
+
|
96
|
+
invalid_properties
|
97
|
+
end
|
98
|
+
|
99
|
+
# Check to see if the all the properties in the model are valid
|
100
|
+
# @return true if the model is valid
|
101
|
+
def valid?
|
102
|
+
return false if @name.nil?
|
103
|
+
true
|
104
|
+
end
|
105
|
+
|
106
|
+
# Checks equality by comparing each attribute.
|
107
|
+
# @param [Object] Object to be compared
|
108
|
+
def ==(o)
|
109
|
+
return true if self.equal?(o)
|
110
|
+
self.class == o.class &&
|
111
|
+
pulp_href == o.pulp_href &&
|
112
|
+
pulp_created == o.pulp_created &&
|
113
|
+
name == o.name &&
|
114
|
+
description == o.description
|
115
|
+
end
|
116
|
+
|
117
|
+
# @see the `==` method
|
118
|
+
# @param [Object] Object to be compared
|
119
|
+
def eql?(o)
|
120
|
+
self == o
|
121
|
+
end
|
122
|
+
|
123
|
+
# Calculates hash code according to all attributes.
|
124
|
+
# @return [Integer] Hash code
|
125
|
+
def hash
|
126
|
+
[pulp_href, pulp_created, name, description].hash
|
127
|
+
end
|
128
|
+
|
129
|
+
# Builds the object from hash
|
130
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
131
|
+
# @return [Object] Returns the model itself
|
132
|
+
def self.build_from_hash(attributes)
|
133
|
+
new.build_from_hash(attributes)
|
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 build_from_hash(attributes)
|
140
|
+
return nil unless attributes.is_a?(Hash)
|
141
|
+
self.class.openapi_types.each_pair do |key, type|
|
142
|
+
if type =~ /\AArray<(.*)>/i
|
143
|
+
# check to ensure the input is an array given that the attribute
|
144
|
+
# is documented as an array but the input is not
|
145
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
146
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
147
|
+
end
|
148
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
149
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
150
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
151
|
+
end
|
152
|
+
|
153
|
+
self
|
154
|
+
end
|
155
|
+
|
156
|
+
# Deserializes the data based on type
|
157
|
+
# @param string type Data type
|
158
|
+
# @param string value Value to be deserialized
|
159
|
+
# @return [Object] Deserialized data
|
160
|
+
def _deserialize(type, value)
|
161
|
+
case type.to_sym
|
162
|
+
when :DateTime
|
163
|
+
DateTime.parse(value)
|
164
|
+
when :Date
|
165
|
+
Date.parse(value)
|
166
|
+
when :String
|
167
|
+
value.to_s
|
168
|
+
when :Integer
|
169
|
+
value.to_i
|
170
|
+
when :Float
|
171
|
+
value.to_f
|
172
|
+
when :Boolean
|
173
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
174
|
+
true
|
175
|
+
else
|
176
|
+
false
|
177
|
+
end
|
178
|
+
when :Object
|
179
|
+
# generic object (usually a Hash), return directly
|
180
|
+
value
|
181
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
182
|
+
inner_type = Regexp.last_match[:inner_type]
|
183
|
+
value.map { |v| _deserialize(inner_type, v) }
|
184
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
185
|
+
k_type = Regexp.last_match[:k_type]
|
186
|
+
v_type = Regexp.last_match[:v_type]
|
187
|
+
{}.tap do |hash|
|
188
|
+
value.each do |k, v|
|
189
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
190
|
+
end
|
191
|
+
end
|
192
|
+
else # model
|
193
|
+
PulpContainerClient.const_get(type).build_from_hash(value)
|
194
|
+
end
|
195
|
+
end
|
196
|
+
|
197
|
+
# Returns the string representation of the object
|
198
|
+
# @return [String] String presentation of the object
|
199
|
+
def to_s
|
200
|
+
to_hash.to_s
|
201
|
+
end
|
202
|
+
|
203
|
+
# to_body is an alias to to_hash (backward compatibility)
|
204
|
+
# @return [Hash] Returns the object in the form of hash
|
205
|
+
def to_body
|
206
|
+
to_hash
|
207
|
+
end
|
208
|
+
|
209
|
+
# Returns the object in the form of hash
|
210
|
+
# @return [Hash] Returns the object in the form of hash
|
211
|
+
def to_hash
|
212
|
+
hash = {}
|
213
|
+
self.class.attribute_map.each_pair do |attr, param|
|
214
|
+
value = self.send(attr)
|
215
|
+
if value.nil?
|
216
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
217
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
218
|
+
end
|
219
|
+
|
220
|
+
hash[param] = _to_hash(value)
|
221
|
+
end
|
222
|
+
hash
|
223
|
+
end
|
224
|
+
|
225
|
+
# Outputs non-array value in the form of hash
|
226
|
+
# For object, use to_hash. Otherwise, just return the value
|
227
|
+
# @param [Object] value Any valid value
|
228
|
+
# @return [Hash] Returns the value in the form of hash
|
229
|
+
def _to_hash(value)
|
230
|
+
if value.is_a?(Array)
|
231
|
+
value.compact.map { |v| _to_hash(v) }
|
232
|
+
elsif value.is_a?(Hash)
|
233
|
+
{}.tap do |hash|
|
234
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
235
|
+
end
|
236
|
+
elsif value.respond_to? :to_hash
|
237
|
+
value.to_hash
|
238
|
+
else
|
239
|
+
value
|
240
|
+
end
|
241
|
+
end
|
242
|
+
end
|
243
|
+
end
|