pulp_maven_client 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +43 -31
  3. data/docs/ContentArtifactApi.md +37 -35
  4. data/docs/ContentSummary.md +3 -3
  5. data/docs/ContentSummaryResponse.md +21 -0
  6. data/docs/DistributionsMavenApi.md +63 -61
  7. data/docs/MavenMavenArtifact.md +3 -13
  8. data/docs/MavenMavenArtifactResponse.md +29 -0
  9. data/docs/MavenMavenDistribution.md +1 -7
  10. data/docs/MavenMavenDistributionResponse.md +29 -0
  11. data/docs/MavenMavenRemote.md +18 -12
  12. data/docs/MavenMavenRemoteResponse.md +51 -0
  13. data/docs/MavenMavenRepository.md +4 -10
  14. data/docs/MavenMavenRepositoryResponse.md +29 -0
  15. data/docs/PaginatedRepositoryVersionResponseList.md +23 -0
  16. data/docs/PaginatedmavenMavenArtifactResponseList.md +23 -0
  17. data/docs/PaginatedmavenMavenDistributionResponseList.md +23 -0
  18. data/docs/PaginatedmavenMavenRemoteResponseList.md +23 -0
  19. data/docs/PaginatedmavenMavenRepositoryResponseList.md +23 -0
  20. data/docs/PatchedmavenMavenDistribution.md +23 -0
  21. data/docs/PatchedmavenMavenRemote.md +45 -0
  22. data/docs/PatchedmavenMavenRepository.md +21 -0
  23. data/docs/PolicyEnum.md +16 -0
  24. data/docs/RemotesMavenApi.md +68 -66
  25. data/docs/RepositoriesMavenApi.md +60 -58
  26. data/docs/RepositoriesMavenVersionsApi.md +110 -53
  27. data/docs/RepositoryVersion.md +1 -9
  28. data/docs/RepositoryVersionResponse.md +25 -0
  29. data/lib/pulp_maven_client/api/content_artifact_api.rb +55 -52
  30. data/lib/pulp_maven_client/api/distributions_maven_api.rb +94 -91
  31. data/lib/pulp_maven_client/api/remotes_maven_api.rb +104 -101
  32. data/lib/pulp_maven_client/api/repositories_maven_api.rb +97 -94
  33. data/lib/pulp_maven_client/api/repositories_maven_versions_api.rb +149 -78
  34. data/lib/pulp_maven_client/api_client.rb +3 -3
  35. data/lib/pulp_maven_client/api_error.rb +3 -3
  36. data/lib/pulp_maven_client/configuration.rb +6 -6
  37. data/lib/pulp_maven_client/models/async_operation_response.rb +4 -3
  38. data/lib/pulp_maven_client/models/content_summary.rb +10 -16
  39. data/lib/pulp_maven_client/models/content_summary_response.rb +240 -0
  40. data/lib/pulp_maven_client/models/maven_maven_artifact.rb +15 -118
  41. data/lib/pulp_maven_client/models/maven_maven_artifact_response.rb +272 -0
  42. data/lib/pulp_maven_client/models/maven_maven_distribution.rb +5 -86
  43. data/lib/pulp_maven_client/models/maven_maven_distribution_response.rb +279 -0
  44. data/lib/pulp_maven_client/models/maven_maven_remote.rb +111 -147
  45. data/lib/pulp_maven_client/models/maven_maven_remote_response.rb +472 -0
  46. data/lib/pulp_maven_client/models/maven_maven_repository.rb +19 -79
  47. data/lib/pulp_maven_client/models/maven_maven_repository_response.rb +271 -0
  48. data/lib/pulp_maven_client/models/{inline_response200.rb → paginated_repository_version_response_list.rb} +7 -17
  49. data/lib/pulp_maven_client/models/{inline_response2002.rb → paginatedmaven_maven_artifact_response_list.rb} +7 -17
  50. data/lib/pulp_maven_client/models/{inline_response2004.rb → paginatedmaven_maven_distribution_response_list.rb} +7 -17
  51. data/lib/pulp_maven_client/models/{inline_response2003.rb → paginatedmaven_maven_remote_response_list.rb} +7 -17
  52. data/lib/pulp_maven_client/models/paginatedmaven_maven_repository_response_list.rb +237 -0
  53. data/lib/pulp_maven_client/models/{inline_response2001.rb → patchedmaven_maven_distribution.rb} +38 -45
  54. data/lib/pulp_maven_client/models/patchedmaven_maven_remote.rb +433 -0
  55. data/lib/pulp_maven_client/models/patchedmaven_maven_repository.rb +229 -0
  56. data/lib/pulp_maven_client/models/policy_enum.rb +36 -0
  57. data/lib/pulp_maven_client/models/repository_version.rb +8 -44
  58. data/lib/pulp_maven_client/models/repository_version_response.rb +246 -0
  59. data/lib/pulp_maven_client/version.rb +4 -4
  60. data/lib/pulp_maven_client.rb +18 -8
  61. data/pulp_maven_client.gemspec +5 -5
  62. data/spec/api/content_artifact_api_spec.rb +16 -15
  63. data/spec/api/distributions_maven_api_spec.rb +20 -19
  64. data/spec/api/remotes_maven_api_spec.rb +23 -22
  65. data/spec/api/repositories_maven_api_spec.rb +21 -20
  66. data/spec/api/repositories_maven_versions_api_spec.rb +36 -23
  67. data/spec/api_client_spec.rb +3 -3
  68. data/spec/configuration_spec.rb +6 -6
  69. data/spec/models/async_operation_response_spec.rb +3 -3
  70. data/spec/models/content_summary_response_spec.rb +53 -0
  71. data/spec/models/content_summary_spec.rb +3 -3
  72. data/spec/models/maven_maven_artifact_response_spec.rb +77 -0
  73. data/spec/models/maven_maven_artifact_spec.rb +4 -34
  74. data/spec/models/maven_maven_distribution_response_spec.rb +77 -0
  75. data/spec/models/maven_maven_distribution_spec.rb +3 -21
  76. data/spec/models/maven_maven_remote_response_spec.rb +143 -0
  77. data/spec/models/maven_maven_remote_spec.rb +33 -19
  78. data/spec/models/maven_maven_repository_response_spec.rb +77 -0
  79. data/spec/models/maven_maven_repository_spec.rb +6 -24
  80. data/spec/models/{inline_response2002_spec.rb → paginated_repository_version_response_list_spec.rb} +9 -9
  81. data/spec/models/{inline_response2003_spec.rb → paginatedmaven_maven_artifact_response_list_spec.rb} +9 -9
  82. data/spec/models/paginatedmaven_maven_distribution_response_list_spec.rb +59 -0
  83. data/spec/models/{inline_response2001_spec.rb → paginatedmaven_maven_remote_response_list_spec.rb} +9 -9
  84. data/spec/models/{inline_response2004_spec.rb → paginatedmaven_maven_repository_response_list_spec.rb} +9 -9
  85. data/spec/models/patchedmaven_maven_distribution_spec.rb +59 -0
  86. data/spec/models/patchedmaven_maven_remote_spec.rb +125 -0
  87. data/spec/models/{inline_response200_spec.rb → patchedmaven_maven_repository_spec.rb} +12 -18
  88. data/spec/models/policy_enum_spec.rb +35 -0
  89. data/spec/models/repository_version_response_spec.rb +65 -0
  90. data/spec/models/repository_version_spec.rb +3 -27
  91. data/spec/spec_helper.rb +3 -3
  92. metadata +70 -30
  93. data/docs/InlineResponse200.md +0 -23
  94. data/docs/InlineResponse2001.md +0 -23
  95. data/docs/InlineResponse2002.md +0 -23
  96. data/docs/InlineResponse2003.md +0 -23
  97. data/docs/InlineResponse2004.md +0 -23
@@ -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 PulpMavenClient
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 `PulpMavenClient::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 `PulpMavenClient::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
+ PulpMavenClient.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,62 +1,39 @@
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
- OpenAPI Generator version: 4.2.2
9
+ OpenAPI Generator version: 4.2.3
10
10
 
11
11
  =end
12
12
 
13
13
  require 'date'
14
14
 
15
15
  module PulpMavenClient
16
+ # A Serializer for MavenArtifact.
16
17
  class MavenMavenArtifact
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
- # Group Id of the artifact's package.
26
- attr_accessor :group_id
27
-
28
- # Artifact Id of the artifact's package.
29
- attr_accessor :artifact_id
30
-
31
- # Version of the artifact's package.
32
- attr_accessor :version
33
-
34
- # Filename of the artifact.
35
- attr_accessor :filename
21
+ # Path where the artifact is located relative to distributions base_path
22
+ attr_accessor :relative_path
36
23
 
37
24
  # Attribute mapping from ruby-style variable name to JSON key.
38
25
  def self.attribute_map
39
26
  {
40
- :'pulp_href' => :'pulp_href',
41
- :'pulp_created' => :'pulp_created',
42
27
  :'artifact' => :'artifact',
43
- :'group_id' => :'group_id',
44
- :'artifact_id' => :'artifact_id',
45
- :'version' => :'version',
46
- :'filename' => :'filename'
28
+ :'relative_path' => :'relative_path'
47
29
  }
48
30
  end
49
31
 
50
32
  # Attribute type mapping.
51
33
  def self.openapi_types
52
34
  {
53
- :'pulp_href' => :'String',
54
- :'pulp_created' => :'DateTime',
55
35
  :'artifact' => :'String',
56
- :'group_id' => :'String',
57
- :'artifact_id' => :'String',
58
- :'version' => :'String',
59
- :'filename' => :'String'
36
+ :'relative_path' => :'String'
60
37
  }
61
38
  end
62
39
 
@@ -81,32 +58,12 @@ module PulpMavenClient
81
58
  h[k.to_sym] = v
82
59
  }
83
60
 
84
- if attributes.key?(:'pulp_href')
85
- self.pulp_href = attributes[:'pulp_href']
86
- end
87
-
88
- if attributes.key?(:'pulp_created')
89
- self.pulp_created = attributes[:'pulp_created']
90
- end
91
-
92
61
  if attributes.key?(:'artifact')
93
62
  self.artifact = attributes[:'artifact']
94
63
  end
95
64
 
96
- if attributes.key?(:'group_id')
97
- self.group_id = attributes[:'group_id']
98
- end
99
-
100
- if attributes.key?(:'artifact_id')
101
- self.artifact_id = attributes[:'artifact_id']
102
- end
103
-
104
- if attributes.key?(:'version')
105
- self.version = attributes[:'version']
106
- end
107
-
108
- if attributes.key?(:'filename')
109
- self.filename = attributes[:'filename']
65
+ if attributes.key?(:'relative_path')
66
+ self.relative_path = attributes[:'relative_path']
110
67
  end
111
68
  end
112
69
 
@@ -118,20 +75,8 @@ module PulpMavenClient
118
75
  invalid_properties.push('invalid value for "artifact", artifact cannot be nil.')
119
76
  end
120
77
 
121
- if !@group_id.nil? && @group_id.to_s.length < 1
122
- invalid_properties.push('invalid value for "group_id", the character length must be great than or equal to 1.')
123
- end
124
-
125
- if !@artifact_id.nil? && @artifact_id.to_s.length < 1
126
- invalid_properties.push('invalid value for "artifact_id", the character length must be great than or equal to 1.')
127
- end
128
-
129
- if !@version.nil? && @version.to_s.length < 1
130
- invalid_properties.push('invalid value for "version", the character length must be great than or equal to 1.')
131
- end
132
-
133
- if !@filename.nil? && @filename.to_s.length < 1
134
- invalid_properties.push('invalid value for "filename", the character length must be great than or equal to 1.')
78
+ if @relative_path.nil?
79
+ invalid_properties.push('invalid value for "relative_path", relative_path cannot be nil.')
135
80
  end
136
81
 
137
82
  invalid_properties
@@ -141,65 +86,17 @@ module PulpMavenClient
141
86
  # @return true if the model is valid
142
87
  def valid?
143
88
  return false if @artifact.nil?
144
- return false if !@group_id.nil? && @group_id.to_s.length < 1
145
- return false if !@artifact_id.nil? && @artifact_id.to_s.length < 1
146
- return false if !@version.nil? && @version.to_s.length < 1
147
- return false if !@filename.nil? && @filename.to_s.length < 1
89
+ return false if @relative_path.nil?
148
90
  true
149
91
  end
150
92
 
151
- # Custom attribute writer method with validation
152
- # @param [Object] group_id Value to be assigned
153
- def group_id=(group_id)
154
- if !group_id.nil? && group_id.to_s.length < 1
155
- fail ArgumentError, 'invalid value for "group_id", the character length must be great than or equal to 1.'
156
- end
157
-
158
- @group_id = group_id
159
- end
160
-
161
- # Custom attribute writer method with validation
162
- # @param [Object] artifact_id Value to be assigned
163
- def artifact_id=(artifact_id)
164
- if !artifact_id.nil? && artifact_id.to_s.length < 1
165
- fail ArgumentError, 'invalid value for "artifact_id", the character length must be great than or equal to 1.'
166
- end
167
-
168
- @artifact_id = artifact_id
169
- end
170
-
171
- # Custom attribute writer method with validation
172
- # @param [Object] version Value to be assigned
173
- def version=(version)
174
- if !version.nil? && version.to_s.length < 1
175
- fail ArgumentError, 'invalid value for "version", the character length must be great than or equal to 1.'
176
- end
177
-
178
- @version = version
179
- end
180
-
181
- # Custom attribute writer method with validation
182
- # @param [Object] filename Value to be assigned
183
- def filename=(filename)
184
- if !filename.nil? && filename.to_s.length < 1
185
- fail ArgumentError, 'invalid value for "filename", the character length must be great than or equal to 1.'
186
- end
187
-
188
- @filename = filename
189
- end
190
-
191
93
  # Checks equality by comparing each attribute.
192
94
  # @param [Object] Object to be compared
193
95
  def ==(o)
194
96
  return true if self.equal?(o)
195
97
  self.class == o.class &&
196
- pulp_href == o.pulp_href &&
197
- pulp_created == o.pulp_created &&
198
98
  artifact == o.artifact &&
199
- group_id == o.group_id &&
200
- artifact_id == o.artifact_id &&
201
- version == o.version &&
202
- filename == o.filename
99
+ relative_path == o.relative_path
203
100
  end
204
101
 
205
102
  # @see the `==` method
@@ -211,7 +108,7 @@ module PulpMavenClient
211
108
  # Calculates hash code according to all attributes.
212
109
  # @return [Integer] Hash code
213
110
  def hash
214
- [pulp_href, pulp_created, artifact, group_id, artifact_id, version, filename].hash
111
+ [artifact, relative_path].hash
215
112
  end
216
113
 
217
114
  # Builds the object from hash