pulp_deb_client 2.21.2 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +35 -7
- data/docs/ContentGenericContentsApi.md +7 -5
- data/docs/ContentInstallerFileIndicesApi.md +3 -1
- data/docs/ContentInstallerPackagesApi.md +7 -5
- data/docs/ContentPackageIndicesApi.md +3 -1
- data/docs/ContentPackageReleaseComponentsApi.md +3 -1
- data/docs/ContentPackagesApi.md +27 -5
- data/docs/ContentReleaseArchitecturesApi.md +5 -7
- data/docs/ContentReleaseComponentsApi.md +7 -7
- data/docs/ContentReleaseFilesApi.md +3 -1
- data/docs/ContentReleasesApi.md +13 -3
- data/docs/ContentSourceIndicesApi.md +204 -0
- data/docs/ContentSourcePackagesApi.md +258 -0
- data/docs/ContentSourceReleaseComponentsApi.md +202 -0
- data/docs/DebAptPublication.md +4 -2
- data/docs/DebAptPublicationResponse.md +4 -2
- data/docs/DebAptRepository.md +7 -1
- data/docs/DebAptRepositoryResponse.md +7 -1
- data/docs/DebCopyApi.md +1 -1
- data/docs/DebGenericContent.md +2 -2
- data/docs/DebInstallerPackage.md +2 -2
- data/docs/DebPackage.md +2 -2
- data/docs/DebRelease.md +9 -1
- data/docs/DebReleaseArchitecture.md +1 -5
- data/docs/DebReleaseArchitectureResponse.md +1 -5
- data/docs/DebReleaseComponent.md +1 -5
- data/docs/DebReleaseComponentResponse.md +1 -5
- data/docs/DebReleaseFile.md +3 -3
- data/docs/DebReleaseFileResponse.md +3 -3
- data/docs/DebReleaseResponse.md +9 -1
- data/docs/DebSourceIndex.md +25 -0
- data/docs/DebSourceIndexResponse.md +27 -0
- data/docs/DebSourcePackage.md +21 -0
- data/docs/DebSourcePackageReleaseComponent.md +21 -0
- data/docs/DebSourcePackageReleaseComponentResponse.md +23 -0
- data/docs/DebSourcePackageResponse.md +77 -0
- data/docs/DistributionsAptApi.md +123 -1
- data/docs/PaginateddebSourceIndexResponseList.md +23 -0
- data/docs/PaginateddebSourcePackageReleaseComponentResponseList.md +23 -0
- data/docs/PaginateddebSourcePackageResponseList.md +23 -0
- data/docs/PatcheddebAptRepository.md +7 -1
- data/docs/PublicationsAptApi.md +3 -1
- data/docs/PublicationsVerbatimApi.md +3 -1
- data/docs/RemotesAptApi.md +123 -1
- data/docs/RepositoriesAptApi.md +123 -1
- data/docs/RepositoriesAptVersionsApi.md +3 -1
- data/docs/SetLabel.md +19 -0
- data/docs/SetLabelResponse.md +19 -0
- data/docs/UnsetLabel.md +17 -0
- data/docs/UnsetLabelResponse.md +19 -0
- data/lib/pulp_deb_client/api/content_generic_contents_api.rb +7 -4
- data/lib/pulp_deb_client/api/content_installer_file_indices_api.rb +3 -0
- data/lib/pulp_deb_client/api/content_installer_packages_api.rb +7 -4
- data/lib/pulp_deb_client/api/content_package_indices_api.rb +3 -0
- data/lib/pulp_deb_client/api/content_package_release_components_api.rb +3 -0
- data/lib/pulp_deb_client/api/content_packages_api.rb +37 -4
- data/lib/pulp_deb_client/api/content_release_architectures_api.rb +6 -9
- data/lib/pulp_deb_client/api/content_release_components_api.rb +9 -9
- data/lib/pulp_deb_client/api/content_release_files_api.rb +3 -0
- data/lib/pulp_deb_client/api/content_releases_api.rb +18 -3
- data/lib/pulp_deb_client/api/content_source_indices_api.rb +256 -0
- data/lib/pulp_deb_client/api/content_source_packages_api.rb +337 -0
- data/lib/pulp_deb_client/api/content_source_release_components_api.rb +253 -0
- data/lib/pulp_deb_client/api/distributions_apt_api.rb +155 -0
- data/lib/pulp_deb_client/api/publications_apt_api.rb +3 -0
- data/lib/pulp_deb_client/api/publications_verbatim_api.rb +3 -0
- data/lib/pulp_deb_client/api/remotes_apt_api.rb +155 -0
- data/lib/pulp_deb_client/api/repositories_apt_api.rb +155 -0
- data/lib/pulp_deb_client/api/repositories_apt_versions_api.rb +3 -0
- data/lib/pulp_deb_client/configuration.rb +2 -2
- data/lib/pulp_deb_client/models/deb_apt_publication.rb +14 -5
- data/lib/pulp_deb_client/models/deb_apt_publication_response.rb +14 -5
- data/lib/pulp_deb_client/models/deb_apt_repository.rb +38 -5
- data/lib/pulp_deb_client/models/deb_apt_repository_response.rb +38 -5
- data/lib/pulp_deb_client/models/deb_generic_content.rb +2 -2
- data/lib/pulp_deb_client/models/deb_installer_package.rb +2 -2
- data/lib/pulp_deb_client/models/deb_package.rb +2 -2
- data/lib/pulp_deb_client/models/deb_release.rb +104 -4
- data/lib/pulp_deb_client/models/deb_release_architecture.rb +4 -70
- data/lib/pulp_deb_client/models/deb_release_architecture_response.rb +4 -32
- data/lib/pulp_deb_client/models/deb_release_component.rb +4 -70
- data/lib/pulp_deb_client/models/deb_release_component_response.rb +4 -32
- data/lib/pulp_deb_client/models/deb_release_file.rb +3 -3
- data/lib/pulp_deb_client/models/deb_release_file_response.rb +3 -3
- data/lib/pulp_deb_client/models/deb_release_response.rb +44 -4
- data/lib/pulp_deb_client/models/deb_source_index.rb +297 -0
- data/lib/pulp_deb_client/models/deb_source_index_response.rb +272 -0
- data/lib/pulp_deb_client/models/deb_source_package.rb +248 -0
- data/lib/pulp_deb_client/models/deb_source_package_release_component.rb +238 -0
- data/lib/pulp_deb_client/models/deb_source_package_release_component_response.rb +247 -0
- data/lib/pulp_deb_client/models/deb_source_package_response.rb +485 -0
- data/lib/pulp_deb_client/models/paginateddeb_source_index_response_list.rb +237 -0
- data/lib/pulp_deb_client/models/paginateddeb_source_package_release_component_response_list.rb +237 -0
- data/lib/pulp_deb_client/models/paginateddeb_source_package_response_list.rb +237 -0
- data/lib/pulp_deb_client/models/patcheddeb_apt_repository.rb +38 -5
- data/lib/pulp_deb_client/models/set_label.rb +252 -0
- data/lib/pulp_deb_client/models/set_label_response.rb +243 -0
- data/lib/pulp_deb_client/models/unset_label.rb +242 -0
- data/lib/pulp_deb_client/models/unset_label_response.rb +242 -0
- data/lib/pulp_deb_client/version.rb +1 -1
- data/lib/pulp_deb_client.rb +16 -0
- data/spec/api/content_generic_contents_api_spec.rb +3 -2
- data/spec/api/content_installer_file_indices_api_spec.rb +1 -0
- data/spec/api/content_installer_packages_api_spec.rb +3 -2
- data/spec/api/content_package_indices_api_spec.rb +1 -0
- data/spec/api/content_package_release_components_api_spec.rb +1 -0
- data/spec/api/content_packages_api_spec.rb +13 -2
- data/spec/api/content_release_architectures_api_spec.rb +2 -3
- data/spec/api/content_release_components_api_spec.rb +3 -3
- data/spec/api/content_release_files_api_spec.rb +1 -0
- data/spec/api/content_releases_api_spec.rb +6 -1
- data/spec/api/content_source_indices_api_spec.rb +86 -0
- data/spec/api/content_source_packages_api_spec.rb +113 -0
- data/spec/api/content_source_release_components_api_spec.rb +85 -0
- data/spec/api/distributions_apt_api_spec.rb +31 -0
- data/spec/api/publications_apt_api_spec.rb +1 -0
- data/spec/api/publications_verbatim_api_spec.rb +1 -0
- data/spec/api/remotes_apt_api_spec.rb +31 -0
- data/spec/api/repositories_apt_api_spec.rb +31 -0
- data/spec/api/repositories_apt_versions_api_spec.rb +1 -0
- data/spec/configuration_spec.rb +3 -3
- data/spec/models/deb_apt_publication_response_spec.rb +6 -0
- data/spec/models/deb_apt_publication_spec.rb +6 -0
- data/spec/models/deb_apt_repository_response_spec.rb +18 -0
- data/spec/models/deb_apt_repository_spec.rb +18 -0
- data/spec/models/deb_release_architecture_response_spec.rb +0 -12
- data/spec/models/deb_release_architecture_spec.rb +0 -12
- data/spec/models/deb_release_component_response_spec.rb +0 -12
- data/spec/models/deb_release_component_spec.rb +0 -12
- data/spec/models/deb_release_response_spec.rb +24 -0
- data/spec/models/deb_release_spec.rb +24 -0
- data/spec/models/deb_source_index_response_spec.rb +71 -0
- data/spec/models/deb_source_index_spec.rb +65 -0
- data/spec/models/deb_source_package_release_component_response_spec.rb +59 -0
- data/spec/models/deb_source_package_release_component_spec.rb +53 -0
- data/spec/models/deb_source_package_response_spec.rb +221 -0
- data/spec/models/deb_source_package_spec.rb +53 -0
- data/spec/models/paginateddeb_source_index_response_list_spec.rb +59 -0
- data/spec/models/paginateddeb_source_package_release_component_response_list_spec.rb +59 -0
- data/spec/models/paginateddeb_source_package_response_list_spec.rb +59 -0
- data/spec/models/patcheddeb_apt_repository_spec.rb +18 -0
- data/spec/models/set_label_response_spec.rb +47 -0
- data/spec/models/set_label_spec.rb +47 -0
- data/spec/models/unset_label_response_spec.rb +47 -0
- data/spec/models/unset_label_spec.rb +41 -0
- metadata +122 -58
@@ -29,6 +29,15 @@ module PulpDebClient
|
|
29
29
|
# An optional remote to use by default when syncing.
|
30
30
|
attr_accessor :remote
|
31
31
|
|
32
|
+
# Previously, pulp_deb only synced the Release file fields codename and suite, now version, origin, label, and description are also synced. Setting this setting to False will make Pulp revert to the old behaviour of using it's own internal values for the new fields during publish. This is primarily intended to avoid a sudden change in behaviour for existing Pulp repositories, since many Release file field changes need to be accepted by hosts consuming the published repository. The default for new repositories is True.
|
33
|
+
attr_accessor :publish_upstream_release_fields
|
34
|
+
|
35
|
+
# A reference to an associated signing service. Used if AptPublication.signing_service is not set
|
36
|
+
attr_accessor :signing_service
|
37
|
+
|
38
|
+
# A dictionary of Release distributions and the Signing Service URLs they should use.Example: {\"bionic\": \"/pulp/api/v3/signing-services/433a1f70-c589-4413-a803-c50b842ea9b5/\"}
|
39
|
+
attr_accessor :signing_service_release_overrides
|
40
|
+
|
32
41
|
# Attribute mapping from ruby-style variable name to JSON key.
|
33
42
|
def self.attribute_map
|
34
43
|
{
|
@@ -36,7 +45,10 @@ module PulpDebClient
|
|
36
45
|
:'name' => :'name',
|
37
46
|
:'description' => :'description',
|
38
47
|
:'retain_repo_versions' => :'retain_repo_versions',
|
39
|
-
:'remote' => :'remote'
|
48
|
+
:'remote' => :'remote',
|
49
|
+
:'publish_upstream_release_fields' => :'publish_upstream_release_fields',
|
50
|
+
:'signing_service' => :'signing_service',
|
51
|
+
:'signing_service_release_overrides' => :'signing_service_release_overrides'
|
40
52
|
}
|
41
53
|
end
|
42
54
|
|
@@ -47,7 +59,10 @@ module PulpDebClient
|
|
47
59
|
:'name' => :'String',
|
48
60
|
:'description' => :'String',
|
49
61
|
:'retain_repo_versions' => :'Integer',
|
50
|
-
:'remote' => :'String'
|
62
|
+
:'remote' => :'String',
|
63
|
+
:'publish_upstream_release_fields' => :'Boolean',
|
64
|
+
:'signing_service' => :'String',
|
65
|
+
:'signing_service_release_overrides' => :'Hash<String, String>'
|
51
66
|
}
|
52
67
|
end
|
53
68
|
|
@@ -56,7 +71,8 @@ module PulpDebClient
|
|
56
71
|
Set.new([
|
57
72
|
:'description',
|
58
73
|
:'retain_repo_versions',
|
59
|
-
:'remote'
|
74
|
+
:'remote',
|
75
|
+
:'signing_service',
|
60
76
|
])
|
61
77
|
end
|
62
78
|
|
@@ -96,6 +112,20 @@ module PulpDebClient
|
|
96
112
|
if attributes.key?(:'remote')
|
97
113
|
self.remote = attributes[:'remote']
|
98
114
|
end
|
115
|
+
|
116
|
+
if attributes.key?(:'publish_upstream_release_fields')
|
117
|
+
self.publish_upstream_release_fields = attributes[:'publish_upstream_release_fields']
|
118
|
+
end
|
119
|
+
|
120
|
+
if attributes.key?(:'signing_service')
|
121
|
+
self.signing_service = attributes[:'signing_service']
|
122
|
+
end
|
123
|
+
|
124
|
+
if attributes.key?(:'signing_service_release_overrides')
|
125
|
+
if (value = attributes[:'signing_service_release_overrides']).is_a?(Hash)
|
126
|
+
self.signing_service_release_overrides = value
|
127
|
+
end
|
128
|
+
end
|
99
129
|
end
|
100
130
|
|
101
131
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -165,7 +195,10 @@ module PulpDebClient
|
|
165
195
|
name == o.name &&
|
166
196
|
description == o.description &&
|
167
197
|
retain_repo_versions == o.retain_repo_versions &&
|
168
|
-
remote == o.remote
|
198
|
+
remote == o.remote &&
|
199
|
+
publish_upstream_release_fields == o.publish_upstream_release_fields &&
|
200
|
+
signing_service == o.signing_service &&
|
201
|
+
signing_service_release_overrides == o.signing_service_release_overrides
|
169
202
|
end
|
170
203
|
|
171
204
|
# @see the `==` method
|
@@ -177,7 +210,7 @@ module PulpDebClient
|
|
177
210
|
# Calculates hash code according to all attributes.
|
178
211
|
# @return [Integer] Hash code
|
179
212
|
def hash
|
180
|
-
[pulp_labels, name, description, retain_repo_versions, remote].hash
|
213
|
+
[pulp_labels, name, description, retain_repo_versions, remote, publish_upstream_release_fields, signing_service, signing_service_release_overrides].hash
|
181
214
|
end
|
182
215
|
|
183
216
|
# Builds the object from hash
|
@@ -0,0 +1,252 @@
|
|
1
|
+
=begin
|
2
|
+
#Pulp 3 API
|
3
|
+
|
4
|
+
#Fetch, Upload, Organize, and Distribute Software Packages
|
5
|
+
|
6
|
+
The version of the OpenAPI document: v3
|
7
|
+
Contact: pulp-list@redhat.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.3.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module PulpDebClient
|
16
|
+
# Serializer for synchronously setting a label.
|
17
|
+
class SetLabel
|
18
|
+
attr_accessor :key
|
19
|
+
|
20
|
+
attr_accessor :value
|
21
|
+
|
22
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
23
|
+
def self.attribute_map
|
24
|
+
{
|
25
|
+
:'key' => :'key',
|
26
|
+
:'value' => :'value'
|
27
|
+
}
|
28
|
+
end
|
29
|
+
|
30
|
+
# Attribute type mapping.
|
31
|
+
def self.openapi_types
|
32
|
+
{
|
33
|
+
:'key' => :'String',
|
34
|
+
:'value' => :'String'
|
35
|
+
}
|
36
|
+
end
|
37
|
+
|
38
|
+
# List of attributes with nullable: true
|
39
|
+
def self.openapi_nullable
|
40
|
+
Set.new([
|
41
|
+
:'value'
|
42
|
+
])
|
43
|
+
end
|
44
|
+
|
45
|
+
# Initializes the object
|
46
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
47
|
+
def initialize(attributes = {})
|
48
|
+
if (!attributes.is_a?(Hash))
|
49
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `PulpDebClient::SetLabel` initialize method"
|
50
|
+
end
|
51
|
+
|
52
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
53
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
54
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
55
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `PulpDebClient::SetLabel`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
56
|
+
end
|
57
|
+
h[k.to_sym] = v
|
58
|
+
}
|
59
|
+
|
60
|
+
if attributes.key?(:'key')
|
61
|
+
self.key = attributes[:'key']
|
62
|
+
end
|
63
|
+
|
64
|
+
if attributes.key?(:'value')
|
65
|
+
self.value = attributes[:'value']
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
70
|
+
# @return Array for valid properties with the reasons
|
71
|
+
def list_invalid_properties
|
72
|
+
invalid_properties = Array.new
|
73
|
+
if @key.nil?
|
74
|
+
invalid_properties.push('invalid value for "key", key cannot be nil.')
|
75
|
+
end
|
76
|
+
|
77
|
+
if @key.to_s.length < 1
|
78
|
+
invalid_properties.push('invalid value for "key", the character length must be great than or equal to 1.')
|
79
|
+
end
|
80
|
+
|
81
|
+
pattern = Regexp.new(/^[-a-zA-Z0-9_]+$/)
|
82
|
+
if @key !~ pattern
|
83
|
+
invalid_properties.push("invalid value for \"key\", must conform to the pattern #{pattern}.")
|
84
|
+
end
|
85
|
+
|
86
|
+
invalid_properties
|
87
|
+
end
|
88
|
+
|
89
|
+
# Check to see if the all the properties in the model are valid
|
90
|
+
# @return true if the model is valid
|
91
|
+
def valid?
|
92
|
+
return false if @key.nil?
|
93
|
+
return false if @key.to_s.length < 1
|
94
|
+
return false if @key !~ Regexp.new(/^[-a-zA-Z0-9_]+$/)
|
95
|
+
true
|
96
|
+
end
|
97
|
+
|
98
|
+
# Custom attribute writer method with validation
|
99
|
+
# @param [Object] key Value to be assigned
|
100
|
+
def key=(key)
|
101
|
+
if key.nil?
|
102
|
+
fail ArgumentError, 'key cannot be nil'
|
103
|
+
end
|
104
|
+
|
105
|
+
if key.to_s.length < 1
|
106
|
+
fail ArgumentError, 'invalid value for "key", the character length must be great than or equal to 1.'
|
107
|
+
end
|
108
|
+
|
109
|
+
pattern = Regexp.new(/^[-a-zA-Z0-9_]+$/)
|
110
|
+
if key !~ pattern
|
111
|
+
fail ArgumentError, "invalid value for \"key\", must conform to the pattern #{pattern}."
|
112
|
+
end
|
113
|
+
|
114
|
+
@key = key
|
115
|
+
end
|
116
|
+
|
117
|
+
# Checks equality by comparing each attribute.
|
118
|
+
# @param [Object] Object to be compared
|
119
|
+
def ==(o)
|
120
|
+
return true if self.equal?(o)
|
121
|
+
self.class == o.class &&
|
122
|
+
key == o.key &&
|
123
|
+
value == o.value
|
124
|
+
end
|
125
|
+
|
126
|
+
# @see the `==` method
|
127
|
+
# @param [Object] Object to be compared
|
128
|
+
def eql?(o)
|
129
|
+
self == o
|
130
|
+
end
|
131
|
+
|
132
|
+
# Calculates hash code according to all attributes.
|
133
|
+
# @return [Integer] Hash code
|
134
|
+
def hash
|
135
|
+
[key, value].hash
|
136
|
+
end
|
137
|
+
|
138
|
+
# Builds the object from hash
|
139
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
140
|
+
# @return [Object] Returns the model itself
|
141
|
+
def self.build_from_hash(attributes)
|
142
|
+
new.build_from_hash(attributes)
|
143
|
+
end
|
144
|
+
|
145
|
+
# Builds the object from hash
|
146
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
147
|
+
# @return [Object] Returns the model itself
|
148
|
+
def build_from_hash(attributes)
|
149
|
+
return nil unless attributes.is_a?(Hash)
|
150
|
+
self.class.openapi_types.each_pair do |key, type|
|
151
|
+
if type =~ /\AArray<(.*)>/i
|
152
|
+
# check to ensure the input is an array given that the attribute
|
153
|
+
# is documented as an array but the input is not
|
154
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
155
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
156
|
+
end
|
157
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
158
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
159
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
160
|
+
end
|
161
|
+
|
162
|
+
self
|
163
|
+
end
|
164
|
+
|
165
|
+
# Deserializes the data based on type
|
166
|
+
# @param string type Data type
|
167
|
+
# @param string value Value to be deserialized
|
168
|
+
# @return [Object] Deserialized data
|
169
|
+
def _deserialize(type, value)
|
170
|
+
case type.to_sym
|
171
|
+
when :DateTime
|
172
|
+
DateTime.parse(value)
|
173
|
+
when :Date
|
174
|
+
Date.parse(value)
|
175
|
+
when :String
|
176
|
+
value.to_s
|
177
|
+
when :Integer
|
178
|
+
value.to_i
|
179
|
+
when :Float
|
180
|
+
value.to_f
|
181
|
+
when :Boolean
|
182
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
183
|
+
true
|
184
|
+
else
|
185
|
+
false
|
186
|
+
end
|
187
|
+
when :Object
|
188
|
+
# generic object (usually a Hash), return directly
|
189
|
+
value
|
190
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
191
|
+
inner_type = Regexp.last_match[:inner_type]
|
192
|
+
value.map { |v| _deserialize(inner_type, v) }
|
193
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
194
|
+
k_type = Regexp.last_match[:k_type]
|
195
|
+
v_type = Regexp.last_match[:v_type]
|
196
|
+
{}.tap do |hash|
|
197
|
+
value.each do |k, v|
|
198
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
199
|
+
end
|
200
|
+
end
|
201
|
+
else # model
|
202
|
+
PulpDebClient.const_get(type).build_from_hash(value)
|
203
|
+
end
|
204
|
+
end
|
205
|
+
|
206
|
+
# Returns the string representation of the object
|
207
|
+
# @return [String] String presentation of the object
|
208
|
+
def to_s
|
209
|
+
to_hash.to_s
|
210
|
+
end
|
211
|
+
|
212
|
+
# to_body is an alias to to_hash (backward compatibility)
|
213
|
+
# @return [Hash] Returns the object in the form of hash
|
214
|
+
def to_body
|
215
|
+
to_hash
|
216
|
+
end
|
217
|
+
|
218
|
+
# Returns the object in the form of hash
|
219
|
+
# @return [Hash] Returns the object in the form of hash
|
220
|
+
def to_hash
|
221
|
+
hash = {}
|
222
|
+
self.class.attribute_map.each_pair do |attr, param|
|
223
|
+
value = self.send(attr)
|
224
|
+
if value.nil?
|
225
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
226
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
227
|
+
end
|
228
|
+
|
229
|
+
hash[param] = _to_hash(value)
|
230
|
+
end
|
231
|
+
hash
|
232
|
+
end
|
233
|
+
|
234
|
+
# Outputs non-array value in the form of hash
|
235
|
+
# For object, use to_hash. Otherwise, just return the value
|
236
|
+
# @param [Object] value Any valid value
|
237
|
+
# @return [Hash] Returns the value in the form of hash
|
238
|
+
def _to_hash(value)
|
239
|
+
if value.is_a?(Array)
|
240
|
+
value.compact.map { |v| _to_hash(v) }
|
241
|
+
elsif value.is_a?(Hash)
|
242
|
+
{}.tap do |hash|
|
243
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
244
|
+
end
|
245
|
+
elsif value.respond_to? :to_hash
|
246
|
+
value.to_hash
|
247
|
+
else
|
248
|
+
value
|
249
|
+
end
|
250
|
+
end
|
251
|
+
end
|
252
|
+
end
|
@@ -0,0 +1,243 @@
|
|
1
|
+
=begin
|
2
|
+
#Pulp 3 API
|
3
|
+
|
4
|
+
#Fetch, Upload, Organize, and Distribute Software Packages
|
5
|
+
|
6
|
+
The version of the OpenAPI document: v3
|
7
|
+
Contact: pulp-list@redhat.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.3.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module PulpDebClient
|
16
|
+
# Serializer for synchronously setting a label.
|
17
|
+
class SetLabelResponse
|
18
|
+
attr_accessor :key
|
19
|
+
|
20
|
+
attr_accessor :value
|
21
|
+
|
22
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
23
|
+
def self.attribute_map
|
24
|
+
{
|
25
|
+
:'key' => :'key',
|
26
|
+
:'value' => :'value'
|
27
|
+
}
|
28
|
+
end
|
29
|
+
|
30
|
+
# Attribute type mapping.
|
31
|
+
def self.openapi_types
|
32
|
+
{
|
33
|
+
:'key' => :'String',
|
34
|
+
:'value' => :'String'
|
35
|
+
}
|
36
|
+
end
|
37
|
+
|
38
|
+
# List of attributes with nullable: true
|
39
|
+
def self.openapi_nullable
|
40
|
+
Set.new([
|
41
|
+
:'value'
|
42
|
+
])
|
43
|
+
end
|
44
|
+
|
45
|
+
# Initializes the object
|
46
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
47
|
+
def initialize(attributes = {})
|
48
|
+
if (!attributes.is_a?(Hash))
|
49
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `PulpDebClient::SetLabelResponse` initialize method"
|
50
|
+
end
|
51
|
+
|
52
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
53
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
54
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
55
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `PulpDebClient::SetLabelResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
56
|
+
end
|
57
|
+
h[k.to_sym] = v
|
58
|
+
}
|
59
|
+
|
60
|
+
if attributes.key?(:'key')
|
61
|
+
self.key = attributes[:'key']
|
62
|
+
end
|
63
|
+
|
64
|
+
if attributes.key?(:'value')
|
65
|
+
self.value = attributes[:'value']
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
70
|
+
# @return Array for valid properties with the reasons
|
71
|
+
def list_invalid_properties
|
72
|
+
invalid_properties = Array.new
|
73
|
+
if @key.nil?
|
74
|
+
invalid_properties.push('invalid value for "key", key cannot be nil.')
|
75
|
+
end
|
76
|
+
|
77
|
+
pattern = Regexp.new(/^[-a-zA-Z0-9_]+$/)
|
78
|
+
if @key !~ pattern
|
79
|
+
invalid_properties.push("invalid value for \"key\", must conform to the pattern #{pattern}.")
|
80
|
+
end
|
81
|
+
|
82
|
+
invalid_properties
|
83
|
+
end
|
84
|
+
|
85
|
+
# Check to see if the all the properties in the model are valid
|
86
|
+
# @return true if the model is valid
|
87
|
+
def valid?
|
88
|
+
return false if @key.nil?
|
89
|
+
return false if @key !~ Regexp.new(/^[-a-zA-Z0-9_]+$/)
|
90
|
+
true
|
91
|
+
end
|
92
|
+
|
93
|
+
# Custom attribute writer method with validation
|
94
|
+
# @param [Object] key Value to be assigned
|
95
|
+
def key=(key)
|
96
|
+
if key.nil?
|
97
|
+
fail ArgumentError, 'key cannot be nil'
|
98
|
+
end
|
99
|
+
|
100
|
+
pattern = Regexp.new(/^[-a-zA-Z0-9_]+$/)
|
101
|
+
if key !~ pattern
|
102
|
+
fail ArgumentError, "invalid value for \"key\", must conform to the pattern #{pattern}."
|
103
|
+
end
|
104
|
+
|
105
|
+
@key = key
|
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
|
+
key == o.key &&
|
114
|
+
value == o.value
|
115
|
+
end
|
116
|
+
|
117
|
+
# @see the `==` method
|
118
|
+
# @param [Object] Object to be compared
|
119
|
+
def eql?(o)
|
120
|
+
self == o
|
121
|
+
end
|
122
|
+
|
123
|
+
# Calculates hash code according to all attributes.
|
124
|
+
# @return [Integer] Hash code
|
125
|
+
def hash
|
126
|
+
[key, value].hash
|
127
|
+
end
|
128
|
+
|
129
|
+
# Builds the object from hash
|
130
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
131
|
+
# @return [Object] Returns the model itself
|
132
|
+
def self.build_from_hash(attributes)
|
133
|
+
new.build_from_hash(attributes)
|
134
|
+
end
|
135
|
+
|
136
|
+
# Builds the object from hash
|
137
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
138
|
+
# @return [Object] Returns the model itself
|
139
|
+
def build_from_hash(attributes)
|
140
|
+
return nil unless attributes.is_a?(Hash)
|
141
|
+
self.class.openapi_types.each_pair do |key, type|
|
142
|
+
if type =~ /\AArray<(.*)>/i
|
143
|
+
# check to ensure the input is an array given that the attribute
|
144
|
+
# is documented as an array but the input is not
|
145
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
146
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
147
|
+
end
|
148
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
149
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
150
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
151
|
+
end
|
152
|
+
|
153
|
+
self
|
154
|
+
end
|
155
|
+
|
156
|
+
# Deserializes the data based on type
|
157
|
+
# @param string type Data type
|
158
|
+
# @param string value Value to be deserialized
|
159
|
+
# @return [Object] Deserialized data
|
160
|
+
def _deserialize(type, value)
|
161
|
+
case type.to_sym
|
162
|
+
when :DateTime
|
163
|
+
DateTime.parse(value)
|
164
|
+
when :Date
|
165
|
+
Date.parse(value)
|
166
|
+
when :String
|
167
|
+
value.to_s
|
168
|
+
when :Integer
|
169
|
+
value.to_i
|
170
|
+
when :Float
|
171
|
+
value.to_f
|
172
|
+
when :Boolean
|
173
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
174
|
+
true
|
175
|
+
else
|
176
|
+
false
|
177
|
+
end
|
178
|
+
when :Object
|
179
|
+
# generic object (usually a Hash), return directly
|
180
|
+
value
|
181
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
182
|
+
inner_type = Regexp.last_match[:inner_type]
|
183
|
+
value.map { |v| _deserialize(inner_type, v) }
|
184
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
185
|
+
k_type = Regexp.last_match[:k_type]
|
186
|
+
v_type = Regexp.last_match[:v_type]
|
187
|
+
{}.tap do |hash|
|
188
|
+
value.each do |k, v|
|
189
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
190
|
+
end
|
191
|
+
end
|
192
|
+
else # model
|
193
|
+
PulpDebClient.const_get(type).build_from_hash(value)
|
194
|
+
end
|
195
|
+
end
|
196
|
+
|
197
|
+
# Returns the string representation of the object
|
198
|
+
# @return [String] String presentation of the object
|
199
|
+
def to_s
|
200
|
+
to_hash.to_s
|
201
|
+
end
|
202
|
+
|
203
|
+
# to_body is an alias to to_hash (backward compatibility)
|
204
|
+
# @return [Hash] Returns the object in the form of hash
|
205
|
+
def to_body
|
206
|
+
to_hash
|
207
|
+
end
|
208
|
+
|
209
|
+
# Returns the object in the form of hash
|
210
|
+
# @return [Hash] Returns the object in the form of hash
|
211
|
+
def to_hash
|
212
|
+
hash = {}
|
213
|
+
self.class.attribute_map.each_pair do |attr, param|
|
214
|
+
value = self.send(attr)
|
215
|
+
if value.nil?
|
216
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
217
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
218
|
+
end
|
219
|
+
|
220
|
+
hash[param] = _to_hash(value)
|
221
|
+
end
|
222
|
+
hash
|
223
|
+
end
|
224
|
+
|
225
|
+
# Outputs non-array value in the form of hash
|
226
|
+
# For object, use to_hash. Otherwise, just return the value
|
227
|
+
# @param [Object] value Any valid value
|
228
|
+
# @return [Hash] Returns the value in the form of hash
|
229
|
+
def _to_hash(value)
|
230
|
+
if value.is_a?(Array)
|
231
|
+
value.compact.map { |v| _to_hash(v) }
|
232
|
+
elsif value.is_a?(Hash)
|
233
|
+
{}.tap do |hash|
|
234
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
235
|
+
end
|
236
|
+
elsif value.respond_to? :to_hash
|
237
|
+
value.to_hash
|
238
|
+
else
|
239
|
+
value
|
240
|
+
end
|
241
|
+
end
|
242
|
+
end
|
243
|
+
end
|