pulpcore_client 3.22.26 → 3.23.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +26 -4
  3. data/docs/ArtifactDistributionResponse.md +5 -5
  4. data/docs/DistributionsApi.md +4 -0
  5. data/docs/DistributionsArtifactsApi.md +4 -0
  6. data/docs/Domain.md +27 -0
  7. data/docs/DomainResponse.md +31 -0
  8. data/docs/DomainsApi.md +362 -0
  9. data/docs/ExportersFilesystemApi.md +3 -3
  10. data/docs/ExportersFilesystemExportsApi.md +3 -3
  11. data/docs/GroupRole.md +3 -1
  12. data/docs/GroupRoleResponse.md +3 -1
  13. data/docs/GroupsApi.md +6 -6
  14. data/docs/GroupsRolesApi.md +6 -4
  15. data/docs/PaginatedDomainResponseList.md +23 -0
  16. data/docs/PaginatedUpstreamPulpResponseList.md +23 -0
  17. data/docs/PatchedDomain.md +27 -0
  18. data/docs/PatchedUpstreamPulp.md +37 -0
  19. data/docs/RepositoriesApi.md +16 -0
  20. data/docs/RepositoryResponse.md +1 -1
  21. data/docs/RolesApi.md +6 -6
  22. data/docs/StatusResponse.md +3 -1
  23. data/docs/StorageClassEnum.md +16 -0
  24. data/docs/TaskSchedulesApi.md +2 -2
  25. data/docs/TasksApi.md +1 -1
  26. data/docs/UpstreamPulp.md +37 -0
  27. data/docs/UpstreamPulpResponse.md +39 -0
  28. data/docs/UpstreamPulpsApi.md +405 -0
  29. data/docs/UserRole.md +4 -2
  30. data/docs/UserRoleResponse.md +4 -2
  31. data/docs/UsersApi.md +6 -6
  32. data/docs/UsersRolesApi.md +6 -4
  33. data/docs/VersionResponse.md +3 -1
  34. data/lib/pulpcore_client/api/distributions_api.rb +6 -0
  35. data/lib/pulpcore_client/api/distributions_artifacts_api.rb +6 -0
  36. data/lib/pulpcore_client/api/domains_api.rb +446 -0
  37. data/lib/pulpcore_client/api/exporters_filesystem_api.rb +6 -6
  38. data/lib/pulpcore_client/api/exporters_filesystem_exports_api.rb +6 -6
  39. data/lib/pulpcore_client/api/groups_api.rb +12 -12
  40. data/lib/pulpcore_client/api/groups_roles_api.rb +11 -8
  41. data/lib/pulpcore_client/api/repositories_api.rb +24 -0
  42. data/lib/pulpcore_client/api/roles_api.rb +12 -12
  43. data/lib/pulpcore_client/api/task_schedules_api.rb +4 -4
  44. data/lib/pulpcore_client/api/tasks_api.rb +2 -2
  45. data/lib/pulpcore_client/api/upstream_pulps_api.rb +492 -0
  46. data/lib/pulpcore_client/api/users_api.rb +12 -12
  47. data/lib/pulpcore_client/api/users_roles_api.rb +11 -8
  48. data/lib/pulpcore_client/api/workers_api.rb +1 -1
  49. data/lib/pulpcore_client/models/artifact_distribution_response.rb +24 -24
  50. data/lib/pulpcore_client/models/domain.rb +323 -0
  51. data/lib/pulpcore_client/models/domain_response.rb +318 -0
  52. data/lib/pulpcore_client/models/group_role.rb +16 -5
  53. data/lib/pulpcore_client/models/group_role_response.rb +15 -4
  54. data/lib/pulpcore_client/models/nested_role.rb +19 -0
  55. data/lib/pulpcore_client/models/paginated_domain_response_list.rb +237 -0
  56. data/lib/pulpcore_client/models/paginated_upstream_pulp_response_list.rb +237 -0
  57. data/lib/pulpcore_client/models/patched_domain.rb +304 -0
  58. data/lib/pulpcore_client/models/patched_upstream_pulp.rb +450 -0
  59. data/lib/pulpcore_client/models/repository_response.rb +1 -1
  60. data/lib/pulpcore_client/models/status_response.rb +19 -4
  61. data/lib/pulpcore_client/models/storage_class_enum.rb +37 -0
  62. data/lib/pulpcore_client/models/upstream_pulp.rb +477 -0
  63. data/lib/pulpcore_client/models/upstream_pulp_response.rb +338 -0
  64. data/lib/pulpcore_client/models/user_role.rb +17 -6
  65. data/lib/pulpcore_client/models/user_role_response.rb +16 -5
  66. data/lib/pulpcore_client/models/version_response.rb +19 -4
  67. data/lib/pulpcore_client/version.rb +1 -1
  68. data/lib/pulpcore_client.rb +11 -0
  69. data/spec/api/distributions_api_spec.rb +2 -0
  70. data/spec/api/distributions_artifacts_api_spec.rb +2 -0
  71. data/spec/api/domains_api_spec.rb +120 -0
  72. data/spec/api/exporters_filesystem_api_spec.rb +3 -3
  73. data/spec/api/exporters_filesystem_exports_api_spec.rb +3 -3
  74. data/spec/api/groups_api_spec.rb +6 -6
  75. data/spec/api/groups_roles_api_spec.rb +5 -4
  76. data/spec/api/repositories_api_spec.rb +8 -0
  77. data/spec/api/roles_api_spec.rb +6 -6
  78. data/spec/api/task_schedules_api_spec.rb +2 -2
  79. data/spec/api/tasks_api_spec.rb +1 -1
  80. data/spec/api/upstream_pulps_api_spec.rb +127 -0
  81. data/spec/api/users_api_spec.rb +6 -6
  82. data/spec/api/users_roles_api_spec.rb +5 -4
  83. data/spec/models/artifact_distribution_response_spec.rb +5 -5
  84. data/spec/models/domain_response_spec.rb +83 -0
  85. data/spec/models/domain_spec.rb +71 -0
  86. data/spec/models/group_role_response_spec.rb +6 -0
  87. data/spec/models/group_role_spec.rb +6 -0
  88. data/spec/models/paginated_domain_response_list_spec.rb +59 -0
  89. data/spec/models/paginated_upstream_pulp_response_list_spec.rb +59 -0
  90. data/spec/models/patched_domain_spec.rb +71 -0
  91. data/spec/models/patched_upstream_pulp_spec.rb +101 -0
  92. data/spec/models/status_response_spec.rb +6 -0
  93. data/spec/models/storage_class_enum_spec.rb +35 -0
  94. data/spec/models/upstream_pulp_response_spec.rb +107 -0
  95. data/spec/models/upstream_pulp_spec.rb +101 -0
  96. data/spec/models/user_role_response_spec.rb +6 -0
  97. data/spec/models/user_role_spec.rb +6 -0
  98. data/spec/models/version_response_spec.rb +6 -0
  99. metadata +173 -129
@@ -0,0 +1,318 @@
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 PulpcoreClient
16
+ # Serializer for Domain.
17
+ class DomainResponse
18
+ attr_accessor :pulp_href
19
+
20
+ # Timestamp of creation.
21
+ attr_accessor :pulp_created
22
+
23
+ # A name for this domain.
24
+ attr_accessor :name
25
+
26
+ # An optional description.
27
+ attr_accessor :description
28
+
29
+ # Backend storage class for domain.
30
+ attr_accessor :storage_class
31
+
32
+ # Settings for storage class.
33
+ attr_accessor :storage_settings
34
+
35
+ # Boolean to have the content app redirect to object storage.
36
+ attr_accessor :redirect_to_object_storage
37
+
38
+ # Boolean to hide distributions with a content guard in the content app.
39
+ attr_accessor :hide_guarded_distributions
40
+
41
+ # Attribute mapping from ruby-style variable name to JSON key.
42
+ def self.attribute_map
43
+ {
44
+ :'pulp_href' => :'pulp_href',
45
+ :'pulp_created' => :'pulp_created',
46
+ :'name' => :'name',
47
+ :'description' => :'description',
48
+ :'storage_class' => :'storage_class',
49
+ :'storage_settings' => :'storage_settings',
50
+ :'redirect_to_object_storage' => :'redirect_to_object_storage',
51
+ :'hide_guarded_distributions' => :'hide_guarded_distributions'
52
+ }
53
+ end
54
+
55
+ # Attribute type mapping.
56
+ def self.openapi_types
57
+ {
58
+ :'pulp_href' => :'String',
59
+ :'pulp_created' => :'DateTime',
60
+ :'name' => :'String',
61
+ :'description' => :'String',
62
+ :'storage_class' => :'StorageClassEnum',
63
+ :'storage_settings' => :'Object',
64
+ :'redirect_to_object_storage' => :'Boolean',
65
+ :'hide_guarded_distributions' => :'Boolean'
66
+ }
67
+ end
68
+
69
+ # List of attributes with nullable: true
70
+ def self.openapi_nullable
71
+ Set.new([
72
+ :'description',
73
+ ])
74
+ end
75
+
76
+ # Initializes the object
77
+ # @param [Hash] attributes Model attributes in the form of hash
78
+ def initialize(attributes = {})
79
+ if (!attributes.is_a?(Hash))
80
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpcoreClient::DomainResponse` initialize method"
81
+ end
82
+
83
+ # check to see if the attribute exists and convert string to symbol for hash key
84
+ attributes = attributes.each_with_object({}) { |(k, v), h|
85
+ if (!self.class.attribute_map.key?(k.to_sym))
86
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpcoreClient::DomainResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
87
+ end
88
+ h[k.to_sym] = v
89
+ }
90
+
91
+ if attributes.key?(:'pulp_href')
92
+ self.pulp_href = attributes[:'pulp_href']
93
+ end
94
+
95
+ if attributes.key?(:'pulp_created')
96
+ self.pulp_created = attributes[:'pulp_created']
97
+ end
98
+
99
+ if attributes.key?(:'name')
100
+ self.name = attributes[:'name']
101
+ end
102
+
103
+ if attributes.key?(:'description')
104
+ self.description = attributes[:'description']
105
+ end
106
+
107
+ if attributes.key?(:'storage_class')
108
+ self.storage_class = attributes[:'storage_class']
109
+ end
110
+
111
+ if attributes.key?(:'storage_settings')
112
+ self.storage_settings = attributes[:'storage_settings']
113
+ end
114
+
115
+ if attributes.key?(:'redirect_to_object_storage')
116
+ self.redirect_to_object_storage = attributes[:'redirect_to_object_storage']
117
+ else
118
+ self.redirect_to_object_storage = true
119
+ end
120
+
121
+ if attributes.key?(:'hide_guarded_distributions')
122
+ self.hide_guarded_distributions = attributes[:'hide_guarded_distributions']
123
+ else
124
+ self.hide_guarded_distributions = false
125
+ end
126
+ end
127
+
128
+ # Show invalid properties with the reasons. Usually used together with valid?
129
+ # @return Array for valid properties with the reasons
130
+ def list_invalid_properties
131
+ invalid_properties = Array.new
132
+ if @name.nil?
133
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
134
+ end
135
+
136
+ pattern = Regexp.new(/^[-a-zA-Z0-9_]+$/)
137
+ if @name !~ pattern
138
+ invalid_properties.push("invalid value for \"name\", must conform to the pattern #{pattern}.")
139
+ end
140
+
141
+ if @storage_class.nil?
142
+ invalid_properties.push('invalid value for "storage_class", storage_class cannot be nil.')
143
+ end
144
+
145
+ if @storage_settings.nil?
146
+ invalid_properties.push('invalid value for "storage_settings", storage_settings cannot be nil.')
147
+ end
148
+
149
+ invalid_properties
150
+ end
151
+
152
+ # Check to see if the all the properties in the model are valid
153
+ # @return true if the model is valid
154
+ def valid?
155
+ return false if @name.nil?
156
+ return false if @name !~ Regexp.new(/^[-a-zA-Z0-9_]+$/)
157
+ return false if @storage_class.nil?
158
+ return false if @storage_settings.nil?
159
+ true
160
+ end
161
+
162
+ # Custom attribute writer method with validation
163
+ # @param [Object] name Value to be assigned
164
+ def name=(name)
165
+ if name.nil?
166
+ fail ArgumentError, 'name cannot be nil'
167
+ end
168
+
169
+ pattern = Regexp.new(/^[-a-zA-Z0-9_]+$/)
170
+ if name !~ pattern
171
+ fail ArgumentError, "invalid value for \"name\", must conform to the pattern #{pattern}."
172
+ end
173
+
174
+ @name = name
175
+ end
176
+
177
+ # Checks equality by comparing each attribute.
178
+ # @param [Object] Object to be compared
179
+ def ==(o)
180
+ return true if self.equal?(o)
181
+ self.class == o.class &&
182
+ pulp_href == o.pulp_href &&
183
+ pulp_created == o.pulp_created &&
184
+ name == o.name &&
185
+ description == o.description &&
186
+ storage_class == o.storage_class &&
187
+ storage_settings == o.storage_settings &&
188
+ redirect_to_object_storage == o.redirect_to_object_storage &&
189
+ hide_guarded_distributions == o.hide_guarded_distributions
190
+ end
191
+
192
+ # @see the `==` method
193
+ # @param [Object] Object to be compared
194
+ def eql?(o)
195
+ self == o
196
+ end
197
+
198
+ # Calculates hash code according to all attributes.
199
+ # @return [Integer] Hash code
200
+ def hash
201
+ [pulp_href, pulp_created, name, description, storage_class, storage_settings, redirect_to_object_storage, hide_guarded_distributions].hash
202
+ end
203
+
204
+ # Builds the object from hash
205
+ # @param [Hash] attributes Model attributes in the form of hash
206
+ # @return [Object] Returns the model itself
207
+ def self.build_from_hash(attributes)
208
+ new.build_from_hash(attributes)
209
+ end
210
+
211
+ # Builds the object from hash
212
+ # @param [Hash] attributes Model attributes in the form of hash
213
+ # @return [Object] Returns the model itself
214
+ def build_from_hash(attributes)
215
+ return nil unless attributes.is_a?(Hash)
216
+ self.class.openapi_types.each_pair do |key, type|
217
+ if type =~ /\AArray<(.*)>/i
218
+ # check to ensure the input is an array given that the attribute
219
+ # is documented as an array but the input is not
220
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
221
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
222
+ end
223
+ elsif !attributes[self.class.attribute_map[key]].nil?
224
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
225
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
226
+ end
227
+
228
+ self
229
+ end
230
+
231
+ # Deserializes the data based on type
232
+ # @param string type Data type
233
+ # @param string value Value to be deserialized
234
+ # @return [Object] Deserialized data
235
+ def _deserialize(type, value)
236
+ case type.to_sym
237
+ when :DateTime
238
+ DateTime.parse(value)
239
+ when :Date
240
+ Date.parse(value)
241
+ when :String
242
+ value.to_s
243
+ when :Integer
244
+ value.to_i
245
+ when :Float
246
+ value.to_f
247
+ when :Boolean
248
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
249
+ true
250
+ else
251
+ false
252
+ end
253
+ when :Object
254
+ # generic object (usually a Hash), return directly
255
+ value
256
+ when /\AArray<(?<inner_type>.+)>\z/
257
+ inner_type = Regexp.last_match[:inner_type]
258
+ value.map { |v| _deserialize(inner_type, v) }
259
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
260
+ k_type = Regexp.last_match[:k_type]
261
+ v_type = Regexp.last_match[:v_type]
262
+ {}.tap do |hash|
263
+ value.each do |k, v|
264
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
265
+ end
266
+ end
267
+ else # model
268
+ PulpcoreClient.const_get(type).build_from_hash(value)
269
+ end
270
+ end
271
+
272
+ # Returns the string representation of the object
273
+ # @return [String] String presentation of the object
274
+ def to_s
275
+ to_hash.to_s
276
+ end
277
+
278
+ # to_body is an alias to to_hash (backward compatibility)
279
+ # @return [Hash] Returns the object in the form of hash
280
+ def to_body
281
+ to_hash
282
+ end
283
+
284
+ # Returns the object in the form of hash
285
+ # @return [Hash] Returns the object in the form of hash
286
+ def to_hash
287
+ hash = {}
288
+ self.class.attribute_map.each_pair do |attr, param|
289
+ value = self.send(attr)
290
+ if value.nil?
291
+ is_nullable = self.class.openapi_nullable.include?(attr)
292
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
293
+ end
294
+
295
+ hash[param] = _to_hash(value)
296
+ end
297
+ hash
298
+ end
299
+
300
+ # Outputs non-array value in the form of hash
301
+ # For object, use to_hash. Otherwise, just return the value
302
+ # @param [Object] value Any valid value
303
+ # @return [Hash] Returns the value in the form of hash
304
+ def _to_hash(value)
305
+ if value.is_a?(Array)
306
+ value.compact.map { |v| _to_hash(v) }
307
+ elsif value.is_a?(Hash)
308
+ {}.tap do |hash|
309
+ value.each { |k, v| hash[k] = _to_hash(v) }
310
+ end
311
+ elsif value.respond_to? :to_hash
312
+ value.to_hash
313
+ else
314
+ value
315
+ end
316
+ end
317
+ end
318
+ end
@@ -20,11 +20,15 @@ module PulpcoreClient
20
20
  # pulp_href of the object for which role permissions should be asserted. If set to 'null', permissions will act on the model-level.
21
21
  attr_accessor :content_object
22
22
 
23
+ # Domain this role should be applied on, mutually exclusive with content_object.
24
+ attr_accessor :domain
25
+
23
26
  # Attribute mapping from ruby-style variable name to JSON key.
24
27
  def self.attribute_map
25
28
  {
26
29
  :'role' => :'role',
27
- :'content_object' => :'content_object'
30
+ :'content_object' => :'content_object',
31
+ :'domain' => :'domain'
28
32
  }
29
33
  end
30
34
 
@@ -32,14 +36,16 @@ module PulpcoreClient
32
36
  def self.openapi_types
33
37
  {
34
38
  :'role' => :'String',
35
- :'content_object' => :'String'
39
+ :'content_object' => :'String',
40
+ :'domain' => :'String'
36
41
  }
37
42
  end
38
43
 
39
44
  # List of attributes with nullable: true
40
45
  def self.openapi_nullable
41
46
  Set.new([
42
- :'content_object'
47
+ :'content_object',
48
+ :'domain'
43
49
  ])
44
50
  end
45
51
 
@@ -65,6 +71,10 @@ module PulpcoreClient
65
71
  if attributes.key?(:'content_object')
66
72
  self.content_object = attributes[:'content_object']
67
73
  end
74
+
75
+ if attributes.key?(:'domain')
76
+ self.domain = attributes[:'domain']
77
+ end
68
78
  end
69
79
 
70
80
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -125,7 +135,8 @@ module PulpcoreClient
125
135
  return true if self.equal?(o)
126
136
  self.class == o.class &&
127
137
  role == o.role &&
128
- content_object == o.content_object
138
+ content_object == o.content_object &&
139
+ domain == o.domain
129
140
  end
130
141
 
131
142
  # @see the `==` method
@@ -137,7 +148,7 @@ module PulpcoreClient
137
148
  # Calculates hash code according to all attributes.
138
149
  # @return [Integer] Hash code
139
150
  def hash
140
- [role, content_object].hash
151
+ [role, content_object, domain].hash
141
152
  end
142
153
 
143
154
  # Builds the object from hash
@@ -29,6 +29,9 @@ module PulpcoreClient
29
29
 
30
30
  attr_accessor :permissions
31
31
 
32
+ # Domain this role should be applied on, mutually exclusive with content_object.
33
+ attr_accessor :domain
34
+
32
35
  # Attribute mapping from ruby-style variable name to JSON key.
33
36
  def self.attribute_map
34
37
  {
@@ -37,7 +40,8 @@ module PulpcoreClient
37
40
  :'role' => :'role',
38
41
  :'content_object' => :'content_object',
39
42
  :'description' => :'description',
40
- :'permissions' => :'permissions'
43
+ :'permissions' => :'permissions',
44
+ :'domain' => :'domain'
41
45
  }
42
46
  end
43
47
 
@@ -49,7 +53,8 @@ module PulpcoreClient
49
53
  :'role' => :'String',
50
54
  :'content_object' => :'String',
51
55
  :'description' => :'String',
52
- :'permissions' => :'Array<String>'
56
+ :'permissions' => :'Array<String>',
57
+ :'domain' => :'String'
53
58
  }
54
59
  end
55
60
 
@@ -57,6 +62,7 @@ module PulpcoreClient
57
62
  def self.openapi_nullable
58
63
  Set.new([
59
64
  :'content_object',
65
+ :'domain'
60
66
  ])
61
67
  end
62
68
 
@@ -100,6 +106,10 @@ module PulpcoreClient
100
106
  self.permissions = value
101
107
  end
102
108
  end
109
+
110
+ if attributes.key?(:'domain')
111
+ self.domain = attributes[:'domain']
112
+ end
103
113
  end
104
114
 
105
115
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -130,7 +140,8 @@ module PulpcoreClient
130
140
  role == o.role &&
131
141
  content_object == o.content_object &&
132
142
  description == o.description &&
133
- permissions == o.permissions
143
+ permissions == o.permissions &&
144
+ domain == o.domain
134
145
  end
135
146
 
136
147
  # @see the `==` method
@@ -142,7 +153,7 @@ module PulpcoreClient
142
153
  # Calculates hash code according to all attributes.
143
154
  # @return [Integer] Hash code
144
155
  def hash
145
- [pulp_href, pulp_created, role, content_object, description, permissions].hash
156
+ [pulp_href, pulp_created, role, content_object, description, permissions, domain].hash
146
157
  end
147
158
 
148
159
  # Builds the object from hash
@@ -85,6 +85,10 @@ module PulpcoreClient
85
85
  invalid_properties.push('invalid value for "role", role cannot be nil.')
86
86
  end
87
87
 
88
+ if @role.to_s.length < 1
89
+ invalid_properties.push('invalid value for "role", the character length must be great than or equal to 1.')
90
+ end
91
+
88
92
  invalid_properties
89
93
  end
90
94
 
@@ -92,9 +96,24 @@ module PulpcoreClient
92
96
  # @return true if the model is valid
93
97
  def valid?
94
98
  return false if @role.nil?
99
+ return false if @role.to_s.length < 1
95
100
  true
96
101
  end
97
102
 
103
+ # Custom attribute writer method with validation
104
+ # @param [Object] role Value to be assigned
105
+ def role=(role)
106
+ if role.nil?
107
+ fail ArgumentError, 'role cannot be nil'
108
+ end
109
+
110
+ if role.to_s.length < 1
111
+ fail ArgumentError, 'invalid value for "role", the character length must be great than or equal to 1.'
112
+ end
113
+
114
+ @role = role
115
+ end
116
+
98
117
  # Checks equality by comparing each attribute.
99
118
  # @param [Object] Object to be compared
100
119
  def ==(o)