pulpcore_client 3.21.35 → 3.22.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 (115) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +12 -6
  3. data/docs/AccessPoliciesApi.md +3 -3
  4. data/docs/ArtifactDistributionResponse.md +29 -0
  5. data/docs/ArtifactsApi.md +1 -1
  6. data/docs/ContentApi.md +1 -1
  7. data/docs/ContentSettingsResponse.md +19 -0
  8. data/docs/ContentguardsApi.md +3 -3
  9. data/docs/ContentguardsContentRedirectApi.md +3 -3
  10. data/docs/ContentguardsRbacApi.md +3 -3
  11. data/docs/DistributionResponse.md +1 -1
  12. data/docs/DistributionsApi.md +6 -6
  13. data/docs/DistributionsArtifactsApi.md +154 -0
  14. data/docs/ExportersFilesystemApi.md +3 -3
  15. data/docs/ExportersFilesystemExportsApi.md +1 -1
  16. data/docs/ExportersPulpApi.md +3 -3
  17. data/docs/ExportersPulpExportsApi.md +1 -1
  18. data/docs/FilesystemExport.md +1 -3
  19. data/docs/GroupsApi.md +1 -1
  20. data/docs/GroupsRolesApi.md +1 -1
  21. data/docs/GroupsUsersApi.md +1 -1
  22. data/docs/ImportersPulpApi.md +3 -3
  23. data/docs/ImportersPulpImportCheckApi.md +1 -1
  24. data/docs/ImportersPulpImportsApi.md +1 -1
  25. data/docs/OrphansApi.md +1 -1
  26. data/docs/OrphansCleanupApi.md +1 -1
  27. data/docs/PaginatedArtifactDistributionResponseList.md +23 -0
  28. data/docs/PublicationsApi.md +3 -3
  29. data/docs/RemoteResponse.md +4 -2
  30. data/docs/RemoteResponseHiddenFields.md +19 -0
  31. data/docs/RemotesApi.md +5 -5
  32. data/docs/RepairApi.md +1 -1
  33. data/docs/RepositoriesApi.md +4 -4
  34. data/docs/RepositoriesReclaimSpaceApi.md +1 -1
  35. data/docs/RepositoryResponse.md +1 -1
  36. data/docs/RepositoryVersionsApi.md +5 -5
  37. data/docs/RolesApi.md +1 -1
  38. data/docs/SigningServicesApi.md +5 -3
  39. data/docs/StatusApi.md +1 -1
  40. data/docs/StatusResponse.md +3 -1
  41. data/docs/TaskGroupsApi.md +1 -3
  42. data/docs/TaskSchedulesApi.md +5 -5
  43. data/docs/TasksApi.md +33 -19
  44. data/docs/UploadsApi.md +11 -1
  45. data/docs/UserResponse.md +3 -1
  46. data/docs/UsersApi.md +1 -1
  47. data/docs/UsersRolesApi.md +1 -1
  48. data/docs/WorkersApi.md +5 -5
  49. data/lib/pulpcore_client/api/access_policies_api.rb +3 -3
  50. data/lib/pulpcore_client/api/artifacts_api.rb +1 -1
  51. data/lib/pulpcore_client/api/contentguards_api.rb +3 -3
  52. data/lib/pulpcore_client/api/contentguards_content_redirect_api.rb +3 -3
  53. data/lib/pulpcore_client/api/contentguards_rbac_api.rb +3 -3
  54. data/lib/pulpcore_client/api/distributions_api.rb +7 -7
  55. data/lib/pulpcore_client/api/distributions_artifacts_api.rb +198 -0
  56. data/lib/pulpcore_client/api/exporters_filesystem_api.rb +3 -3
  57. data/lib/pulpcore_client/api/exporters_pulp_api.rb +3 -3
  58. data/lib/pulpcore_client/api/groups_api.rb +1 -1
  59. data/lib/pulpcore_client/api/importers_pulp_api.rb +3 -3
  60. data/lib/pulpcore_client/api/publications_api.rb +3 -3
  61. data/lib/pulpcore_client/api/remotes_api.rb +5 -5
  62. data/lib/pulpcore_client/api/repositories_api.rb +3 -3
  63. data/lib/pulpcore_client/api/repository_versions_api.rb +5 -5
  64. data/lib/pulpcore_client/api/roles_api.rb +1 -1
  65. data/lib/pulpcore_client/api/signing_services_api.rb +9 -2
  66. data/lib/pulpcore_client/api/task_groups_api.rb +0 -7
  67. data/lib/pulpcore_client/api/task_schedules_api.rb +5 -5
  68. data/lib/pulpcore_client/api/tasks_api.rb +40 -19
  69. data/lib/pulpcore_client/api/uploads_api.rb +19 -0
  70. data/lib/pulpcore_client/api/users_api.rb +1 -1
  71. data/lib/pulpcore_client/api/workers_api.rb +5 -5
  72. data/lib/pulpcore_client/configuration.rb +3 -3
  73. data/lib/pulpcore_client/models/artifact_distribution_response.rb +279 -0
  74. data/lib/pulpcore_client/models/content_settings_response.rb +228 -0
  75. data/lib/pulpcore_client/models/distribution_response.rb +4 -2
  76. data/lib/pulpcore_client/models/filesystem_export.rb +4 -14
  77. data/lib/pulpcore_client/models/group_role.rb +19 -0
  78. data/lib/pulpcore_client/models/paginated_artifact_distribution_response_list.rb +237 -0
  79. data/lib/pulpcore_client/models/remote_response.rb +41 -27
  80. data/lib/pulpcore_client/models/remote_response_hidden_fields.rb +215 -0
  81. data/lib/pulpcore_client/models/repository_response.rb +4 -2
  82. data/lib/pulpcore_client/models/status_response.rb +19 -4
  83. data/lib/pulpcore_client/models/user_response.rb +16 -4
  84. data/lib/pulpcore_client/models/user_role.rb +19 -0
  85. data/lib/pulpcore_client/version.rb +1 -1
  86. data/lib/pulpcore_client.rb +5 -0
  87. data/spec/api/access_policies_api_spec.rb +1 -1
  88. data/spec/api/contentguards_api_spec.rb +1 -1
  89. data/spec/api/contentguards_content_redirect_api_spec.rb +1 -1
  90. data/spec/api/contentguards_rbac_api_spec.rb +1 -1
  91. data/spec/api/distributions_api_spec.rb +3 -3
  92. data/spec/api/distributions_artifacts_api_spec.rb +76 -0
  93. data/spec/api/exporters_filesystem_api_spec.rb +1 -1
  94. data/spec/api/exporters_pulp_api_spec.rb +1 -1
  95. data/spec/api/importers_pulp_api_spec.rb +1 -1
  96. data/spec/api/publications_api_spec.rb +1 -1
  97. data/spec/api/remotes_api_spec.rb +2 -2
  98. data/spec/api/repositories_api_spec.rb +1 -1
  99. data/spec/api/repository_versions_api_spec.rb +2 -2
  100. data/spec/api/signing_services_api_spec.rb +2 -1
  101. data/spec/api/task_groups_api_spec.rb +0 -1
  102. data/spec/api/task_schedules_api_spec.rb +2 -2
  103. data/spec/api/tasks_api_spec.rb +16 -9
  104. data/spec/api/uploads_api_spec.rb +5 -0
  105. data/spec/api/workers_api_spec.rb +2 -2
  106. data/spec/configuration_spec.rb +3 -3
  107. data/spec/models/artifact_distribution_response_spec.rb +77 -0
  108. data/spec/models/content_settings_response_spec.rb +47 -0
  109. data/spec/models/filesystem_export_spec.rb +0 -6
  110. data/spec/models/paginated_artifact_distribution_response_list_spec.rb +59 -0
  111. data/spec/models/remote_response_hidden_fields_spec.rb +47 -0
  112. data/spec/models/remote_response_spec.rb +6 -0
  113. data/spec/models/status_response_spec.rb +6 -0
  114. data/spec/models/user_response_spec.rb +6 -0
  115. metadata +159 -139
@@ -0,0 +1,279 @@
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
+ # A serializer for ArtifactDistribution.
17
+ class ArtifactDistributionResponse
18
+ # An optional content-guard.
19
+ attr_accessor :content_guard
20
+
21
+ attr_accessor :pulp_labels
22
+
23
+ # Timestamp of creation.
24
+ attr_accessor :pulp_created
25
+
26
+ # The base (relative) path component of the published url. Avoid paths that overlap with other distribution base paths (e.g. \"foo\" and \"foo/bar\")
27
+ attr_accessor :base_path
28
+
29
+ # The URL for accessing the publication as defined by this distribution.
30
+ attr_accessor :base_url
31
+
32
+ attr_accessor :pulp_href
33
+
34
+ # A unique name. Ex, `rawhide` and `stable`.
35
+ attr_accessor :name
36
+
37
+ # Attribute mapping from ruby-style variable name to JSON key.
38
+ def self.attribute_map
39
+ {
40
+ :'content_guard' => :'content_guard',
41
+ :'pulp_labels' => :'pulp_labels',
42
+ :'pulp_created' => :'pulp_created',
43
+ :'base_path' => :'base_path',
44
+ :'base_url' => :'base_url',
45
+ :'pulp_href' => :'pulp_href',
46
+ :'name' => :'name'
47
+ }
48
+ end
49
+
50
+ # Attribute type mapping.
51
+ def self.openapi_types
52
+ {
53
+ :'content_guard' => :'String',
54
+ :'pulp_labels' => :'Hash<String, String>',
55
+ :'pulp_created' => :'DateTime',
56
+ :'base_path' => :'String',
57
+ :'base_url' => :'String',
58
+ :'pulp_href' => :'String',
59
+ :'name' => :'String'
60
+ }
61
+ end
62
+
63
+ # List of attributes with nullable: true
64
+ def self.openapi_nullable
65
+ Set.new([
66
+ :'content_guard',
67
+ ])
68
+ end
69
+
70
+ # Initializes the object
71
+ # @param [Hash] attributes Model attributes in the form of hash
72
+ def initialize(attributes = {})
73
+ if (!attributes.is_a?(Hash))
74
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpcoreClient::ArtifactDistributionResponse` initialize method"
75
+ end
76
+
77
+ # check to see if the attribute exists and convert string to symbol for hash key
78
+ attributes = attributes.each_with_object({}) { |(k, v), h|
79
+ if (!self.class.attribute_map.key?(k.to_sym))
80
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpcoreClient::ArtifactDistributionResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
81
+ end
82
+ h[k.to_sym] = v
83
+ }
84
+
85
+ if attributes.key?(:'content_guard')
86
+ self.content_guard = attributes[:'content_guard']
87
+ end
88
+
89
+ if attributes.key?(:'pulp_labels')
90
+ if (value = attributes[:'pulp_labels']).is_a?(Hash)
91
+ self.pulp_labels = value
92
+ end
93
+ end
94
+
95
+ if attributes.key?(:'pulp_created')
96
+ self.pulp_created = attributes[:'pulp_created']
97
+ end
98
+
99
+ if attributes.key?(:'base_path')
100
+ self.base_path = attributes[:'base_path']
101
+ end
102
+
103
+ if attributes.key?(:'base_url')
104
+ self.base_url = attributes[:'base_url']
105
+ end
106
+
107
+ if attributes.key?(:'pulp_href')
108
+ self.pulp_href = attributes[:'pulp_href']
109
+ end
110
+
111
+ if attributes.key?(:'name')
112
+ self.name = attributes[:'name']
113
+ end
114
+ end
115
+
116
+ # Show invalid properties with the reasons. Usually used together with valid?
117
+ # @return Array for valid properties with the reasons
118
+ def list_invalid_properties
119
+ invalid_properties = Array.new
120
+ if @base_path.nil?
121
+ invalid_properties.push('invalid value for "base_path", base_path cannot be nil.')
122
+ end
123
+
124
+ if @name.nil?
125
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
126
+ end
127
+
128
+ invalid_properties
129
+ end
130
+
131
+ # Check to see if the all the properties in the model are valid
132
+ # @return true if the model is valid
133
+ def valid?
134
+ return false if @base_path.nil?
135
+ return false if @name.nil?
136
+ true
137
+ end
138
+
139
+ # Checks equality by comparing each attribute.
140
+ # @param [Object] Object to be compared
141
+ def ==(o)
142
+ return true if self.equal?(o)
143
+ self.class == o.class &&
144
+ content_guard == o.content_guard &&
145
+ pulp_labels == o.pulp_labels &&
146
+ pulp_created == o.pulp_created &&
147
+ base_path == o.base_path &&
148
+ base_url == o.base_url &&
149
+ pulp_href == o.pulp_href &&
150
+ name == o.name
151
+ end
152
+
153
+ # @see the `==` method
154
+ # @param [Object] Object to be compared
155
+ def eql?(o)
156
+ self == o
157
+ end
158
+
159
+ # Calculates hash code according to all attributes.
160
+ # @return [Integer] Hash code
161
+ def hash
162
+ [content_guard, pulp_labels, pulp_created, base_path, base_url, pulp_href, name].hash
163
+ end
164
+
165
+ # Builds the object from hash
166
+ # @param [Hash] attributes Model attributes in the form of hash
167
+ # @return [Object] Returns the model itself
168
+ def self.build_from_hash(attributes)
169
+ new.build_from_hash(attributes)
170
+ end
171
+
172
+ # Builds the object from hash
173
+ # @param [Hash] attributes Model attributes in the form of hash
174
+ # @return [Object] Returns the model itself
175
+ def build_from_hash(attributes)
176
+ return nil unless attributes.is_a?(Hash)
177
+ self.class.openapi_types.each_pair do |key, type|
178
+ if type =~ /\AArray<(.*)>/i
179
+ # check to ensure the input is an array given that the attribute
180
+ # is documented as an array but the input is not
181
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
182
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
183
+ end
184
+ elsif !attributes[self.class.attribute_map[key]].nil?
185
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
186
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
187
+ end
188
+
189
+ self
190
+ end
191
+
192
+ # Deserializes the data based on type
193
+ # @param string type Data type
194
+ # @param string value Value to be deserialized
195
+ # @return [Object] Deserialized data
196
+ def _deserialize(type, value)
197
+ case type.to_sym
198
+ when :DateTime
199
+ DateTime.parse(value)
200
+ when :Date
201
+ Date.parse(value)
202
+ when :String
203
+ value.to_s
204
+ when :Integer
205
+ value.to_i
206
+ when :Float
207
+ value.to_f
208
+ when :Boolean
209
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
210
+ true
211
+ else
212
+ false
213
+ end
214
+ when :Object
215
+ # generic object (usually a Hash), return directly
216
+ value
217
+ when /\AArray<(?<inner_type>.+)>\z/
218
+ inner_type = Regexp.last_match[:inner_type]
219
+ value.map { |v| _deserialize(inner_type, v) }
220
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
221
+ k_type = Regexp.last_match[:k_type]
222
+ v_type = Regexp.last_match[:v_type]
223
+ {}.tap do |hash|
224
+ value.each do |k, v|
225
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
226
+ end
227
+ end
228
+ else # model
229
+ PulpcoreClient.const_get(type).build_from_hash(value)
230
+ end
231
+ end
232
+
233
+ # Returns the string representation of the object
234
+ # @return [String] String presentation of the object
235
+ def to_s
236
+ to_hash.to_s
237
+ end
238
+
239
+ # to_body is an alias to to_hash (backward compatibility)
240
+ # @return [Hash] Returns the object in the form of hash
241
+ def to_body
242
+ to_hash
243
+ end
244
+
245
+ # Returns the object in the form of hash
246
+ # @return [Hash] Returns the object in the form of hash
247
+ def to_hash
248
+ hash = {}
249
+ self.class.attribute_map.each_pair do |attr, param|
250
+ value = self.send(attr)
251
+ if value.nil?
252
+ is_nullable = self.class.openapi_nullable.include?(attr)
253
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
254
+ end
255
+
256
+ hash[param] = _to_hash(value)
257
+ end
258
+ hash
259
+ end
260
+
261
+ # Outputs non-array value in the form of hash
262
+ # For object, use to_hash. Otherwise, just return the value
263
+ # @param [Object] value Any valid value
264
+ # @return [Hash] Returns the value in the form of hash
265
+ def _to_hash(value)
266
+ if value.is_a?(Array)
267
+ value.compact.map { |v| _to_hash(v) }
268
+ elsif value.is_a?(Hash)
269
+ {}.tap do |hash|
270
+ value.each { |k, v| hash[k] = _to_hash(v) }
271
+ end
272
+ elsif value.respond_to? :to_hash
273
+ value.to_hash
274
+ else
275
+ value
276
+ end
277
+ end
278
+ end
279
+ end
@@ -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)