pulp_file_client 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (136) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +51 -37
  3. data/docs/ContentFilesApi.md +24 -24
  4. data/docs/ContentSummary.md +3 -3
  5. data/docs/ContentSummaryResponse.md +21 -0
  6. data/docs/DistributionsFileApi.md +108 -60
  7. data/docs/{Export.md → ExportResponse.md} +2 -2
  8. data/docs/ExportersFileExportsApi.md +34 -34
  9. data/docs/ExportersFilesystemApi.md +61 -61
  10. data/docs/FileFileContent.md +5 -17
  11. data/docs/FileFileContentResponse.md +35 -0
  12. data/docs/FileFileDistribution.md +1 -7
  13. data/docs/FileFileDistributionResponse.md +29 -0
  14. data/docs/FileFileFilesystemExporter.md +1 -5
  15. data/docs/FileFileFilesystemExporterResponse.md +23 -0
  16. data/docs/FileFilePublication.md +1 -7
  17. data/docs/FileFilePublicationResponse.md +27 -0
  18. data/docs/FileFileRemote.md +4 -10
  19. data/docs/FileFileRemoteResponse.md +43 -0
  20. data/docs/FileFileRepository.md +4 -10
  21. data/docs/FileFileRepositoryResponse.md +29 -0
  22. data/docs/InlineResponse200.md +3 -3
  23. data/docs/InlineResponse2001.md +3 -3
  24. data/docs/InlineResponse2002.md +3 -3
  25. data/docs/InlineResponse2003.md +3 -3
  26. data/docs/InlineResponse2004.md +3 -3
  27. data/docs/InlineResponse2005.md +3 -3
  28. data/docs/InlineResponse2006.md +3 -3
  29. data/docs/InlineResponse2007.md +3 -3
  30. data/docs/PatchedfileFileDistribution.md +23 -0
  31. data/docs/PatchedfileFileFilesystemExporter.md +19 -0
  32. data/docs/PatchedfileFileRemote.md +37 -0
  33. data/docs/PatchedfileFileRepository.md +21 -0
  34. data/docs/PolicyEnum.md +16 -0
  35. data/docs/PublicationsFileApi.md +40 -40
  36. data/docs/RemotesFileApi.md +125 -65
  37. data/docs/RepositoriesFileApi.md +97 -73
  38. data/docs/RepositoriesFileVersionsApi.md +94 -62
  39. data/docs/RepositoryAddRemoveContent.md +2 -2
  40. data/docs/RepositorySyncURL.md +1 -1
  41. data/docs/RepositoryVersion.md +1 -9
  42. data/docs/RepositoryVersionResponse.md +25 -0
  43. data/lib/pulp_file_client/api/content_files_api.rb +32 -36
  44. data/lib/pulp_file_client/api/distributions_file_api.rb +153 -90
  45. data/lib/pulp_file_client/api/exporters_file_exports_api.rb +55 -55
  46. data/lib/pulp_file_client/api/exporters_filesystem_api.rb +102 -102
  47. data/lib/pulp_file_client/api/publications_file_api.rb +59 -59
  48. data/lib/pulp_file_client/api/remotes_file_api.rb +181 -100
  49. data/lib/pulp_file_client/api/repositories_file_api.rb +145 -118
  50. data/lib/pulp_file_client/api/repositories_file_versions_api.rb +137 -92
  51. data/lib/pulp_file_client/api_client.rb +2 -2
  52. data/lib/pulp_file_client/api_error.rb +2 -2
  53. data/lib/pulp_file_client/configuration.rb +3 -3
  54. data/lib/pulp_file_client/models/async_operation_response.rb +3 -2
  55. data/lib/pulp_file_client/models/content_summary.rb +9 -15
  56. data/lib/pulp_file_client/models/content_summary_response.rb +240 -0
  57. data/lib/pulp_file_client/models/{export.rb → export_response.rb} +6 -5
  58. data/lib/pulp_file_client/models/file_file_content.rb +18 -185
  59. data/lib/pulp_file_client/models/file_file_content_response.rb +302 -0
  60. data/lib/pulp_file_client/models/file_file_distribution.rb +4 -85
  61. data/lib/pulp_file_client/models/file_file_distribution_response.rb +279 -0
  62. data/lib/pulp_file_client/models/file_file_filesystem_exporter.rb +4 -60
  63. data/lib/pulp_file_client/models/file_file_filesystem_exporter_response.rb +247 -0
  64. data/lib/pulp_file_client/models/file_file_publication.rb +4 -49
  65. data/lib/pulp_file_client/models/file_file_publication_response.rb +260 -0
  66. data/lib/pulp_file_client/models/file_file_remote.rb +7 -199
  67. data/lib/pulp_file_client/models/file_file_remote_response.rb +368 -0
  68. data/lib/pulp_file_client/models/file_file_repository.rb +18 -78
  69. data/lib/pulp_file_client/models/file_file_repository_response.rb +271 -0
  70. data/lib/pulp_file_client/models/inline_response200.rb +3 -13
  71. data/lib/pulp_file_client/models/inline_response2001.rb +3 -13
  72. data/lib/pulp_file_client/models/inline_response2002.rb +3 -13
  73. data/lib/pulp_file_client/models/inline_response2003.rb +3 -13
  74. data/lib/pulp_file_client/models/inline_response2004.rb +3 -13
  75. data/lib/pulp_file_client/models/inline_response2005.rb +3 -13
  76. data/lib/pulp_file_client/models/inline_response2006.rb +3 -13
  77. data/lib/pulp_file_client/models/inline_response2007.rb +3 -13
  78. data/lib/pulp_file_client/models/patchedfile_file_distribution.rb +240 -0
  79. data/lib/pulp_file_client/models/patchedfile_file_filesystem_exporter.rb +218 -0
  80. data/lib/pulp_file_client/models/patchedfile_file_remote.rb +329 -0
  81. data/lib/pulp_file_client/models/patchedfile_file_repository.rb +229 -0
  82. data/lib/pulp_file_client/models/policy_enum.rb +37 -0
  83. data/lib/pulp_file_client/models/publication_export.rb +3 -2
  84. data/lib/pulp_file_client/models/repository_add_remove_content.rb +5 -4
  85. data/lib/pulp_file_client/models/repository_sync_url.rb +3 -8
  86. data/lib/pulp_file_client/models/repository_version.rb +7 -43
  87. data/lib/pulp_file_client/models/repository_version_response.rb +246 -0
  88. data/lib/pulp_file_client/version.rb +3 -3
  89. data/lib/pulp_file_client.rb +16 -3
  90. data/pulp_file_client.gemspec +4 -4
  91. data/spec/api/content_files_api_spec.rb +10 -10
  92. data/spec/api/distributions_file_api_spec.rb +39 -18
  93. data/spec/api/exporters_file_exports_api_spec.rb +9 -9
  94. data/spec/api/exporters_filesystem_api_spec.rb +23 -23
  95. data/spec/api/publications_file_api_spec.rb +14 -14
  96. data/spec/api/remotes_file_api_spec.rb +48 -21
  97. data/spec/api/repositories_file_api_spec.rb +28 -19
  98. data/spec/api/repositories_file_versions_api_spec.rb +38 -23
  99. data/spec/api_client_spec.rb +2 -2
  100. data/spec/configuration_spec.rb +2 -2
  101. data/spec/models/async_operation_response_spec.rb +2 -2
  102. data/spec/models/content_summary_response_spec.rb +53 -0
  103. data/spec/models/content_summary_spec.rb +2 -2
  104. data/spec/models/{export_spec.rb → export_response_spec.rb} +8 -8
  105. data/spec/models/file_file_content_response_spec.rb +95 -0
  106. data/spec/models/file_file_content_spec.rb +4 -40
  107. data/spec/models/file_file_distribution_response_spec.rb +77 -0
  108. data/spec/models/file_file_distribution_spec.rb +2 -20
  109. data/spec/models/file_file_filesystem_exporter_response_spec.rb +59 -0
  110. data/spec/models/file_file_filesystem_exporter_spec.rb +2 -14
  111. data/spec/models/file_file_publication_response_spec.rb +71 -0
  112. data/spec/models/file_file_publication_spec.rb +2 -20
  113. data/spec/models/file_file_remote_response_spec.rb +119 -0
  114. data/spec/models/file_file_remote_spec.rb +2 -24
  115. data/spec/models/file_file_repository_response_spec.rb +77 -0
  116. data/spec/models/file_file_repository_spec.rb +5 -23
  117. data/spec/models/inline_response2001_spec.rb +2 -2
  118. data/spec/models/inline_response2002_spec.rb +2 -2
  119. data/spec/models/inline_response2003_spec.rb +2 -2
  120. data/spec/models/inline_response2004_spec.rb +2 -2
  121. data/spec/models/inline_response2005_spec.rb +2 -2
  122. data/spec/models/inline_response2006_spec.rb +2 -2
  123. data/spec/models/inline_response2007_spec.rb +2 -2
  124. data/spec/models/inline_response200_spec.rb +2 -2
  125. data/spec/models/patchedfile_file_distribution_spec.rb +59 -0
  126. data/spec/models/patchedfile_file_filesystem_exporter_spec.rb +47 -0
  127. data/spec/models/patchedfile_file_remote_spec.rb +101 -0
  128. data/spec/models/patchedfile_file_repository_spec.rb +53 -0
  129. data/spec/models/policy_enum_spec.rb +35 -0
  130. data/spec/models/publication_export_spec.rb +2 -2
  131. data/spec/models/repository_add_remove_content_spec.rb +2 -2
  132. data/spec/models/repository_sync_url_spec.rb +2 -2
  133. data/spec/models/repository_version_response_spec.rb +65 -0
  134. data/spec/models/repository_version_spec.rb +2 -26
  135. data/spec/spec_helper.rb +2 -2
  136. metadata +76 -24
@@ -0,0 +1,240 @@
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.2.3
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module PulpFileClient
16
+ # Serializer for the RepositoryVersion content summary
17
+ class ContentSummaryResponse
18
+ attr_accessor :added
19
+
20
+ attr_accessor :removed
21
+
22
+ attr_accessor :present
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'added' => :'added',
28
+ :'removed' => :'removed',
29
+ :'present' => :'present'
30
+ }
31
+ end
32
+
33
+ # Attribute type mapping.
34
+ def self.openapi_types
35
+ {
36
+ :'added' => :'Object',
37
+ :'removed' => :'Object',
38
+ :'present' => :'Object'
39
+ }
40
+ end
41
+
42
+ # List of attributes with nullable: true
43
+ def self.openapi_nullable
44
+ Set.new([
45
+ ])
46
+ end
47
+
48
+ # Initializes the object
49
+ # @param [Hash] attributes Model attributes in the form of hash
50
+ def initialize(attributes = {})
51
+ if (!attributes.is_a?(Hash))
52
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpFileClient::ContentSummaryResponse` initialize method"
53
+ end
54
+
55
+ # check to see if the attribute exists and convert string to symbol for hash key
56
+ attributes = attributes.each_with_object({}) { |(k, v), h|
57
+ if (!self.class.attribute_map.key?(k.to_sym))
58
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpFileClient::ContentSummaryResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
59
+ end
60
+ h[k.to_sym] = v
61
+ }
62
+
63
+ if attributes.key?(:'added')
64
+ self.added = attributes[:'added']
65
+ end
66
+
67
+ if attributes.key?(:'removed')
68
+ self.removed = attributes[:'removed']
69
+ end
70
+
71
+ if attributes.key?(:'present')
72
+ self.present = attributes[:'present']
73
+ end
74
+ end
75
+
76
+ # Show invalid properties with the reasons. Usually used together with valid?
77
+ # @return Array for valid properties with the reasons
78
+ def list_invalid_properties
79
+ invalid_properties = Array.new
80
+ if @added.nil?
81
+ invalid_properties.push('invalid value for "added", added cannot be nil.')
82
+ end
83
+
84
+ if @removed.nil?
85
+ invalid_properties.push('invalid value for "removed", removed cannot be nil.')
86
+ end
87
+
88
+ if @present.nil?
89
+ invalid_properties.push('invalid value for "present", present cannot be nil.')
90
+ end
91
+
92
+ invalid_properties
93
+ end
94
+
95
+ # Check to see if the all the properties in the model are valid
96
+ # @return true if the model is valid
97
+ def valid?
98
+ return false if @added.nil?
99
+ return false if @removed.nil?
100
+ return false if @present.nil?
101
+ true
102
+ end
103
+
104
+ # Checks equality by comparing each attribute.
105
+ # @param [Object] Object to be compared
106
+ def ==(o)
107
+ return true if self.equal?(o)
108
+ self.class == o.class &&
109
+ added == o.added &&
110
+ removed == o.removed &&
111
+ present == o.present
112
+ end
113
+
114
+ # @see the `==` method
115
+ # @param [Object] Object to be compared
116
+ def eql?(o)
117
+ self == o
118
+ end
119
+
120
+ # Calculates hash code according to all attributes.
121
+ # @return [Integer] Hash code
122
+ def hash
123
+ [added, removed, present].hash
124
+ end
125
+
126
+ # Builds the object from hash
127
+ # @param [Hash] attributes Model attributes in the form of hash
128
+ # @return [Object] Returns the model itself
129
+ def self.build_from_hash(attributes)
130
+ new.build_from_hash(attributes)
131
+ end
132
+
133
+ # Builds the object from hash
134
+ # @param [Hash] attributes Model attributes in the form of hash
135
+ # @return [Object] Returns the model itself
136
+ def build_from_hash(attributes)
137
+ return nil unless attributes.is_a?(Hash)
138
+ self.class.openapi_types.each_pair do |key, type|
139
+ if type =~ /\AArray<(.*)>/i
140
+ # check to ensure the input is an array given that the attribute
141
+ # is documented as an array but the input is not
142
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
143
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
144
+ end
145
+ elsif !attributes[self.class.attribute_map[key]].nil?
146
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
147
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
148
+ end
149
+
150
+ self
151
+ end
152
+
153
+ # Deserializes the data based on type
154
+ # @param string type Data type
155
+ # @param string value Value to be deserialized
156
+ # @return [Object] Deserialized data
157
+ def _deserialize(type, value)
158
+ case type.to_sym
159
+ when :DateTime
160
+ DateTime.parse(value)
161
+ when :Date
162
+ Date.parse(value)
163
+ when :String
164
+ value.to_s
165
+ when :Integer
166
+ value.to_i
167
+ when :Float
168
+ value.to_f
169
+ when :Boolean
170
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
171
+ true
172
+ else
173
+ false
174
+ end
175
+ when :Object
176
+ # generic object (usually a Hash), return directly
177
+ value
178
+ when /\AArray<(?<inner_type>.+)>\z/
179
+ inner_type = Regexp.last_match[:inner_type]
180
+ value.map { |v| _deserialize(inner_type, v) }
181
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
182
+ k_type = Regexp.last_match[:k_type]
183
+ v_type = Regexp.last_match[:v_type]
184
+ {}.tap do |hash|
185
+ value.each do |k, v|
186
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
187
+ end
188
+ end
189
+ else # model
190
+ PulpFileClient.const_get(type).build_from_hash(value)
191
+ end
192
+ end
193
+
194
+ # Returns the string representation of the object
195
+ # @return [String] String presentation of the object
196
+ def to_s
197
+ to_hash.to_s
198
+ end
199
+
200
+ # to_body is an alias to to_hash (backward compatibility)
201
+ # @return [Hash] Returns the object in the form of hash
202
+ def to_body
203
+ to_hash
204
+ end
205
+
206
+ # Returns the object in the form of hash
207
+ # @return [Hash] Returns the object in the form of hash
208
+ def to_hash
209
+ hash = {}
210
+ self.class.attribute_map.each_pair do |attr, param|
211
+ value = self.send(attr)
212
+ if value.nil?
213
+ is_nullable = self.class.openapi_nullable.include?(attr)
214
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
215
+ end
216
+
217
+ hash[param] = _to_hash(value)
218
+ end
219
+ hash
220
+ end
221
+
222
+ # Outputs non-array value in the form of hash
223
+ # For object, use to_hash. Otherwise, just return the value
224
+ # @param [Object] value Any valid value
225
+ # @return [Hash] Returns the value in the form of hash
226
+ def _to_hash(value)
227
+ if value.is_a?(Array)
228
+ value.compact.map { |v| _to_hash(v) }
229
+ elsif value.is_a?(Hash)
230
+ {}.tap do |hash|
231
+ value.each { |k, v| hash[k] = _to_hash(v) }
232
+ end
233
+ elsif value.respond_to? :to_hash
234
+ value.to_hash
235
+ else
236
+ value
237
+ end
238
+ end
239
+ end
240
+ end
@@ -1,10 +1,10 @@
1
1
  =begin
2
2
  #Pulp 3 API
3
3
 
4
- #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
+ #Fetch, Upload, Organize, and Distribute Software Packages
5
5
 
6
6
  The version of the OpenAPI document: v3
7
-
7
+ Contact: pulp-list@redhat.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 4.2.3
10
10
 
@@ -13,7 +13,8 @@ OpenAPI Generator version: 4.2.3
13
13
  require 'date'
14
14
 
15
15
  module PulpFileClient
16
- class Export
16
+ # Base serializer for Exports.
17
+ class ExportResponse
17
18
  attr_accessor :pulp_href
18
19
 
19
20
  # Timestamp of creation.
@@ -61,13 +62,13 @@ module PulpFileClient
61
62
  # @param [Hash] attributes Model attributes in the form of hash
62
63
  def initialize(attributes = {})
63
64
  if (!attributes.is_a?(Hash))
64
- fail ArgumentError, "The input argument (attributes) must be a hash in `PulpFileClient::Export` initialize method"
65
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpFileClient::ExportResponse` initialize method"
65
66
  end
66
67
 
67
68
  # check to see if the attribute exists and convert string to symbol for hash key
68
69
  attributes = attributes.each_with_object({}) { |(k, v), h|
69
70
  if (!self.class.attribute_map.key?(k.to_sym))
70
- fail ArgumentError, "`#{k}` is not a valid attribute in `PulpFileClient::Export`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
71
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpFileClient::ExportResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
71
72
  end
72
73
  h[k.to_sym] = v
73
74
  }
@@ -1,10 +1,10 @@
1
1
  =begin
2
2
  #Pulp 3 API
3
3
 
4
- #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
+ #Fetch, Upload, Organize, and Distribute Software Packages
5
5
 
6
6
  The version of the OpenAPI document: v3
7
-
7
+ Contact: pulp-list@redhat.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 4.2.3
10
10
 
@@ -13,65 +13,37 @@ OpenAPI Generator version: 4.2.3
13
13
  require 'date'
14
14
 
15
15
  module PulpFileClient
16
+ # Serializer for File Content.
16
17
  class FileFileContent
17
- attr_accessor :pulp_href
18
-
19
- # Timestamp of creation.
20
- attr_accessor :pulp_created
21
-
22
18
  # Artifact file representing the physical content
23
19
  attr_accessor :artifact
24
20
 
25
21
  # Path where the artifact is located relative to distributions base_path
26
22
  attr_accessor :relative_path
27
23
 
28
- # The MD5 checksum if available.
29
- attr_accessor :md5
30
-
31
- # The SHA-1 checksum if available.
32
- attr_accessor :sha1
24
+ # An uploaded file that may be turned into the artifact of the content unit.
25
+ attr_accessor :file
33
26
 
34
- # The SHA-224 checksum if available.
35
- attr_accessor :sha224
36
-
37
- # The SHA-256 checksum if available.
38
- attr_accessor :sha256
39
-
40
- # The SHA-384 checksum if available.
41
- attr_accessor :sha384
42
-
43
- # The SHA-512 checksum if available.
44
- attr_accessor :sha512
27
+ # A URI of a repository the new content unit should be associated with.
28
+ attr_accessor :repository
45
29
 
46
30
  # Attribute mapping from ruby-style variable name to JSON key.
47
31
  def self.attribute_map
48
32
  {
49
- :'pulp_href' => :'pulp_href',
50
- :'pulp_created' => :'pulp_created',
51
33
  :'artifact' => :'artifact',
52
34
  :'relative_path' => :'relative_path',
53
- :'md5' => :'md5',
54
- :'sha1' => :'sha1',
55
- :'sha224' => :'sha224',
56
- :'sha256' => :'sha256',
57
- :'sha384' => :'sha384',
58
- :'sha512' => :'sha512'
35
+ :'file' => :'file',
36
+ :'repository' => :'repository'
59
37
  }
60
38
  end
61
39
 
62
40
  # Attribute type mapping.
63
41
  def self.openapi_types
64
42
  {
65
- :'pulp_href' => :'String',
66
- :'pulp_created' => :'DateTime',
67
43
  :'artifact' => :'String',
68
44
  :'relative_path' => :'String',
69
- :'md5' => :'String',
70
- :'sha1' => :'String',
71
- :'sha224' => :'String',
72
- :'sha256' => :'String',
73
- :'sha384' => :'String',
74
- :'sha512' => :'String'
45
+ :'file' => :'File',
46
+ :'repository' => :'String'
75
47
  }
76
48
  end
77
49
 
@@ -96,14 +68,6 @@ module PulpFileClient
96
68
  h[k.to_sym] = v
97
69
  }
98
70
 
99
- if attributes.key?(:'pulp_href')
100
- self.pulp_href = attributes[:'pulp_href']
101
- end
102
-
103
- if attributes.key?(:'pulp_created')
104
- self.pulp_created = attributes[:'pulp_created']
105
- end
106
-
107
71
  if attributes.key?(:'artifact')
108
72
  self.artifact = attributes[:'artifact']
109
73
  end
@@ -112,28 +76,12 @@ module PulpFileClient
112
76
  self.relative_path = attributes[:'relative_path']
113
77
  end
114
78
 
115
- if attributes.key?(:'md5')
116
- self.md5 = attributes[:'md5']
117
- end
118
-
119
- if attributes.key?(:'sha1')
120
- self.sha1 = attributes[:'sha1']
121
- end
122
-
123
- if attributes.key?(:'sha224')
124
- self.sha224 = attributes[:'sha224']
125
- end
126
-
127
- if attributes.key?(:'sha256')
128
- self.sha256 = attributes[:'sha256']
129
- end
130
-
131
- if attributes.key?(:'sha384')
132
- self.sha384 = attributes[:'sha384']
79
+ if attributes.key?(:'file')
80
+ self.file = attributes[:'file']
133
81
  end
134
82
 
135
- if attributes.key?(:'sha512')
136
- self.sha512 = attributes[:'sha512']
83
+ if attributes.key?(:'repository')
84
+ self.repository = attributes[:'repository']
137
85
  end
138
86
  end
139
87
 
@@ -145,34 +93,6 @@ module PulpFileClient
145
93
  invalid_properties.push('invalid value for "relative_path", relative_path cannot be nil.')
146
94
  end
147
95
 
148
- if @relative_path.to_s.length < 1
149
- invalid_properties.push('invalid value for "relative_path", the character length must be great than or equal to 1.')
150
- end
151
-
152
- if !@md5.nil? && @md5.to_s.length < 1
153
- invalid_properties.push('invalid value for "md5", the character length must be great than or equal to 1.')
154
- end
155
-
156
- if !@sha1.nil? && @sha1.to_s.length < 1
157
- invalid_properties.push('invalid value for "sha1", the character length must be great than or equal to 1.')
158
- end
159
-
160
- if !@sha224.nil? && @sha224.to_s.length < 1
161
- invalid_properties.push('invalid value for "sha224", the character length must be great than or equal to 1.')
162
- end
163
-
164
- if !@sha256.nil? && @sha256.to_s.length < 1
165
- invalid_properties.push('invalid value for "sha256", the character length must be great than or equal to 1.')
166
- end
167
-
168
- if !@sha384.nil? && @sha384.to_s.length < 1
169
- invalid_properties.push('invalid value for "sha384", the character length must be great than or equal to 1.')
170
- end
171
-
172
- if !@sha512.nil? && @sha512.to_s.length < 1
173
- invalid_properties.push('invalid value for "sha512", the character length must be great than or equal to 1.')
174
- end
175
-
176
96
  invalid_properties
177
97
  end
178
98
 
@@ -180,105 +100,18 @@ module PulpFileClient
180
100
  # @return true if the model is valid
181
101
  def valid?
182
102
  return false if @relative_path.nil?
183
- return false if @relative_path.to_s.length < 1
184
- return false if !@md5.nil? && @md5.to_s.length < 1
185
- return false if !@sha1.nil? && @sha1.to_s.length < 1
186
- return false if !@sha224.nil? && @sha224.to_s.length < 1
187
- return false if !@sha256.nil? && @sha256.to_s.length < 1
188
- return false if !@sha384.nil? && @sha384.to_s.length < 1
189
- return false if !@sha512.nil? && @sha512.to_s.length < 1
190
103
  true
191
104
  end
192
105
 
193
- # Custom attribute writer method with validation
194
- # @param [Object] relative_path Value to be assigned
195
- def relative_path=(relative_path)
196
- if relative_path.nil?
197
- fail ArgumentError, 'relative_path cannot be nil'
198
- end
199
-
200
- if relative_path.to_s.length < 1
201
- fail ArgumentError, 'invalid value for "relative_path", the character length must be great than or equal to 1.'
202
- end
203
-
204
- @relative_path = relative_path
205
- end
206
-
207
- # Custom attribute writer method with validation
208
- # @param [Object] md5 Value to be assigned
209
- def md5=(md5)
210
- if !md5.nil? && md5.to_s.length < 1
211
- fail ArgumentError, 'invalid value for "md5", the character length must be great than or equal to 1.'
212
- end
213
-
214
- @md5 = md5
215
- end
216
-
217
- # Custom attribute writer method with validation
218
- # @param [Object] sha1 Value to be assigned
219
- def sha1=(sha1)
220
- if !sha1.nil? && sha1.to_s.length < 1
221
- fail ArgumentError, 'invalid value for "sha1", the character length must be great than or equal to 1.'
222
- end
223
-
224
- @sha1 = sha1
225
- end
226
-
227
- # Custom attribute writer method with validation
228
- # @param [Object] sha224 Value to be assigned
229
- def sha224=(sha224)
230
- if !sha224.nil? && sha224.to_s.length < 1
231
- fail ArgumentError, 'invalid value for "sha224", the character length must be great than or equal to 1.'
232
- end
233
-
234
- @sha224 = sha224
235
- end
236
-
237
- # Custom attribute writer method with validation
238
- # @param [Object] sha256 Value to be assigned
239
- def sha256=(sha256)
240
- if !sha256.nil? && sha256.to_s.length < 1
241
- fail ArgumentError, 'invalid value for "sha256", the character length must be great than or equal to 1.'
242
- end
243
-
244
- @sha256 = sha256
245
- end
246
-
247
- # Custom attribute writer method with validation
248
- # @param [Object] sha384 Value to be assigned
249
- def sha384=(sha384)
250
- if !sha384.nil? && sha384.to_s.length < 1
251
- fail ArgumentError, 'invalid value for "sha384", the character length must be great than or equal to 1.'
252
- end
253
-
254
- @sha384 = sha384
255
- end
256
-
257
- # Custom attribute writer method with validation
258
- # @param [Object] sha512 Value to be assigned
259
- def sha512=(sha512)
260
- if !sha512.nil? && sha512.to_s.length < 1
261
- fail ArgumentError, 'invalid value for "sha512", the character length must be great than or equal to 1.'
262
- end
263
-
264
- @sha512 = sha512
265
- end
266
-
267
106
  # Checks equality by comparing each attribute.
268
107
  # @param [Object] Object to be compared
269
108
  def ==(o)
270
109
  return true if self.equal?(o)
271
110
  self.class == o.class &&
272
- pulp_href == o.pulp_href &&
273
- pulp_created == o.pulp_created &&
274
111
  artifact == o.artifact &&
275
112
  relative_path == o.relative_path &&
276
- md5 == o.md5 &&
277
- sha1 == o.sha1 &&
278
- sha224 == o.sha224 &&
279
- sha256 == o.sha256 &&
280
- sha384 == o.sha384 &&
281
- sha512 == o.sha512
113
+ file == o.file &&
114
+ repository == o.repository
282
115
  end
283
116
 
284
117
  # @see the `==` method
@@ -290,7 +123,7 @@ module PulpFileClient
290
123
  # Calculates hash code according to all attributes.
291
124
  # @return [Integer] Hash code
292
125
  def hash
293
- [pulp_href, pulp_created, artifact, relative_path, md5, sha1, sha224, sha256, sha384, sha512].hash
126
+ [artifact, relative_path, file, repository].hash
294
127
  end
295
128
 
296
129
  # Builds the object from hash