pulp_container_client 2.0.0b2 → 2.0.0b3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +32 -20
- data/docs/{ContainerBlobRead.md → ContainerBlob.md} +2 -2
- data/docs/ContainerContainerDistribution.md +8 -8
- data/docs/{ContainerContainerRepositoryRead.md → ContainerContainerPushRepository.md} +2 -2
- data/docs/ContainerContentRedirectContentGuard.md +23 -0
- data/docs/{ContainerManifestRead.md → ContainerManifest.md} +2 -2
- data/docs/{ContainerTagRead.md → ContainerTag.md} +2 -2
- data/docs/ContentBlobsApi.md +2 -2
- data/docs/ContentManifestsApi.md +2 -2
- data/docs/ContentTagsApi.md +2 -2
- data/docs/ContentguardsContentRedirectApi.md +355 -0
- data/docs/DistributionsContainerApi.md +4 -4
- data/docs/InlineResponse200.md +1 -1
- data/docs/InlineResponse2001.md +1 -1
- data/docs/InlineResponse2002.md +1 -1
- data/docs/InlineResponse2003.md +1 -1
- data/docs/InlineResponse2004.md +1 -1
- data/docs/InlineResponse2005.md +1 -1
- data/docs/InlineResponse2006.md +1 -1
- data/docs/InlineResponse2007.md +23 -0
- data/docs/InlineResponse2008.md +23 -0
- data/docs/RemotesContainerApi.md +6 -6
- data/docs/RepositoriesContainerApi.md +6 -6
- data/docs/RepositoriesContainerPushApi.md +356 -0
- data/docs/RepositoriesContainerVersionsApi.md +285 -20
- data/docs/{V2Api.md → TokenApi.md} +5 -5
- data/lib/pulp_container_client.rb +10 -12
- data/lib/pulp_container_client/api/content_blobs_api.rb +3 -3
- data/lib/pulp_container_client/api/content_manifests_api.rb +3 -3
- data/lib/pulp_container_client/api/content_tags_api.rb +3 -3
- data/lib/pulp_container_client/api/contentguards_content_redirect_api.rb +431 -0
- data/lib/pulp_container_client/api/distributions_container_api.rb +6 -6
- data/lib/pulp_container_client/api/remotes_container_api.rb +9 -9
- data/lib/pulp_container_client/api/repositories_container_api.rb +9 -9
- data/lib/pulp_container_client/api/repositories_container_push_api.rb +433 -0
- data/lib/pulp_container_client/api/repositories_container_versions_api.rb +354 -34
- data/lib/pulp_container_client/api/{v2_api.rb → token_api.rb} +6 -6
- data/lib/pulp_container_client/models/{container_blob_read.rb → container_blob.rb} +3 -3
- data/lib/pulp_container_client/models/container_container_distribution.rb +60 -61
- data/lib/pulp_container_client/models/{container_container_repository_read.rb → container_container_push_repository.rb} +3 -3
- data/lib/pulp_container_client/models/container_content_redirect_content_guard.rb +276 -0
- data/lib/pulp_container_client/models/{container_manifest_read.rb → container_manifest.rb} +3 -3
- data/lib/pulp_container_client/models/{container_tag_read.rb → container_tag.rb} +3 -3
- data/lib/pulp_container_client/models/inline_response200.rb +1 -1
- data/lib/pulp_container_client/models/inline_response2001.rb +1 -1
- data/lib/pulp_container_client/models/inline_response2002.rb +1 -1
- data/lib/pulp_container_client/models/inline_response2003.rb +1 -1
- data/lib/pulp_container_client/models/inline_response2004.rb +1 -1
- data/lib/pulp_container_client/models/inline_response2005.rb +1 -1
- data/lib/pulp_container_client/models/inline_response2006.rb +1 -1
- data/lib/pulp_container_client/models/{repository_version_read.rb → inline_response2007.rb} +42 -39
- data/lib/pulp_container_client/models/inline_response2008.rb +247 -0
- data/lib/pulp_container_client/version.rb +1 -1
- data/spec/api/content_blobs_api_spec.rb +1 -1
- data/spec/api/content_manifests_api_spec.rb +1 -1
- data/spec/api/content_tags_api_spec.rb +1 -1
- data/spec/api/contentguards_content_redirect_api_spec.rb +117 -0
- data/spec/api/distributions_container_api_spec.rb +2 -2
- data/spec/api/remotes_container_api_spec.rb +3 -3
- data/spec/api/repositories_container_api_spec.rb +3 -3
- data/spec/api/repositories_container_push_api_spec.rb +117 -0
- data/spec/api/repositories_container_versions_api_spec.rb +77 -7
- data/spec/api/{v2_api_spec.rb → token_api_spec.rb} +7 -7
- data/spec/models/{container_blob_read_spec.rb → container_blob_spec.rb} +6 -6
- data/spec/models/container_container_distribution_spec.rb +7 -7
- data/spec/models/{container_container_repository_read_spec.rb → container_container_push_repository_spec.rb} +6 -6
- data/spec/models/{repository_version_read_spec.rb → container_content_redirect_content_guard_spec.rb} +8 -14
- data/spec/models/{container_manifest_read_spec.rb → container_manifest_spec.rb} +6 -6
- data/spec/models/{container_tag_read_spec.rb → container_tag_spec.rb} +6 -6
- data/spec/models/inline_response2007_spec.rb +59 -0
- data/spec/models/inline_response2008_spec.rb +59 -0
- metadata +42 -50
- data/docs/ContainerContainerDistributionRead.md +0 -31
- data/docs/ContainerContainerRemoteRead.md +0 -47
- data/docs/RepositoryVersionRead.md +0 -25
- data/docs/V2BlobsApi.md +0 -63
- data/docs/V2CatalogApi.md +0 -64
- data/docs/V2ListApi.md +0 -66
- data/docs/V2UploadsApi.md +0 -61
- data/lib/pulp_container_client/api/v2_blobs_api.rb +0 -88
- data/lib/pulp_container_client/api/v2_catalog_api.rb +0 -80
- data/lib/pulp_container_client/api/v2_list_api.rb +0 -86
- data/lib/pulp_container_client/api/v2_uploads_api.rb +0 -82
- data/lib/pulp_container_client/models/container_container_distribution_read.rb +0 -342
- data/lib/pulp_container_client/models/container_container_remote_read.rb +0 -578
- data/spec/api/v2_blobs_api_spec.rb +0 -48
- data/spec/api/v2_catalog_api_spec.rb +0 -47
- data/spec/api/v2_list_api_spec.rb +0 -48
- data/spec/api/v2_uploads_api_spec.rb +0 -47
- data/spec/models/container_container_distribution_read_spec.rb +0 -83
- data/spec/models/container_container_remote_read_spec.rb +0 -135
@@ -13,7 +13,7 @@ OpenAPI Generator version: 4.2.3
|
|
13
13
|
require 'date'
|
14
14
|
|
15
15
|
module PulpContainerClient
|
16
|
-
class
|
16
|
+
class ContainerManifest
|
17
17
|
attr_accessor :pulp_href
|
18
18
|
|
19
19
|
# Timestamp of creation.
|
@@ -80,13 +80,13 @@ module PulpContainerClient
|
|
80
80
|
# @param [Hash] attributes Model attributes in the form of hash
|
81
81
|
def initialize(attributes = {})
|
82
82
|
if (!attributes.is_a?(Hash))
|
83
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `PulpContainerClient::
|
83
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `PulpContainerClient::ContainerManifest` initialize method"
|
84
84
|
end
|
85
85
|
|
86
86
|
# check to see if the attribute exists and convert string to symbol for hash key
|
87
87
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
88
88
|
if (!self.class.attribute_map.key?(k.to_sym))
|
89
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `PulpContainerClient::
|
89
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `PulpContainerClient::ContainerManifest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
90
90
|
end
|
91
91
|
h[k.to_sym] = v
|
92
92
|
}
|
@@ -13,7 +13,7 @@ OpenAPI Generator version: 4.2.3
|
|
13
13
|
require 'date'
|
14
14
|
|
15
15
|
module PulpContainerClient
|
16
|
-
class
|
16
|
+
class ContainerTag
|
17
17
|
attr_accessor :pulp_href
|
18
18
|
|
19
19
|
# Timestamp of creation.
|
@@ -60,13 +60,13 @@ module PulpContainerClient
|
|
60
60
|
# @param [Hash] attributes Model attributes in the form of hash
|
61
61
|
def initialize(attributes = {})
|
62
62
|
if (!attributes.is_a?(Hash))
|
63
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `PulpContainerClient::
|
63
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `PulpContainerClient::ContainerTag` initialize method"
|
64
64
|
end
|
65
65
|
|
66
66
|
# check to see if the attribute exists and convert string to symbol for hash key
|
67
67
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
68
68
|
if (!self.class.attribute_map.key?(k.to_sym))
|
69
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `PulpContainerClient::
|
69
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `PulpContainerClient::ContainerTag`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
70
70
|
end
|
71
71
|
h[k.to_sym] = v
|
72
72
|
}
|
@@ -13,44 +13,40 @@ OpenAPI Generator version: 4.2.3
|
|
13
13
|
require 'date'
|
14
14
|
|
15
15
|
module PulpContainerClient
|
16
|
-
class
|
17
|
-
attr_accessor :
|
16
|
+
class InlineResponse2007
|
17
|
+
attr_accessor :count
|
18
18
|
|
19
|
-
|
20
|
-
attr_accessor :pulp_created
|
19
|
+
attr_accessor :_next
|
21
20
|
|
22
|
-
attr_accessor :
|
21
|
+
attr_accessor :previous
|
23
22
|
|
24
|
-
|
25
|
-
attr_accessor :base_version
|
26
|
-
|
27
|
-
attr_accessor :content_summary
|
23
|
+
attr_accessor :results
|
28
24
|
|
29
25
|
# Attribute mapping from ruby-style variable name to JSON key.
|
30
26
|
def self.attribute_map
|
31
27
|
{
|
32
|
-
:'
|
33
|
-
:'
|
34
|
-
:'
|
35
|
-
:'
|
36
|
-
:'content_summary' => :'content_summary'
|
28
|
+
:'count' => :'count',
|
29
|
+
:'_next' => :'next',
|
30
|
+
:'previous' => :'previous',
|
31
|
+
:'results' => :'results'
|
37
32
|
}
|
38
33
|
end
|
39
34
|
|
40
35
|
# Attribute type mapping.
|
41
36
|
def self.openapi_types
|
42
37
|
{
|
43
|
-
:'
|
44
|
-
:'
|
45
|
-
:'
|
46
|
-
:'
|
47
|
-
:'content_summary' => :'ContentSummary'
|
38
|
+
:'count' => :'Integer',
|
39
|
+
:'_next' => :'String',
|
40
|
+
:'previous' => :'String',
|
41
|
+
:'results' => :'Array<RepositoryVersion>'
|
48
42
|
}
|
49
43
|
end
|
50
44
|
|
51
45
|
# List of attributes with nullable: true
|
52
46
|
def self.openapi_nullable
|
53
47
|
Set.new([
|
48
|
+
:'_next',
|
49
|
+
:'previous',
|
54
50
|
])
|
55
51
|
end
|
56
52
|
|
@@ -58,35 +54,33 @@ module PulpContainerClient
|
|
58
54
|
# @param [Hash] attributes Model attributes in the form of hash
|
59
55
|
def initialize(attributes = {})
|
60
56
|
if (!attributes.is_a?(Hash))
|
61
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `PulpContainerClient::
|
57
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `PulpContainerClient::InlineResponse2007` initialize method"
|
62
58
|
end
|
63
59
|
|
64
60
|
# check to see if the attribute exists and convert string to symbol for hash key
|
65
61
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
66
62
|
if (!self.class.attribute_map.key?(k.to_sym))
|
67
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `PulpContainerClient::
|
63
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `PulpContainerClient::InlineResponse2007`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
68
64
|
end
|
69
65
|
h[k.to_sym] = v
|
70
66
|
}
|
71
67
|
|
72
|
-
if attributes.key?(:'
|
73
|
-
self.
|
74
|
-
end
|
75
|
-
|
76
|
-
if attributes.key?(:'pulp_created')
|
77
|
-
self.pulp_created = attributes[:'pulp_created']
|
68
|
+
if attributes.key?(:'count')
|
69
|
+
self.count = attributes[:'count']
|
78
70
|
end
|
79
71
|
|
80
|
-
if attributes.key?(:'
|
81
|
-
self.
|
72
|
+
if attributes.key?(:'_next')
|
73
|
+
self._next = attributes[:'_next']
|
82
74
|
end
|
83
75
|
|
84
|
-
if attributes.key?(:'
|
85
|
-
self.
|
76
|
+
if attributes.key?(:'previous')
|
77
|
+
self.previous = attributes[:'previous']
|
86
78
|
end
|
87
79
|
|
88
|
-
if attributes.key?(:'
|
89
|
-
|
80
|
+
if attributes.key?(:'results')
|
81
|
+
if (value = attributes[:'results']).is_a?(Array)
|
82
|
+
self.results = value
|
83
|
+
end
|
90
84
|
end
|
91
85
|
end
|
92
86
|
|
@@ -94,12 +88,22 @@ module PulpContainerClient
|
|
94
88
|
# @return Array for valid properties with the reasons
|
95
89
|
def list_invalid_properties
|
96
90
|
invalid_properties = Array.new
|
91
|
+
if @count.nil?
|
92
|
+
invalid_properties.push('invalid value for "count", count cannot be nil.')
|
93
|
+
end
|
94
|
+
|
95
|
+
if @results.nil?
|
96
|
+
invalid_properties.push('invalid value for "results", results cannot be nil.')
|
97
|
+
end
|
98
|
+
|
97
99
|
invalid_properties
|
98
100
|
end
|
99
101
|
|
100
102
|
# Check to see if the all the properties in the model are valid
|
101
103
|
# @return true if the model is valid
|
102
104
|
def valid?
|
105
|
+
return false if @count.nil?
|
106
|
+
return false if @results.nil?
|
103
107
|
true
|
104
108
|
end
|
105
109
|
|
@@ -108,11 +112,10 @@ module PulpContainerClient
|
|
108
112
|
def ==(o)
|
109
113
|
return true if self.equal?(o)
|
110
114
|
self.class == o.class &&
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
content_summary == o.content_summary
|
115
|
+
count == o.count &&
|
116
|
+
_next == o._next &&
|
117
|
+
previous == o.previous &&
|
118
|
+
results == o.results
|
116
119
|
end
|
117
120
|
|
118
121
|
# @see the `==` method
|
@@ -124,7 +127,7 @@ module PulpContainerClient
|
|
124
127
|
# Calculates hash code according to all attributes.
|
125
128
|
# @return [Integer] Hash code
|
126
129
|
def hash
|
127
|
-
[
|
130
|
+
[count, _next, previous, results].hash
|
128
131
|
end
|
129
132
|
|
130
133
|
# Builds the object from hash
|
@@ -0,0 +1,247 @@
|
|
1
|
+
=begin
|
2
|
+
#Pulp 3 API
|
3
|
+
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
5
|
+
|
6
|
+
The version of the OpenAPI document: v3
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.2.3
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module PulpContainerClient
|
16
|
+
class InlineResponse2008
|
17
|
+
attr_accessor :count
|
18
|
+
|
19
|
+
attr_accessor :_next
|
20
|
+
|
21
|
+
attr_accessor :previous
|
22
|
+
|
23
|
+
attr_accessor :results
|
24
|
+
|
25
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
26
|
+
def self.attribute_map
|
27
|
+
{
|
28
|
+
:'count' => :'count',
|
29
|
+
:'_next' => :'next',
|
30
|
+
:'previous' => :'previous',
|
31
|
+
:'results' => :'results'
|
32
|
+
}
|
33
|
+
end
|
34
|
+
|
35
|
+
# Attribute type mapping.
|
36
|
+
def self.openapi_types
|
37
|
+
{
|
38
|
+
:'count' => :'Integer',
|
39
|
+
:'_next' => :'String',
|
40
|
+
:'previous' => :'String',
|
41
|
+
:'results' => :'Array<ContainerContainerRepository>'
|
42
|
+
}
|
43
|
+
end
|
44
|
+
|
45
|
+
# List of attributes with nullable: true
|
46
|
+
def self.openapi_nullable
|
47
|
+
Set.new([
|
48
|
+
:'_next',
|
49
|
+
:'previous',
|
50
|
+
])
|
51
|
+
end
|
52
|
+
|
53
|
+
# Initializes the object
|
54
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
55
|
+
def initialize(attributes = {})
|
56
|
+
if (!attributes.is_a?(Hash))
|
57
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `PulpContainerClient::InlineResponse2008` initialize method"
|
58
|
+
end
|
59
|
+
|
60
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
61
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
62
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
63
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `PulpContainerClient::InlineResponse2008`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
64
|
+
end
|
65
|
+
h[k.to_sym] = v
|
66
|
+
}
|
67
|
+
|
68
|
+
if attributes.key?(:'count')
|
69
|
+
self.count = attributes[:'count']
|
70
|
+
end
|
71
|
+
|
72
|
+
if attributes.key?(:'_next')
|
73
|
+
self._next = attributes[:'_next']
|
74
|
+
end
|
75
|
+
|
76
|
+
if attributes.key?(:'previous')
|
77
|
+
self.previous = attributes[:'previous']
|
78
|
+
end
|
79
|
+
|
80
|
+
if attributes.key?(:'results')
|
81
|
+
if (value = attributes[:'results']).is_a?(Array)
|
82
|
+
self.results = value
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
88
|
+
# @return Array for valid properties with the reasons
|
89
|
+
def list_invalid_properties
|
90
|
+
invalid_properties = Array.new
|
91
|
+
if @count.nil?
|
92
|
+
invalid_properties.push('invalid value for "count", count cannot be nil.')
|
93
|
+
end
|
94
|
+
|
95
|
+
if @results.nil?
|
96
|
+
invalid_properties.push('invalid value for "results", results cannot be nil.')
|
97
|
+
end
|
98
|
+
|
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
|
+
return false if @count.nil?
|
106
|
+
return false if @results.nil?
|
107
|
+
true
|
108
|
+
end
|
109
|
+
|
110
|
+
# Checks equality by comparing each attribute.
|
111
|
+
# @param [Object] Object to be compared
|
112
|
+
def ==(o)
|
113
|
+
return true if self.equal?(o)
|
114
|
+
self.class == o.class &&
|
115
|
+
count == o.count &&
|
116
|
+
_next == o._next &&
|
117
|
+
previous == o.previous &&
|
118
|
+
results == o.results
|
119
|
+
end
|
120
|
+
|
121
|
+
# @see the `==` method
|
122
|
+
# @param [Object] Object to be compared
|
123
|
+
def eql?(o)
|
124
|
+
self == o
|
125
|
+
end
|
126
|
+
|
127
|
+
# Calculates hash code according to all attributes.
|
128
|
+
# @return [Integer] Hash code
|
129
|
+
def hash
|
130
|
+
[count, _next, previous, results].hash
|
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 self.build_from_hash(attributes)
|
137
|
+
new.build_from_hash(attributes)
|
138
|
+
end
|
139
|
+
|
140
|
+
# Builds the object from hash
|
141
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
142
|
+
# @return [Object] Returns the model itself
|
143
|
+
def build_from_hash(attributes)
|
144
|
+
return nil unless attributes.is_a?(Hash)
|
145
|
+
self.class.openapi_types.each_pair do |key, type|
|
146
|
+
if type =~ /\AArray<(.*)>/i
|
147
|
+
# check to ensure the input is an array given that the attribute
|
148
|
+
# is documented as an array but the input is not
|
149
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
150
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
151
|
+
end
|
152
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
153
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
154
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
155
|
+
end
|
156
|
+
|
157
|
+
self
|
158
|
+
end
|
159
|
+
|
160
|
+
# Deserializes the data based on type
|
161
|
+
# @param string type Data type
|
162
|
+
# @param string value Value to be deserialized
|
163
|
+
# @return [Object] Deserialized data
|
164
|
+
def _deserialize(type, value)
|
165
|
+
case type.to_sym
|
166
|
+
when :DateTime
|
167
|
+
DateTime.parse(value)
|
168
|
+
when :Date
|
169
|
+
Date.parse(value)
|
170
|
+
when :String
|
171
|
+
value.to_s
|
172
|
+
when :Integer
|
173
|
+
value.to_i
|
174
|
+
when :Float
|
175
|
+
value.to_f
|
176
|
+
when :Boolean
|
177
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
178
|
+
true
|
179
|
+
else
|
180
|
+
false
|
181
|
+
end
|
182
|
+
when :Object
|
183
|
+
# generic object (usually a Hash), return directly
|
184
|
+
value
|
185
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
186
|
+
inner_type = Regexp.last_match[:inner_type]
|
187
|
+
value.map { |v| _deserialize(inner_type, v) }
|
188
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
189
|
+
k_type = Regexp.last_match[:k_type]
|
190
|
+
v_type = Regexp.last_match[:v_type]
|
191
|
+
{}.tap do |hash|
|
192
|
+
value.each do |k, v|
|
193
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
194
|
+
end
|
195
|
+
end
|
196
|
+
else # model
|
197
|
+
PulpContainerClient.const_get(type).build_from_hash(value)
|
198
|
+
end
|
199
|
+
end
|
200
|
+
|
201
|
+
# Returns the string representation of the object
|
202
|
+
# @return [String] String presentation of the object
|
203
|
+
def to_s
|
204
|
+
to_hash.to_s
|
205
|
+
end
|
206
|
+
|
207
|
+
# to_body is an alias to to_hash (backward compatibility)
|
208
|
+
# @return [Hash] Returns the object in the form of hash
|
209
|
+
def to_body
|
210
|
+
to_hash
|
211
|
+
end
|
212
|
+
|
213
|
+
# Returns the object in the form of hash
|
214
|
+
# @return [Hash] Returns the object in the form of hash
|
215
|
+
def to_hash
|
216
|
+
hash = {}
|
217
|
+
self.class.attribute_map.each_pair do |attr, param|
|
218
|
+
value = self.send(attr)
|
219
|
+
if value.nil?
|
220
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
221
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
222
|
+
end
|
223
|
+
|
224
|
+
hash[param] = _to_hash(value)
|
225
|
+
end
|
226
|
+
hash
|
227
|
+
end
|
228
|
+
|
229
|
+
# Outputs non-array value in the form of hash
|
230
|
+
# For object, use to_hash. Otherwise, just return the value
|
231
|
+
# @param [Object] value Any valid value
|
232
|
+
# @return [Hash] Returns the value in the form of hash
|
233
|
+
def _to_hash(value)
|
234
|
+
if value.is_a?(Array)
|
235
|
+
value.compact.map { |v| _to_hash(v) }
|
236
|
+
elsif value.is_a?(Hash)
|
237
|
+
{}.tap do |hash|
|
238
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
239
|
+
end
|
240
|
+
elsif value.respond_to? :to_hash
|
241
|
+
value.to_hash
|
242
|
+
else
|
243
|
+
value
|
244
|
+
end
|
245
|
+
end
|
246
|
+
end
|
247
|
+
end
|