pulp_file_client 1.8.1 → 1.10.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 +22 -15
- data/docs/AcsFileApi.md +417 -0
- data/docs/ContentFilesApi.md +1 -1
- data/docs/DistributionsFileApi.md +1 -1
- data/docs/FileFileAlternateContentSource.md +23 -0
- data/docs/FileFileAlternateContentSourceResponse.md +27 -0
- data/docs/FileFileRepository.md +3 -3
- data/docs/FileFileRepositoryResponse.md +3 -3
- data/docs/PaginatedfileFileAlternateContentSourceResponseList.md +23 -0
- data/docs/PatchedfileFileAlternateContentSource.md +23 -0
- data/docs/PatchedfileFileRepository.md +3 -3
- data/docs/PublicationsFileApi.md +1 -1
- data/docs/RemotesFileApi.md +1 -1
- data/docs/RepositoriesFileApi.md +1 -1
- data/docs/RepositoriesFileVersionsApi.md +1 -1
- data/docs/TaskGroupOperationResponse.md +17 -0
- data/lib/pulp_file_client/api/acs_file_api.rb +510 -0
- data/lib/pulp_file_client/configuration.rb +2 -2
- data/lib/pulp_file_client/models/file_file_alternate_content_source.rb +251 -0
- data/lib/pulp_file_client/models/file_file_alternate_content_source_response.rb +270 -0
- data/lib/pulp_file_client/models/file_file_repository.rb +17 -16
- data/lib/pulp_file_client/models/file_file_repository_response.rb +17 -16
- data/lib/pulp_file_client/models/paginatedfile_file_alternate_content_source_response_list.rb +237 -0
- data/lib/pulp_file_client/models/patchedfile_file_alternate_content_source.rb +241 -0
- data/lib/pulp_file_client/models/patchedfile_file_repository.rb +17 -16
- data/lib/pulp_file_client/models/task_group_operation_response.rb +213 -0
- data/lib/pulp_file_client/version.rb +1 -1
- data/lib/pulp_file_client.rb +6 -0
- data/spec/api/acs_file_api_spec.rb +132 -0
- data/spec/configuration_spec.rb +3 -3
- data/spec/models/file_file_alternate_content_source_response_spec.rb +71 -0
- data/spec/models/file_file_alternate_content_source_spec.rb +59 -0
- data/spec/models/file_file_repository_response_spec.rb +1 -1
- data/spec/models/file_file_repository_spec.rb +1 -1
- data/spec/models/paginatedfile_file_alternate_content_source_response_list_spec.rb +59 -0
- data/spec/models/patchedfile_file_alternate_content_source_spec.rb +59 -0
- data/spec/models/patchedfile_file_repository_spec.rb +1 -1
- data/spec/models/task_group_operation_response_spec.rb +41 -0
- metadata +44 -20
@@ -33,8 +33,9 @@ module PulpFileClient
|
|
33
33
|
attr_accessor :description
|
34
34
|
|
35
35
|
# Retain X versions of the repository. Default is null which retains all versions. This is provided as a tech preview in Pulp 3 and may change in the future.
|
36
|
-
attr_accessor :
|
36
|
+
attr_accessor :retain_repo_versions
|
37
37
|
|
38
|
+
# An optional remote to use by default when syncing.
|
38
39
|
attr_accessor :remote
|
39
40
|
|
40
41
|
# Whether to automatically create publications for new repository versions, and update any distributions pointing to this repository.
|
@@ -53,7 +54,7 @@ module PulpFileClient
|
|
53
54
|
:'latest_version_href' => :'latest_version_href',
|
54
55
|
:'name' => :'name',
|
55
56
|
:'description' => :'description',
|
56
|
-
:'
|
57
|
+
:'retain_repo_versions' => :'retain_repo_versions',
|
57
58
|
:'remote' => :'remote',
|
58
59
|
:'autopublish' => :'autopublish',
|
59
60
|
:'manifest' => :'manifest'
|
@@ -70,7 +71,7 @@ module PulpFileClient
|
|
70
71
|
:'latest_version_href' => :'String',
|
71
72
|
:'name' => :'String',
|
72
73
|
:'description' => :'String',
|
73
|
-
:'
|
74
|
+
:'retain_repo_versions' => :'Integer',
|
74
75
|
:'remote' => :'String',
|
75
76
|
:'autopublish' => :'Boolean',
|
76
77
|
:'manifest' => :'String'
|
@@ -81,7 +82,7 @@ module PulpFileClient
|
|
81
82
|
def self.openapi_nullable
|
82
83
|
Set.new([
|
83
84
|
:'description',
|
84
|
-
:'
|
85
|
+
:'retain_repo_versions',
|
85
86
|
:'remote',
|
86
87
|
])
|
87
88
|
end
|
@@ -129,8 +130,8 @@ module PulpFileClient
|
|
129
130
|
self.description = attributes[:'description']
|
130
131
|
end
|
131
132
|
|
132
|
-
if attributes.key?(:'
|
133
|
-
self.
|
133
|
+
if attributes.key?(:'retain_repo_versions')
|
134
|
+
self.retain_repo_versions = attributes[:'retain_repo_versions']
|
134
135
|
end
|
135
136
|
|
136
137
|
if attributes.key?(:'remote')
|
@@ -158,8 +159,8 @@ module PulpFileClient
|
|
158
159
|
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
159
160
|
end
|
160
161
|
|
161
|
-
if !@
|
162
|
-
invalid_properties.push('invalid value for "
|
162
|
+
if !@retain_repo_versions.nil? && @retain_repo_versions < 1
|
163
|
+
invalid_properties.push('invalid value for "retain_repo_versions", must be greater than or equal to 1.')
|
163
164
|
end
|
164
165
|
|
165
166
|
invalid_properties
|
@@ -169,18 +170,18 @@ module PulpFileClient
|
|
169
170
|
# @return true if the model is valid
|
170
171
|
def valid?
|
171
172
|
return false if @name.nil?
|
172
|
-
return false if !@
|
173
|
+
return false if !@retain_repo_versions.nil? && @retain_repo_versions < 1
|
173
174
|
true
|
174
175
|
end
|
175
176
|
|
176
177
|
# Custom attribute writer method with validation
|
177
|
-
# @param [Object]
|
178
|
-
def
|
179
|
-
if !
|
180
|
-
fail ArgumentError, 'invalid value for "
|
178
|
+
# @param [Object] retain_repo_versions Value to be assigned
|
179
|
+
def retain_repo_versions=(retain_repo_versions)
|
180
|
+
if !retain_repo_versions.nil? && retain_repo_versions < 1
|
181
|
+
fail ArgumentError, 'invalid value for "retain_repo_versions", must be greater than or equal to 1.'
|
181
182
|
end
|
182
183
|
|
183
|
-
@
|
184
|
+
@retain_repo_versions = retain_repo_versions
|
184
185
|
end
|
185
186
|
|
186
187
|
# Checks equality by comparing each attribute.
|
@@ -195,7 +196,7 @@ module PulpFileClient
|
|
195
196
|
latest_version_href == o.latest_version_href &&
|
196
197
|
name == o.name &&
|
197
198
|
description == o.description &&
|
198
|
-
|
199
|
+
retain_repo_versions == o.retain_repo_versions &&
|
199
200
|
remote == o.remote &&
|
200
201
|
autopublish == o.autopublish &&
|
201
202
|
manifest == o.manifest
|
@@ -210,7 +211,7 @@ module PulpFileClient
|
|
210
211
|
# Calculates hash code according to all attributes.
|
211
212
|
# @return [Integer] Hash code
|
212
213
|
def hash
|
213
|
-
[pulp_href, pulp_created, versions_href, pulp_labels, latest_version_href, name, description,
|
214
|
+
[pulp_href, pulp_created, versions_href, pulp_labels, latest_version_href, name, description, retain_repo_versions, remote, autopublish, manifest].hash
|
214
215
|
end
|
215
216
|
|
216
217
|
# Builds the object from hash
|
@@ -0,0 +1,237 @@
|
|
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.3.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module PulpFileClient
|
16
|
+
class PaginatedfileFileAlternateContentSourceResponseList
|
17
|
+
attr_accessor :count
|
18
|
+
|
19
|
+
attr_accessor :_next
|
20
|
+
|
21
|
+
attr_accessor :previous
|
22
|
+
|
23
|
+
attr_accessor :results
|
24
|
+
|
25
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
26
|
+
def self.attribute_map
|
27
|
+
{
|
28
|
+
:'count' => :'count',
|
29
|
+
:'_next' => :'next',
|
30
|
+
:'previous' => :'previous',
|
31
|
+
:'results' => :'results'
|
32
|
+
}
|
33
|
+
end
|
34
|
+
|
35
|
+
# Attribute type mapping.
|
36
|
+
def self.openapi_types
|
37
|
+
{
|
38
|
+
:'count' => :'Integer',
|
39
|
+
:'_next' => :'String',
|
40
|
+
:'previous' => :'String',
|
41
|
+
:'results' => :'Array<FileFileAlternateContentSourceResponse>'
|
42
|
+
}
|
43
|
+
end
|
44
|
+
|
45
|
+
# List of attributes with nullable: true
|
46
|
+
def self.openapi_nullable
|
47
|
+
Set.new([
|
48
|
+
:'_next',
|
49
|
+
:'previous',
|
50
|
+
])
|
51
|
+
end
|
52
|
+
|
53
|
+
# Initializes the object
|
54
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
55
|
+
def initialize(attributes = {})
|
56
|
+
if (!attributes.is_a?(Hash))
|
57
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `PulpFileClient::PaginatedfileFileAlternateContentSourceResponseList` initialize method"
|
58
|
+
end
|
59
|
+
|
60
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
61
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
62
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
63
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `PulpFileClient::PaginatedfileFileAlternateContentSourceResponseList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
64
|
+
end
|
65
|
+
h[k.to_sym] = v
|
66
|
+
}
|
67
|
+
|
68
|
+
if attributes.key?(:'count')
|
69
|
+
self.count = attributes[:'count']
|
70
|
+
end
|
71
|
+
|
72
|
+
if attributes.key?(:'_next')
|
73
|
+
self._next = attributes[:'_next']
|
74
|
+
end
|
75
|
+
|
76
|
+
if attributes.key?(:'previous')
|
77
|
+
self.previous = attributes[:'previous']
|
78
|
+
end
|
79
|
+
|
80
|
+
if attributes.key?(:'results')
|
81
|
+
if (value = attributes[:'results']).is_a?(Array)
|
82
|
+
self.results = value
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
88
|
+
# @return Array for valid properties with the reasons
|
89
|
+
def list_invalid_properties
|
90
|
+
invalid_properties = Array.new
|
91
|
+
invalid_properties
|
92
|
+
end
|
93
|
+
|
94
|
+
# Check to see if the all the properties in the model are valid
|
95
|
+
# @return true if the model is valid
|
96
|
+
def valid?
|
97
|
+
true
|
98
|
+
end
|
99
|
+
|
100
|
+
# Checks equality by comparing each attribute.
|
101
|
+
# @param [Object] Object to be compared
|
102
|
+
def ==(o)
|
103
|
+
return true if self.equal?(o)
|
104
|
+
self.class == o.class &&
|
105
|
+
count == o.count &&
|
106
|
+
_next == o._next &&
|
107
|
+
previous == o.previous &&
|
108
|
+
results == o.results
|
109
|
+
end
|
110
|
+
|
111
|
+
# @see the `==` method
|
112
|
+
# @param [Object] Object to be compared
|
113
|
+
def eql?(o)
|
114
|
+
self == o
|
115
|
+
end
|
116
|
+
|
117
|
+
# Calculates hash code according to all attributes.
|
118
|
+
# @return [Integer] Hash code
|
119
|
+
def hash
|
120
|
+
[count, _next, previous, results].hash
|
121
|
+
end
|
122
|
+
|
123
|
+
# Builds the object from hash
|
124
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
125
|
+
# @return [Object] Returns the model itself
|
126
|
+
def self.build_from_hash(attributes)
|
127
|
+
new.build_from_hash(attributes)
|
128
|
+
end
|
129
|
+
|
130
|
+
# Builds the object from hash
|
131
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
132
|
+
# @return [Object] Returns the model itself
|
133
|
+
def build_from_hash(attributes)
|
134
|
+
return nil unless attributes.is_a?(Hash)
|
135
|
+
self.class.openapi_types.each_pair do |key, type|
|
136
|
+
if type =~ /\AArray<(.*)>/i
|
137
|
+
# check to ensure the input is an array given that the attribute
|
138
|
+
# is documented as an array but the input is not
|
139
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
140
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
141
|
+
end
|
142
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
143
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
144
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
145
|
+
end
|
146
|
+
|
147
|
+
self
|
148
|
+
end
|
149
|
+
|
150
|
+
# Deserializes the data based on type
|
151
|
+
# @param string type Data type
|
152
|
+
# @param string value Value to be deserialized
|
153
|
+
# @return [Object] Deserialized data
|
154
|
+
def _deserialize(type, value)
|
155
|
+
case type.to_sym
|
156
|
+
when :DateTime
|
157
|
+
DateTime.parse(value)
|
158
|
+
when :Date
|
159
|
+
Date.parse(value)
|
160
|
+
when :String
|
161
|
+
value.to_s
|
162
|
+
when :Integer
|
163
|
+
value.to_i
|
164
|
+
when :Float
|
165
|
+
value.to_f
|
166
|
+
when :Boolean
|
167
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
168
|
+
true
|
169
|
+
else
|
170
|
+
false
|
171
|
+
end
|
172
|
+
when :Object
|
173
|
+
# generic object (usually a Hash), return directly
|
174
|
+
value
|
175
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
176
|
+
inner_type = Regexp.last_match[:inner_type]
|
177
|
+
value.map { |v| _deserialize(inner_type, v) }
|
178
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
179
|
+
k_type = Regexp.last_match[:k_type]
|
180
|
+
v_type = Regexp.last_match[:v_type]
|
181
|
+
{}.tap do |hash|
|
182
|
+
value.each do |k, v|
|
183
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
184
|
+
end
|
185
|
+
end
|
186
|
+
else # model
|
187
|
+
PulpFileClient.const_get(type).build_from_hash(value)
|
188
|
+
end
|
189
|
+
end
|
190
|
+
|
191
|
+
# Returns the string representation of the object
|
192
|
+
# @return [String] String presentation of the object
|
193
|
+
def to_s
|
194
|
+
to_hash.to_s
|
195
|
+
end
|
196
|
+
|
197
|
+
# to_body is an alias to to_hash (backward compatibility)
|
198
|
+
# @return [Hash] Returns the object in the form of hash
|
199
|
+
def to_body
|
200
|
+
to_hash
|
201
|
+
end
|
202
|
+
|
203
|
+
# Returns the object in the form of hash
|
204
|
+
# @return [Hash] Returns the object in the form of hash
|
205
|
+
def to_hash
|
206
|
+
hash = {}
|
207
|
+
self.class.attribute_map.each_pair do |attr, param|
|
208
|
+
value = self.send(attr)
|
209
|
+
if value.nil?
|
210
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
211
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
212
|
+
end
|
213
|
+
|
214
|
+
hash[param] = _to_hash(value)
|
215
|
+
end
|
216
|
+
hash
|
217
|
+
end
|
218
|
+
|
219
|
+
# Outputs non-array value in the form of hash
|
220
|
+
# For object, use to_hash. Otherwise, just return the value
|
221
|
+
# @param [Object] value Any valid value
|
222
|
+
# @return [Hash] Returns the value in the form of hash
|
223
|
+
def _to_hash(value)
|
224
|
+
if value.is_a?(Array)
|
225
|
+
value.compact.map { |v| _to_hash(v) }
|
226
|
+
elsif value.is_a?(Hash)
|
227
|
+
{}.tap do |hash|
|
228
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
229
|
+
end
|
230
|
+
elsif value.respond_to? :to_hash
|
231
|
+
value.to_hash
|
232
|
+
else
|
233
|
+
value
|
234
|
+
end
|
235
|
+
end
|
236
|
+
end
|
237
|
+
end
|
@@ -0,0 +1,241 @@
|
|
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.3.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module PulpFileClient
|
16
|
+
# Serializer for File alternate content source.
|
17
|
+
class PatchedfileFileAlternateContentSource
|
18
|
+
# Name of Alternate Content Source.
|
19
|
+
attr_accessor :name
|
20
|
+
|
21
|
+
# Date of last refresh of AlternateContentSource.
|
22
|
+
attr_accessor :last_refreshed
|
23
|
+
|
24
|
+
# List of paths that will be appended to the Remote url when searching for content.
|
25
|
+
attr_accessor :paths
|
26
|
+
|
27
|
+
# The remote to provide alternate content source.
|
28
|
+
attr_accessor :remote
|
29
|
+
|
30
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
31
|
+
def self.attribute_map
|
32
|
+
{
|
33
|
+
:'name' => :'name',
|
34
|
+
:'last_refreshed' => :'last_refreshed',
|
35
|
+
:'paths' => :'paths',
|
36
|
+
:'remote' => :'remote'
|
37
|
+
}
|
38
|
+
end
|
39
|
+
|
40
|
+
# Attribute type mapping.
|
41
|
+
def self.openapi_types
|
42
|
+
{
|
43
|
+
:'name' => :'String',
|
44
|
+
:'last_refreshed' => :'DateTime',
|
45
|
+
:'paths' => :'Array<String>',
|
46
|
+
:'remote' => :'String'
|
47
|
+
}
|
48
|
+
end
|
49
|
+
|
50
|
+
# List of attributes with nullable: true
|
51
|
+
def self.openapi_nullable
|
52
|
+
Set.new([
|
53
|
+
:'last_refreshed',
|
54
|
+
])
|
55
|
+
end
|
56
|
+
|
57
|
+
# Initializes the object
|
58
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
59
|
+
def initialize(attributes = {})
|
60
|
+
if (!attributes.is_a?(Hash))
|
61
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `PulpFileClient::PatchedfileFileAlternateContentSource` initialize method"
|
62
|
+
end
|
63
|
+
|
64
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
65
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
66
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
67
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `PulpFileClient::PatchedfileFileAlternateContentSource`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
68
|
+
end
|
69
|
+
h[k.to_sym] = v
|
70
|
+
}
|
71
|
+
|
72
|
+
if attributes.key?(:'name')
|
73
|
+
self.name = attributes[:'name']
|
74
|
+
end
|
75
|
+
|
76
|
+
if attributes.key?(:'last_refreshed')
|
77
|
+
self.last_refreshed = attributes[:'last_refreshed']
|
78
|
+
end
|
79
|
+
|
80
|
+
if attributes.key?(:'paths')
|
81
|
+
if (value = attributes[:'paths']).is_a?(Array)
|
82
|
+
self.paths = value
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
if attributes.key?(:'remote')
|
87
|
+
self.remote = attributes[:'remote']
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
91
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
92
|
+
# @return Array for valid properties with the reasons
|
93
|
+
def list_invalid_properties
|
94
|
+
invalid_properties = Array.new
|
95
|
+
invalid_properties
|
96
|
+
end
|
97
|
+
|
98
|
+
# Check to see if the all the properties in the model are valid
|
99
|
+
# @return true if the model is valid
|
100
|
+
def valid?
|
101
|
+
true
|
102
|
+
end
|
103
|
+
|
104
|
+
# Checks equality by comparing each attribute.
|
105
|
+
# @param [Object] Object to be compared
|
106
|
+
def ==(o)
|
107
|
+
return true if self.equal?(o)
|
108
|
+
self.class == o.class &&
|
109
|
+
name == o.name &&
|
110
|
+
last_refreshed == o.last_refreshed &&
|
111
|
+
paths == o.paths &&
|
112
|
+
remote == o.remote
|
113
|
+
end
|
114
|
+
|
115
|
+
# @see the `==` method
|
116
|
+
# @param [Object] Object to be compared
|
117
|
+
def eql?(o)
|
118
|
+
self == o
|
119
|
+
end
|
120
|
+
|
121
|
+
# Calculates hash code according to all attributes.
|
122
|
+
# @return [Integer] Hash code
|
123
|
+
def hash
|
124
|
+
[name, last_refreshed, paths, remote].hash
|
125
|
+
end
|
126
|
+
|
127
|
+
# Builds the object from hash
|
128
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
129
|
+
# @return [Object] Returns the model itself
|
130
|
+
def self.build_from_hash(attributes)
|
131
|
+
new.build_from_hash(attributes)
|
132
|
+
end
|
133
|
+
|
134
|
+
# Builds the object from hash
|
135
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
136
|
+
# @return [Object] Returns the model itself
|
137
|
+
def build_from_hash(attributes)
|
138
|
+
return nil unless attributes.is_a?(Hash)
|
139
|
+
self.class.openapi_types.each_pair do |key, type|
|
140
|
+
if type =~ /\AArray<(.*)>/i
|
141
|
+
# check to ensure the input is an array given that the attribute
|
142
|
+
# is documented as an array but the input is not
|
143
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
144
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
145
|
+
end
|
146
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
147
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
148
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
149
|
+
end
|
150
|
+
|
151
|
+
self
|
152
|
+
end
|
153
|
+
|
154
|
+
# Deserializes the data based on type
|
155
|
+
# @param string type Data type
|
156
|
+
# @param string value Value to be deserialized
|
157
|
+
# @return [Object] Deserialized data
|
158
|
+
def _deserialize(type, value)
|
159
|
+
case type.to_sym
|
160
|
+
when :DateTime
|
161
|
+
DateTime.parse(value)
|
162
|
+
when :Date
|
163
|
+
Date.parse(value)
|
164
|
+
when :String
|
165
|
+
value.to_s
|
166
|
+
when :Integer
|
167
|
+
value.to_i
|
168
|
+
when :Float
|
169
|
+
value.to_f
|
170
|
+
when :Boolean
|
171
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
172
|
+
true
|
173
|
+
else
|
174
|
+
false
|
175
|
+
end
|
176
|
+
when :Object
|
177
|
+
# generic object (usually a Hash), return directly
|
178
|
+
value
|
179
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
180
|
+
inner_type = Regexp.last_match[:inner_type]
|
181
|
+
value.map { |v| _deserialize(inner_type, v) }
|
182
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
183
|
+
k_type = Regexp.last_match[:k_type]
|
184
|
+
v_type = Regexp.last_match[:v_type]
|
185
|
+
{}.tap do |hash|
|
186
|
+
value.each do |k, v|
|
187
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
188
|
+
end
|
189
|
+
end
|
190
|
+
else # model
|
191
|
+
PulpFileClient.const_get(type).build_from_hash(value)
|
192
|
+
end
|
193
|
+
end
|
194
|
+
|
195
|
+
# Returns the string representation of the object
|
196
|
+
# @return [String] String presentation of the object
|
197
|
+
def to_s
|
198
|
+
to_hash.to_s
|
199
|
+
end
|
200
|
+
|
201
|
+
# to_body is an alias to to_hash (backward compatibility)
|
202
|
+
# @return [Hash] Returns the object in the form of hash
|
203
|
+
def to_body
|
204
|
+
to_hash
|
205
|
+
end
|
206
|
+
|
207
|
+
# Returns the object in the form of hash
|
208
|
+
# @return [Hash] Returns the object in the form of hash
|
209
|
+
def to_hash
|
210
|
+
hash = {}
|
211
|
+
self.class.attribute_map.each_pair do |attr, param|
|
212
|
+
value = self.send(attr)
|
213
|
+
if value.nil?
|
214
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
215
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
216
|
+
end
|
217
|
+
|
218
|
+
hash[param] = _to_hash(value)
|
219
|
+
end
|
220
|
+
hash
|
221
|
+
end
|
222
|
+
|
223
|
+
# Outputs non-array value in the form of hash
|
224
|
+
# For object, use to_hash. Otherwise, just return the value
|
225
|
+
# @param [Object] value Any valid value
|
226
|
+
# @return [Hash] Returns the value in the form of hash
|
227
|
+
def _to_hash(value)
|
228
|
+
if value.is_a?(Array)
|
229
|
+
value.compact.map { |v| _to_hash(v) }
|
230
|
+
elsif value.is_a?(Hash)
|
231
|
+
{}.tap do |hash|
|
232
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
233
|
+
end
|
234
|
+
elsif value.respond_to? :to_hash
|
235
|
+
value.to_hash
|
236
|
+
else
|
237
|
+
value
|
238
|
+
end
|
239
|
+
end
|
240
|
+
end
|
241
|
+
end
|
@@ -24,8 +24,9 @@ module PulpFileClient
|
|
24
24
|
attr_accessor :description
|
25
25
|
|
26
26
|
# Retain X versions of the repository. Default is null which retains all versions. This is provided as a tech preview in Pulp 3 and may change in the future.
|
27
|
-
attr_accessor :
|
27
|
+
attr_accessor :retain_repo_versions
|
28
28
|
|
29
|
+
# An optional remote to use by default when syncing.
|
29
30
|
attr_accessor :remote
|
30
31
|
|
31
32
|
# Whether to automatically create publications for new repository versions, and update any distributions pointing to this repository.
|
@@ -40,7 +41,7 @@ module PulpFileClient
|
|
40
41
|
:'pulp_labels' => :'pulp_labels',
|
41
42
|
:'name' => :'name',
|
42
43
|
:'description' => :'description',
|
43
|
-
:'
|
44
|
+
:'retain_repo_versions' => :'retain_repo_versions',
|
44
45
|
:'remote' => :'remote',
|
45
46
|
:'autopublish' => :'autopublish',
|
46
47
|
:'manifest' => :'manifest'
|
@@ -53,7 +54,7 @@ module PulpFileClient
|
|
53
54
|
:'pulp_labels' => :'Object',
|
54
55
|
:'name' => :'String',
|
55
56
|
:'description' => :'String',
|
56
|
-
:'
|
57
|
+
:'retain_repo_versions' => :'Integer',
|
57
58
|
:'remote' => :'String',
|
58
59
|
:'autopublish' => :'Boolean',
|
59
60
|
:'manifest' => :'String'
|
@@ -64,7 +65,7 @@ module PulpFileClient
|
|
64
65
|
def self.openapi_nullable
|
65
66
|
Set.new([
|
66
67
|
:'description',
|
67
|
-
:'
|
68
|
+
:'retain_repo_versions',
|
68
69
|
:'remote',
|
69
70
|
])
|
70
71
|
end
|
@@ -96,8 +97,8 @@ module PulpFileClient
|
|
96
97
|
self.description = attributes[:'description']
|
97
98
|
end
|
98
99
|
|
99
|
-
if attributes.key?(:'
|
100
|
-
self.
|
100
|
+
if attributes.key?(:'retain_repo_versions')
|
101
|
+
self.retain_repo_versions = attributes[:'retain_repo_versions']
|
101
102
|
end
|
102
103
|
|
103
104
|
if attributes.key?(:'remote')
|
@@ -121,8 +122,8 @@ module PulpFileClient
|
|
121
122
|
# @return Array for valid properties with the reasons
|
122
123
|
def list_invalid_properties
|
123
124
|
invalid_properties = Array.new
|
124
|
-
if !@
|
125
|
-
invalid_properties.push('invalid value for "
|
125
|
+
if !@retain_repo_versions.nil? && @retain_repo_versions < 1
|
126
|
+
invalid_properties.push('invalid value for "retain_repo_versions", must be greater than or equal to 1.')
|
126
127
|
end
|
127
128
|
|
128
129
|
invalid_properties
|
@@ -131,18 +132,18 @@ module PulpFileClient
|
|
131
132
|
# Check to see if the all the properties in the model are valid
|
132
133
|
# @return true if the model is valid
|
133
134
|
def valid?
|
134
|
-
return false if !@
|
135
|
+
return false if !@retain_repo_versions.nil? && @retain_repo_versions < 1
|
135
136
|
true
|
136
137
|
end
|
137
138
|
|
138
139
|
# Custom attribute writer method with validation
|
139
|
-
# @param [Object]
|
140
|
-
def
|
141
|
-
if !
|
142
|
-
fail ArgumentError, 'invalid value for "
|
140
|
+
# @param [Object] retain_repo_versions Value to be assigned
|
141
|
+
def retain_repo_versions=(retain_repo_versions)
|
142
|
+
if !retain_repo_versions.nil? && retain_repo_versions < 1
|
143
|
+
fail ArgumentError, 'invalid value for "retain_repo_versions", must be greater than or equal to 1.'
|
143
144
|
end
|
144
145
|
|
145
|
-
@
|
146
|
+
@retain_repo_versions = retain_repo_versions
|
146
147
|
end
|
147
148
|
|
148
149
|
# Checks equality by comparing each attribute.
|
@@ -153,7 +154,7 @@ module PulpFileClient
|
|
153
154
|
pulp_labels == o.pulp_labels &&
|
154
155
|
name == o.name &&
|
155
156
|
description == o.description &&
|
156
|
-
|
157
|
+
retain_repo_versions == o.retain_repo_versions &&
|
157
158
|
remote == o.remote &&
|
158
159
|
autopublish == o.autopublish &&
|
159
160
|
manifest == o.manifest
|
@@ -168,7 +169,7 @@ module PulpFileClient
|
|
168
169
|
# Calculates hash code according to all attributes.
|
169
170
|
# @return [Integer] Hash code
|
170
171
|
def hash
|
171
|
-
[pulp_labels, name, description,
|
172
|
+
[pulp_labels, name, description, retain_repo_versions, remote, autopublish, manifest].hash
|
172
173
|
end
|
173
174
|
|
174
175
|
# Builds the object from hash
|