pulpcore_client 3.21.25 → 3.22.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (96) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +11 -5
  3. data/docs/AccessPoliciesApi.md +2 -2
  4. data/docs/ArtifactDistributionResponse.md +29 -0
  5. data/docs/ContentSettingsResponse.md +19 -0
  6. data/docs/ContentguardsApi.md +2 -2
  7. data/docs/ContentguardsContentRedirectApi.md +2 -2
  8. data/docs/ContentguardsRbacApi.md +2 -2
  9. data/docs/DistributionResponse.md +1 -1
  10. data/docs/DistributionsApi.md +5 -5
  11. data/docs/DistributionsArtifactsApi.md +154 -0
  12. data/docs/ExportersFilesystemApi.md +2 -2
  13. data/docs/ExportersPulpApi.md +2 -2
  14. data/docs/FilesystemExport.md +1 -3
  15. data/docs/ImportersPulpApi.md +2 -2
  16. data/docs/PaginatedArtifactDistributionResponseList.md +23 -0
  17. data/docs/PublicationsApi.md +2 -2
  18. data/docs/RemoteResponse.md +4 -2
  19. data/docs/RemoteResponseHiddenFields.md +19 -0
  20. data/docs/RemotesApi.md +4 -4
  21. data/docs/RepositoriesApi.md +3 -3
  22. data/docs/RepositoryResponse.md +1 -1
  23. data/docs/RepositoryVersionsApi.md +4 -4
  24. data/docs/SigningServicesApi.md +4 -2
  25. data/docs/StatusResponse.md +3 -1
  26. data/docs/TaskGroupsApi.md +0 -2
  27. data/docs/TaskSchedulesApi.md +4 -4
  28. data/docs/TasksApi.md +32 -18
  29. data/docs/UploadsApi.md +10 -0
  30. data/docs/UserResponse.md +3 -1
  31. data/docs/WorkersApi.md +4 -4
  32. data/lib/pulpcore_client/api/access_policies_api.rb +3 -3
  33. data/lib/pulpcore_client/api/artifacts_api.rb +1 -1
  34. data/lib/pulpcore_client/api/contentguards_api.rb +3 -3
  35. data/lib/pulpcore_client/api/contentguards_content_redirect_api.rb +3 -3
  36. data/lib/pulpcore_client/api/contentguards_rbac_api.rb +3 -3
  37. data/lib/pulpcore_client/api/distributions_api.rb +7 -7
  38. data/lib/pulpcore_client/api/distributions_artifacts_api.rb +198 -0
  39. data/lib/pulpcore_client/api/exporters_filesystem_api.rb +3 -3
  40. data/lib/pulpcore_client/api/exporters_pulp_api.rb +3 -3
  41. data/lib/pulpcore_client/api/groups_api.rb +1 -1
  42. data/lib/pulpcore_client/api/importers_pulp_api.rb +3 -3
  43. data/lib/pulpcore_client/api/publications_api.rb +3 -3
  44. data/lib/pulpcore_client/api/remotes_api.rb +5 -5
  45. data/lib/pulpcore_client/api/repositories_api.rb +3 -3
  46. data/lib/pulpcore_client/api/repository_versions_api.rb +5 -5
  47. data/lib/pulpcore_client/api/roles_api.rb +1 -1
  48. data/lib/pulpcore_client/api/signing_services_api.rb +9 -2
  49. data/lib/pulpcore_client/api/task_groups_api.rb +0 -7
  50. data/lib/pulpcore_client/api/task_schedules_api.rb +5 -5
  51. data/lib/pulpcore_client/api/tasks_api.rb +40 -19
  52. data/lib/pulpcore_client/api/uploads_api.rb +19 -0
  53. data/lib/pulpcore_client/api/users_api.rb +1 -1
  54. data/lib/pulpcore_client/api/workers_api.rb +5 -5
  55. data/lib/pulpcore_client/models/artifact_distribution_response.rb +279 -0
  56. data/lib/pulpcore_client/models/content_settings_response.rb +228 -0
  57. data/lib/pulpcore_client/models/distribution_response.rb +4 -2
  58. data/lib/pulpcore_client/models/filesystem_export.rb +4 -14
  59. data/lib/pulpcore_client/models/group_role.rb +19 -0
  60. data/lib/pulpcore_client/models/paginated_artifact_distribution_response_list.rb +237 -0
  61. data/lib/pulpcore_client/models/remote_response.rb +21 -7
  62. data/lib/pulpcore_client/models/remote_response_hidden_fields.rb +215 -0
  63. data/lib/pulpcore_client/models/repository_response.rb +4 -2
  64. data/lib/pulpcore_client/models/status_response.rb +19 -4
  65. data/lib/pulpcore_client/models/user_response.rb +16 -4
  66. data/lib/pulpcore_client/models/user_role.rb +19 -0
  67. data/lib/pulpcore_client/version.rb +1 -1
  68. data/lib/pulpcore_client.rb +5 -0
  69. data/spec/api/access_policies_api_spec.rb +1 -1
  70. data/spec/api/contentguards_api_spec.rb +1 -1
  71. data/spec/api/contentguards_content_redirect_api_spec.rb +1 -1
  72. data/spec/api/contentguards_rbac_api_spec.rb +1 -1
  73. data/spec/api/distributions_api_spec.rb +3 -3
  74. data/spec/api/distributions_artifacts_api_spec.rb +76 -0
  75. data/spec/api/exporters_filesystem_api_spec.rb +1 -1
  76. data/spec/api/exporters_pulp_api_spec.rb +1 -1
  77. data/spec/api/importers_pulp_api_spec.rb +1 -1
  78. data/spec/api/publications_api_spec.rb +1 -1
  79. data/spec/api/remotes_api_spec.rb +2 -2
  80. data/spec/api/repositories_api_spec.rb +1 -1
  81. data/spec/api/repository_versions_api_spec.rb +2 -2
  82. data/spec/api/signing_services_api_spec.rb +2 -1
  83. data/spec/api/task_groups_api_spec.rb +0 -1
  84. data/spec/api/task_schedules_api_spec.rb +2 -2
  85. data/spec/api/tasks_api_spec.rb +16 -9
  86. data/spec/api/uploads_api_spec.rb +5 -0
  87. data/spec/api/workers_api_spec.rb +2 -2
  88. data/spec/models/artifact_distribution_response_spec.rb +77 -0
  89. data/spec/models/content_settings_response_spec.rb +47 -0
  90. data/spec/models/filesystem_export_spec.rb +0 -6
  91. data/spec/models/paginated_artifact_distribution_response_list_spec.rb +59 -0
  92. data/spec/models/remote_response_hidden_fields_spec.rb +47 -0
  93. data/spec/models/remote_response_spec.rb +6 -0
  94. data/spec/models/status_response_spec.rb +6 -0
  95. data/spec/models/user_response_spec.rb +6 -0
  96. metadata +146 -126
@@ -0,0 +1,228 @@
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 information about content-app-settings for the pulp instance
17
+ class ContentSettingsResponse
18
+ # The CONTENT_ORIGIN setting for this Pulp instance
19
+ attr_accessor :content_origin
20
+
21
+ # The CONTENT_PATH_PREFIX setting for this Pulp instance
22
+ attr_accessor :content_path_prefix
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'content_origin' => :'content_origin',
28
+ :'content_path_prefix' => :'content_path_prefix'
29
+ }
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.openapi_types
34
+ {
35
+ :'content_origin' => :'String',
36
+ :'content_path_prefix' => :'String'
37
+ }
38
+ end
39
+
40
+ # List of attributes with nullable: true
41
+ def self.openapi_nullable
42
+ Set.new([
43
+ ])
44
+ end
45
+
46
+ # Initializes the object
47
+ # @param [Hash] attributes Model attributes in the form of hash
48
+ def initialize(attributes = {})
49
+ if (!attributes.is_a?(Hash))
50
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpcoreClient::ContentSettingsResponse` initialize method"
51
+ end
52
+
53
+ # check to see if the attribute exists and convert string to symbol for hash key
54
+ attributes = attributes.each_with_object({}) { |(k, v), h|
55
+ if (!self.class.attribute_map.key?(k.to_sym))
56
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpcoreClient::ContentSettingsResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
57
+ end
58
+ h[k.to_sym] = v
59
+ }
60
+
61
+ if attributes.key?(:'content_origin')
62
+ self.content_origin = attributes[:'content_origin']
63
+ end
64
+
65
+ if attributes.key?(:'content_path_prefix')
66
+ self.content_path_prefix = attributes[:'content_path_prefix']
67
+ end
68
+ end
69
+
70
+ # Show invalid properties with the reasons. Usually used together with valid?
71
+ # @return Array for valid properties with the reasons
72
+ def list_invalid_properties
73
+ invalid_properties = Array.new
74
+ if @content_origin.nil?
75
+ invalid_properties.push('invalid value for "content_origin", content_origin cannot be nil.')
76
+ end
77
+
78
+ if @content_path_prefix.nil?
79
+ invalid_properties.push('invalid value for "content_path_prefix", content_path_prefix cannot be nil.')
80
+ end
81
+
82
+ invalid_properties
83
+ end
84
+
85
+ # Check to see if the all the properties in the model are valid
86
+ # @return true if the model is valid
87
+ def valid?
88
+ return false if @content_origin.nil?
89
+ return false if @content_path_prefix.nil?
90
+ true
91
+ end
92
+
93
+ # Checks equality by comparing each attribute.
94
+ # @param [Object] Object to be compared
95
+ def ==(o)
96
+ return true if self.equal?(o)
97
+ self.class == o.class &&
98
+ content_origin == o.content_origin &&
99
+ content_path_prefix == o.content_path_prefix
100
+ end
101
+
102
+ # @see the `==` method
103
+ # @param [Object] Object to be compared
104
+ def eql?(o)
105
+ self == o
106
+ end
107
+
108
+ # Calculates hash code according to all attributes.
109
+ # @return [Integer] Hash code
110
+ def hash
111
+ [content_origin, content_path_prefix].hash
112
+ end
113
+
114
+ # Builds the object from hash
115
+ # @param [Hash] attributes Model attributes in the form of hash
116
+ # @return [Object] Returns the model itself
117
+ def self.build_from_hash(attributes)
118
+ new.build_from_hash(attributes)
119
+ end
120
+
121
+ # Builds the object from hash
122
+ # @param [Hash] attributes Model attributes in the form of hash
123
+ # @return [Object] Returns the model itself
124
+ def build_from_hash(attributes)
125
+ return nil unless attributes.is_a?(Hash)
126
+ self.class.openapi_types.each_pair do |key, type|
127
+ if type =~ /\AArray<(.*)>/i
128
+ # check to ensure the input is an array given that the attribute
129
+ # is documented as an array but the input is not
130
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
131
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
132
+ end
133
+ elsif !attributes[self.class.attribute_map[key]].nil?
134
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
135
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
136
+ end
137
+
138
+ self
139
+ end
140
+
141
+ # Deserializes the data based on type
142
+ # @param string type Data type
143
+ # @param string value Value to be deserialized
144
+ # @return [Object] Deserialized data
145
+ def _deserialize(type, value)
146
+ case type.to_sym
147
+ when :DateTime
148
+ DateTime.parse(value)
149
+ when :Date
150
+ Date.parse(value)
151
+ when :String
152
+ value.to_s
153
+ when :Integer
154
+ value.to_i
155
+ when :Float
156
+ value.to_f
157
+ when :Boolean
158
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
159
+ true
160
+ else
161
+ false
162
+ end
163
+ when :Object
164
+ # generic object (usually a Hash), return directly
165
+ value
166
+ when /\AArray<(?<inner_type>.+)>\z/
167
+ inner_type = Regexp.last_match[:inner_type]
168
+ value.map { |v| _deserialize(inner_type, v) }
169
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
170
+ k_type = Regexp.last_match[:k_type]
171
+ v_type = Regexp.last_match[:v_type]
172
+ {}.tap do |hash|
173
+ value.each do |k, v|
174
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
175
+ end
176
+ end
177
+ else # model
178
+ PulpcoreClient.const_get(type).build_from_hash(value)
179
+ end
180
+ end
181
+
182
+ # Returns the string representation of the object
183
+ # @return [String] String presentation of the object
184
+ def to_s
185
+ to_hash.to_s
186
+ end
187
+
188
+ # to_body is an alias to to_hash (backward compatibility)
189
+ # @return [Hash] Returns the object in the form of hash
190
+ def to_body
191
+ to_hash
192
+ end
193
+
194
+ # Returns the object in the form of hash
195
+ # @return [Hash] Returns the object in the form of hash
196
+ def to_hash
197
+ hash = {}
198
+ self.class.attribute_map.each_pair do |attr, param|
199
+ value = self.send(attr)
200
+ if value.nil?
201
+ is_nullable = self.class.openapi_nullable.include?(attr)
202
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
203
+ end
204
+
205
+ hash[param] = _to_hash(value)
206
+ end
207
+ hash
208
+ end
209
+
210
+ # Outputs non-array value in the form of hash
211
+ # For object, use to_hash. Otherwise, just return the value
212
+ # @param [Object] value Any valid value
213
+ # @return [Hash] Returns the value in the form of hash
214
+ def _to_hash(value)
215
+ if value.is_a?(Array)
216
+ value.compact.map { |v| _to_hash(v) }
217
+ elsif value.is_a?(Hash)
218
+ {}.tap do |hash|
219
+ value.each { |k, v| hash[k] = _to_hash(v) }
220
+ end
221
+ elsif value.respond_to? :to_hash
222
+ value.to_hash
223
+ else
224
+ value
225
+ end
226
+ end
227
+ end
228
+ end
@@ -59,7 +59,7 @@ module PulpcoreClient
59
59
  :'base_path' => :'String',
60
60
  :'base_url' => :'String',
61
61
  :'content_guard' => :'String',
62
- :'pulp_labels' => :'Object',
62
+ :'pulp_labels' => :'Hash<String, String>',
63
63
  :'name' => :'String',
64
64
  :'repository' => :'String'
65
65
  }
@@ -109,7 +109,9 @@ module PulpcoreClient
109
109
  end
110
110
 
111
111
  if attributes.key?(:'pulp_labels')
112
- self.pulp_labels = attributes[:'pulp_labels']
112
+ if (value = attributes[:'pulp_labels']).is_a?(Hash)
113
+ self.pulp_labels = value
114
+ end
113
115
  end
114
116
 
115
117
  if attributes.key?(:'name')
@@ -24,16 +24,12 @@ module PulpcoreClient
24
24
  # A URI of the repository version export.
25
25
  attr_accessor :repository_version
26
26
 
27
- # The URI of the last-exported-repo-version.
28
- attr_accessor :start_repository_version
29
-
30
27
  # Attribute mapping from ruby-style variable name to JSON key.
31
28
  def self.attribute_map
32
29
  {
33
30
  :'task' => :'task',
34
31
  :'publication' => :'publication',
35
- :'repository_version' => :'repository_version',
36
- :'start_repository_version' => :'start_repository_version'
32
+ :'repository_version' => :'repository_version'
37
33
  }
38
34
  end
39
35
 
@@ -42,8 +38,7 @@ module PulpcoreClient
42
38
  {
43
39
  :'task' => :'String',
44
40
  :'publication' => :'String',
45
- :'repository_version' => :'String',
46
- :'start_repository_version' => :'String'
41
+ :'repository_version' => :'String'
47
42
  }
48
43
  end
49
44
 
@@ -80,10 +75,6 @@ module PulpcoreClient
80
75
  if attributes.key?(:'repository_version')
81
76
  self.repository_version = attributes[:'repository_version']
82
77
  end
83
-
84
- if attributes.key?(:'start_repository_version')
85
- self.start_repository_version = attributes[:'start_repository_version']
86
- end
87
78
  end
88
79
 
89
80
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -106,8 +97,7 @@ module PulpcoreClient
106
97
  self.class == o.class &&
107
98
  task == o.task &&
108
99
  publication == o.publication &&
109
- repository_version == o.repository_version &&
110
- start_repository_version == o.start_repository_version
100
+ repository_version == o.repository_version
111
101
  end
112
102
 
113
103
  # @see the `==` method
@@ -119,7 +109,7 @@ module PulpcoreClient
119
109
  # Calculates hash code according to all attributes.
120
110
  # @return [Integer] Hash code
121
111
  def hash
122
- [task, publication, repository_version, start_repository_version].hash
112
+ [task, publication, repository_version].hash
123
113
  end
124
114
 
125
115
  # Builds the object from hash
@@ -75,6 +75,10 @@ module PulpcoreClient
75
75
  invalid_properties.push('invalid value for "role", role cannot be nil.')
76
76
  end
77
77
 
78
+ if @role.to_s.length < 1
79
+ invalid_properties.push('invalid value for "role", the character length must be great than or equal to 1.')
80
+ end
81
+
78
82
  if @content_object.to_s.length < 1
79
83
  invalid_properties.push('invalid value for "content_object", the character length must be great than or equal to 1.')
80
84
  end
@@ -86,10 +90,25 @@ module PulpcoreClient
86
90
  # @return true if the model is valid
87
91
  def valid?
88
92
  return false if @role.nil?
93
+ return false if @role.to_s.length < 1
89
94
  return false if @content_object.to_s.length < 1
90
95
  true
91
96
  end
92
97
 
98
+ # Custom attribute writer method with validation
99
+ # @param [Object] role Value to be assigned
100
+ def role=(role)
101
+ if role.nil?
102
+ fail ArgumentError, 'role cannot be nil'
103
+ end
104
+
105
+ if role.to_s.length < 1
106
+ fail ArgumentError, 'invalid value for "role", the character length must be great than or equal to 1.'
107
+ end
108
+
109
+ @role = role
110
+ end
111
+
93
112
  # Custom attribute writer method with validation
94
113
  # @param [Object] content_object Value to be assigned
95
114
  def content_object=(content_object)
@@ -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 PulpcoreClient
16
+ class PaginatedArtifactDistributionResponseList
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<ArtifactDistributionResponse>'
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 `PulpcoreClient::PaginatedArtifactDistributionResponseList` 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 `PulpcoreClient::PaginatedArtifactDistributionResponseList`. 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
+ PulpcoreClient.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
@@ -70,6 +70,9 @@ module PulpcoreClient
70
70
  # Limits requests per second for each concurrent downloader
71
71
  attr_accessor :rate_limit
72
72
 
73
+ # List of hidden (write only) fields
74
+ attr_accessor :hidden_fields
75
+
73
76
  # Attribute mapping from ruby-style variable name to JSON key.
74
77
  def self.attribute_map
75
78
  {
@@ -91,7 +94,8 @@ module PulpcoreClient
91
94
  :'sock_connect_timeout' => :'sock_connect_timeout',
92
95
  :'sock_read_timeout' => :'sock_read_timeout',
93
96
  :'headers' => :'headers',
94
- :'rate_limit' => :'rate_limit'
97
+ :'rate_limit' => :'rate_limit',
98
+ :'hidden_fields' => :'hidden_fields'
95
99
  }
96
100
  end
97
101
 
@@ -106,7 +110,7 @@ module PulpcoreClient
106
110
  :'client_cert' => :'String',
107
111
  :'tls_validation' => :'Boolean',
108
112
  :'proxy_url' => :'String',
109
- :'pulp_labels' => :'Object',
113
+ :'pulp_labels' => :'Hash<String, String>',
110
114
  :'pulp_last_updated' => :'DateTime',
111
115
  :'download_concurrency' => :'Integer',
112
116
  :'max_retries' => :'Integer',
@@ -116,7 +120,8 @@ module PulpcoreClient
116
120
  :'sock_connect_timeout' => :'Float',
117
121
  :'sock_read_timeout' => :'Float',
118
122
  :'headers' => :'Array<Object>',
119
- :'rate_limit' => :'Integer'
123
+ :'rate_limit' => :'Integer',
124
+ :'hidden_fields' => :'Array<RemoteResponseHiddenFields>'
120
125
  }
121
126
  end
122
127
 
@@ -132,7 +137,7 @@ module PulpcoreClient
132
137
  :'connect_timeout',
133
138
  :'sock_connect_timeout',
134
139
  :'sock_read_timeout',
135
- :'rate_limit'
140
+ :'rate_limit',
136
141
  ])
137
142
  end
138
143
 
@@ -184,7 +189,9 @@ module PulpcoreClient
184
189
  end
185
190
 
186
191
  if attributes.key?(:'pulp_labels')
187
- self.pulp_labels = attributes[:'pulp_labels']
192
+ if (value = attributes[:'pulp_labels']).is_a?(Hash)
193
+ self.pulp_labels = value
194
+ end
188
195
  end
189
196
 
190
197
  if attributes.key?(:'pulp_last_updated')
@@ -228,6 +235,12 @@ module PulpcoreClient
228
235
  if attributes.key?(:'rate_limit')
229
236
  self.rate_limit = attributes[:'rate_limit']
230
237
  end
238
+
239
+ if attributes.key?(:'hidden_fields')
240
+ if (value = attributes[:'hidden_fields']).is_a?(Array)
241
+ self.hidden_fields = value
242
+ end
243
+ end
231
244
  end
232
245
 
233
246
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -351,7 +364,8 @@ module PulpcoreClient
351
364
  sock_connect_timeout == o.sock_connect_timeout &&
352
365
  sock_read_timeout == o.sock_read_timeout &&
353
366
  headers == o.headers &&
354
- rate_limit == o.rate_limit
367
+ rate_limit == o.rate_limit &&
368
+ hidden_fields == o.hidden_fields
355
369
  end
356
370
 
357
371
  # @see the `==` method
@@ -363,7 +377,7 @@ module PulpcoreClient
363
377
  # Calculates hash code according to all attributes.
364
378
  # @return [Integer] Hash code
365
379
  def hash
366
- [pulp_href, pulp_created, name, url, ca_cert, client_cert, tls_validation, proxy_url, pulp_labels, pulp_last_updated, download_concurrency, max_retries, policy, total_timeout, connect_timeout, sock_connect_timeout, sock_read_timeout, headers, rate_limit].hash
380
+ [pulp_href, pulp_created, name, url, ca_cert, client_cert, tls_validation, proxy_url, pulp_labels, pulp_last_updated, download_concurrency, max_retries, policy, total_timeout, connect_timeout, sock_connect_timeout, sock_read_timeout, headers, rate_limit, hidden_fields].hash
367
381
  end
368
382
 
369
383
  # Builds the object from hash