pulpcore_client 3.118.6 → 3.119.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +18 -4
  3. data/docs/ArtifactDistributionResponse.md +12 -12
  4. data/docs/ContentguardsApi.md +4 -4
  5. data/docs/ContentguardsEnvvarHeaderApi.md +810 -0
  6. data/docs/EnvVarHeaderContentGuard.md +24 -0
  7. data/docs/EnvVarHeaderContentGuardResponse.md +32 -0
  8. data/docs/PaginatedEnvVarHeaderContentGuardResponseList.md +24 -0
  9. data/docs/PatchedEnvVarHeaderContentGuard.md +24 -0
  10. data/docs/Purge.md +1 -1
  11. data/lib/pulpcore_client/api/contentguards_api.rb +6 -6
  12. data/lib/pulpcore_client/api/contentguards_envvar_header_api.rb +799 -0
  13. data/lib/pulpcore_client/models/artifact_distribution_response.rb +56 -56
  14. data/lib/pulpcore_client/models/env_var_header_content_guard.rb +340 -0
  15. data/lib/pulpcore_client/models/env_var_header_content_guard_response.rb +307 -0
  16. data/lib/pulpcore_client/models/paginated_env_var_header_content_guard_response_list.rb +257 -0
  17. data/lib/pulpcore_client/models/patched_env_var_header_content_guard.rb +319 -0
  18. data/lib/pulpcore_client/models/purge.rb +1 -1
  19. data/lib/pulpcore_client/version.rb +1 -1
  20. data/lib/pulpcore_client.rb +5 -0
  21. data/spec/api/contentguards_api_spec.rb +2 -2
  22. data/spec/api/contentguards_envvar_header_api_spec.rb +192 -0
  23. data/spec/models/artifact_distribution_response_spec.rb +12 -12
  24. data/spec/models/env_var_header_content_guard_response_spec.rb +78 -0
  25. data/spec/models/env_var_header_content_guard_spec.rb +54 -0
  26. data/spec/models/paginated_env_var_header_content_guard_response_list_spec.rb +54 -0
  27. data/spec/models/patched_env_var_header_content_guard_spec.rb +54 -0
  28. metadata +221 -198
@@ -19,56 +19,56 @@ module PulpcoreClient
19
19
  # The base (relative) path component of the published url. Avoid paths that overlap with other distribution base paths (e.g. \"foo\" and \"foo/bar\")
20
20
  attr_accessor :base_path
21
21
 
22
+ # The Pulp Resource Name (PRN).
23
+ attr_accessor :prn
24
+
25
+ # Whether this distribution should be shown in the content app.
26
+ attr_accessor :hidden
27
+
28
+ attr_accessor :pulp_href
29
+
22
30
  # The URL for accessing the publication as defined by this distribution.
23
31
  attr_accessor :base_url
24
32
 
25
- # Timestamp of creation.
26
- attr_accessor :pulp_created
27
-
28
33
  # An optional content-guard.
29
34
  attr_accessor :content_guard
30
35
 
31
36
  # A unique name. Ex, `rawhide` and `stable`.
32
37
  attr_accessor :name
33
38
 
34
- # Timestamp since when the distributed content served by this distribution has not changed. If equals to `null`, no guarantee is provided about content changes.
35
- attr_accessor :no_content_change_since
36
-
37
39
  attr_accessor :pulp_labels
38
40
 
39
- # The Pulp Resource Name (PRN).
40
- attr_accessor :prn
41
+ # Timestamp of creation.
42
+ attr_accessor :pulp_created
41
43
 
42
44
  # Timestamp of the last time this resource was updated. Note: for immutable resources - like content, repository versions, and publication - pulp_created and pulp_last_updated dates will be the same.
43
45
  attr_accessor :pulp_last_updated
44
46
 
45
- attr_accessor :pulp_href
46
-
47
- # The Pulp Resource Name (PRN) of the associated optional content guard.
48
- attr_accessor :content_guard_prn
49
-
50
47
  # RepositoryVersion to be served
51
48
  attr_accessor :repository_version
52
49
 
53
- # Whether this distribution should be shown in the content app.
54
- attr_accessor :hidden
50
+ # Timestamp since when the distributed content served by this distribution has not changed. If equals to `null`, no guarantee is provided about content changes.
51
+ attr_accessor :no_content_change_since
52
+
53
+ # The Pulp Resource Name (PRN) of the associated optional content guard.
54
+ attr_accessor :content_guard_prn
55
55
 
56
56
  # Attribute mapping from ruby-style variable name to JSON key.
57
57
  def self.attribute_map
58
58
  {
59
59
  :'base_path' => :'base_path',
60
+ :'prn' => :'prn',
61
+ :'hidden' => :'hidden',
62
+ :'pulp_href' => :'pulp_href',
60
63
  :'base_url' => :'base_url',
61
- :'pulp_created' => :'pulp_created',
62
64
  :'content_guard' => :'content_guard',
63
65
  :'name' => :'name',
64
- :'no_content_change_since' => :'no_content_change_since',
65
66
  :'pulp_labels' => :'pulp_labels',
66
- :'prn' => :'prn',
67
+ :'pulp_created' => :'pulp_created',
67
68
  :'pulp_last_updated' => :'pulp_last_updated',
68
- :'pulp_href' => :'pulp_href',
69
- :'content_guard_prn' => :'content_guard_prn',
70
69
  :'repository_version' => :'repository_version',
71
- :'hidden' => :'hidden'
70
+ :'no_content_change_since' => :'no_content_change_since',
71
+ :'content_guard_prn' => :'content_guard_prn'
72
72
  }
73
73
  end
74
74
 
@@ -81,18 +81,18 @@ module PulpcoreClient
81
81
  def self.openapi_types
82
82
  {
83
83
  :'base_path' => :'String',
84
+ :'prn' => :'String',
85
+ :'hidden' => :'Boolean',
86
+ :'pulp_href' => :'String',
84
87
  :'base_url' => :'String',
85
- :'pulp_created' => :'Time',
86
88
  :'content_guard' => :'String',
87
89
  :'name' => :'String',
88
- :'no_content_change_since' => :'String',
89
90
  :'pulp_labels' => :'Hash<String, String>',
90
- :'prn' => :'String',
91
+ :'pulp_created' => :'Time',
91
92
  :'pulp_last_updated' => :'Time',
92
- :'pulp_href' => :'String',
93
- :'content_guard_prn' => :'String',
94
93
  :'repository_version' => :'String',
95
- :'hidden' => :'Boolean'
94
+ :'no_content_change_since' => :'String',
95
+ :'content_guard_prn' => :'String'
96
96
  }
97
97
  end
98
98
 
@@ -125,12 +125,22 @@ module PulpcoreClient
125
125
  self.base_path = nil
126
126
  end
127
127
 
128
- if attributes.key?(:'base_url')
129
- self.base_url = attributes[:'base_url']
128
+ if attributes.key?(:'prn')
129
+ self.prn = attributes[:'prn']
130
130
  end
131
131
 
132
- if attributes.key?(:'pulp_created')
133
- self.pulp_created = attributes[:'pulp_created']
132
+ if attributes.key?(:'hidden')
133
+ self.hidden = attributes[:'hidden']
134
+ else
135
+ self.hidden = false
136
+ end
137
+
138
+ if attributes.key?(:'pulp_href')
139
+ self.pulp_href = attributes[:'pulp_href']
140
+ end
141
+
142
+ if attributes.key?(:'base_url')
143
+ self.base_url = attributes[:'base_url']
134
144
  end
135
145
 
136
146
  if attributes.key?(:'content_guard')
@@ -143,40 +153,30 @@ module PulpcoreClient
143
153
  self.name = nil
144
154
  end
145
155
 
146
- if attributes.key?(:'no_content_change_since')
147
- self.no_content_change_since = attributes[:'no_content_change_since']
148
- end
149
-
150
156
  if attributes.key?(:'pulp_labels')
151
157
  if (value = attributes[:'pulp_labels']).is_a?(Hash)
152
158
  self.pulp_labels = value
153
159
  end
154
160
  end
155
161
 
156
- if attributes.key?(:'prn')
157
- self.prn = attributes[:'prn']
162
+ if attributes.key?(:'pulp_created')
163
+ self.pulp_created = attributes[:'pulp_created']
158
164
  end
159
165
 
160
166
  if attributes.key?(:'pulp_last_updated')
161
167
  self.pulp_last_updated = attributes[:'pulp_last_updated']
162
168
  end
163
169
 
164
- if attributes.key?(:'pulp_href')
165
- self.pulp_href = attributes[:'pulp_href']
166
- end
167
-
168
- if attributes.key?(:'content_guard_prn')
169
- self.content_guard_prn = attributes[:'content_guard_prn']
170
- end
171
-
172
170
  if attributes.key?(:'repository_version')
173
171
  self.repository_version = attributes[:'repository_version']
174
172
  end
175
173
 
176
- if attributes.key?(:'hidden')
177
- self.hidden = attributes[:'hidden']
178
- else
179
- self.hidden = false
174
+ if attributes.key?(:'no_content_change_since')
175
+ self.no_content_change_since = attributes[:'no_content_change_since']
176
+ end
177
+
178
+ if attributes.key?(:'content_guard_prn')
179
+ self.content_guard_prn = attributes[:'content_guard_prn']
180
180
  end
181
181
  end
182
182
 
@@ -211,18 +211,18 @@ module PulpcoreClient
211
211
  return true if self.equal?(o)
212
212
  self.class == o.class &&
213
213
  base_path == o.base_path &&
214
+ prn == o.prn &&
215
+ hidden == o.hidden &&
216
+ pulp_href == o.pulp_href &&
214
217
  base_url == o.base_url &&
215
- pulp_created == o.pulp_created &&
216
218
  content_guard == o.content_guard &&
217
219
  name == o.name &&
218
- no_content_change_since == o.no_content_change_since &&
219
220
  pulp_labels == o.pulp_labels &&
220
- prn == o.prn &&
221
+ pulp_created == o.pulp_created &&
221
222
  pulp_last_updated == o.pulp_last_updated &&
222
- pulp_href == o.pulp_href &&
223
- content_guard_prn == o.content_guard_prn &&
224
223
  repository_version == o.repository_version &&
225
- hidden == o.hidden
224
+ no_content_change_since == o.no_content_change_since &&
225
+ content_guard_prn == o.content_guard_prn
226
226
  end
227
227
 
228
228
  # @see the `==` method
@@ -234,7 +234,7 @@ module PulpcoreClient
234
234
  # Calculates hash code according to all attributes.
235
235
  # @return [Integer] Hash code
236
236
  def hash
237
- [base_path, base_url, pulp_created, content_guard, name, no_content_change_since, pulp_labels, prn, pulp_last_updated, pulp_href, content_guard_prn, repository_version, hidden].hash
237
+ [base_path, prn, hidden, pulp_href, base_url, content_guard, name, pulp_labels, pulp_created, pulp_last_updated, repository_version, no_content_change_since, content_guard_prn].hash
238
238
  end
239
239
 
240
240
  # Builds the object from hash
@@ -0,0 +1,340 @@
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
+ Generator version: 7.10.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module PulpcoreClient
17
+ # A serializer for EnvVarHeaderContentGuard. The guard expects the request header named ``header_name`` to carry a Base64-encoded UTF-8 representation of the secret. The plaintext secret is read from ``env_var`` on the server at request time and is never stored in or returned by the API.
18
+ class EnvVarHeaderContentGuard
19
+ # The unique name.
20
+ attr_accessor :name
21
+
22
+ # An optional description.
23
+ attr_accessor :description
24
+
25
+ # The header name the guard will check on.
26
+ attr_accessor :header_name
27
+
28
+ # Name of a content-app environment variable holding the expected secret (plaintext UTF-8). Must be listed in ENVVAR_HEADER_CONTENT_GUARD_ALLOWED_VARS. The request header must send that value Base64-encoded. The value is never stored in or returned by the API.
29
+ attr_accessor :env_var
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+ :'name' => :'name',
35
+ :'description' => :'description',
36
+ :'header_name' => :'header_name',
37
+ :'env_var' => :'env_var'
38
+ }
39
+ end
40
+
41
+ # Returns all the JSON keys this model knows about
42
+ def self.acceptable_attributes
43
+ attribute_map.values
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.openapi_types
48
+ {
49
+ :'name' => :'String',
50
+ :'description' => :'String',
51
+ :'header_name' => :'String',
52
+ :'env_var' => :'String'
53
+ }
54
+ end
55
+
56
+ # List of attributes with nullable: true
57
+ def self.openapi_nullable
58
+ Set.new([
59
+ :'description',
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 `PulpcoreClient::EnvVarHeaderContentGuard` 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 `PulpcoreClient::EnvVarHeaderContentGuard`. 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?(:'name')
79
+ self.name = attributes[:'name']
80
+ else
81
+ self.name = nil
82
+ end
83
+
84
+ if attributes.key?(:'description')
85
+ self.description = attributes[:'description']
86
+ end
87
+
88
+ if attributes.key?(:'header_name')
89
+ self.header_name = attributes[:'header_name']
90
+ else
91
+ self.header_name = nil
92
+ end
93
+
94
+ if attributes.key?(:'env_var')
95
+ self.env_var = attributes[:'env_var']
96
+ else
97
+ self.env_var = nil
98
+ end
99
+ end
100
+
101
+ # Show invalid properties with the reasons. Usually used together with valid?
102
+ # @return Array for valid properties with the reasons
103
+ def list_invalid_properties
104
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
105
+ invalid_properties = Array.new
106
+ if @name.nil?
107
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
108
+ end
109
+
110
+ if @name.to_s.length < 1
111
+ invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
112
+ end
113
+
114
+ if !@description.nil? && @description.to_s.length < 1
115
+ invalid_properties.push('invalid value for "description", the character length must be great than or equal to 1.')
116
+ end
117
+
118
+ if @header_name.nil?
119
+ invalid_properties.push('invalid value for "header_name", header_name cannot be nil.')
120
+ end
121
+
122
+ if @header_name.to_s.length < 1
123
+ invalid_properties.push('invalid value for "header_name", the character length must be great than or equal to 1.')
124
+ end
125
+
126
+ if @env_var.nil?
127
+ invalid_properties.push('invalid value for "env_var", env_var cannot be nil.')
128
+ end
129
+
130
+ if @env_var.to_s.length < 1
131
+ invalid_properties.push('invalid value for "env_var", the character length must be great than or equal to 1.')
132
+ end
133
+
134
+ invalid_properties
135
+ end
136
+
137
+ # Check to see if the all the properties in the model are valid
138
+ # @return true if the model is valid
139
+ def valid?
140
+ warn '[DEPRECATED] the `valid?` method is obsolete'
141
+ return false if @name.nil?
142
+ return false if @name.to_s.length < 1
143
+ return false if !@description.nil? && @description.to_s.length < 1
144
+ return false if @header_name.nil?
145
+ return false if @header_name.to_s.length < 1
146
+ return false if @env_var.nil?
147
+ return false if @env_var.to_s.length < 1
148
+ true
149
+ end
150
+
151
+ # Custom attribute writer method with validation
152
+ # @param [Object] name Value to be assigned
153
+ def name=(name)
154
+ if name.nil?
155
+ fail ArgumentError, 'name cannot be nil'
156
+ end
157
+
158
+ if name.to_s.length < 1
159
+ fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
160
+ end
161
+
162
+ @name = name
163
+ end
164
+
165
+ # Custom attribute writer method with validation
166
+ # @param [Object] description Value to be assigned
167
+ def description=(description)
168
+ if !description.nil? && description.to_s.length < 1
169
+ fail ArgumentError, 'invalid value for "description", the character length must be great than or equal to 1.'
170
+ end
171
+
172
+ @description = description
173
+ end
174
+
175
+ # Custom attribute writer method with validation
176
+ # @param [Object] header_name Value to be assigned
177
+ def header_name=(header_name)
178
+ if header_name.nil?
179
+ fail ArgumentError, 'header_name cannot be nil'
180
+ end
181
+
182
+ if header_name.to_s.length < 1
183
+ fail ArgumentError, 'invalid value for "header_name", the character length must be great than or equal to 1.'
184
+ end
185
+
186
+ @header_name = header_name
187
+ end
188
+
189
+ # Custom attribute writer method with validation
190
+ # @param [Object] env_var Value to be assigned
191
+ def env_var=(env_var)
192
+ if env_var.nil?
193
+ fail ArgumentError, 'env_var cannot be nil'
194
+ end
195
+
196
+ if env_var.to_s.length < 1
197
+ fail ArgumentError, 'invalid value for "env_var", the character length must be great than or equal to 1.'
198
+ end
199
+
200
+ @env_var = env_var
201
+ end
202
+
203
+ # Checks equality by comparing each attribute.
204
+ # @param [Object] Object to be compared
205
+ def ==(o)
206
+ return true if self.equal?(o)
207
+ self.class == o.class &&
208
+ name == o.name &&
209
+ description == o.description &&
210
+ header_name == o.header_name &&
211
+ env_var == o.env_var
212
+ end
213
+
214
+ # @see the `==` method
215
+ # @param [Object] Object to be compared
216
+ def eql?(o)
217
+ self == o
218
+ end
219
+
220
+ # Calculates hash code according to all attributes.
221
+ # @return [Integer] Hash code
222
+ def hash
223
+ [name, description, header_name, env_var].hash
224
+ end
225
+
226
+ # Builds the object from hash
227
+ # @param [Hash] attributes Model attributes in the form of hash
228
+ # @return [Object] Returns the model itself
229
+ def self.build_from_hash(attributes)
230
+ return nil unless attributes.is_a?(Hash)
231
+ attributes = attributes.transform_keys(&:to_sym)
232
+ transformed_hash = {}
233
+ openapi_types.each_pair do |key, type|
234
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
235
+ transformed_hash["#{key}"] = nil
236
+ elsif type =~ /\AArray<(.*)>/i
237
+ # check to ensure the input is an array given that the attribute
238
+ # is documented as an array but the input is not
239
+ if attributes[attribute_map[key]].is_a?(Array)
240
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
241
+ end
242
+ elsif !attributes[attribute_map[key]].nil?
243
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
244
+ end
245
+ end
246
+ new(transformed_hash)
247
+ end
248
+
249
+ # Deserializes the data based on type
250
+ # @param string type Data type
251
+ # @param string value Value to be deserialized
252
+ # @return [Object] Deserialized data
253
+ def self._deserialize(type, value)
254
+ case type.to_sym
255
+ when :Time
256
+ Time.parse(value)
257
+ when :Date
258
+ Date.parse(value)
259
+ when :String
260
+ value.to_s
261
+ when :Integer
262
+ value.to_i
263
+ when :Float
264
+ value.to_f
265
+ when :Boolean
266
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
267
+ true
268
+ else
269
+ false
270
+ end
271
+ when :Object
272
+ # generic object (usually a Hash), return directly
273
+ value
274
+ when /\AArray<(?<inner_type>.+)>\z/
275
+ inner_type = Regexp.last_match[:inner_type]
276
+ value.map { |v| _deserialize(inner_type, v) }
277
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
278
+ k_type = Regexp.last_match[:k_type]
279
+ v_type = Regexp.last_match[:v_type]
280
+ {}.tap do |hash|
281
+ value.each do |k, v|
282
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
283
+ end
284
+ end
285
+ else # model
286
+ # models (e.g. Pet) or oneOf
287
+ klass = PulpcoreClient.const_get(type)
288
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
289
+ end
290
+ end
291
+
292
+ # Returns the string representation of the object
293
+ # @return [String] String presentation of the object
294
+ def to_s
295
+ to_hash.to_s
296
+ end
297
+
298
+ # to_body is an alias to to_hash (backward compatibility)
299
+ # @return [Hash] Returns the object in the form of hash
300
+ def to_body
301
+ to_hash
302
+ end
303
+
304
+ # Returns the object in the form of hash
305
+ # @return [Hash] Returns the object in the form of hash
306
+ def to_hash
307
+ hash = {}
308
+ self.class.attribute_map.each_pair do |attr, param|
309
+ value = self.send(attr)
310
+ if value.nil?
311
+ is_nullable = self.class.openapi_nullable.include?(attr)
312
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
313
+ end
314
+
315
+ hash[param] = _to_hash(value)
316
+ end
317
+ hash
318
+ end
319
+
320
+ # Outputs non-array value in the form of hash
321
+ # For object, use to_hash. Otherwise, just return the value
322
+ # @param [Object] value Any valid value
323
+ # @return [Hash] Returns the value in the form of hash
324
+ def _to_hash(value)
325
+ if value.is_a?(Array)
326
+ value.compact.map { |v| _to_hash(v) }
327
+ elsif value.is_a?(Hash)
328
+ {}.tap do |hash|
329
+ value.each { |k, v| hash[k] = _to_hash(v) }
330
+ end
331
+ elsif value.respond_to? :to_hash
332
+ value.to_hash
333
+ else
334
+ value
335
+ end
336
+ end
337
+
338
+ end
339
+
340
+ end