pulp_npm_client 0.1.0a1.dev01595640515 → 0.1.0a1.dev01595986114
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.
- checksums.yaml +4 -4
- data/README.md +42 -32
- data/docs/ContentPackagesApi.md +33 -36
- data/docs/ContentSummary.md +3 -3
- data/docs/ContentSummaryResponse.md +21 -0
- data/docs/DistributionsNpmApi.md +113 -71
- data/docs/InlineResponse200.md +3 -3
- data/docs/InlineResponse2001.md +3 -3
- data/docs/InlineResponse2002.md +3 -3
- data/docs/InlineResponse2003.md +3 -3
- data/docs/InlineResponse2004.md +3 -3
- data/docs/NpmNpmDistribution.md +1 -7
- data/docs/NpmNpmDistributionResponse.md +31 -0
- data/docs/NpmNpmRemote.md +4 -10
- data/docs/NpmNpmRemoteResponse.md +43 -0
- data/docs/NpmNpmRepository.md +4 -10
- data/docs/NpmNpmRepositoryResponse.md +29 -0
- data/docs/NpmPackage.md +5 -5
- data/docs/NpmPackageResponse.md +27 -0
- data/docs/PatchednpmNpmDistribution.md +25 -0
- data/docs/PatchednpmNpmRemote.md +37 -0
- data/docs/PatchednpmNpmRepository.md +21 -0
- data/docs/PolicyEnum.md +16 -0
- data/docs/RemotesNpmApi.md +133 -79
- data/docs/RepositoriesNpmApi.md +103 -85
- data/docs/RepositoriesNpmVersionsApi.md +95 -66
- data/docs/RepositoryAddRemoveContent.md +2 -2
- data/docs/RepositorySyncURL.md +1 -1
- data/docs/RepositoryVersion.md +1 -9
- data/docs/RepositoryVersionResponse.md +25 -0
- data/lib/pulp_npm_client.rb +12 -2
- data/lib/pulp_npm_client/api/content_packages_api.rb +34 -52
- data/lib/pulp_npm_client/api/distributions_npm_api.rb +129 -78
- data/lib/pulp_npm_client/api/remotes_npm_api.rb +163 -94
- data/lib/pulp_npm_client/api/repositories_npm_api.rb +119 -104
- data/lib/pulp_npm_client/api/repositories_npm_versions_api.rb +119 -80
- data/lib/pulp_npm_client/api_client.rb +2 -2
- data/lib/pulp_npm_client/api_error.rb +2 -2
- data/lib/pulp_npm_client/configuration.rb +3 -3
- data/lib/pulp_npm_client/models/async_operation_response.rb +3 -2
- data/lib/pulp_npm_client/models/content_summary.rb +9 -15
- data/lib/pulp_npm_client/models/content_summary_response.rb +240 -0
- data/lib/pulp_npm_client/models/inline_response200.rb +3 -13
- data/lib/pulp_npm_client/models/inline_response2001.rb +3 -13
- data/lib/pulp_npm_client/models/inline_response2002.rb +3 -13
- data/lib/pulp_npm_client/models/inline_response2003.rb +3 -13
- data/lib/pulp_npm_client/models/inline_response2004.rb +3 -13
- data/lib/pulp_npm_client/models/npm_npm_distribution.rb +4 -85
- data/lib/pulp_npm_client/models/npm_npm_distribution_response.rb +290 -0
- data/lib/pulp_npm_client/models/npm_npm_remote.rb +7 -199
- data/lib/pulp_npm_client/models/npm_npm_remote_response.rb +368 -0
- data/lib/pulp_npm_client/models/npm_npm_repository.rb +18 -78
- data/lib/pulp_npm_client/models/npm_npm_repository_response.rb +271 -0
- data/lib/pulp_npm_client/models/npm_package.rb +24 -79
- data/lib/pulp_npm_client/models/npm_package_response.rb +269 -0
- data/lib/pulp_npm_client/models/patchednpm_npm_distribution.rb +251 -0
- data/lib/pulp_npm_client/models/patchednpm_npm_remote.rb +329 -0
- data/lib/pulp_npm_client/models/patchednpm_npm_repository.rb +229 -0
- data/lib/pulp_npm_client/models/policy_enum.rb +37 -0
- data/lib/pulp_npm_client/models/repository_add_remove_content.rb +5 -4
- data/lib/pulp_npm_client/models/repository_sync_url.rb +3 -8
- data/lib/pulp_npm_client/models/repository_version.rb +7 -43
- data/lib/pulp_npm_client/models/repository_version_response.rb +246 -0
- data/lib/pulp_npm_client/version.rb +3 -3
- data/pulp_npm_client.gemspec +4 -4
- data/spec/api/content_packages_api_spec.rb +14 -17
- data/spec/api/distributions_npm_api_spec.rb +38 -23
- data/spec/api/remotes_npm_api_spec.rb +50 -29
- data/spec/api/repositories_npm_api_spec.rb +30 -27
- data/spec/api/repositories_npm_versions_api_spec.rb +38 -26
- data/spec/api_client_spec.rb +2 -2
- data/spec/configuration_spec.rb +2 -2
- data/spec/models/async_operation_response_spec.rb +2 -2
- data/spec/models/content_summary_response_spec.rb +53 -0
- data/spec/models/content_summary_spec.rb +2 -2
- data/spec/models/inline_response2001_spec.rb +2 -2
- data/spec/models/inline_response2002_spec.rb +2 -2
- data/spec/models/inline_response2003_spec.rb +2 -2
- data/spec/models/inline_response2004_spec.rb +2 -2
- data/spec/models/inline_response200_spec.rb +2 -2
- data/spec/models/npm_npm_distribution_response_spec.rb +83 -0
- data/spec/models/npm_npm_distribution_spec.rb +2 -20
- data/spec/models/npm_npm_remote_response_spec.rb +119 -0
- data/spec/models/npm_npm_remote_spec.rb +2 -24
- data/spec/models/npm_npm_repository_response_spec.rb +77 -0
- data/spec/models/npm_npm_repository_spec.rb +5 -23
- data/spec/models/npm_package_response_spec.rb +71 -0
- data/spec/models/npm_package_spec.rb +6 -6
- data/spec/models/patchednpm_npm_distribution_spec.rb +65 -0
- data/spec/models/patchednpm_npm_remote_spec.rb +101 -0
- data/spec/models/patchednpm_npm_repository_spec.rb +53 -0
- data/spec/models/policy_enum_spec.rb +35 -0
- data/spec/models/repository_add_remove_content_spec.rb +2 -2
- data/spec/models/repository_sync_url_spec.rb +2 -2
- data/spec/models/repository_version_response_spec.rb +65 -0
- data/spec/models/repository_version_spec.rb +2 -26
- data/spec/spec_helper.rb +2 -2
- metadata +44 -4
@@ -1,10 +1,10 @@
|
|
1
1
|
=begin
|
2
2
|
#Pulp 3 API
|
3
3
|
|
4
|
-
#
|
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,50 +13,39 @@ OpenAPI Generator version: 4.2.3
|
|
13
13
|
require 'date'
|
14
14
|
|
15
15
|
module PulpNpmClient
|
16
|
+
# A Serializer for NpmRepository. Add any new fields if defined on NpmRepository. Similar to the example above, in PackageSerializer. Additional validators can be added to the parent validators list For example:: class Meta: validators = platform.RepositorySerializer.Meta.validators + [myValidator1, myValidator2]
|
16
17
|
class NpmNpmRepository
|
17
|
-
attr_accessor :pulp_href
|
18
|
-
|
19
|
-
# Timestamp of creation.
|
20
|
-
attr_accessor :pulp_created
|
21
|
-
|
22
|
-
attr_accessor :versions_href
|
23
|
-
|
24
|
-
attr_accessor :latest_version_href
|
25
|
-
|
26
18
|
# A unique name for this repository.
|
27
19
|
attr_accessor :name
|
28
20
|
|
29
21
|
# An optional description.
|
30
22
|
attr_accessor :description
|
31
23
|
|
24
|
+
attr_accessor :remote
|
25
|
+
|
32
26
|
# Attribute mapping from ruby-style variable name to JSON key.
|
33
27
|
def self.attribute_map
|
34
28
|
{
|
35
|
-
:'pulp_href' => :'pulp_href',
|
36
|
-
:'pulp_created' => :'pulp_created',
|
37
|
-
:'versions_href' => :'versions_href',
|
38
|
-
:'latest_version_href' => :'latest_version_href',
|
39
29
|
:'name' => :'name',
|
40
|
-
:'description' => :'description'
|
30
|
+
:'description' => :'description',
|
31
|
+
:'remote' => :'remote'
|
41
32
|
}
|
42
33
|
end
|
43
34
|
|
44
35
|
# Attribute type mapping.
|
45
36
|
def self.openapi_types
|
46
37
|
{
|
47
|
-
:'pulp_href' => :'String',
|
48
|
-
:'pulp_created' => :'DateTime',
|
49
|
-
:'versions_href' => :'String',
|
50
|
-
:'latest_version_href' => :'String',
|
51
38
|
:'name' => :'String',
|
52
|
-
:'description' => :'String'
|
39
|
+
:'description' => :'String',
|
40
|
+
:'remote' => :'String'
|
53
41
|
}
|
54
42
|
end
|
55
43
|
|
56
44
|
# List of attributes with nullable: true
|
57
45
|
def self.openapi_nullable
|
58
46
|
Set.new([
|
59
|
-
:'description'
|
47
|
+
:'description',
|
48
|
+
:'remote'
|
60
49
|
])
|
61
50
|
end
|
62
51
|
|
@@ -75,22 +64,6 @@ module PulpNpmClient
|
|
75
64
|
h[k.to_sym] = v
|
76
65
|
}
|
77
66
|
|
78
|
-
if attributes.key?(:'pulp_href')
|
79
|
-
self.pulp_href = attributes[:'pulp_href']
|
80
|
-
end
|
81
|
-
|
82
|
-
if attributes.key?(:'pulp_created')
|
83
|
-
self.pulp_created = attributes[:'pulp_created']
|
84
|
-
end
|
85
|
-
|
86
|
-
if attributes.key?(:'versions_href')
|
87
|
-
self.versions_href = attributes[:'versions_href']
|
88
|
-
end
|
89
|
-
|
90
|
-
if attributes.key?(:'latest_version_href')
|
91
|
-
self.latest_version_href = attributes[:'latest_version_href']
|
92
|
-
end
|
93
|
-
|
94
67
|
if attributes.key?(:'name')
|
95
68
|
self.name = attributes[:'name']
|
96
69
|
end
|
@@ -98,6 +71,10 @@ module PulpNpmClient
|
|
98
71
|
if attributes.key?(:'description')
|
99
72
|
self.description = attributes[:'description']
|
100
73
|
end
|
74
|
+
|
75
|
+
if attributes.key?(:'remote')
|
76
|
+
self.remote = attributes[:'remote']
|
77
|
+
end
|
101
78
|
end
|
102
79
|
|
103
80
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -108,14 +85,6 @@ module PulpNpmClient
|
|
108
85
|
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
109
86
|
end
|
110
87
|
|
111
|
-
if @name.to_s.length < 1
|
112
|
-
invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
|
113
|
-
end
|
114
|
-
|
115
|
-
if !@description.nil? && @description.to_s.length < 1
|
116
|
-
invalid_properties.push('invalid value for "description", the character length must be great than or equal to 1.')
|
117
|
-
end
|
118
|
-
|
119
88
|
invalid_properties
|
120
89
|
end
|
121
90
|
|
@@ -123,46 +92,17 @@ module PulpNpmClient
|
|
123
92
|
# @return true if the model is valid
|
124
93
|
def valid?
|
125
94
|
return false if @name.nil?
|
126
|
-
return false if @name.to_s.length < 1
|
127
|
-
return false if !@description.nil? && @description.to_s.length < 1
|
128
95
|
true
|
129
96
|
end
|
130
97
|
|
131
|
-
# Custom attribute writer method with validation
|
132
|
-
# @param [Object] name Value to be assigned
|
133
|
-
def name=(name)
|
134
|
-
if name.nil?
|
135
|
-
fail ArgumentError, 'name cannot be nil'
|
136
|
-
end
|
137
|
-
|
138
|
-
if name.to_s.length < 1
|
139
|
-
fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
|
140
|
-
end
|
141
|
-
|
142
|
-
@name = name
|
143
|
-
end
|
144
|
-
|
145
|
-
# Custom attribute writer method with validation
|
146
|
-
# @param [Object] description Value to be assigned
|
147
|
-
def description=(description)
|
148
|
-
if !description.nil? && description.to_s.length < 1
|
149
|
-
fail ArgumentError, 'invalid value for "description", the character length must be great than or equal to 1.'
|
150
|
-
end
|
151
|
-
|
152
|
-
@description = description
|
153
|
-
end
|
154
|
-
|
155
98
|
# Checks equality by comparing each attribute.
|
156
99
|
# @param [Object] Object to be compared
|
157
100
|
def ==(o)
|
158
101
|
return true if self.equal?(o)
|
159
102
|
self.class == o.class &&
|
160
|
-
pulp_href == o.pulp_href &&
|
161
|
-
pulp_created == o.pulp_created &&
|
162
|
-
versions_href == o.versions_href &&
|
163
|
-
latest_version_href == o.latest_version_href &&
|
164
103
|
name == o.name &&
|
165
|
-
description == o.description
|
104
|
+
description == o.description &&
|
105
|
+
remote == o.remote
|
166
106
|
end
|
167
107
|
|
168
108
|
# @see the `==` method
|
@@ -174,7 +114,7 @@ module PulpNpmClient
|
|
174
114
|
# Calculates hash code according to all attributes.
|
175
115
|
# @return [Integer] Hash code
|
176
116
|
def hash
|
177
|
-
[
|
117
|
+
[name, description, remote].hash
|
178
118
|
end
|
179
119
|
|
180
120
|
# Builds the object from hash
|
@@ -0,0 +1,271 @@
|
|
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
|
+
# A Serializer for NpmRepository. Add any new fields if defined on NpmRepository. Similar to the example above, in PackageSerializer. Additional validators can be added to the parent validators list For example:: class Meta: validators = platform.RepositorySerializer.Meta.validators + [myValidator1, myValidator2]
|
17
|
+
class NpmNpmRepositoryResponse
|
18
|
+
attr_accessor :pulp_href
|
19
|
+
|
20
|
+
# Timestamp of creation.
|
21
|
+
attr_accessor :pulp_created
|
22
|
+
|
23
|
+
attr_accessor :versions_href
|
24
|
+
|
25
|
+
attr_accessor :latest_version_href
|
26
|
+
|
27
|
+
# A unique name for this repository.
|
28
|
+
attr_accessor :name
|
29
|
+
|
30
|
+
# An optional description.
|
31
|
+
attr_accessor :description
|
32
|
+
|
33
|
+
attr_accessor :remote
|
34
|
+
|
35
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
36
|
+
def self.attribute_map
|
37
|
+
{
|
38
|
+
:'pulp_href' => :'pulp_href',
|
39
|
+
:'pulp_created' => :'pulp_created',
|
40
|
+
:'versions_href' => :'versions_href',
|
41
|
+
:'latest_version_href' => :'latest_version_href',
|
42
|
+
:'name' => :'name',
|
43
|
+
:'description' => :'description',
|
44
|
+
:'remote' => :'remote'
|
45
|
+
}
|
46
|
+
end
|
47
|
+
|
48
|
+
# Attribute type mapping.
|
49
|
+
def self.openapi_types
|
50
|
+
{
|
51
|
+
:'pulp_href' => :'String',
|
52
|
+
:'pulp_created' => :'DateTime',
|
53
|
+
:'versions_href' => :'String',
|
54
|
+
:'latest_version_href' => :'String',
|
55
|
+
:'name' => :'String',
|
56
|
+
:'description' => :'String',
|
57
|
+
:'remote' => :'String'
|
58
|
+
}
|
59
|
+
end
|
60
|
+
|
61
|
+
# List of attributes with nullable: true
|
62
|
+
def self.openapi_nullable
|
63
|
+
Set.new([
|
64
|
+
:'description',
|
65
|
+
:'remote'
|
66
|
+
])
|
67
|
+
end
|
68
|
+
|
69
|
+
# Initializes the object
|
70
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
71
|
+
def initialize(attributes = {})
|
72
|
+
if (!attributes.is_a?(Hash))
|
73
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `PulpNpmClient::NpmNpmRepositoryResponse` initialize method"
|
74
|
+
end
|
75
|
+
|
76
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
77
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
78
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
79
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `PulpNpmClient::NpmNpmRepositoryResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
80
|
+
end
|
81
|
+
h[k.to_sym] = v
|
82
|
+
}
|
83
|
+
|
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
|
+
if attributes.key?(:'versions_href')
|
93
|
+
self.versions_href = attributes[:'versions_href']
|
94
|
+
end
|
95
|
+
|
96
|
+
if attributes.key?(:'latest_version_href')
|
97
|
+
self.latest_version_href = attributes[:'latest_version_href']
|
98
|
+
end
|
99
|
+
|
100
|
+
if attributes.key?(:'name')
|
101
|
+
self.name = attributes[:'name']
|
102
|
+
end
|
103
|
+
|
104
|
+
if attributes.key?(:'description')
|
105
|
+
self.description = attributes[:'description']
|
106
|
+
end
|
107
|
+
|
108
|
+
if attributes.key?(:'remote')
|
109
|
+
self.remote = attributes[:'remote']
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
113
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
114
|
+
# @return Array for valid properties with the reasons
|
115
|
+
def list_invalid_properties
|
116
|
+
invalid_properties = Array.new
|
117
|
+
if @name.nil?
|
118
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
119
|
+
end
|
120
|
+
|
121
|
+
invalid_properties
|
122
|
+
end
|
123
|
+
|
124
|
+
# Check to see if the all the properties in the model are valid
|
125
|
+
# @return true if the model is valid
|
126
|
+
def valid?
|
127
|
+
return false if @name.nil?
|
128
|
+
true
|
129
|
+
end
|
130
|
+
|
131
|
+
# Checks equality by comparing each attribute.
|
132
|
+
# @param [Object] Object to be compared
|
133
|
+
def ==(o)
|
134
|
+
return true if self.equal?(o)
|
135
|
+
self.class == o.class &&
|
136
|
+
pulp_href == o.pulp_href &&
|
137
|
+
pulp_created == o.pulp_created &&
|
138
|
+
versions_href == o.versions_href &&
|
139
|
+
latest_version_href == o.latest_version_href &&
|
140
|
+
name == o.name &&
|
141
|
+
description == o.description &&
|
142
|
+
remote == o.remote
|
143
|
+
end
|
144
|
+
|
145
|
+
# @see the `==` method
|
146
|
+
# @param [Object] Object to be compared
|
147
|
+
def eql?(o)
|
148
|
+
self == o
|
149
|
+
end
|
150
|
+
|
151
|
+
# Calculates hash code according to all attributes.
|
152
|
+
# @return [Integer] Hash code
|
153
|
+
def hash
|
154
|
+
[pulp_href, pulp_created, versions_href, latest_version_href, name, description, remote].hash
|
155
|
+
end
|
156
|
+
|
157
|
+
# Builds the object from hash
|
158
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
159
|
+
# @return [Object] Returns the model itself
|
160
|
+
def self.build_from_hash(attributes)
|
161
|
+
new.build_from_hash(attributes)
|
162
|
+
end
|
163
|
+
|
164
|
+
# Builds the object from hash
|
165
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
166
|
+
# @return [Object] Returns the model itself
|
167
|
+
def build_from_hash(attributes)
|
168
|
+
return nil unless attributes.is_a?(Hash)
|
169
|
+
self.class.openapi_types.each_pair do |key, type|
|
170
|
+
if type =~ /\AArray<(.*)>/i
|
171
|
+
# check to ensure the input is an array given that the attribute
|
172
|
+
# is documented as an array but the input is not
|
173
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
174
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
175
|
+
end
|
176
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
177
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
178
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
179
|
+
end
|
180
|
+
|
181
|
+
self
|
182
|
+
end
|
183
|
+
|
184
|
+
# Deserializes the data based on type
|
185
|
+
# @param string type Data type
|
186
|
+
# @param string value Value to be deserialized
|
187
|
+
# @return [Object] Deserialized data
|
188
|
+
def _deserialize(type, value)
|
189
|
+
case type.to_sym
|
190
|
+
when :DateTime
|
191
|
+
DateTime.parse(value)
|
192
|
+
when :Date
|
193
|
+
Date.parse(value)
|
194
|
+
when :String
|
195
|
+
value.to_s
|
196
|
+
when :Integer
|
197
|
+
value.to_i
|
198
|
+
when :Float
|
199
|
+
value.to_f
|
200
|
+
when :Boolean
|
201
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
202
|
+
true
|
203
|
+
else
|
204
|
+
false
|
205
|
+
end
|
206
|
+
when :Object
|
207
|
+
# generic object (usually a Hash), return directly
|
208
|
+
value
|
209
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
210
|
+
inner_type = Regexp.last_match[:inner_type]
|
211
|
+
value.map { |v| _deserialize(inner_type, v) }
|
212
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
213
|
+
k_type = Regexp.last_match[:k_type]
|
214
|
+
v_type = Regexp.last_match[:v_type]
|
215
|
+
{}.tap do |hash|
|
216
|
+
value.each do |k, v|
|
217
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
218
|
+
end
|
219
|
+
end
|
220
|
+
else # model
|
221
|
+
PulpNpmClient.const_get(type).build_from_hash(value)
|
222
|
+
end
|
223
|
+
end
|
224
|
+
|
225
|
+
# Returns the string representation of the object
|
226
|
+
# @return [String] String presentation of the object
|
227
|
+
def to_s
|
228
|
+
to_hash.to_s
|
229
|
+
end
|
230
|
+
|
231
|
+
# to_body is an alias to to_hash (backward compatibility)
|
232
|
+
# @return [Hash] Returns the object in the form of hash
|
233
|
+
def to_body
|
234
|
+
to_hash
|
235
|
+
end
|
236
|
+
|
237
|
+
# Returns the object in the form of hash
|
238
|
+
# @return [Hash] Returns the object in the form of hash
|
239
|
+
def to_hash
|
240
|
+
hash = {}
|
241
|
+
self.class.attribute_map.each_pair do |attr, param|
|
242
|
+
value = self.send(attr)
|
243
|
+
if value.nil?
|
244
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
245
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
246
|
+
end
|
247
|
+
|
248
|
+
hash[param] = _to_hash(value)
|
249
|
+
end
|
250
|
+
hash
|
251
|
+
end
|
252
|
+
|
253
|
+
# Outputs non-array value in the form of hash
|
254
|
+
# For object, use to_hash. Otherwise, just return the value
|
255
|
+
# @param [Object] value Any valid value
|
256
|
+
# @return [Hash] Returns the value in the form of hash
|
257
|
+
def _to_hash(value)
|
258
|
+
if value.is_a?(Array)
|
259
|
+
value.compact.map { |v| _to_hash(v) }
|
260
|
+
elsif value.is_a?(Hash)
|
261
|
+
{}.tap do |hash|
|
262
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
263
|
+
end
|
264
|
+
elsif value.respond_to? :to_hash
|
265
|
+
value.to_hash
|
266
|
+
else
|
267
|
+
value
|
268
|
+
end
|
269
|
+
end
|
270
|
+
end
|
271
|
+
end
|
@@ -1,10 +1,10 @@
|
|
1
1
|
=begin
|
2
2
|
#Pulp 3 API
|
3
3
|
|
4
|
-
#
|
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,17 +13,19 @@ OpenAPI Generator version: 4.2.3
|
|
13
13
|
require 'date'
|
14
14
|
|
15
15
|
module PulpNpmClient
|
16
|
+
# A Serializer for Package. Add serializers for the new fields defined in Package and add those fields to the Meta class keeping fields from the parent class as well. For example:: field1 = serializers.TextField() field2 = serializers.IntegerField() field3 = serializers.CharField() class Meta: fields = platform.SingleArtifactContentSerializer.Meta.fields + ( 'field1', 'field2', 'field3' ) model = models.Package
|
16
17
|
class NpmPackage
|
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
|
attr_accessor :relative_path
|
26
22
|
|
23
|
+
# An uploaded file that may be turned into the artifact of the content unit.
|
24
|
+
attr_accessor :file
|
25
|
+
|
26
|
+
# A URI of a repository the new content unit should be associated with.
|
27
|
+
attr_accessor :repository
|
28
|
+
|
27
29
|
attr_accessor :name
|
28
30
|
|
29
31
|
attr_accessor :version
|
@@ -31,10 +33,10 @@ module PulpNpmClient
|
|
31
33
|
# Attribute mapping from ruby-style variable name to JSON key.
|
32
34
|
def self.attribute_map
|
33
35
|
{
|
34
|
-
:'pulp_href' => :'pulp_href',
|
35
|
-
:'pulp_created' => :'pulp_created',
|
36
36
|
:'artifact' => :'artifact',
|
37
37
|
:'relative_path' => :'relative_path',
|
38
|
+
:'file' => :'file',
|
39
|
+
:'repository' => :'repository',
|
38
40
|
:'name' => :'name',
|
39
41
|
:'version' => :'version'
|
40
42
|
}
|
@@ -43,10 +45,10 @@ module PulpNpmClient
|
|
43
45
|
# Attribute type mapping.
|
44
46
|
def self.openapi_types
|
45
47
|
{
|
46
|
-
:'pulp_href' => :'String',
|
47
|
-
:'pulp_created' => :'DateTime',
|
48
48
|
:'artifact' => :'String',
|
49
49
|
:'relative_path' => :'String',
|
50
|
+
:'file' => :'File',
|
51
|
+
:'repository' => :'String',
|
50
52
|
:'name' => :'String',
|
51
53
|
:'version' => :'String'
|
52
54
|
}
|
@@ -73,14 +75,6 @@ module PulpNpmClient
|
|
73
75
|
h[k.to_sym] = v
|
74
76
|
}
|
75
77
|
|
76
|
-
if attributes.key?(:'pulp_href')
|
77
|
-
self.pulp_href = attributes[:'pulp_href']
|
78
|
-
end
|
79
|
-
|
80
|
-
if attributes.key?(:'pulp_created')
|
81
|
-
self.pulp_created = attributes[:'pulp_created']
|
82
|
-
end
|
83
|
-
|
84
78
|
if attributes.key?(:'artifact')
|
85
79
|
self.artifact = attributes[:'artifact']
|
86
80
|
end
|
@@ -89,6 +83,14 @@ module PulpNpmClient
|
|
89
83
|
self.relative_path = attributes[:'relative_path']
|
90
84
|
end
|
91
85
|
|
86
|
+
if attributes.key?(:'file')
|
87
|
+
self.file = attributes[:'file']
|
88
|
+
end
|
89
|
+
|
90
|
+
if attributes.key?(:'repository')
|
91
|
+
self.repository = attributes[:'repository']
|
92
|
+
end
|
93
|
+
|
92
94
|
if attributes.key?(:'name')
|
93
95
|
self.name = attributes[:'name']
|
94
96
|
end
|
@@ -106,26 +108,14 @@ module PulpNpmClient
|
|
106
108
|
invalid_properties.push('invalid value for "relative_path", relative_path cannot be nil.')
|
107
109
|
end
|
108
110
|
|
109
|
-
if @relative_path.to_s.length < 1
|
110
|
-
invalid_properties.push('invalid value for "relative_path", the character length must be great than or equal to 1.')
|
111
|
-
end
|
112
|
-
|
113
111
|
if @name.nil?
|
114
112
|
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
115
113
|
end
|
116
114
|
|
117
|
-
if @name.to_s.length < 1
|
118
|
-
invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
|
119
|
-
end
|
120
|
-
|
121
115
|
if @version.nil?
|
122
116
|
invalid_properties.push('invalid value for "version", version cannot be nil.')
|
123
117
|
end
|
124
118
|
|
125
|
-
if @version.to_s.length < 1
|
126
|
-
invalid_properties.push('invalid value for "version", the character length must be great than or equal to 1.')
|
127
|
-
end
|
128
|
-
|
129
119
|
invalid_properties
|
130
120
|
end
|
131
121
|
|
@@ -133,65 +123,20 @@ module PulpNpmClient
|
|
133
123
|
# @return true if the model is valid
|
134
124
|
def valid?
|
135
125
|
return false if @relative_path.nil?
|
136
|
-
return false if @relative_path.to_s.length < 1
|
137
126
|
return false if @name.nil?
|
138
|
-
return false if @name.to_s.length < 1
|
139
127
|
return false if @version.nil?
|
140
|
-
return false if @version.to_s.length < 1
|
141
128
|
true
|
142
129
|
end
|
143
130
|
|
144
|
-
# Custom attribute writer method with validation
|
145
|
-
# @param [Object] relative_path Value to be assigned
|
146
|
-
def relative_path=(relative_path)
|
147
|
-
if relative_path.nil?
|
148
|
-
fail ArgumentError, 'relative_path cannot be nil'
|
149
|
-
end
|
150
|
-
|
151
|
-
if relative_path.to_s.length < 1
|
152
|
-
fail ArgumentError, 'invalid value for "relative_path", the character length must be great than or equal to 1.'
|
153
|
-
end
|
154
|
-
|
155
|
-
@relative_path = relative_path
|
156
|
-
end
|
157
|
-
|
158
|
-
# Custom attribute writer method with validation
|
159
|
-
# @param [Object] name Value to be assigned
|
160
|
-
def name=(name)
|
161
|
-
if name.nil?
|
162
|
-
fail ArgumentError, 'name cannot be nil'
|
163
|
-
end
|
164
|
-
|
165
|
-
if name.to_s.length < 1
|
166
|
-
fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
|
167
|
-
end
|
168
|
-
|
169
|
-
@name = name
|
170
|
-
end
|
171
|
-
|
172
|
-
# Custom attribute writer method with validation
|
173
|
-
# @param [Object] version Value to be assigned
|
174
|
-
def version=(version)
|
175
|
-
if version.nil?
|
176
|
-
fail ArgumentError, 'version cannot be nil'
|
177
|
-
end
|
178
|
-
|
179
|
-
if version.to_s.length < 1
|
180
|
-
fail ArgumentError, 'invalid value for "version", the character length must be great than or equal to 1.'
|
181
|
-
end
|
182
|
-
|
183
|
-
@version = version
|
184
|
-
end
|
185
|
-
|
186
131
|
# Checks equality by comparing each attribute.
|
187
132
|
# @param [Object] Object to be compared
|
188
133
|
def ==(o)
|
189
134
|
return true if self.equal?(o)
|
190
135
|
self.class == o.class &&
|
191
|
-
pulp_href == o.pulp_href &&
|
192
|
-
pulp_created == o.pulp_created &&
|
193
136
|
artifact == o.artifact &&
|
194
137
|
relative_path == o.relative_path &&
|
138
|
+
file == o.file &&
|
139
|
+
repository == o.repository &&
|
195
140
|
name == o.name &&
|
196
141
|
version == o.version
|
197
142
|
end
|
@@ -205,7 +150,7 @@ module PulpNpmClient
|
|
205
150
|
# Calculates hash code according to all attributes.
|
206
151
|
# @return [Integer] Hash code
|
207
152
|
def hash
|
208
|
-
[
|
153
|
+
[artifact, relative_path, file, repository, name, version].hash
|
209
154
|
end
|
210
155
|
|
211
156
|
# Builds the object from hash
|