pulp_npm_client 0.1.0a1.dev01595813316 → 0.1.0a1.dev01596158992

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of pulp_npm_client might be problematic. Click here for more details.

Files changed (98) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +22 -11
  3. data/docs/ContentPackagesApi.md +27 -27
  4. data/docs/ContentSummary.md +3 -3
  5. data/docs/ContentSummaryResponse.md +21 -0
  6. data/docs/DistributionsNpmApi.md +104 -56
  7. data/docs/InlineResponse200.md +3 -3
  8. data/docs/InlineResponse2001.md +3 -3
  9. data/docs/InlineResponse2002.md +3 -3
  10. data/docs/InlineResponse2003.md +3 -3
  11. data/docs/InlineResponse2004.md +3 -3
  12. data/docs/NpmNpmDistribution.md +1 -7
  13. data/docs/NpmNpmDistributionResponse.md +31 -0
  14. data/docs/NpmNpmRemote.md +4 -10
  15. data/docs/NpmNpmRemoteResponse.md +43 -0
  16. data/docs/NpmNpmRepository.md +4 -10
  17. data/docs/NpmNpmRepositoryResponse.md +29 -0
  18. data/docs/NpmPackage.md +5 -5
  19. data/docs/NpmPackageResponse.md +27 -0
  20. data/docs/PatchednpmNpmDistribution.md +25 -0
  21. data/docs/PatchednpmNpmRemote.md +37 -0
  22. data/docs/PatchednpmNpmRepository.md +21 -0
  23. data/docs/PolicyEnum.md +16 -0
  24. data/docs/RemotesNpmApi.md +124 -64
  25. data/docs/RepositoriesNpmApi.md +94 -70
  26. data/docs/RepositoriesNpmVersionsApi.md +90 -58
  27. data/docs/RepositoryAddRemoveContent.md +2 -2
  28. data/docs/RepositorySyncURL.md +1 -1
  29. data/docs/RepositoryVersion.md +1 -9
  30. data/docs/RepositoryVersionResponse.md +25 -0
  31. data/lib/pulp_npm_client.rb +12 -2
  32. data/lib/pulp_npm_client/api/content_packages_api.rb +34 -46
  33. data/lib/pulp_npm_client/api/distributions_npm_api.rb +131 -68
  34. data/lib/pulp_npm_client/api/remotes_npm_api.rb +165 -84
  35. data/lib/pulp_npm_client/api/repositories_npm_api.rb +121 -94
  36. data/lib/pulp_npm_client/api/repositories_npm_versions_api.rb +119 -74
  37. data/lib/pulp_npm_client/api_client.rb +2 -2
  38. data/lib/pulp_npm_client/api_error.rb +2 -2
  39. data/lib/pulp_npm_client/configuration.rb +3 -3
  40. data/lib/pulp_npm_client/models/async_operation_response.rb +3 -2
  41. data/lib/pulp_npm_client/models/content_summary.rb +9 -15
  42. data/lib/pulp_npm_client/models/content_summary_response.rb +240 -0
  43. data/lib/pulp_npm_client/models/inline_response200.rb +3 -13
  44. data/lib/pulp_npm_client/models/inline_response2001.rb +3 -13
  45. data/lib/pulp_npm_client/models/inline_response2002.rb +3 -13
  46. data/lib/pulp_npm_client/models/inline_response2003.rb +3 -13
  47. data/lib/pulp_npm_client/models/inline_response2004.rb +3 -13
  48. data/lib/pulp_npm_client/models/npm_npm_distribution.rb +4 -85
  49. data/lib/pulp_npm_client/models/npm_npm_distribution_response.rb +290 -0
  50. data/lib/pulp_npm_client/models/npm_npm_remote.rb +7 -199
  51. data/lib/pulp_npm_client/models/npm_npm_remote_response.rb +368 -0
  52. data/lib/pulp_npm_client/models/npm_npm_repository.rb +18 -78
  53. data/lib/pulp_npm_client/models/npm_npm_repository_response.rb +271 -0
  54. data/lib/pulp_npm_client/models/npm_package.rb +24 -79
  55. data/lib/pulp_npm_client/models/npm_package_response.rb +269 -0
  56. data/lib/pulp_npm_client/models/patchednpm_npm_distribution.rb +251 -0
  57. data/lib/pulp_npm_client/models/patchednpm_npm_remote.rb +329 -0
  58. data/lib/pulp_npm_client/models/patchednpm_npm_repository.rb +229 -0
  59. data/lib/pulp_npm_client/models/policy_enum.rb +37 -0
  60. data/lib/pulp_npm_client/models/repository_add_remove_content.rb +5 -4
  61. data/lib/pulp_npm_client/models/repository_sync_url.rb +3 -8
  62. data/lib/pulp_npm_client/models/repository_version.rb +7 -43
  63. data/lib/pulp_npm_client/models/repository_version_response.rb +246 -0
  64. data/lib/pulp_npm_client/version.rb +3 -3
  65. data/pulp_npm_client.gemspec +4 -4
  66. data/spec/api/content_packages_api_spec.rb +14 -14
  67. data/spec/api/distributions_npm_api_spec.rb +39 -18
  68. data/spec/api/remotes_npm_api_spec.rb +51 -24
  69. data/spec/api/repositories_npm_api_spec.rb +31 -22
  70. data/spec/api/repositories_npm_versions_api_spec.rb +38 -23
  71. data/spec/api_client_spec.rb +2 -2
  72. data/spec/configuration_spec.rb +2 -2
  73. data/spec/models/async_operation_response_spec.rb +2 -2
  74. data/spec/models/content_summary_response_spec.rb +53 -0
  75. data/spec/models/content_summary_spec.rb +2 -2
  76. data/spec/models/inline_response2001_spec.rb +2 -2
  77. data/spec/models/inline_response2002_spec.rb +2 -2
  78. data/spec/models/inline_response2003_spec.rb +2 -2
  79. data/spec/models/inline_response2004_spec.rb +2 -2
  80. data/spec/models/inline_response200_spec.rb +2 -2
  81. data/spec/models/npm_npm_distribution_response_spec.rb +83 -0
  82. data/spec/models/npm_npm_distribution_spec.rb +2 -20
  83. data/spec/models/npm_npm_remote_response_spec.rb +119 -0
  84. data/spec/models/npm_npm_remote_spec.rb +2 -24
  85. data/spec/models/npm_npm_repository_response_spec.rb +77 -0
  86. data/spec/models/npm_npm_repository_spec.rb +5 -23
  87. data/spec/models/npm_package_response_spec.rb +71 -0
  88. data/spec/models/npm_package_spec.rb +6 -6
  89. data/spec/models/patchednpm_npm_distribution_spec.rb +65 -0
  90. data/spec/models/patchednpm_npm_remote_spec.rb +101 -0
  91. data/spec/models/patchednpm_npm_repository_spec.rb +53 -0
  92. data/spec/models/policy_enum_spec.rb +35 -0
  93. data/spec/models/repository_add_remove_content_spec.rb +2 -2
  94. data/spec/models/repository_sync_url_spec.rb +2 -2
  95. data/spec/models/repository_version_response_spec.rb +65 -0
  96. data/spec/models/repository_version_spec.rb +2 -26
  97. data/spec/spec_helper.rb +2 -2
  98. metadata +54 -14
@@ -0,0 +1,37 @@
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 PulpNpmClient
16
+ class PolicyEnum
17
+ IMMEDIATE = "immediate".freeze
18
+ ON_DEMAND = "on_demand".freeze
19
+ STREAMED = "streamed".freeze
20
+
21
+ # Builds the enum from string
22
+ # @param [String] The enum value in the form of the string
23
+ # @return [String] The enum value
24
+ def self.build_from_hash(value)
25
+ new.build_from_hash(value)
26
+ end
27
+
28
+ # Builds the enum from string
29
+ # @param [String] The enum value in the form of the string
30
+ # @return [String] The enum value
31
+ def build_from_hash(value)
32
+ constantValues = PolicyEnum.constants.select { |c| PolicyEnum::const_get(c) == value }
33
+ raise "Invalid ENUM value #{value} for class #PolicyEnum" if constantValues.empty?
34
+ value
35
+ end
36
+ end
37
+ 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,6 +13,7 @@ OpenAPI Generator version: 4.2.3
13
13
  require 'date'
14
14
 
15
15
  module PulpNpmClient
16
+ # Base serializer for use with :class:`pulpcore.app.models.Model` This ensures that all Serializers provide values for the 'pulp_href` field. The class provides a default for the ``ref_name`` attribute in the ModelSerializers's ``Meta`` class. This ensures that the OpenAPI definitions of plugins are namespaced properly.
16
17
  class RepositoryAddRemoveContent
17
18
  # A list of content units to add to a new repository version. This content is added after remove_content_units are removed.
18
19
  attr_accessor :add_content_units
@@ -35,8 +36,8 @@ module PulpNpmClient
35
36
  # Attribute type mapping.
36
37
  def self.openapi_types
37
38
  {
38
- :'add_content_units' => :'Array<String>',
39
- :'remove_content_units' => :'Array<String>',
39
+ :'add_content_units' => :'Array<Object>',
40
+ :'remove_content_units' => :'Array<Object>',
40
41
  :'base_version' => :'String'
41
42
  }
42
43
  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
 
@@ -14,7 +14,7 @@ require 'date'
14
14
 
15
15
  module PulpNpmClient
16
16
  class RepositorySyncURL
17
- # A URI of the repository to be synchronized.
17
+ # A remote to sync from. This will override a remote set on repository.
18
18
  attr_accessor :remote
19
19
 
20
20
  # If ``True``, synchronization will remove all content that is not present in the remote repository. If ``False``, sync will be additive only.
@@ -72,17 +72,12 @@ module PulpNpmClient
72
72
  # @return Array for valid properties with the reasons
73
73
  def list_invalid_properties
74
74
  invalid_properties = Array.new
75
- if @remote.nil?
76
- invalid_properties.push('invalid value for "remote", remote cannot be nil.')
77
- end
78
-
79
75
  invalid_properties
80
76
  end
81
77
 
82
78
  # Check to see if the all the properties in the model are valid
83
79
  # @return true if the model is valid
84
80
  def valid?
85
- return false if @remote.nil?
86
81
  true
87
82
  end
88
83
 
@@ -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,38 +13,22 @@ OpenAPI Generator version: 4.2.3
13
13
  require 'date'
14
14
 
15
15
  module PulpNpmClient
16
+ # Base serializer for use with :class:`pulpcore.app.models.Model` This ensures that all Serializers provide values for the 'pulp_href` field. The class provides a default for the ``ref_name`` attribute in the ModelSerializers's ``Meta`` class. This ensures that the OpenAPI definitions of plugins are namespaced properly.
16
17
  class RepositoryVersion
17
- attr_accessor :pulp_href
18
-
19
- # Timestamp of creation.
20
- attr_accessor :pulp_created
21
-
22
- attr_accessor :number
23
-
24
18
  # A repository version whose content was used as the initial set of content for this repository version
25
19
  attr_accessor :base_version
26
20
 
27
- attr_accessor :content_summary
28
-
29
21
  # Attribute mapping from ruby-style variable name to JSON key.
30
22
  def self.attribute_map
31
23
  {
32
- :'pulp_href' => :'pulp_href',
33
- :'pulp_created' => :'pulp_created',
34
- :'number' => :'number',
35
- :'base_version' => :'base_version',
36
- :'content_summary' => :'content_summary'
24
+ :'base_version' => :'base_version'
37
25
  }
38
26
  end
39
27
 
40
28
  # Attribute type mapping.
41
29
  def self.openapi_types
42
30
  {
43
- :'pulp_href' => :'String',
44
- :'pulp_created' => :'DateTime',
45
- :'number' => :'Integer',
46
- :'base_version' => :'String',
47
- :'content_summary' => :'ContentSummary'
31
+ :'base_version' => :'String'
48
32
  }
49
33
  end
50
34
 
@@ -69,25 +53,9 @@ module PulpNpmClient
69
53
  h[k.to_sym] = v
70
54
  }
71
55
 
72
- if attributes.key?(:'pulp_href')
73
- self.pulp_href = attributes[:'pulp_href']
74
- end
75
-
76
- if attributes.key?(:'pulp_created')
77
- self.pulp_created = attributes[:'pulp_created']
78
- end
79
-
80
- if attributes.key?(:'number')
81
- self.number = attributes[:'number']
82
- end
83
-
84
56
  if attributes.key?(:'base_version')
85
57
  self.base_version = attributes[:'base_version']
86
58
  end
87
-
88
- if attributes.key?(:'content_summary')
89
- self.content_summary = attributes[:'content_summary']
90
- end
91
59
  end
92
60
 
93
61
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -108,11 +76,7 @@ module PulpNpmClient
108
76
  def ==(o)
109
77
  return true if self.equal?(o)
110
78
  self.class == o.class &&
111
- pulp_href == o.pulp_href &&
112
- pulp_created == o.pulp_created &&
113
- number == o.number &&
114
- base_version == o.base_version &&
115
- content_summary == o.content_summary
79
+ base_version == o.base_version
116
80
  end
117
81
 
118
82
  # @see the `==` method
@@ -124,7 +88,7 @@ module PulpNpmClient
124
88
  # Calculates hash code according to all attributes.
125
89
  # @return [Integer] Hash code
126
90
  def hash
127
- [pulp_href, pulp_created, number, base_version, content_summary].hash
91
+ [base_version].hash
128
92
  end
129
93
 
130
94
  # Builds the object from hash
@@ -0,0 +1,246 @@
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 PulpNpmClient
16
+ # Base serializer for use with :class:`pulpcore.app.models.Model` This ensures that all Serializers provide values for the 'pulp_href` field. The class provides a default for the ``ref_name`` attribute in the ModelSerializers's ``Meta`` class. This ensures that the OpenAPI definitions of plugins are namespaced properly.
17
+ class RepositoryVersionResponse
18
+ attr_accessor :pulp_href
19
+
20
+ # Timestamp of creation.
21
+ attr_accessor :pulp_created
22
+
23
+ attr_accessor :number
24
+
25
+ # A repository version whose content was used as the initial set of content for this repository version
26
+ attr_accessor :base_version
27
+
28
+ # Various count summaries of the content in the version and the HREF to view them.
29
+ attr_accessor :content_summary
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+ :'pulp_href' => :'pulp_href',
35
+ :'pulp_created' => :'pulp_created',
36
+ :'number' => :'number',
37
+ :'base_version' => :'base_version',
38
+ :'content_summary' => :'content_summary'
39
+ }
40
+ end
41
+
42
+ # Attribute type mapping.
43
+ def self.openapi_types
44
+ {
45
+ :'pulp_href' => :'String',
46
+ :'pulp_created' => :'DateTime',
47
+ :'number' => :'Integer',
48
+ :'base_version' => :'String',
49
+ :'content_summary' => :'ContentSummaryResponse'
50
+ }
51
+ end
52
+
53
+ # List of attributes with nullable: true
54
+ def self.openapi_nullable
55
+ Set.new([
56
+ ])
57
+ end
58
+
59
+ # Initializes the object
60
+ # @param [Hash] attributes Model attributes in the form of hash
61
+ def initialize(attributes = {})
62
+ if (!attributes.is_a?(Hash))
63
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpNpmClient::RepositoryVersionResponse` initialize method"
64
+ end
65
+
66
+ # check to see if the attribute exists and convert string to symbol for hash key
67
+ attributes = attributes.each_with_object({}) { |(k, v), h|
68
+ if (!self.class.attribute_map.key?(k.to_sym))
69
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpNpmClient::RepositoryVersionResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
70
+ end
71
+ h[k.to_sym] = v
72
+ }
73
+
74
+ if attributes.key?(:'pulp_href')
75
+ self.pulp_href = attributes[:'pulp_href']
76
+ end
77
+
78
+ if attributes.key?(:'pulp_created')
79
+ self.pulp_created = attributes[:'pulp_created']
80
+ end
81
+
82
+ if attributes.key?(:'number')
83
+ self.number = attributes[:'number']
84
+ end
85
+
86
+ if attributes.key?(:'base_version')
87
+ self.base_version = attributes[:'base_version']
88
+ end
89
+
90
+ if attributes.key?(:'content_summary')
91
+ self.content_summary = attributes[:'content_summary']
92
+ end
93
+ end
94
+
95
+ # Show invalid properties with the reasons. Usually used together with valid?
96
+ # @return Array for valid properties with the reasons
97
+ def list_invalid_properties
98
+ invalid_properties = Array.new
99
+ invalid_properties
100
+ end
101
+
102
+ # Check to see if the all the properties in the model are valid
103
+ # @return true if the model is valid
104
+ def valid?
105
+ true
106
+ end
107
+
108
+ # Checks equality by comparing each attribute.
109
+ # @param [Object] Object to be compared
110
+ def ==(o)
111
+ return true if self.equal?(o)
112
+ self.class == o.class &&
113
+ pulp_href == o.pulp_href &&
114
+ pulp_created == o.pulp_created &&
115
+ number == o.number &&
116
+ base_version == o.base_version &&
117
+ content_summary == o.content_summary
118
+ end
119
+
120
+ # @see the `==` method
121
+ # @param [Object] Object to be compared
122
+ def eql?(o)
123
+ self == o
124
+ end
125
+
126
+ # Calculates hash code according to all attributes.
127
+ # @return [Integer] Hash code
128
+ def hash
129
+ [pulp_href, pulp_created, number, base_version, content_summary].hash
130
+ end
131
+
132
+ # Builds the object from hash
133
+ # @param [Hash] attributes Model attributes in the form of hash
134
+ # @return [Object] Returns the model itself
135
+ def self.build_from_hash(attributes)
136
+ new.build_from_hash(attributes)
137
+ end
138
+
139
+ # Builds the object from hash
140
+ # @param [Hash] attributes Model attributes in the form of hash
141
+ # @return [Object] Returns the model itself
142
+ def build_from_hash(attributes)
143
+ return nil unless attributes.is_a?(Hash)
144
+ self.class.openapi_types.each_pair do |key, type|
145
+ if type =~ /\AArray<(.*)>/i
146
+ # check to ensure the input is an array given that the attribute
147
+ # is documented as an array but the input is not
148
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
149
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
150
+ end
151
+ elsif !attributes[self.class.attribute_map[key]].nil?
152
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
153
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
154
+ end
155
+
156
+ self
157
+ end
158
+
159
+ # Deserializes the data based on type
160
+ # @param string type Data type
161
+ # @param string value Value to be deserialized
162
+ # @return [Object] Deserialized data
163
+ def _deserialize(type, value)
164
+ case type.to_sym
165
+ when :DateTime
166
+ DateTime.parse(value)
167
+ when :Date
168
+ Date.parse(value)
169
+ when :String
170
+ value.to_s
171
+ when :Integer
172
+ value.to_i
173
+ when :Float
174
+ value.to_f
175
+ when :Boolean
176
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
177
+ true
178
+ else
179
+ false
180
+ end
181
+ when :Object
182
+ # generic object (usually a Hash), return directly
183
+ value
184
+ when /\AArray<(?<inner_type>.+)>\z/
185
+ inner_type = Regexp.last_match[:inner_type]
186
+ value.map { |v| _deserialize(inner_type, v) }
187
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
188
+ k_type = Regexp.last_match[:k_type]
189
+ v_type = Regexp.last_match[:v_type]
190
+ {}.tap do |hash|
191
+ value.each do |k, v|
192
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
193
+ end
194
+ end
195
+ else # model
196
+ PulpNpmClient.const_get(type).build_from_hash(value)
197
+ end
198
+ end
199
+
200
+ # Returns the string representation of the object
201
+ # @return [String] String presentation of the object
202
+ def to_s
203
+ to_hash.to_s
204
+ end
205
+
206
+ # to_body is an alias to to_hash (backward compatibility)
207
+ # @return [Hash] Returns the object in the form of hash
208
+ def to_body
209
+ to_hash
210
+ end
211
+
212
+ # Returns the object in the form of hash
213
+ # @return [Hash] Returns the object in the form of hash
214
+ def to_hash
215
+ hash = {}
216
+ self.class.attribute_map.each_pair do |attr, param|
217
+ value = self.send(attr)
218
+ if value.nil?
219
+ is_nullable = self.class.openapi_nullable.include?(attr)
220
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
221
+ end
222
+
223
+ hash[param] = _to_hash(value)
224
+ end
225
+ hash
226
+ end
227
+
228
+ # Outputs non-array value in the form of hash
229
+ # For object, use to_hash. Otherwise, just return the value
230
+ # @param [Object] value Any valid value
231
+ # @return [Hash] Returns the value in the form of hash
232
+ def _to_hash(value)
233
+ if value.is_a?(Array)
234
+ value.compact.map { |v| _to_hash(v) }
235
+ elsif value.is_a?(Hash)
236
+ {}.tap do |hash|
237
+ value.each { |k, v| hash[k] = _to_hash(v) }
238
+ end
239
+ elsif value.respond_to? :to_hash
240
+ value.to_hash
241
+ else
242
+ value
243
+ end
244
+ end
245
+ end
246
+ end