pulp_rpm_client 3.2.0 → 3.3.0b1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (136) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +6 -4
  3. data/docs/ContentModulemdDefaultsApi.md +2 -0
  4. data/docs/ContentModulemdsApi.md +2 -0
  5. data/docs/ContentPackagesApi.md +2 -0
  6. data/docs/Copy.md +19 -0
  7. data/docs/RpmCopyApi.md +62 -0
  8. data/docs/RpmModulemd.md +3 -1
  9. data/docs/RpmModulemdDefaults.md +3 -1
  10. data/docs/RpmPackage.md +2 -0
  11. data/docs/RpmRepoMetadataFile.md +3 -1
  12. data/docs/RpmRpmRepository.md +3 -1
  13. data/lib/pulp_rpm_client.rb +3 -1
  14. data/lib/pulp_rpm_client/api/content_advisories_api.rb +1 -1
  15. data/lib/pulp_rpm_client/api/content_distribution_trees_api.rb +1 -1
  16. data/lib/pulp_rpm_client/api/content_modulemd_defaults_api.rb +4 -1
  17. data/lib/pulp_rpm_client/api/content_modulemds_api.rb +4 -1
  18. data/lib/pulp_rpm_client/api/content_packagecategories_api.rb +1 -1
  19. data/lib/pulp_rpm_client/api/content_packageenvironments_api.rb +1 -1
  20. data/lib/pulp_rpm_client/api/content_packagegroups_api.rb +1 -1
  21. data/lib/pulp_rpm_client/api/content_packagelangpacks_api.rb +1 -1
  22. data/lib/pulp_rpm_client/api/content_packages_api.rb +4 -1
  23. data/lib/pulp_rpm_client/api/content_repo_metadata_files_api.rb +1 -1
  24. data/lib/pulp_rpm_client/api/distributions_rpm_api.rb +1 -1
  25. data/lib/pulp_rpm_client/api/publications_rpm_api.rb +1 -1
  26. data/lib/pulp_rpm_client/api/remotes_rpm_api.rb +1 -1
  27. data/lib/pulp_rpm_client/api/repositories_rpm_api.rb +1 -1
  28. data/lib/pulp_rpm_client/api/repositories_rpm_versions_api.rb +1 -1
  29. data/lib/pulp_rpm_client/api/rpm_copy_api.rb +86 -0
  30. data/lib/pulp_rpm_client/api_client.rb +1 -1
  31. data/lib/pulp_rpm_client/api_error.rb +1 -1
  32. data/lib/pulp_rpm_client/configuration.rb +1 -1
  33. data/lib/pulp_rpm_client/models/addon.rb +1 -1
  34. data/lib/pulp_rpm_client/models/artifact.rb +1 -1
  35. data/lib/pulp_rpm_client/models/async_operation_response.rb +1 -1
  36. data/lib/pulp_rpm_client/models/checksum.rb +1 -1
  37. data/lib/pulp_rpm_client/models/content_summary.rb +1 -1
  38. data/lib/pulp_rpm_client/models/copy.rb +224 -0
  39. data/lib/pulp_rpm_client/models/image.rb +1 -1
  40. data/lib/pulp_rpm_client/models/inline_response200.rb +1 -1
  41. data/lib/pulp_rpm_client/models/inline_response2001.rb +1 -1
  42. data/lib/pulp_rpm_client/models/inline_response20010.rb +1 -1
  43. data/lib/pulp_rpm_client/models/inline_response20011.rb +1 -1
  44. data/lib/pulp_rpm_client/models/inline_response20012.rb +1 -1
  45. data/lib/pulp_rpm_client/models/inline_response20013.rb +1 -1
  46. data/lib/pulp_rpm_client/models/inline_response20014.rb +1 -1
  47. data/lib/pulp_rpm_client/models/inline_response2002.rb +1 -1
  48. data/lib/pulp_rpm_client/models/inline_response2003.rb +1 -1
  49. data/lib/pulp_rpm_client/models/inline_response2004.rb +1 -1
  50. data/lib/pulp_rpm_client/models/inline_response2005.rb +1 -1
  51. data/lib/pulp_rpm_client/models/inline_response2006.rb +1 -1
  52. data/lib/pulp_rpm_client/models/inline_response2007.rb +1 -1
  53. data/lib/pulp_rpm_client/models/inline_response2008.rb +1 -1
  54. data/lib/pulp_rpm_client/models/inline_response2009.rb +1 -1
  55. data/lib/pulp_rpm_client/models/repository_add_remove_content.rb +1 -1
  56. data/lib/pulp_rpm_client/models/repository_version.rb +1 -1
  57. data/lib/pulp_rpm_client/models/rpm_distribution_tree.rb +1 -1
  58. data/lib/pulp_rpm_client/models/rpm_modulemd.rb +30 -5
  59. data/lib/pulp_rpm_client/models/rpm_modulemd_defaults.rb +30 -5
  60. data/lib/pulp_rpm_client/models/rpm_package.rb +27 -2
  61. data/lib/pulp_rpm_client/models/rpm_package_category.rb +1 -1
  62. data/lib/pulp_rpm_client/models/rpm_package_environment.rb +1 -1
  63. data/lib/pulp_rpm_client/models/rpm_package_group.rb +1 -1
  64. data/lib/pulp_rpm_client/models/rpm_package_langpacks.rb +1 -1
  65. data/lib/pulp_rpm_client/models/rpm_repo_metadata_file.rb +30 -5
  66. data/lib/pulp_rpm_client/models/rpm_repository_sync_url.rb +1 -1
  67. data/lib/pulp_rpm_client/models/rpm_rpm_distribution.rb +1 -1
  68. data/lib/pulp_rpm_client/models/rpm_rpm_publication.rb +1 -1
  69. data/lib/pulp_rpm_client/models/rpm_rpm_remote.rb +1 -1
  70. data/lib/pulp_rpm_client/models/rpm_rpm_repository.rb +17 -6
  71. data/lib/pulp_rpm_client/models/rpm_update_collection.rb +1 -1
  72. data/lib/pulp_rpm_client/models/rpm_update_record.rb +1 -1
  73. data/lib/pulp_rpm_client/models/variant.rb +1 -1
  74. data/lib/pulp_rpm_client/version.rb +2 -2
  75. data/pulp_rpm_client.gemspec +1 -1
  76. data/spec/api/content_advisories_api_spec.rb +1 -1
  77. data/spec/api/content_distribution_trees_api_spec.rb +1 -1
  78. data/spec/api/content_modulemd_defaults_api_spec.rb +2 -1
  79. data/spec/api/content_modulemds_api_spec.rb +2 -1
  80. data/spec/api/content_packagecategories_api_spec.rb +1 -1
  81. data/spec/api/content_packageenvironments_api_spec.rb +1 -1
  82. data/spec/api/content_packagegroups_api_spec.rb +1 -1
  83. data/spec/api/content_packagelangpacks_api_spec.rb +1 -1
  84. data/spec/api/content_packages_api_spec.rb +2 -1
  85. data/spec/api/content_repo_metadata_files_api_spec.rb +1 -1
  86. data/spec/api/distributions_rpm_api_spec.rb +1 -1
  87. data/spec/api/publications_rpm_api_spec.rb +1 -1
  88. data/spec/api/remotes_rpm_api_spec.rb +1 -1
  89. data/spec/api/repositories_rpm_api_spec.rb +1 -1
  90. data/spec/api/repositories_rpm_versions_api_spec.rb +1 -1
  91. data/spec/api/rpm_copy_api_spec.rb +47 -0
  92. data/spec/api_client_spec.rb +1 -1
  93. data/spec/configuration_spec.rb +1 -1
  94. data/spec/models/addon_spec.rb +1 -1
  95. data/spec/models/artifact_spec.rb +1 -1
  96. data/spec/models/async_operation_response_spec.rb +1 -1
  97. data/spec/models/checksum_spec.rb +1 -1
  98. data/spec/models/content_summary_spec.rb +1 -1
  99. data/spec/models/copy_spec.rb +47 -0
  100. data/spec/models/image_spec.rb +1 -1
  101. data/spec/models/inline_response20010_spec.rb +1 -1
  102. data/spec/models/inline_response20011_spec.rb +1 -1
  103. data/spec/models/inline_response20012_spec.rb +1 -1
  104. data/spec/models/inline_response20013_spec.rb +1 -1
  105. data/spec/models/inline_response20014_spec.rb +1 -1
  106. data/spec/models/inline_response2001_spec.rb +1 -1
  107. data/spec/models/inline_response2002_spec.rb +1 -1
  108. data/spec/models/inline_response2003_spec.rb +1 -1
  109. data/spec/models/inline_response2004_spec.rb +1 -1
  110. data/spec/models/inline_response2005_spec.rb +1 -1
  111. data/spec/models/inline_response2006_spec.rb +1 -1
  112. data/spec/models/inline_response2007_spec.rb +1 -1
  113. data/spec/models/inline_response2008_spec.rb +1 -1
  114. data/spec/models/inline_response2009_spec.rb +1 -1
  115. data/spec/models/inline_response200_spec.rb +1 -1
  116. data/spec/models/repository_add_remove_content_spec.rb +1 -1
  117. data/spec/models/repository_version_spec.rb +1 -1
  118. data/spec/models/rpm_distribution_tree_spec.rb +1 -1
  119. data/spec/models/rpm_modulemd_defaults_spec.rb +7 -1
  120. data/spec/models/rpm_modulemd_spec.rb +7 -1
  121. data/spec/models/rpm_package_category_spec.rb +1 -1
  122. data/spec/models/rpm_package_environment_spec.rb +1 -1
  123. data/spec/models/rpm_package_group_spec.rb +1 -1
  124. data/spec/models/rpm_package_langpacks_spec.rb +1 -1
  125. data/spec/models/rpm_package_spec.rb +7 -1
  126. data/spec/models/rpm_repo_metadata_file_spec.rb +7 -1
  127. data/spec/models/rpm_repository_sync_url_spec.rb +1 -1
  128. data/spec/models/rpm_rpm_distribution_spec.rb +1 -1
  129. data/spec/models/rpm_rpm_publication_spec.rb +1 -1
  130. data/spec/models/rpm_rpm_remote_spec.rb +1 -1
  131. data/spec/models/rpm_rpm_repository_spec.rb +7 -1
  132. data/spec/models/rpm_update_collection_spec.rb +1 -1
  133. data/spec/models/rpm_update_record_spec.rb +1 -1
  134. data/spec/models/variant_spec.rb +1 -1
  135. data/spec/spec_helper.rb +1 -1
  136. metadata +12 -4
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: v3
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.2
9
+ OpenAPI Generator version: 4.2.3
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: v3
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.2
9
+ OpenAPI Generator version: 4.2.3
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: v3
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.2
9
+ OpenAPI Generator version: 4.2.3
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: v3
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.2
9
+ OpenAPI Generator version: 4.2.3
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: v3
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.2
9
+ OpenAPI Generator version: 4.2.3
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: v3
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.2
9
+ OpenAPI Generator version: 4.2.3
10
10
 
11
11
  =end
12
12
 
@@ -0,0 +1,86 @@
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 'cgi'
14
+
15
+ module PulpRpmClient
16
+ class RpmCopyApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Copy content
23
+ # Trigger an asynchronous task to copy RPM contentfrom one repository into another, creating a newrepository version.
24
+ # @param data [Copy]
25
+ # @param [Hash] opts the optional parameters
26
+ # @return [AsyncOperationResponse]
27
+ def copy_content(data, opts = {})
28
+ data, _status_code, _headers = copy_content_with_http_info(data, opts)
29
+ data
30
+ end
31
+
32
+ # Copy content
33
+ # Trigger an asynchronous task to copy RPM contentfrom one repository into another, creating a newrepository version.
34
+ # @param data [Copy]
35
+ # @param [Hash] opts the optional parameters
36
+ # @return [Array<(AsyncOperationResponse, Integer, Hash)>] AsyncOperationResponse data, response status code and response headers
37
+ def copy_content_with_http_info(data, opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: RpmCopyApi.copy_content ...'
40
+ end
41
+ # verify the required parameter 'data' is set
42
+ if @api_client.config.client_side_validation && data.nil?
43
+ fail ArgumentError, "Missing the required parameter 'data' when calling RpmCopyApi.copy_content"
44
+ end
45
+ # resource path
46
+ local_var_path = '/pulp/api/v3/rpm/copy/'
47
+
48
+ # query parameters
49
+ query_params = opts[:query_params] || {}
50
+
51
+ # header parameters
52
+ header_params = opts[:header_params] || {}
53
+ # HTTP header 'Accept' (if needed)
54
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
55
+ # HTTP header 'Content-Type'
56
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
57
+
58
+ # form parameters
59
+ form_params = opts[:form_params] || {}
60
+
61
+ # http body (model)
62
+ post_body = opts[:body] || @api_client.object_to_http_body(data)
63
+
64
+ # return_type
65
+ return_type = opts[:return_type] || 'AsyncOperationResponse'
66
+
67
+ # auth_names
68
+ auth_names = opts[:auth_names] || ['Basic']
69
+
70
+ new_options = opts.merge(
71
+ :header_params => header_params,
72
+ :query_params => query_params,
73
+ :form_params => form_params,
74
+ :body => post_body,
75
+ :auth_names => auth_names,
76
+ :return_type => return_type
77
+ )
78
+
79
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
80
+ if @api_client.config.debugging
81
+ @api_client.config.logger.debug "API called: RpmCopyApi#copy_content\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
82
+ end
83
+ return data, status_code, headers
84
+ end
85
+ end
86
+ end
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: v3
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.2
9
+ OpenAPI Generator version: 4.2.3
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: v3
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.2
9
+ OpenAPI Generator version: 4.2.3
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: v3
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.2
9
+ OpenAPI Generator version: 4.2.3
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: v3
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.2
9
+ OpenAPI Generator version: 4.2.3
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: v3
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.2
9
+ OpenAPI Generator version: 4.2.3
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: v3
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.2
9
+ OpenAPI Generator version: 4.2.3
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: v3
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.2
9
+ OpenAPI Generator version: 4.2.3
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: v3
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.2
9
+ OpenAPI Generator version: 4.2.3
10
10
 
11
11
  =end
12
12
 
@@ -0,0 +1,224 @@
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 PulpRpmClient
16
+ class Copy
17
+ # A JSON document describing sources, destinations, and content to be copied
18
+ attr_accessor :config
19
+
20
+ # Also copy dependencies of the content being copied.
21
+ attr_accessor :dependency_solving
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'config' => :'config',
27
+ :'dependency_solving' => :'dependency_solving'
28
+ }
29
+ end
30
+
31
+ # Attribute type mapping.
32
+ def self.openapi_types
33
+ {
34
+ :'config' => :'Object',
35
+ :'dependency_solving' => :'Boolean'
36
+ }
37
+ end
38
+
39
+ # List of attributes with nullable: true
40
+ def self.openapi_nullable
41
+ Set.new([
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 `PulpRpmClient::Copy` 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 `PulpRpmClient::Copy`. 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?(:'config')
61
+ self.config = attributes[:'config']
62
+ end
63
+
64
+ if attributes.key?(:'dependency_solving')
65
+ self.dependency_solving = attributes[:'dependency_solving']
66
+ else
67
+ self.dependency_solving = true
68
+ end
69
+ end
70
+
71
+ # Show invalid properties with the reasons. Usually used together with valid?
72
+ # @return Array for valid properties with the reasons
73
+ def list_invalid_properties
74
+ invalid_properties = Array.new
75
+ if @config.nil?
76
+ invalid_properties.push('invalid value for "config", config cannot be nil.')
77
+ end
78
+
79
+ invalid_properties
80
+ end
81
+
82
+ # Check to see if the all the properties in the model are valid
83
+ # @return true if the model is valid
84
+ def valid?
85
+ return false if @config.nil?
86
+ true
87
+ end
88
+
89
+ # Checks equality by comparing each attribute.
90
+ # @param [Object] Object to be compared
91
+ def ==(o)
92
+ return true if self.equal?(o)
93
+ self.class == o.class &&
94
+ config == o.config &&
95
+ dependency_solving == o.dependency_solving
96
+ end
97
+
98
+ # @see the `==` method
99
+ # @param [Object] Object to be compared
100
+ def eql?(o)
101
+ self == o
102
+ end
103
+
104
+ # Calculates hash code according to all attributes.
105
+ # @return [Integer] Hash code
106
+ def hash
107
+ [config, dependency_solving].hash
108
+ end
109
+
110
+ # Builds the object from hash
111
+ # @param [Hash] attributes Model attributes in the form of hash
112
+ # @return [Object] Returns the model itself
113
+ def self.build_from_hash(attributes)
114
+ new.build_from_hash(attributes)
115
+ end
116
+
117
+ # Builds the object from hash
118
+ # @param [Hash] attributes Model attributes in the form of hash
119
+ # @return [Object] Returns the model itself
120
+ def build_from_hash(attributes)
121
+ return nil unless attributes.is_a?(Hash)
122
+ self.class.openapi_types.each_pair do |key, type|
123
+ if type =~ /\AArray<(.*)>/i
124
+ # check to ensure the input is an array given that the attribute
125
+ # is documented as an array but the input is not
126
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
127
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
128
+ end
129
+ elsif !attributes[self.class.attribute_map[key]].nil?
130
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
131
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
132
+ end
133
+
134
+ self
135
+ end
136
+
137
+ # Deserializes the data based on type
138
+ # @param string type Data type
139
+ # @param string value Value to be deserialized
140
+ # @return [Object] Deserialized data
141
+ def _deserialize(type, value)
142
+ case type.to_sym
143
+ when :DateTime
144
+ DateTime.parse(value)
145
+ when :Date
146
+ Date.parse(value)
147
+ when :String
148
+ value.to_s
149
+ when :Integer
150
+ value.to_i
151
+ when :Float
152
+ value.to_f
153
+ when :Boolean
154
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
155
+ true
156
+ else
157
+ false
158
+ end
159
+ when :Object
160
+ # generic object (usually a Hash), return directly
161
+ value
162
+ when /\AArray<(?<inner_type>.+)>\z/
163
+ inner_type = Regexp.last_match[:inner_type]
164
+ value.map { |v| _deserialize(inner_type, v) }
165
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
166
+ k_type = Regexp.last_match[:k_type]
167
+ v_type = Regexp.last_match[:v_type]
168
+ {}.tap do |hash|
169
+ value.each do |k, v|
170
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
171
+ end
172
+ end
173
+ else # model
174
+ PulpRpmClient.const_get(type).build_from_hash(value)
175
+ end
176
+ end
177
+
178
+ # Returns the string representation of the object
179
+ # @return [String] String presentation of the object
180
+ def to_s
181
+ to_hash.to_s
182
+ end
183
+
184
+ # to_body is an alias to to_hash (backward compatibility)
185
+ # @return [Hash] Returns the object in the form of hash
186
+ def to_body
187
+ to_hash
188
+ end
189
+
190
+ # Returns the object in the form of hash
191
+ # @return [Hash] Returns the object in the form of hash
192
+ def to_hash
193
+ hash = {}
194
+ self.class.attribute_map.each_pair do |attr, param|
195
+ value = self.send(attr)
196
+ if value.nil?
197
+ is_nullable = self.class.openapi_nullable.include?(attr)
198
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
199
+ end
200
+
201
+ hash[param] = _to_hash(value)
202
+ end
203
+ hash
204
+ end
205
+
206
+ # Outputs non-array value in the form of hash
207
+ # For object, use to_hash. Otherwise, just return the value
208
+ # @param [Object] value Any valid value
209
+ # @return [Hash] Returns the value in the form of hash
210
+ def _to_hash(value)
211
+ if value.is_a?(Array)
212
+ value.compact.map { |v| _to_hash(v) }
213
+ elsif value.is_a?(Hash)
214
+ {}.tap do |hash|
215
+ value.each { |k, v| hash[k] = _to_hash(v) }
216
+ end
217
+ elsif value.respond_to? :to_hash
218
+ value.to_hash
219
+ else
220
+ value
221
+ end
222
+ end
223
+ end
224
+ end