pulp_ostree_client 2.0.0a1.dev1626751709 → 2.0.0a1.dev1631416829

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of pulp_ostree_client might be problematic. Click here for more details.

Files changed (102) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +41 -23
  3. data/docs/ContentCommitsApi.md +138 -0
  4. data/docs/ContentConfigsApi.md +138 -0
  5. data/docs/ContentObjectsApi.md +138 -0
  6. data/docs/ContentRefsApi.md +138 -0
  7. data/docs/{ContentOstreeApi.md → ContentSummariesApi.md} +21 -75
  8. data/docs/DistributionsOstreeApi.md +3 -3
  9. data/docs/OstreeOstreeCommitResponse.md +25 -0
  10. data/docs/OstreeOstreeConfigResponse.md +21 -0
  11. data/docs/OstreeOstreeDistribution.md +2 -2
  12. data/docs/OstreeOstreeDistributionResponse.md +2 -2
  13. data/docs/OstreeOstreeObjectResponse.md +27 -0
  14. data/docs/OstreeOstreeRefResponse.md +25 -0
  15. data/docs/OstreeOstreeRemote.md +4 -2
  16. data/docs/OstreeOstreeRemoteResponse.md +4 -2
  17. data/docs/OstreeOstreeRepository.md +3 -3
  18. data/docs/OstreeOstreeRepositoryResponse.md +3 -3
  19. data/docs/{OstreeOstreeContentResponse.md → OstreeOstreeSummaryResponse.md} +2 -2
  20. data/docs/OstreeRepoImport.md +23 -0
  21. data/docs/{PaginatedostreeOstreePublicationResponseList.md → PaginatedostreeOstreeCommitResponseList.md} +3 -3
  22. data/docs/PaginatedostreeOstreeConfigResponseList.md +23 -0
  23. data/docs/PaginatedostreeOstreeObjectResponseList.md +23 -0
  24. data/docs/PaginatedostreeOstreeRefResponseList.md +23 -0
  25. data/docs/{PaginatedostreeOstreeContentResponseList.md → PaginatedostreeOstreeSummaryResponseList.md} +3 -3
  26. data/docs/PatchedostreeOstreeDistribution.md +2 -2
  27. data/docs/PatchedostreeOstreeRemote.md +4 -2
  28. data/docs/PatchedostreeOstreeRepository.md +3 -3
  29. data/docs/RemotesOstreeApi.md +4 -4
  30. data/docs/RepositoriesOstreeApi.md +60 -4
  31. data/docs/RepositoriesOstreeVersionsApi.md +3 -3
  32. data/lib/pulp_ostree_client/api/content_commits_api.rb +170 -0
  33. data/lib/pulp_ostree_client/api/content_configs_api.rb +170 -0
  34. data/lib/pulp_ostree_client/api/content_objects_api.rb +170 -0
  35. data/lib/pulp_ostree_client/api/content_refs_api.rb +170 -0
  36. data/lib/pulp_ostree_client/api/{content_ostree_api.rb → content_summaries_api.rb} +29 -93
  37. data/lib/pulp_ostree_client/api/distributions_ostree_api.rb +4 -4
  38. data/lib/pulp_ostree_client/api/remotes_ostree_api.rb +6 -6
  39. data/lib/pulp_ostree_client/api/repositories_ostree_api.rb +76 -6
  40. data/lib/pulp_ostree_client/api/repositories_ostree_versions_api.rb +4 -4
  41. data/lib/pulp_ostree_client/configuration.rb +2 -2
  42. data/lib/pulp_ostree_client/models/ostree_ostree_commit_response.rb +256 -0
  43. data/lib/pulp_ostree_client/models/{ostree_ostree_publication_response.rb → ostree_ostree_config_response.rb} +17 -21
  44. data/lib/pulp_ostree_client/models/ostree_ostree_distribution.rb +10 -10
  45. data/lib/pulp_ostree_client/models/ostree_ostree_distribution_response.rb +10 -10
  46. data/lib/pulp_ostree_client/models/ostree_ostree_object_response.rb +275 -0
  47. data/lib/pulp_ostree_client/models/{ostree_ostree_content.rb → ostree_ostree_ref_response.rb} +47 -15
  48. data/lib/pulp_ostree_client/models/ostree_ostree_remote.rb +34 -7
  49. data/lib/pulp_ostree_client/models/ostree_ostree_remote_response.rb +34 -7
  50. data/lib/pulp_ostree_client/models/ostree_ostree_repository.rb +18 -17
  51. data/lib/pulp_ostree_client/models/ostree_ostree_repository_response.rb +18 -17
  52. data/lib/pulp_ostree_client/models/{ostree_ostree_content_response.rb → ostree_ostree_summary_response.rb} +4 -4
  53. data/lib/pulp_ostree_client/models/ostree_repo_import.rb +248 -0
  54. data/lib/pulp_ostree_client/models/{paginatedostree_ostree_publication_response_list.rb → paginatedostree_ostree_commit_response_list.rb} +4 -4
  55. data/lib/pulp_ostree_client/models/paginatedostree_ostree_config_response_list.rb +237 -0
  56. data/lib/pulp_ostree_client/models/paginatedostree_ostree_object_response_list.rb +237 -0
  57. data/lib/pulp_ostree_client/models/{ostree_ostree_publication.rb → paginatedostree_ostree_ref_response_list.rb} +38 -18
  58. data/lib/pulp_ostree_client/models/{paginatedostree_ostree_content_response_list.rb → paginatedostree_ostree_summary_response_list.rb} +4 -4
  59. data/lib/pulp_ostree_client/models/patchedostree_ostree_distribution.rb +10 -10
  60. data/lib/pulp_ostree_client/models/patchedostree_ostree_remote.rb +34 -7
  61. data/lib/pulp_ostree_client/models/patchedostree_ostree_repository.rb +18 -17
  62. data/lib/pulp_ostree_client/models/policy_enum.rb +1 -1
  63. data/lib/pulp_ostree_client/version.rb +1 -1
  64. data/lib/pulp_ostree_client.rb +16 -8
  65. data/spec/api/{content_ostree_api_spec.rb → content_commits_api_spec.rb} +13 -25
  66. data/spec/api/content_configs_api_spec.rb +68 -0
  67. data/spec/api/content_objects_api_spec.rb +68 -0
  68. data/spec/api/content_refs_api_spec.rb +68 -0
  69. data/spec/api/content_summaries_api_spec.rb +68 -0
  70. data/spec/api/distributions_ostree_api_spec.rb +2 -2
  71. data/spec/api/remotes_ostree_api_spec.rb +3 -3
  72. data/spec/api/repositories_ostree_api_spec.rb +16 -3
  73. data/spec/api/repositories_ostree_versions_api_spec.rb +2 -2
  74. data/spec/configuration_spec.rb +3 -3
  75. data/spec/models/ostree_ostree_commit_response_spec.rb +65 -0
  76. data/spec/models/{ostree_ostree_content_spec.rb → ostree_ostree_config_response_spec.rb} +14 -8
  77. data/spec/models/ostree_ostree_distribution_response_spec.rb +1 -1
  78. data/spec/models/ostree_ostree_distribution_spec.rb +1 -1
  79. data/spec/models/ostree_ostree_object_response_spec.rb +71 -0
  80. data/spec/models/{ostree_ostree_publication_response_spec.rb → ostree_ostree_ref_response_spec.rb} +14 -8
  81. data/spec/models/ostree_ostree_remote_response_spec.rb +6 -0
  82. data/spec/models/ostree_ostree_remote_spec.rb +6 -0
  83. data/spec/models/ostree_ostree_repository_response_spec.rb +1 -1
  84. data/spec/models/ostree_ostree_repository_spec.rb +1 -1
  85. data/spec/models/{ostree_ostree_content_response_spec.rb → ostree_ostree_summary_response_spec.rb} +6 -6
  86. data/spec/models/ostree_repo_import_spec.rb +59 -0
  87. data/spec/models/{paginatedostree_ostree_publication_response_list_spec.rb → paginatedostree_ostree_commit_response_list_spec.rb} +6 -6
  88. data/spec/models/paginatedostree_ostree_config_response_list_spec.rb +59 -0
  89. data/spec/models/paginatedostree_ostree_object_response_list_spec.rb +59 -0
  90. data/spec/models/paginatedostree_ostree_ref_response_list_spec.rb +59 -0
  91. data/spec/models/{paginatedostree_ostree_content_response_list_spec.rb → paginatedostree_ostree_summary_response_list_spec.rb} +6 -6
  92. data/spec/models/patchedostree_ostree_distribution_spec.rb +1 -1
  93. data/spec/models/patchedostree_ostree_remote_spec.rb +6 -0
  94. data/spec/models/patchedostree_ostree_repository_spec.rb +1 -1
  95. metadata +81 -49
  96. data/docs/OstreeOstreeContent.md +0 -19
  97. data/docs/OstreeOstreePublication.md +0 -19
  98. data/docs/OstreeOstreePublicationResponse.md +0 -23
  99. data/docs/PublicationsOstreeApi.md +0 -257
  100. data/lib/pulp_ostree_client/api/publications_ostree_api.rb +0 -312
  101. data/spec/api/publications_ostree_api_spec.rb +0 -98
  102. data/spec/models/ostree_ostree_publication_spec.rb +0 -47
@@ -20,7 +20,7 @@ module PulpOstreeClient
20
20
  @api_client = api_client
21
21
  end
22
22
  # Create an ostree repository
23
- # A ViewSet for OstreeRepository. Similar to the OstreeContentViewSet above, define endpoint_name, queryset and serializer, at a minimum.
23
+ # A ViewSet class for OSTree repositories.
24
24
  # @param ostree_ostree_repository [OstreeOstreeRepository]
25
25
  # @param [Hash] opts the optional parameters
26
26
  # @return [OstreeOstreeRepositoryResponse]
@@ -30,7 +30,7 @@ module PulpOstreeClient
30
30
  end
31
31
 
32
32
  # Create an ostree repository
33
- # A ViewSet for OstreeRepository. Similar to the OstreeContentViewSet above, define endpoint_name, queryset and serializer, at a minimum.
33
+ # A ViewSet class for OSTree repositories.
34
34
  # @param ostree_ostree_repository [OstreeOstreeRepository]
35
35
  # @param [Hash] opts the optional parameters
36
36
  # @return [Array<(OstreeOstreeRepositoryResponse, Integer, Hash)>] OstreeOstreeRepositoryResponse data, response status code and response headers
@@ -145,8 +145,78 @@ module PulpOstreeClient
145
145
  return data, status_code, headers
146
146
  end
147
147
 
148
+ # Import commits to a repository
149
+ # Trigger an asynchronous task to create a new OSTree repository version.
150
+ # @param ostree_ostree_repository_href [String]
151
+ # @param ostree_repo_import [OstreeRepoImport]
152
+ # @param [Hash] opts the optional parameters
153
+ # @return [AsyncOperationResponse]
154
+ def import_commits(ostree_ostree_repository_href, ostree_repo_import, opts = {})
155
+ data, _status_code, _headers = import_commits_with_http_info(ostree_ostree_repository_href, ostree_repo_import, opts)
156
+ data
157
+ end
158
+
159
+ # Import commits to a repository
160
+ # Trigger an asynchronous task to create a new OSTree repository version.
161
+ # @param ostree_ostree_repository_href [String]
162
+ # @param ostree_repo_import [OstreeRepoImport]
163
+ # @param [Hash] opts the optional parameters
164
+ # @return [Array<(AsyncOperationResponse, Integer, Hash)>] AsyncOperationResponse data, response status code and response headers
165
+ def import_commits_with_http_info(ostree_ostree_repository_href, ostree_repo_import, opts = {})
166
+ if @api_client.config.debugging
167
+ @api_client.config.logger.debug 'Calling API: RepositoriesOstreeApi.import_commits ...'
168
+ end
169
+ # verify the required parameter 'ostree_ostree_repository_href' is set
170
+ if @api_client.config.client_side_validation && ostree_ostree_repository_href.nil?
171
+ fail ArgumentError, "Missing the required parameter 'ostree_ostree_repository_href' when calling RepositoriesOstreeApi.import_commits"
172
+ end
173
+ # verify the required parameter 'ostree_repo_import' is set
174
+ if @api_client.config.client_side_validation && ostree_repo_import.nil?
175
+ fail ArgumentError, "Missing the required parameter 'ostree_repo_import' when calling RepositoriesOstreeApi.import_commits"
176
+ end
177
+ # resource path
178
+ local_var_path = '{ostree_ostree_repository_href}import_commits/'.sub('{' + 'ostree_ostree_repository_href' + '}', CGI.escape(ostree_ostree_repository_href.to_s).gsub('%2F', '/'))
179
+
180
+ # query parameters
181
+ query_params = opts[:query_params] || {}
182
+
183
+ # header parameters
184
+ header_params = opts[:header_params] || {}
185
+ # HTTP header 'Accept' (if needed)
186
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
187
+ # HTTP header 'Content-Type'
188
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])
189
+
190
+ # form parameters
191
+ form_params = opts[:form_params] || {}
192
+
193
+ # http body (model)
194
+ post_body = opts[:body] || @api_client.object_to_http_body(ostree_repo_import)
195
+
196
+ # return_type
197
+ return_type = opts[:return_type] || 'AsyncOperationResponse'
198
+
199
+ # auth_names
200
+ auth_names = opts[:auth_names] || ['basicAuth']
201
+
202
+ new_options = opts.merge(
203
+ :header_params => header_params,
204
+ :query_params => query_params,
205
+ :form_params => form_params,
206
+ :body => post_body,
207
+ :auth_names => auth_names,
208
+ :return_type => return_type
209
+ )
210
+
211
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
212
+ if @api_client.config.debugging
213
+ @api_client.config.logger.debug "API called: RepositoriesOstreeApi#import_commits\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
214
+ end
215
+ return data, status_code, headers
216
+ end
217
+
148
218
  # List ostree repositorys
149
- # A ViewSet for OstreeRepository. Similar to the OstreeContentViewSet above, define endpoint_name, queryset and serializer, at a minimum.
219
+ # A ViewSet class for OSTree repositories.
150
220
  # @param [Hash] opts the optional parameters
151
221
  # @option opts [Integer] :limit Number of results to return per page.
152
222
  # @option opts [String] :name
@@ -166,7 +236,7 @@ module PulpOstreeClient
166
236
  end
167
237
 
168
238
  # List ostree repositorys
169
- # A ViewSet for OstreeRepository. Similar to the OstreeContentViewSet above, define endpoint_name, queryset and serializer, at a minimum.
239
+ # A ViewSet class for OSTree repositories.
170
240
  # @param [Hash] opts the optional parameters
171
241
  # @option opts [Integer] :limit Number of results to return per page.
172
242
  # @option opts [String] :name
@@ -375,7 +445,7 @@ module PulpOstreeClient
375
445
  end
376
446
 
377
447
  # Inspect an ostree repository
378
- # A ViewSet for OstreeRepository. Similar to the OstreeContentViewSet above, define endpoint_name, queryset and serializer, at a minimum.
448
+ # A ViewSet class for OSTree repositories.
379
449
  # @param ostree_ostree_repository_href [String]
380
450
  # @param [Hash] opts the optional parameters
381
451
  # @option opts [String] :fields A list of fields to include in the response.
@@ -387,7 +457,7 @@ module PulpOstreeClient
387
457
  end
388
458
 
389
459
  # Inspect an ostree repository
390
- # A ViewSet for OstreeRepository. Similar to the OstreeContentViewSet above, define endpoint_name, queryset and serializer, at a minimum.
460
+ # A ViewSet class for OSTree repositories.
391
461
  # @param ostree_ostree_repository_href [String]
392
462
  # @param [Hash] opts the optional parameters
393
463
  # @option opts [String] :fields A list of fields to include in the response.
@@ -82,7 +82,7 @@ module PulpOstreeClient
82
82
  end
83
83
 
84
84
  # List repository versions
85
- # A ViewSet for a OstreeRepositoryVersion represents a single Ostree repository version.
85
+ # A ViewSet class that represents a single OSTree repository version.
86
86
  # @param ostree_ostree_repository_href [String]
87
87
  # @param [Hash] opts the optional parameters
88
88
  # @option opts [String] :content Content Unit referenced by HREF
@@ -111,7 +111,7 @@ module PulpOstreeClient
111
111
  end
112
112
 
113
113
  # List repository versions
114
- # A ViewSet for a OstreeRepositoryVersion represents a single Ostree repository version.
114
+ # A ViewSet class that represents a single OSTree repository version.
115
115
  # @param ostree_ostree_repository_href [String]
116
116
  # @param [Hash] opts the optional parameters
117
117
  # @option opts [String] :content Content Unit referenced by HREF
@@ -201,7 +201,7 @@ module PulpOstreeClient
201
201
  end
202
202
 
203
203
  # Inspect a repository version
204
- # A ViewSet for a OstreeRepositoryVersion represents a single Ostree repository version.
204
+ # A ViewSet class that represents a single OSTree repository version.
205
205
  # @param ostree_ostree_repository_version_href [String]
206
206
  # @param [Hash] opts the optional parameters
207
207
  # @option opts [String] :fields A list of fields to include in the response.
@@ -213,7 +213,7 @@ module PulpOstreeClient
213
213
  end
214
214
 
215
215
  # Inspect a repository version
216
- # A ViewSet for a OstreeRepositoryVersion represents a single Ostree repository version.
216
+ # A ViewSet class that represents a single OSTree repository version.
217
217
  # @param ostree_ostree_repository_version_href [String]
218
218
  # @param [Hash] opts the optional parameters
219
219
  # @option opts [String] :fields A list of fields to include in the response.
@@ -127,7 +127,7 @@ module PulpOstreeClient
127
127
  attr_accessor :force_ending_format
128
128
 
129
129
  def initialize
130
- @scheme = 'http'
130
+ @scheme = 'https'
131
131
  @host = 'pulp'
132
132
  @base_path = ''
133
133
  @api_key = {}
@@ -209,7 +209,7 @@ module PulpOstreeClient
209
209
  def server_settings
210
210
  [
211
211
  {
212
- url: "http://pulp/",
212
+ url: "https://pulp/",
213
213
  description: "No description provided",
214
214
  }
215
215
  ]
@@ -0,0 +1,256 @@
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 PulpOstreeClient
16
+ # A Serializer class for OSTree commits.
17
+ class OstreeOstreeCommitResponse
18
+ attr_accessor :pulp_href
19
+
20
+ # Timestamp of creation.
21
+ attr_accessor :pulp_created
22
+
23
+ # Artifact file representing the physical content
24
+ attr_accessor :artifact
25
+
26
+ attr_accessor :parent_commit
27
+
28
+ attr_accessor :checksum
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ :'pulp_href' => :'pulp_href',
34
+ :'pulp_created' => :'pulp_created',
35
+ :'artifact' => :'artifact',
36
+ :'parent_commit' => :'parent_commit',
37
+ :'checksum' => :'checksum'
38
+ }
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'pulp_href' => :'String',
45
+ :'pulp_created' => :'DateTime',
46
+ :'artifact' => :'String',
47
+ :'parent_commit' => :'String',
48
+ :'checksum' => :'String'
49
+ }
50
+ end
51
+
52
+ # List of attributes with nullable: true
53
+ def self.openapi_nullable
54
+ Set.new([
55
+ :'parent_commit',
56
+ ])
57
+ end
58
+
59
+ # Initializes the object
60
+ # @param [Hash] attributes Model attributes in the form of hash
61
+ def initialize(attributes = {})
62
+ if (!attributes.is_a?(Hash))
63
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpOstreeClient::OstreeOstreeCommitResponse` initialize method"
64
+ end
65
+
66
+ # check to see if the attribute exists and convert string to symbol for hash key
67
+ attributes = attributes.each_with_object({}) { |(k, v), h|
68
+ if (!self.class.attribute_map.key?(k.to_sym))
69
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpOstreeClient::OstreeOstreeCommitResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
70
+ end
71
+ h[k.to_sym] = v
72
+ }
73
+
74
+ if attributes.key?(:'pulp_href')
75
+ self.pulp_href = attributes[:'pulp_href']
76
+ end
77
+
78
+ if attributes.key?(:'pulp_created')
79
+ self.pulp_created = attributes[:'pulp_created']
80
+ end
81
+
82
+ if attributes.key?(:'artifact')
83
+ self.artifact = attributes[:'artifact']
84
+ end
85
+
86
+ if attributes.key?(:'parent_commit')
87
+ self.parent_commit = attributes[:'parent_commit']
88
+ end
89
+
90
+ if attributes.key?(:'checksum')
91
+ self.checksum = attributes[:'checksum']
92
+ end
93
+ end
94
+
95
+ # Show invalid properties with the reasons. Usually used together with valid?
96
+ # @return Array for valid properties with the reasons
97
+ def list_invalid_properties
98
+ invalid_properties = Array.new
99
+ if @artifact.nil?
100
+ invalid_properties.push('invalid value for "artifact", artifact cannot be nil.')
101
+ end
102
+
103
+ if @checksum.nil?
104
+ invalid_properties.push('invalid value for "checksum", checksum cannot be nil.')
105
+ end
106
+
107
+ invalid_properties
108
+ end
109
+
110
+ # Check to see if the all the properties in the model are valid
111
+ # @return true if the model is valid
112
+ def valid?
113
+ return false if @artifact.nil?
114
+ return false if @checksum.nil?
115
+ true
116
+ end
117
+
118
+ # Checks equality by comparing each attribute.
119
+ # @param [Object] Object to be compared
120
+ def ==(o)
121
+ return true if self.equal?(o)
122
+ self.class == o.class &&
123
+ pulp_href == o.pulp_href &&
124
+ pulp_created == o.pulp_created &&
125
+ artifact == o.artifact &&
126
+ parent_commit == o.parent_commit &&
127
+ checksum == o.checksum
128
+ end
129
+
130
+ # @see the `==` method
131
+ # @param [Object] Object to be compared
132
+ def eql?(o)
133
+ self == o
134
+ end
135
+
136
+ # Calculates hash code according to all attributes.
137
+ # @return [Integer] Hash code
138
+ def hash
139
+ [pulp_href, pulp_created, artifact, parent_commit, checksum].hash
140
+ end
141
+
142
+ # Builds the object from hash
143
+ # @param [Hash] attributes Model attributes in the form of hash
144
+ # @return [Object] Returns the model itself
145
+ def self.build_from_hash(attributes)
146
+ new.build_from_hash(attributes)
147
+ end
148
+
149
+ # Builds the object from hash
150
+ # @param [Hash] attributes Model attributes in the form of hash
151
+ # @return [Object] Returns the model itself
152
+ def build_from_hash(attributes)
153
+ return nil unless attributes.is_a?(Hash)
154
+ self.class.openapi_types.each_pair do |key, type|
155
+ if type =~ /\AArray<(.*)>/i
156
+ # check to ensure the input is an array given that the attribute
157
+ # is documented as an array but the input is not
158
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
159
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
160
+ end
161
+ elsif !attributes[self.class.attribute_map[key]].nil?
162
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
163
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
164
+ end
165
+
166
+ self
167
+ end
168
+
169
+ # Deserializes the data based on type
170
+ # @param string type Data type
171
+ # @param string value Value to be deserialized
172
+ # @return [Object] Deserialized data
173
+ def _deserialize(type, value)
174
+ case type.to_sym
175
+ when :DateTime
176
+ DateTime.parse(value)
177
+ when :Date
178
+ Date.parse(value)
179
+ when :String
180
+ value.to_s
181
+ when :Integer
182
+ value.to_i
183
+ when :Float
184
+ value.to_f
185
+ when :Boolean
186
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
187
+ true
188
+ else
189
+ false
190
+ end
191
+ when :Object
192
+ # generic object (usually a Hash), return directly
193
+ value
194
+ when /\AArray<(?<inner_type>.+)>\z/
195
+ inner_type = Regexp.last_match[:inner_type]
196
+ value.map { |v| _deserialize(inner_type, v) }
197
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
198
+ k_type = Regexp.last_match[:k_type]
199
+ v_type = Regexp.last_match[:v_type]
200
+ {}.tap do |hash|
201
+ value.each do |k, v|
202
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
203
+ end
204
+ end
205
+ else # model
206
+ PulpOstreeClient.const_get(type).build_from_hash(value)
207
+ end
208
+ end
209
+
210
+ # Returns the string representation of the object
211
+ # @return [String] String presentation of the object
212
+ def to_s
213
+ to_hash.to_s
214
+ end
215
+
216
+ # to_body is an alias to to_hash (backward compatibility)
217
+ # @return [Hash] Returns the object in the form of hash
218
+ def to_body
219
+ to_hash
220
+ end
221
+
222
+ # Returns the object in the form of hash
223
+ # @return [Hash] Returns the object in the form of hash
224
+ def to_hash
225
+ hash = {}
226
+ self.class.attribute_map.each_pair do |attr, param|
227
+ value = self.send(attr)
228
+ if value.nil?
229
+ is_nullable = self.class.openapi_nullable.include?(attr)
230
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
231
+ end
232
+
233
+ hash[param] = _to_hash(value)
234
+ end
235
+ hash
236
+ end
237
+
238
+ # Outputs non-array value in the form of hash
239
+ # For object, use to_hash. Otherwise, just return the value
240
+ # @param [Object] value Any valid value
241
+ # @return [Hash] Returns the value in the form of hash
242
+ def _to_hash(value)
243
+ if value.is_a?(Array)
244
+ value.compact.map { |v| _to_hash(v) }
245
+ elsif value.is_a?(Hash)
246
+ {}.tap do |hash|
247
+ value.each { |k, v| hash[k] = _to_hash(v) }
248
+ end
249
+ elsif value.respond_to? :to_hash
250
+ value.to_hash
251
+ else
252
+ value
253
+ end
254
+ end
255
+ end
256
+ end
@@ -13,25 +13,22 @@ OpenAPI Generator version: 4.3.1
13
13
  require 'date'
14
14
 
15
15
  module PulpOstreeClient
16
- # A Serializer for OstreePublication. Add any new fields if defined on OstreePublication. Similar to the example above, in OstreeContentSerializer. Additional validators can be added to the parent validators list For example:: class Meta: validators = platform.PublicationSerializer.Meta.validators + [myValidator1, myValidator2]
17
- class OstreeOstreePublicationResponse
16
+ # A Serializer class for OSTree repository configuration files.
17
+ class OstreeOstreeConfigResponse
18
18
  attr_accessor :pulp_href
19
19
 
20
20
  # Timestamp of creation.
21
21
  attr_accessor :pulp_created
22
22
 
23
- attr_accessor :repository_version
24
-
25
- # A URI of the repository to be published.
26
- attr_accessor :repository
23
+ # Artifact file representing the physical content
24
+ attr_accessor :artifact
27
25
 
28
26
  # Attribute mapping from ruby-style variable name to JSON key.
29
27
  def self.attribute_map
30
28
  {
31
29
  :'pulp_href' => :'pulp_href',
32
30
  :'pulp_created' => :'pulp_created',
33
- :'repository_version' => :'repository_version',
34
- :'repository' => :'repository'
31
+ :'artifact' => :'artifact'
35
32
  }
36
33
  end
37
34
 
@@ -40,8 +37,7 @@ module PulpOstreeClient
40
37
  {
41
38
  :'pulp_href' => :'String',
42
39
  :'pulp_created' => :'DateTime',
43
- :'repository_version' => :'String',
44
- :'repository' => :'String'
40
+ :'artifact' => :'String'
45
41
  }
46
42
  end
47
43
 
@@ -55,13 +51,13 @@ module PulpOstreeClient
55
51
  # @param [Hash] attributes Model attributes in the form of hash
56
52
  def initialize(attributes = {})
57
53
  if (!attributes.is_a?(Hash))
58
- fail ArgumentError, "The input argument (attributes) must be a hash in `PulpOstreeClient::OstreeOstreePublicationResponse` initialize method"
54
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpOstreeClient::OstreeOstreeConfigResponse` initialize method"
59
55
  end
60
56
 
61
57
  # check to see if the attribute exists and convert string to symbol for hash key
62
58
  attributes = attributes.each_with_object({}) { |(k, v), h|
63
59
  if (!self.class.attribute_map.key?(k.to_sym))
64
- fail ArgumentError, "`#{k}` is not a valid attribute in `PulpOstreeClient::OstreeOstreePublicationResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
60
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpOstreeClient::OstreeOstreeConfigResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
65
61
  end
66
62
  h[k.to_sym] = v
67
63
  }
@@ -74,12 +70,8 @@ module PulpOstreeClient
74
70
  self.pulp_created = attributes[:'pulp_created']
75
71
  end
76
72
 
77
- if attributes.key?(:'repository_version')
78
- self.repository_version = attributes[:'repository_version']
79
- end
80
-
81
- if attributes.key?(:'repository')
82
- self.repository = attributes[:'repository']
73
+ if attributes.key?(:'artifact')
74
+ self.artifact = attributes[:'artifact']
83
75
  end
84
76
  end
85
77
 
@@ -87,12 +79,17 @@ module PulpOstreeClient
87
79
  # @return Array for valid properties with the reasons
88
80
  def list_invalid_properties
89
81
  invalid_properties = Array.new
82
+ if @artifact.nil?
83
+ invalid_properties.push('invalid value for "artifact", artifact cannot be nil.')
84
+ end
85
+
90
86
  invalid_properties
91
87
  end
92
88
 
93
89
  # Check to see if the all the properties in the model are valid
94
90
  # @return true if the model is valid
95
91
  def valid?
92
+ return false if @artifact.nil?
96
93
  true
97
94
  end
98
95
 
@@ -103,8 +100,7 @@ module PulpOstreeClient
103
100
  self.class == o.class &&
104
101
  pulp_href == o.pulp_href &&
105
102
  pulp_created == o.pulp_created &&
106
- repository_version == o.repository_version &&
107
- repository == o.repository
103
+ artifact == o.artifact
108
104
  end
109
105
 
110
106
  # @see the `==` method
@@ -116,7 +112,7 @@ module PulpOstreeClient
116
112
  # Calculates hash code according to all attributes.
117
113
  # @return [Integer] Hash code
118
114
  def hash
119
- [pulp_href, pulp_created, repository_version, repository].hash
115
+ [pulp_href, pulp_created, artifact].hash
120
116
  end
121
117
 
122
118
  # Builds the object from hash