pulpcore_client 3.118.1 → 3.119.1

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 +15 -15
  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 +67 -67
  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 +13 -13
  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 +22 -2
@@ -16,34 +16,25 @@ require 'time'
16
16
  module PulpcoreClient
17
17
  # A serializer for ArtifactDistribution.
18
18
  class ArtifactDistributionResponse
19
- # The Pulp Resource Name (PRN).
20
- attr_accessor :prn
21
-
22
- # A unique name. Ex, `rawhide` and `stable`.
23
- attr_accessor :name
24
-
25
19
  # RepositoryVersion to be served
26
20
  attr_accessor :repository_version
27
21
 
28
- # An optional content-guard.
29
- attr_accessor :content_guard
30
-
31
- # Timestamp since when the distributed content served by this distribution has not changed. If equals to `null`, no guarantee is provided about content changes.
32
- attr_accessor :no_content_change_since
22
+ # Whether this distribution should be shown in the content app.
23
+ attr_accessor :hidden
33
24
 
34
25
  attr_accessor :pulp_href
35
26
 
36
- # Timestamp of creation.
37
- attr_accessor :pulp_created
27
+ # Timestamp since when the distributed content served by this distribution has not changed. If equals to `null`, no guarantee is provided about content changes.
28
+ attr_accessor :no_content_change_since
38
29
 
39
30
  # The Pulp Resource Name (PRN) of the associated optional content guard.
40
31
  attr_accessor :content_guard_prn
41
32
 
42
- # Whether this distribution should be shown in the content app.
43
- attr_accessor :hidden
33
+ # A unique name. Ex, `rawhide` and `stable`.
34
+ attr_accessor :name
44
35
 
45
- # The base (relative) path component of the published url. Avoid paths that overlap with other distribution base paths (e.g. \"foo\" and \"foo/bar\")
46
- attr_accessor :base_path
36
+ # An optional content-guard.
37
+ attr_accessor :content_guard
47
38
 
48
39
  # The URL for accessing the publication as defined by this distribution.
49
40
  attr_accessor :base_url
@@ -53,22 +44,31 @@ module PulpcoreClient
53
44
 
54
45
  attr_accessor :pulp_labels
55
46
 
47
+ # The Pulp Resource Name (PRN).
48
+ attr_accessor :prn
49
+
50
+ # Timestamp of creation.
51
+ attr_accessor :pulp_created
52
+
53
+ # The base (relative) path component of the published url. Avoid paths that overlap with other distribution base paths (e.g. \"foo\" and \"foo/bar\")
54
+ attr_accessor :base_path
55
+
56
56
  # Attribute mapping from ruby-style variable name to JSON key.
57
57
  def self.attribute_map
58
58
  {
59
- :'prn' => :'prn',
60
- :'name' => :'name',
61
59
  :'repository_version' => :'repository_version',
62
- :'content_guard' => :'content_guard',
63
- :'no_content_change_since' => :'no_content_change_since',
60
+ :'hidden' => :'hidden',
64
61
  :'pulp_href' => :'pulp_href',
65
- :'pulp_created' => :'pulp_created',
62
+ :'no_content_change_since' => :'no_content_change_since',
66
63
  :'content_guard_prn' => :'content_guard_prn',
67
- :'hidden' => :'hidden',
68
- :'base_path' => :'base_path',
64
+ :'name' => :'name',
65
+ :'content_guard' => :'content_guard',
69
66
  :'base_url' => :'base_url',
70
67
  :'pulp_last_updated' => :'pulp_last_updated',
71
- :'pulp_labels' => :'pulp_labels'
68
+ :'pulp_labels' => :'pulp_labels',
69
+ :'prn' => :'prn',
70
+ :'pulp_created' => :'pulp_created',
71
+ :'base_path' => :'base_path'
72
72
  }
73
73
  end
74
74
 
@@ -80,19 +80,19 @@ module PulpcoreClient
80
80
  # Attribute type mapping.
81
81
  def self.openapi_types
82
82
  {
83
- :'prn' => :'String',
84
- :'name' => :'String',
85
83
  :'repository_version' => :'String',
86
- :'content_guard' => :'String',
87
- :'no_content_change_since' => :'String',
84
+ :'hidden' => :'Boolean',
88
85
  :'pulp_href' => :'String',
89
- :'pulp_created' => :'Time',
86
+ :'no_content_change_since' => :'String',
90
87
  :'content_guard_prn' => :'String',
91
- :'hidden' => :'Boolean',
92
- :'base_path' => :'String',
88
+ :'name' => :'String',
89
+ :'content_guard' => :'String',
93
90
  :'base_url' => :'String',
94
91
  :'pulp_last_updated' => :'Time',
95
- :'pulp_labels' => :'Hash<String, String>'
92
+ :'pulp_labels' => :'Hash<String, String>',
93
+ :'prn' => :'String',
94
+ :'pulp_created' => :'Time',
95
+ :'base_path' => :'String'
96
96
  }
97
97
  end
98
98
 
@@ -119,50 +119,36 @@ module PulpcoreClient
119
119
  h[k.to_sym] = v
120
120
  }
121
121
 
122
- if attributes.key?(:'prn')
123
- self.prn = attributes[:'prn']
124
- end
125
-
126
- if attributes.key?(:'name')
127
- self.name = attributes[:'name']
128
- else
129
- self.name = nil
130
- end
131
-
132
122
  if attributes.key?(:'repository_version')
133
123
  self.repository_version = attributes[:'repository_version']
134
124
  end
135
125
 
136
- if attributes.key?(:'content_guard')
137
- self.content_guard = attributes[:'content_guard']
138
- end
139
-
140
- if attributes.key?(:'no_content_change_since')
141
- self.no_content_change_since = attributes[:'no_content_change_since']
126
+ if attributes.key?(:'hidden')
127
+ self.hidden = attributes[:'hidden']
128
+ else
129
+ self.hidden = false
142
130
  end
143
131
 
144
132
  if attributes.key?(:'pulp_href')
145
133
  self.pulp_href = attributes[:'pulp_href']
146
134
  end
147
135
 
148
- if attributes.key?(:'pulp_created')
149
- self.pulp_created = attributes[:'pulp_created']
136
+ if attributes.key?(:'no_content_change_since')
137
+ self.no_content_change_since = attributes[:'no_content_change_since']
150
138
  end
151
139
 
152
140
  if attributes.key?(:'content_guard_prn')
153
141
  self.content_guard_prn = attributes[:'content_guard_prn']
154
142
  end
155
143
 
156
- if attributes.key?(:'hidden')
157
- self.hidden = attributes[:'hidden']
144
+ if attributes.key?(:'name')
145
+ self.name = attributes[:'name']
158
146
  else
159
- self.hidden = false
147
+ self.name = nil
160
148
  end
161
149
 
162
- if attributes.key?(:'base_path')
163
- self.base_path = attributes[:'base_path']
164
- else
165
- self.base_path = nil
150
+ if attributes.key?(:'content_guard')
151
+ self.content_guard = attributes[:'content_guard']
166
152
  end
167
153
 
168
154
  if attributes.key?(:'base_url')
@@ -178,6 +164,20 @@ module PulpcoreClient
178
164
  self.pulp_labels = value
179
165
  end
180
166
  end
167
+
168
+ if attributes.key?(:'prn')
169
+ self.prn = attributes[:'prn']
170
+ end
171
+
172
+ if attributes.key?(:'pulp_created')
173
+ self.pulp_created = attributes[:'pulp_created']
174
+ end
175
+
176
+ if attributes.key?(:'base_path')
177
+ self.base_path = attributes[:'base_path']
178
+ else
179
+ self.base_path = nil
180
+ end
181
181
  end
182
182
 
183
183
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -210,19 +210,19 @@ module PulpcoreClient
210
210
  def ==(o)
211
211
  return true if self.equal?(o)
212
212
  self.class == o.class &&
213
- prn == o.prn &&
214
- name == o.name &&
215
213
  repository_version == o.repository_version &&
216
- content_guard == o.content_guard &&
217
- no_content_change_since == o.no_content_change_since &&
214
+ hidden == o.hidden &&
218
215
  pulp_href == o.pulp_href &&
219
- pulp_created == o.pulp_created &&
216
+ no_content_change_since == o.no_content_change_since &&
220
217
  content_guard_prn == o.content_guard_prn &&
221
- hidden == o.hidden &&
222
- base_path == o.base_path &&
218
+ name == o.name &&
219
+ content_guard == o.content_guard &&
223
220
  base_url == o.base_url &&
224
221
  pulp_last_updated == o.pulp_last_updated &&
225
- pulp_labels == o.pulp_labels
222
+ pulp_labels == o.pulp_labels &&
223
+ prn == o.prn &&
224
+ pulp_created == o.pulp_created &&
225
+ base_path == o.base_path
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
- [prn, name, repository_version, content_guard, no_content_change_since, pulp_href, pulp_created, content_guard_prn, hidden, base_path, base_url, pulp_last_updated, pulp_labels].hash
237
+ [repository_version, hidden, pulp_href, no_content_change_since, content_guard_prn, name, content_guard, base_url, pulp_last_updated, pulp_labels, prn, pulp_created, base_path].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