pulp_rpm_client 3.5.1 → 3.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (232) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +73 -55
  3. data/docs/{Addon.md → AddonResponse.md} +2 -2
  4. data/docs/{Artifact.md → ArtifactResponse.md} +3 -3
  5. data/docs/{Checksum.md → ChecksumResponse.md} +2 -2
  6. data/docs/ContentAdvisoriesApi.md +44 -44
  7. data/docs/ContentDistributionTreesApi.md +25 -25
  8. data/docs/ContentModulemdDefaultsApi.md +32 -32
  9. data/docs/ContentModulemdsApi.md +34 -34
  10. data/docs/ContentPackagecategoriesApi.md +25 -25
  11. data/docs/ContentPackageenvironmentsApi.md +25 -25
  12. data/docs/ContentPackagegroupsApi.md +25 -25
  13. data/docs/ContentPackagelangpacksApi.md +25 -25
  14. data/docs/ContentPackagesApi.md +64 -64
  15. data/docs/ContentRepoMetadataFilesApi.md +25 -25
  16. data/docs/ContentSummary.md +3 -3
  17. data/docs/ContentSummaryResponse.md +21 -0
  18. data/docs/DistributionsRpmApi.md +108 -60
  19. data/docs/{Image.md → ImageResponse.md} +3 -3
  20. data/docs/InlineResponse200.md +3 -3
  21. data/docs/InlineResponse2001.md +3 -3
  22. data/docs/InlineResponse20010.md +3 -3
  23. data/docs/InlineResponse20011.md +3 -3
  24. data/docs/InlineResponse20012.md +3 -3
  25. data/docs/InlineResponse20013.md +3 -3
  26. data/docs/InlineResponse20014.md +3 -3
  27. data/docs/InlineResponse2002.md +3 -3
  28. data/docs/InlineResponse2003.md +3 -3
  29. data/docs/InlineResponse2004.md +3 -3
  30. data/docs/InlineResponse2005.md +3 -3
  31. data/docs/InlineResponse2006.md +3 -3
  32. data/docs/InlineResponse2007.md +3 -3
  33. data/docs/InlineResponse2008.md +3 -3
  34. data/docs/InlineResponse2009.md +3 -3
  35. data/docs/MetadataChecksumTypeEnum.md +16 -0
  36. data/docs/PackageChecksumTypeEnum.md +16 -0
  37. data/docs/PatchedrpmRpmDistribution.md +23 -0
  38. data/docs/PatchedrpmRpmRemote.md +39 -0
  39. data/docs/PatchedrpmRpmRepository.md +25 -0
  40. data/docs/PolicyEnum.md +16 -0
  41. data/docs/PublicationsRpmApi.md +40 -40
  42. data/docs/RemotesRpmApi.md +125 -65
  43. data/docs/RepositoriesRpmApi.md +97 -73
  44. data/docs/RepositoriesRpmVersionsApi.md +94 -62
  45. data/docs/RepositoryAddRemoveContent.md +2 -2
  46. data/docs/RepositoryVersion.md +1 -9
  47. data/docs/RepositoryVersionResponse.md +25 -0
  48. data/docs/RpmCopyApi.md +10 -10
  49. data/docs/{RpmDistributionTree.md → RpmDistributionTreeResponse.md} +6 -6
  50. data/docs/RpmModulemd.md +8 -8
  51. data/docs/RpmModulemdDefaults.md +8 -8
  52. data/docs/RpmModulemdDefaultsResponse.md +29 -0
  53. data/docs/RpmModulemdResponse.md +39 -0
  54. data/docs/RpmPackage.md +7 -79
  55. data/docs/{RpmPackageCategory.md → RpmPackageCategoryResponse.md} +2 -2
  56. data/docs/{RpmPackageEnvironment.md → RpmPackageEnvironmentResponse.md} +2 -2
  57. data/docs/{RpmPackageGroup.md → RpmPackageGroupResponse.md} +2 -2
  58. data/docs/{RpmPackageLangpacks.md → RpmPackageLangpacksResponse.md} +2 -2
  59. data/docs/RpmPackageResponse.md +95 -0
  60. data/docs/{RpmRepoMetadataFile.md → RpmRepoMetadataFileResponse.md} +2 -2
  61. data/docs/RpmRepositorySyncURL.md +1 -1
  62. data/docs/RpmRpmDistribution.md +1 -7
  63. data/docs/RpmRpmDistributionResponse.md +29 -0
  64. data/docs/RpmRpmPublication.md +3 -7
  65. data/docs/RpmRpmPublicationResponse.md +27 -0
  66. data/docs/RpmRpmRemote.md +4 -10
  67. data/docs/RpmRpmRemoteResponse.md +45 -0
  68. data/docs/RpmRpmRepository.md +3 -9
  69. data/docs/RpmRpmRepositoryResponse.md +33 -0
  70. data/docs/RpmUpdateCollection.md +1 -3
  71. data/docs/RpmUpdateCollectionResponse.md +23 -0
  72. data/docs/RpmUpdateRecord.md +4 -40
  73. data/docs/RpmUpdateRecordResponse.md +55 -0
  74. data/docs/{Variant.md → VariantResponse.md} +2 -2
  75. data/lib/pulp_rpm_client/api/content_advisories_api.rb +60 -60
  76. data/lib/pulp_rpm_client/api/content_distribution_trees_api.rb +36 -36
  77. data/lib/pulp_rpm_client/api/content_modulemd_defaults_api.rb +42 -54
  78. data/lib/pulp_rpm_client/api/content_modulemds_api.rb +44 -76
  79. data/lib/pulp_rpm_client/api/content_packagecategories_api.rb +36 -36
  80. data/lib/pulp_rpm_client/api/content_packageenvironments_api.rb +36 -36
  81. data/lib/pulp_rpm_client/api/content_packagegroups_api.rb +36 -36
  82. data/lib/pulp_rpm_client/api/content_packagelangpacks_api.rb +36 -36
  83. data/lib/pulp_rpm_client/api/content_packages_api.rb +92 -92
  84. data/lib/pulp_rpm_client/api/content_repo_metadata_files_api.rb +36 -36
  85. data/lib/pulp_rpm_client/api/distributions_rpm_api.rb +153 -90
  86. data/lib/pulp_rpm_client/api/publications_rpm_api.rb +59 -59
  87. data/lib/pulp_rpm_client/api/remotes_rpm_api.rb +181 -100
  88. data/lib/pulp_rpm_client/api/repositories_rpm_api.rb +145 -118
  89. data/lib/pulp_rpm_client/api/repositories_rpm_versions_api.rb +137 -92
  90. data/lib/pulp_rpm_client/api/rpm_copy_api.rb +15 -15
  91. data/lib/pulp_rpm_client/api_client.rb +2 -2
  92. data/lib/pulp_rpm_client/api_error.rb +2 -2
  93. data/lib/pulp_rpm_client/configuration.rb +3 -3
  94. data/lib/pulp_rpm_client/models/{addon.rb → addon_response.rb} +6 -100
  95. data/lib/pulp_rpm_client/models/{artifact.rb → artifact_response.rb} +9 -93
  96. data/lib/pulp_rpm_client/models/async_operation_response.rb +3 -2
  97. data/lib/pulp_rpm_client/models/{checksum.rb → checksum_response.rb} +6 -43
  98. data/lib/pulp_rpm_client/models/content_summary.rb +9 -15
  99. data/lib/pulp_rpm_client/models/content_summary_response.rb +240 -0
  100. data/lib/pulp_rpm_client/models/copy.rb +3 -2
  101. data/lib/pulp_rpm_client/models/{image.rb → image_response.rb} +7 -63
  102. data/lib/pulp_rpm_client/models/inline_response200.rb +3 -13
  103. data/lib/pulp_rpm_client/models/inline_response2001.rb +3 -13
  104. data/lib/pulp_rpm_client/models/inline_response20010.rb +3 -13
  105. data/lib/pulp_rpm_client/models/inline_response20011.rb +3 -13
  106. data/lib/pulp_rpm_client/models/inline_response20012.rb +3 -13
  107. data/lib/pulp_rpm_client/models/inline_response20013.rb +3 -13
  108. data/lib/pulp_rpm_client/models/inline_response20014.rb +3 -13
  109. data/lib/pulp_rpm_client/models/inline_response2002.rb +3 -13
  110. data/lib/pulp_rpm_client/models/inline_response2003.rb +3 -13
  111. data/lib/pulp_rpm_client/models/inline_response2004.rb +3 -13
  112. data/lib/pulp_rpm_client/models/inline_response2005.rb +3 -13
  113. data/lib/pulp_rpm_client/models/inline_response2006.rb +3 -13
  114. data/lib/pulp_rpm_client/models/inline_response2007.rb +3 -13
  115. data/lib/pulp_rpm_client/models/inline_response2008.rb +3 -13
  116. data/lib/pulp_rpm_client/models/inline_response2009.rb +3 -13
  117. data/lib/pulp_rpm_client/models/metadata_checksum_type_enum.rb +41 -0
  118. data/lib/pulp_rpm_client/models/package_checksum_type_enum.rb +41 -0
  119. data/lib/pulp_rpm_client/models/patchedrpm_rpm_distribution.rb +240 -0
  120. data/lib/pulp_rpm_client/models/patchedrpm_rpm_remote.rb +340 -0
  121. data/lib/pulp_rpm_client/models/patchedrpm_rpm_repository.rb +265 -0
  122. data/lib/pulp_rpm_client/models/policy_enum.rb +37 -0
  123. data/lib/pulp_rpm_client/models/repository_add_remove_content.rb +5 -4
  124. data/lib/pulp_rpm_client/models/repository_version.rb +7 -43
  125. data/lib/pulp_rpm_client/models/repository_version_response.rb +246 -0
  126. data/lib/pulp_rpm_client/models/{rpm_distribution_tree.rb → rpm_distribution_tree_response.rb} +17 -234
  127. data/lib/pulp_rpm_client/models/rpm_modulemd.rb +42 -153
  128. data/lib/pulp_rpm_client/models/rpm_modulemd_defaults.rb +40 -86
  129. data/lib/pulp_rpm_client/models/rpm_modulemd_defaults_response.rb +282 -0
  130. data/lib/pulp_rpm_client/models/rpm_modulemd_response.rb +346 -0
  131. data/lib/pulp_rpm_client/models/rpm_package.rb +28 -501
  132. data/lib/pulp_rpm_client/models/{rpm_package_category.rb → rpm_package_category_response.rb} +10 -63
  133. data/lib/pulp_rpm_client/models/{rpm_package_environment.rb → rpm_package_environment_response.rb} +11 -68
  134. data/lib/pulp_rpm_client/models/{rpm_package_group.rb → rpm_package_group_response.rb} +10 -63
  135. data/lib/pulp_rpm_client/models/{rpm_package_langpacks.rb → rpm_package_langpacks_response.rb} +8 -34
  136. data/lib/pulp_rpm_client/models/rpm_package_response.rb +597 -0
  137. data/lib/pulp_rpm_client/models/{rpm_repo_metadata_file.rb → rpm_repo_metadata_file_response.rb} +6 -96
  138. data/lib/pulp_rpm_client/models/rpm_repository_sync_url.rb +4 -30
  139. data/lib/pulp_rpm_client/models/rpm_rpm_distribution.rb +4 -85
  140. data/lib/pulp_rpm_client/models/rpm_rpm_distribution_response.rb +279 -0
  141. data/lib/pulp_rpm_client/models/rpm_rpm_publication.rb +6 -74
  142. data/lib/pulp_rpm_client/models/rpm_rpm_publication_response.rb +256 -0
  143. data/lib/pulp_rpm_client/models/rpm_rpm_remote.rb +7 -214
  144. data/lib/pulp_rpm_client/models/rpm_rpm_remote_response.rb +379 -0
  145. data/lib/pulp_rpm_client/models/rpm_rpm_repository.rb +14 -74
  146. data/lib/pulp_rpm_client/models/rpm_rpm_repository_response.rb +307 -0
  147. data/lib/pulp_rpm_client/models/rpm_update_collection.rb +10 -34
  148. data/lib/pulp_rpm_client/models/rpm_update_collection_response.rb +243 -0
  149. data/lib/pulp_rpm_client/models/rpm_update_record.rb +18 -245
  150. data/lib/pulp_rpm_client/models/rpm_update_record_response.rb +401 -0
  151. data/lib/pulp_rpm_client/models/{variant.rb → variant_response.rb} +6 -195
  152. data/lib/pulp_rpm_client/version.rb +3 -3
  153. data/lib/pulp_rpm_client.rb +30 -13
  154. data/pulp_rpm_client.gemspec +4 -4
  155. data/spec/api/content_advisories_api_spec.rb +21 -21
  156. data/spec/api/content_distribution_trees_api_spec.rb +9 -9
  157. data/spec/api/content_modulemd_defaults_api_spec.rb +13 -13
  158. data/spec/api/content_modulemds_api_spec.rb +13 -13
  159. data/spec/api/content_packagecategories_api_spec.rb +9 -9
  160. data/spec/api/content_packageenvironments_api_spec.rb +9 -9
  161. data/spec/api/content_packagegroups_api_spec.rb +9 -9
  162. data/spec/api/content_packagelangpacks_api_spec.rb +9 -9
  163. data/spec/api/content_packages_api_spec.rb +31 -31
  164. data/spec/api/content_repo_metadata_files_api_spec.rb +9 -9
  165. data/spec/api/distributions_rpm_api_spec.rb +39 -18
  166. data/spec/api/publications_rpm_api_spec.rb +14 -14
  167. data/spec/api/remotes_rpm_api_spec.rb +48 -21
  168. data/spec/api/repositories_rpm_api_spec.rb +28 -19
  169. data/spec/api/repositories_rpm_versions_api_spec.rb +38 -23
  170. data/spec/api/rpm_copy_api_spec.rb +5 -5
  171. data/spec/api_client_spec.rb +2 -2
  172. data/spec/configuration_spec.rb +2 -2
  173. data/spec/models/{addon_spec.rb → addon_response_spec.rb} +8 -8
  174. data/spec/models/{artifact_spec.rb → artifact_response_spec.rb} +8 -8
  175. data/spec/models/async_operation_response_spec.rb +2 -2
  176. data/spec/models/{checksum_spec.rb → checksum_response_spec.rb} +8 -8
  177. data/spec/models/content_summary_response_spec.rb +53 -0
  178. data/spec/models/content_summary_spec.rb +2 -2
  179. data/spec/models/copy_spec.rb +2 -2
  180. data/spec/models/{image_spec.rb → image_response_spec.rb} +8 -8
  181. data/spec/models/inline_response20010_spec.rb +2 -2
  182. data/spec/models/inline_response20011_spec.rb +2 -2
  183. data/spec/models/inline_response20012_spec.rb +2 -2
  184. data/spec/models/inline_response20013_spec.rb +2 -2
  185. data/spec/models/inline_response20014_spec.rb +2 -2
  186. data/spec/models/inline_response2001_spec.rb +2 -2
  187. data/spec/models/inline_response2002_spec.rb +2 -2
  188. data/spec/models/inline_response2003_spec.rb +2 -2
  189. data/spec/models/inline_response2004_spec.rb +2 -2
  190. data/spec/models/inline_response2005_spec.rb +2 -2
  191. data/spec/models/inline_response2006_spec.rb +2 -2
  192. data/spec/models/inline_response2007_spec.rb +2 -2
  193. data/spec/models/inline_response2008_spec.rb +2 -2
  194. data/spec/models/inline_response2009_spec.rb +2 -2
  195. data/spec/models/inline_response200_spec.rb +2 -2
  196. data/spec/models/metadata_checksum_type_enum_spec.rb +35 -0
  197. data/spec/models/package_checksum_type_enum_spec.rb +35 -0
  198. data/spec/models/patchedrpm_rpm_distribution_spec.rb +59 -0
  199. data/spec/models/patchedrpm_rpm_remote_spec.rb +107 -0
  200. data/spec/models/patchedrpm_rpm_repository_spec.rb +65 -0
  201. data/spec/models/policy_enum_spec.rb +35 -0
  202. data/spec/models/repository_add_remove_content_spec.rb +2 -2
  203. data/spec/models/repository_version_response_spec.rb +65 -0
  204. data/spec/models/repository_version_spec.rb +2 -26
  205. data/spec/models/{rpm_distribution_tree_spec.rb → rpm_distribution_tree_response_spec.rb} +8 -8
  206. data/spec/models/rpm_modulemd_defaults_response_spec.rb +77 -0
  207. data/spec/models/rpm_modulemd_defaults_spec.rb +9 -9
  208. data/spec/models/rpm_modulemd_response_spec.rb +107 -0
  209. data/spec/models/rpm_modulemd_spec.rb +11 -11
  210. data/spec/models/{rpm_package_category_spec.rb → rpm_package_category_response_spec.rb} +8 -8
  211. data/spec/models/{rpm_package_environment_spec.rb → rpm_package_environment_response_spec.rb} +8 -8
  212. data/spec/models/{rpm_package_group_spec.rb → rpm_package_group_response_spec.rb} +8 -8
  213. data/spec/models/{rpm_package_langpacks_spec.rb → rpm_package_langpacks_response_spec.rb} +8 -8
  214. data/spec/models/rpm_package_response_spec.rb +275 -0
  215. data/spec/models/rpm_package_spec.rb +5 -221
  216. data/spec/models/{rpm_repo_metadata_file_spec.rb → rpm_repo_metadata_file_response_spec.rb} +8 -8
  217. data/spec/models/rpm_repository_sync_url_spec.rb +2 -6
  218. data/spec/models/rpm_rpm_distribution_response_spec.rb +77 -0
  219. data/spec/models/rpm_rpm_distribution_spec.rb +2 -20
  220. data/spec/models/rpm_rpm_publication_response_spec.rb +71 -0
  221. data/spec/models/rpm_rpm_publication_spec.rb +2 -22
  222. data/spec/models/rpm_rpm_remote_response_spec.rb +125 -0
  223. data/spec/models/rpm_rpm_remote_spec.rb +2 -24
  224. data/spec/models/rpm_rpm_repository_response_spec.rb +89 -0
  225. data/spec/models/rpm_rpm_repository_spec.rb +5 -23
  226. data/spec/models/rpm_update_collection_response_spec.rb +59 -0
  227. data/spec/models/rpm_update_collection_spec.rb +2 -8
  228. data/spec/models/rpm_update_record_response_spec.rb +155 -0
  229. data/spec/models/rpm_update_record_spec.rb +4 -112
  230. data/spec/models/{variant_spec.rb → variant_response_spec.rb} +8 -8
  231. data/spec/spec_helper.rb +2 -2
  232. metadata +116 -48
@@ -0,0 +1,240 @@
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 PulpRpmClient
16
+ # Serializer for RPM Distributions.
17
+ class PatchedrpmRpmDistribution
18
+ # The base (relative) path component of the published url. Avoid paths that overlap with other distribution base paths (e.g. \"foo\" and \"foo/bar\")
19
+ attr_accessor :base_path
20
+
21
+ # An optional content-guard.
22
+ attr_accessor :content_guard
23
+
24
+ # A unique name. Ex, `rawhide` and `stable`.
25
+ attr_accessor :name
26
+
27
+ # Publication to be served
28
+ attr_accessor :publication
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ :'base_path' => :'base_path',
34
+ :'content_guard' => :'content_guard',
35
+ :'name' => :'name',
36
+ :'publication' => :'publication'
37
+ }
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.openapi_types
42
+ {
43
+ :'base_path' => :'String',
44
+ :'content_guard' => :'String',
45
+ :'name' => :'String',
46
+ :'publication' => :'String'
47
+ }
48
+ end
49
+
50
+ # List of attributes with nullable: true
51
+ def self.openapi_nullable
52
+ Set.new([
53
+ :'content_guard',
54
+ :'publication'
55
+ ])
56
+ end
57
+
58
+ # Initializes the object
59
+ # @param [Hash] attributes Model attributes in the form of hash
60
+ def initialize(attributes = {})
61
+ if (!attributes.is_a?(Hash))
62
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpRpmClient::PatchedrpmRpmDistribution` initialize method"
63
+ end
64
+
65
+ # check to see if the attribute exists and convert string to symbol for hash key
66
+ attributes = attributes.each_with_object({}) { |(k, v), h|
67
+ if (!self.class.attribute_map.key?(k.to_sym))
68
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpRpmClient::PatchedrpmRpmDistribution`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
69
+ end
70
+ h[k.to_sym] = v
71
+ }
72
+
73
+ if attributes.key?(:'base_path')
74
+ self.base_path = attributes[:'base_path']
75
+ end
76
+
77
+ if attributes.key?(:'content_guard')
78
+ self.content_guard = attributes[:'content_guard']
79
+ end
80
+
81
+ if attributes.key?(:'name')
82
+ self.name = attributes[:'name']
83
+ end
84
+
85
+ if attributes.key?(:'publication')
86
+ self.publication = attributes[:'publication']
87
+ end
88
+ end
89
+
90
+ # Show invalid properties with the reasons. Usually used together with valid?
91
+ # @return Array for valid properties with the reasons
92
+ def list_invalid_properties
93
+ invalid_properties = Array.new
94
+ invalid_properties
95
+ end
96
+
97
+ # Check to see if the all the properties in the model are valid
98
+ # @return true if the model is valid
99
+ def valid?
100
+ true
101
+ end
102
+
103
+ # Checks equality by comparing each attribute.
104
+ # @param [Object] Object to be compared
105
+ def ==(o)
106
+ return true if self.equal?(o)
107
+ self.class == o.class &&
108
+ base_path == o.base_path &&
109
+ content_guard == o.content_guard &&
110
+ name == o.name &&
111
+ publication == o.publication
112
+ end
113
+
114
+ # @see the `==` method
115
+ # @param [Object] Object to be compared
116
+ def eql?(o)
117
+ self == o
118
+ end
119
+
120
+ # Calculates hash code according to all attributes.
121
+ # @return [Integer] Hash code
122
+ def hash
123
+ [base_path, content_guard, name, publication].hash
124
+ end
125
+
126
+ # Builds the object from hash
127
+ # @param [Hash] attributes Model attributes in the form of hash
128
+ # @return [Object] Returns the model itself
129
+ def self.build_from_hash(attributes)
130
+ new.build_from_hash(attributes)
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 build_from_hash(attributes)
137
+ return nil unless attributes.is_a?(Hash)
138
+ self.class.openapi_types.each_pair do |key, type|
139
+ if type =~ /\AArray<(.*)>/i
140
+ # check to ensure the input is an array given that the attribute
141
+ # is documented as an array but the input is not
142
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
143
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
144
+ end
145
+ elsif !attributes[self.class.attribute_map[key]].nil?
146
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
147
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
148
+ end
149
+
150
+ self
151
+ end
152
+
153
+ # Deserializes the data based on type
154
+ # @param string type Data type
155
+ # @param string value Value to be deserialized
156
+ # @return [Object] Deserialized data
157
+ def _deserialize(type, value)
158
+ case type.to_sym
159
+ when :DateTime
160
+ DateTime.parse(value)
161
+ when :Date
162
+ Date.parse(value)
163
+ when :String
164
+ value.to_s
165
+ when :Integer
166
+ value.to_i
167
+ when :Float
168
+ value.to_f
169
+ when :Boolean
170
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
171
+ true
172
+ else
173
+ false
174
+ end
175
+ when :Object
176
+ # generic object (usually a Hash), return directly
177
+ value
178
+ when /\AArray<(?<inner_type>.+)>\z/
179
+ inner_type = Regexp.last_match[:inner_type]
180
+ value.map { |v| _deserialize(inner_type, v) }
181
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
182
+ k_type = Regexp.last_match[:k_type]
183
+ v_type = Regexp.last_match[:v_type]
184
+ {}.tap do |hash|
185
+ value.each do |k, v|
186
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
187
+ end
188
+ end
189
+ else # model
190
+ PulpRpmClient.const_get(type).build_from_hash(value)
191
+ end
192
+ end
193
+
194
+ # Returns the string representation of the object
195
+ # @return [String] String presentation of the object
196
+ def to_s
197
+ to_hash.to_s
198
+ end
199
+
200
+ # to_body is an alias to to_hash (backward compatibility)
201
+ # @return [Hash] Returns the object in the form of hash
202
+ def to_body
203
+ to_hash
204
+ end
205
+
206
+ # Returns the object in the form of hash
207
+ # @return [Hash] Returns the object in the form of hash
208
+ def to_hash
209
+ hash = {}
210
+ self.class.attribute_map.each_pair do |attr, param|
211
+ value = self.send(attr)
212
+ if value.nil?
213
+ is_nullable = self.class.openapi_nullable.include?(attr)
214
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
215
+ end
216
+
217
+ hash[param] = _to_hash(value)
218
+ end
219
+ hash
220
+ end
221
+
222
+ # Outputs non-array value in the form of hash
223
+ # For object, use to_hash. Otherwise, just return the value
224
+ # @param [Object] value Any valid value
225
+ # @return [Hash] Returns the value in the form of hash
226
+ def _to_hash(value)
227
+ if value.is_a?(Array)
228
+ value.compact.map { |v| _to_hash(v) }
229
+ elsif value.is_a?(Hash)
230
+ {}.tap do |hash|
231
+ value.each { |k, v| hash[k] = _to_hash(v) }
232
+ end
233
+ elsif value.respond_to? :to_hash
234
+ value.to_hash
235
+ else
236
+ value
237
+ end
238
+ end
239
+ end
240
+ end
@@ -0,0 +1,340 @@
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 PulpRpmClient
16
+ # A Serializer for RpmRemote.
17
+ class PatchedrpmRpmRemote
18
+ # A unique name for this remote.
19
+ attr_accessor :name
20
+
21
+ # The URL of an external content source.
22
+ attr_accessor :url
23
+
24
+ # A PEM encoded CA certificate used to validate the server certificate presented by the remote server.
25
+ attr_accessor :ca_cert
26
+
27
+ # A PEM encoded client certificate used for authentication.
28
+ attr_accessor :client_cert
29
+
30
+ # A PEM encoded private key used for authentication.
31
+ attr_accessor :client_key
32
+
33
+ # If True, TLS peer validation must be performed.
34
+ attr_accessor :tls_validation
35
+
36
+ # The proxy URL. Format: scheme://user:password@host:port
37
+ attr_accessor :proxy_url
38
+
39
+ # The username to be used for authentication when syncing.
40
+ attr_accessor :username
41
+
42
+ # The password to be used for authentication when syncing.
43
+ attr_accessor :password
44
+
45
+ # Total number of simultaneous connections.
46
+ attr_accessor :download_concurrency
47
+
48
+ # The policy to use when downloading content. The possible values include: 'immediate', 'on_demand', and 'streamed'. 'immediate' is the default.
49
+ attr_accessor :policy
50
+
51
+ # Authentication token for SLES repositories.
52
+ attr_accessor :sles_auth_token
53
+
54
+ # Attribute mapping from ruby-style variable name to JSON key.
55
+ def self.attribute_map
56
+ {
57
+ :'name' => :'name',
58
+ :'url' => :'url',
59
+ :'ca_cert' => :'ca_cert',
60
+ :'client_cert' => :'client_cert',
61
+ :'client_key' => :'client_key',
62
+ :'tls_validation' => :'tls_validation',
63
+ :'proxy_url' => :'proxy_url',
64
+ :'username' => :'username',
65
+ :'password' => :'password',
66
+ :'download_concurrency' => :'download_concurrency',
67
+ :'policy' => :'policy',
68
+ :'sles_auth_token' => :'sles_auth_token'
69
+ }
70
+ end
71
+
72
+ # Attribute type mapping.
73
+ def self.openapi_types
74
+ {
75
+ :'name' => :'String',
76
+ :'url' => :'String',
77
+ :'ca_cert' => :'String',
78
+ :'client_cert' => :'String',
79
+ :'client_key' => :'String',
80
+ :'tls_validation' => :'Boolean',
81
+ :'proxy_url' => :'String',
82
+ :'username' => :'String',
83
+ :'password' => :'String',
84
+ :'download_concurrency' => :'Integer',
85
+ :'policy' => :'PolicyEnum',
86
+ :'sles_auth_token' => :'String'
87
+ }
88
+ end
89
+
90
+ # List of attributes with nullable: true
91
+ def self.openapi_nullable
92
+ Set.new([
93
+ :'ca_cert',
94
+ :'client_cert',
95
+ :'client_key',
96
+ :'proxy_url',
97
+ :'username',
98
+ :'password',
99
+ :'sles_auth_token'
100
+ ])
101
+ end
102
+
103
+ # Initializes the object
104
+ # @param [Hash] attributes Model attributes in the form of hash
105
+ def initialize(attributes = {})
106
+ if (!attributes.is_a?(Hash))
107
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpRpmClient::PatchedrpmRpmRemote` initialize method"
108
+ end
109
+
110
+ # check to see if the attribute exists and convert string to symbol for hash key
111
+ attributes = attributes.each_with_object({}) { |(k, v), h|
112
+ if (!self.class.attribute_map.key?(k.to_sym))
113
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpRpmClient::PatchedrpmRpmRemote`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
114
+ end
115
+ h[k.to_sym] = v
116
+ }
117
+
118
+ if attributes.key?(:'name')
119
+ self.name = attributes[:'name']
120
+ end
121
+
122
+ if attributes.key?(:'url')
123
+ self.url = attributes[:'url']
124
+ end
125
+
126
+ if attributes.key?(:'ca_cert')
127
+ self.ca_cert = attributes[:'ca_cert']
128
+ end
129
+
130
+ if attributes.key?(:'client_cert')
131
+ self.client_cert = attributes[:'client_cert']
132
+ end
133
+
134
+ if attributes.key?(:'client_key')
135
+ self.client_key = attributes[:'client_key']
136
+ end
137
+
138
+ if attributes.key?(:'tls_validation')
139
+ self.tls_validation = attributes[:'tls_validation']
140
+ end
141
+
142
+ if attributes.key?(:'proxy_url')
143
+ self.proxy_url = attributes[:'proxy_url']
144
+ end
145
+
146
+ if attributes.key?(:'username')
147
+ self.username = attributes[:'username']
148
+ end
149
+
150
+ if attributes.key?(:'password')
151
+ self.password = attributes[:'password']
152
+ end
153
+
154
+ if attributes.key?(:'download_concurrency')
155
+ self.download_concurrency = attributes[:'download_concurrency']
156
+ end
157
+
158
+ if attributes.key?(:'policy')
159
+ self.policy = attributes[:'policy']
160
+ end
161
+
162
+ if attributes.key?(:'sles_auth_token')
163
+ self.sles_auth_token = attributes[:'sles_auth_token']
164
+ end
165
+ end
166
+
167
+ # Show invalid properties with the reasons. Usually used together with valid?
168
+ # @return Array for valid properties with the reasons
169
+ def list_invalid_properties
170
+ invalid_properties = Array.new
171
+ if !@download_concurrency.nil? && @download_concurrency < 1
172
+ invalid_properties.push('invalid value for "download_concurrency", must be greater than or equal to 1.')
173
+ end
174
+
175
+ invalid_properties
176
+ end
177
+
178
+ # Check to see if the all the properties in the model are valid
179
+ # @return true if the model is valid
180
+ def valid?
181
+ return false if !@download_concurrency.nil? && @download_concurrency < 1
182
+ true
183
+ end
184
+
185
+ # Custom attribute writer method with validation
186
+ # @param [Object] download_concurrency Value to be assigned
187
+ def download_concurrency=(download_concurrency)
188
+ if !download_concurrency.nil? && download_concurrency < 1
189
+ fail ArgumentError, 'invalid value for "download_concurrency", must be greater than or equal to 1.'
190
+ end
191
+
192
+ @download_concurrency = download_concurrency
193
+ end
194
+
195
+ # Checks equality by comparing each attribute.
196
+ # @param [Object] Object to be compared
197
+ def ==(o)
198
+ return true if self.equal?(o)
199
+ self.class == o.class &&
200
+ name == o.name &&
201
+ url == o.url &&
202
+ ca_cert == o.ca_cert &&
203
+ client_cert == o.client_cert &&
204
+ client_key == o.client_key &&
205
+ tls_validation == o.tls_validation &&
206
+ proxy_url == o.proxy_url &&
207
+ username == o.username &&
208
+ password == o.password &&
209
+ download_concurrency == o.download_concurrency &&
210
+ policy == o.policy &&
211
+ sles_auth_token == o.sles_auth_token
212
+ end
213
+
214
+ # @see the `==` method
215
+ # @param [Object] Object to be compared
216
+ def eql?(o)
217
+ self == o
218
+ end
219
+
220
+ # Calculates hash code according to all attributes.
221
+ # @return [Integer] Hash code
222
+ def hash
223
+ [name, url, ca_cert, client_cert, client_key, tls_validation, proxy_url, username, password, download_concurrency, policy, sles_auth_token].hash
224
+ end
225
+
226
+ # Builds the object from hash
227
+ # @param [Hash] attributes Model attributes in the form of hash
228
+ # @return [Object] Returns the model itself
229
+ def self.build_from_hash(attributes)
230
+ new.build_from_hash(attributes)
231
+ end
232
+
233
+ # Builds the object from hash
234
+ # @param [Hash] attributes Model attributes in the form of hash
235
+ # @return [Object] Returns the model itself
236
+ def build_from_hash(attributes)
237
+ return nil unless attributes.is_a?(Hash)
238
+ self.class.openapi_types.each_pair do |key, type|
239
+ if type =~ /\AArray<(.*)>/i
240
+ # check to ensure the input is an array given that the attribute
241
+ # is documented as an array but the input is not
242
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
243
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
244
+ end
245
+ elsif !attributes[self.class.attribute_map[key]].nil?
246
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
247
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
248
+ end
249
+
250
+ self
251
+ end
252
+
253
+ # Deserializes the data based on type
254
+ # @param string type Data type
255
+ # @param string value Value to be deserialized
256
+ # @return [Object] Deserialized data
257
+ def _deserialize(type, value)
258
+ case type.to_sym
259
+ when :DateTime
260
+ DateTime.parse(value)
261
+ when :Date
262
+ Date.parse(value)
263
+ when :String
264
+ value.to_s
265
+ when :Integer
266
+ value.to_i
267
+ when :Float
268
+ value.to_f
269
+ when :Boolean
270
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
271
+ true
272
+ else
273
+ false
274
+ end
275
+ when :Object
276
+ # generic object (usually a Hash), return directly
277
+ value
278
+ when /\AArray<(?<inner_type>.+)>\z/
279
+ inner_type = Regexp.last_match[:inner_type]
280
+ value.map { |v| _deserialize(inner_type, v) }
281
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
282
+ k_type = Regexp.last_match[:k_type]
283
+ v_type = Regexp.last_match[:v_type]
284
+ {}.tap do |hash|
285
+ value.each do |k, v|
286
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
287
+ end
288
+ end
289
+ else # model
290
+ PulpRpmClient.const_get(type).build_from_hash(value)
291
+ end
292
+ end
293
+
294
+ # Returns the string representation of the object
295
+ # @return [String] String presentation of the object
296
+ def to_s
297
+ to_hash.to_s
298
+ end
299
+
300
+ # to_body is an alias to to_hash (backward compatibility)
301
+ # @return [Hash] Returns the object in the form of hash
302
+ def to_body
303
+ to_hash
304
+ end
305
+
306
+ # Returns the object in the form of hash
307
+ # @return [Hash] Returns the object in the form of hash
308
+ def to_hash
309
+ hash = {}
310
+ self.class.attribute_map.each_pair do |attr, param|
311
+ value = self.send(attr)
312
+ if value.nil?
313
+ is_nullable = self.class.openapi_nullable.include?(attr)
314
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
315
+ end
316
+
317
+ hash[param] = _to_hash(value)
318
+ end
319
+ hash
320
+ end
321
+
322
+ # Outputs non-array value in the form of hash
323
+ # For object, use to_hash. Otherwise, just return the value
324
+ # @param [Object] value Any valid value
325
+ # @return [Hash] Returns the value in the form of hash
326
+ def _to_hash(value)
327
+ if value.is_a?(Array)
328
+ value.compact.map { |v| _to_hash(v) }
329
+ elsif value.is_a?(Hash)
330
+ {}.tap do |hash|
331
+ value.each { |k, v| hash[k] = _to_hash(v) }
332
+ end
333
+ elsif value.respond_to? :to_hash
334
+ value.to_hash
335
+ else
336
+ value
337
+ end
338
+ end
339
+ end
340
+ end