pulpcore_client 3.0.0rc2 → 3.0.0rc3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (91) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/README.md +43 -37
  4. data/docs/ArtifactsApi.md +20 -20
  5. data/docs/ContentAppStatus.md +19 -0
  6. data/docs/DatabaseConnection.md +17 -0
  7. data/docs/OrphansApi.md +5 -5
  8. data/docs/ProgressReport.md +1 -3
  9. data/docs/RedisConnection.md +17 -0
  10. data/docs/RepositoriesApi.md +30 -278
  11. data/docs/RepositoriesVersionsApi.md +256 -0
  12. data/docs/RepositoryVersionCreate.md +2 -2
  13. data/docs/Status.md +27 -0
  14. data/docs/StatusApi.md +8 -7
  15. data/docs/TaskCancel.md +17 -0
  16. data/docs/TasksApi.md +71 -71
  17. data/docs/Upload.md +6 -8
  18. data/docs/UploadCommit.md +17 -0
  19. data/docs/UploadsApi.md +66 -106
  20. data/docs/Version.md +19 -0
  21. data/docs/WorkersApi.md +10 -10
  22. data/lib/pulpcore_client/api/artifacts_api.rb +47 -23
  23. data/lib/pulpcore_client/api/orphans_api.rb +6 -6
  24. data/lib/pulpcore_client/api/repositories_api.rb +38 -338
  25. data/lib/pulpcore_client/api/repositories_versions_api.rb +322 -0
  26. data/lib/pulpcore_client/api/status_api.rb +12 -10
  27. data/lib/pulpcore_client/api/tasks_api.rb +88 -88
  28. data/lib/pulpcore_client/api/uploads_api.rb +105 -154
  29. data/lib/pulpcore_client/api/workers_api.rb +12 -12
  30. data/lib/pulpcore_client/api_client.rb +1 -1
  31. data/lib/pulpcore_client/api_error.rb +1 -1
  32. data/lib/pulpcore_client/configuration.rb +1 -1
  33. data/lib/pulpcore_client/models/artifact.rb +91 -1
  34. data/lib/pulpcore_client/models/async_operation_response.rb +1 -1
  35. data/lib/pulpcore_client/models/content_app_status.rb +223 -0
  36. data/lib/pulpcore_client/models/database_connection.rb +203 -0
  37. data/lib/pulpcore_client/models/inline_response200.rb +1 -1
  38. data/lib/pulpcore_client/models/inline_response2001.rb +1 -1
  39. data/lib/pulpcore_client/models/inline_response2002.rb +1 -1
  40. data/lib/pulpcore_client/models/inline_response2003.rb +1 -1
  41. data/lib/pulpcore_client/models/inline_response2004.rb +1 -1
  42. data/lib/pulpcore_client/models/inline_response2005.rb +1 -1
  43. data/lib/pulpcore_client/models/progress_report.rb +20 -15
  44. data/lib/pulpcore_client/models/redis_connection.rb +203 -0
  45. data/lib/pulpcore_client/models/repository.rb +16 -1
  46. data/lib/pulpcore_client/models/repository_version.rb +1 -1
  47. data/lib/pulpcore_client/models/repository_version_create.rb +3 -13
  48. data/lib/pulpcore_client/models/status.rb +283 -0
  49. data/lib/pulpcore_client/models/task.rb +1 -1
  50. data/lib/pulpcore_client/models/task_cancel.rb +221 -0
  51. data/lib/pulpcore_client/models/upload.rb +26 -52
  52. data/lib/pulpcore_client/models/upload_commit.rb +221 -0
  53. data/lib/pulpcore_client/models/version.rb +256 -0
  54. data/lib/pulpcore_client/models/worker.rb +2 -1
  55. data/lib/pulpcore_client/version.rb +2 -2
  56. data/lib/pulpcore_client.rb +9 -1
  57. data/pulpcore_client.gemspec +1 -1
  58. data/spec/api/artifacts_api_spec.rb +9 -9
  59. data/spec/api/orphans_api_spec.rb +3 -3
  60. data/spec/api/repositories_api_spec.rb +13 -76
  61. data/spec/api/repositories_versions_api_spec.rb +98 -0
  62. data/spec/api/status_api_spec.rb +4 -4
  63. data/spec/api/tasks_api_spec.rb +20 -20
  64. data/spec/api/uploads_api_spec.rb +32 -37
  65. data/spec/api/workers_api_spec.rb +5 -5
  66. data/spec/api_client_spec.rb +1 -1
  67. data/spec/configuration_spec.rb +1 -1
  68. data/spec/models/artifact_spec.rb +1 -1
  69. data/spec/models/async_operation_response_spec.rb +1 -1
  70. data/spec/models/content_app_status_spec.rb +47 -0
  71. data/spec/models/database_connection_spec.rb +41 -0
  72. data/spec/models/inline_response2001_spec.rb +1 -1
  73. data/spec/models/inline_response2002_spec.rb +1 -1
  74. data/spec/models/inline_response2003_spec.rb +1 -1
  75. data/spec/models/inline_response2004_spec.rb +1 -1
  76. data/spec/models/inline_response2005_spec.rb +1 -1
  77. data/spec/models/inline_response200_spec.rb +1 -1
  78. data/spec/models/progress_report_spec.rb +1 -7
  79. data/spec/models/redis_connection_spec.rb +41 -0
  80. data/spec/models/repository_spec.rb +1 -1
  81. data/spec/models/repository_version_create_spec.rb +1 -1
  82. data/spec/models/repository_version_spec.rb +1 -1
  83. data/spec/models/status_spec.rb +71 -0
  84. data/spec/models/task_cancel_spec.rb +41 -0
  85. data/spec/models/task_spec.rb +1 -1
  86. data/spec/models/upload_commit_spec.rb +41 -0
  87. data/spec/models/upload_spec.rb +4 -10
  88. data/spec/models/version_spec.rb +47 -0
  89. data/spec/models/worker_spec.rb +1 -1
  90. data/spec/spec_helper.rb +1 -1
  91. metadata +34 -2
@@ -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.0.1-SNAPSHOT
9
+ OpenAPI Generator version: 4.0.0
10
10
 
11
11
  =end
12
12
 
@@ -29,9 +29,6 @@ module PulpcoreClient
29
29
  # The suffix to be shown with the progress report.
30
30
  attr_accessor :suffix
31
31
 
32
- # The task associated with this progress report.
33
- attr_accessor :task
34
-
35
32
  # Attribute mapping from ruby-style variable name to JSON key.
36
33
  def self.attribute_map
37
34
  {
@@ -39,8 +36,7 @@ module PulpcoreClient
39
36
  :'state' => :'state',
40
37
  :'total' => :'total',
41
38
  :'done' => :'done',
42
- :'suffix' => :'suffix',
43
- :'task' => :'task'
39
+ :'suffix' => :'suffix'
44
40
  }
45
41
  end
46
42
 
@@ -51,8 +47,7 @@ module PulpcoreClient
51
47
  :'state' => :'String',
52
48
  :'total' => :'Integer',
53
49
  :'done' => :'Integer',
54
- :'suffix' => :'String',
55
- :'task' => :'String'
50
+ :'suffix' => :'String'
56
51
  }
57
52
  end
58
53
 
@@ -90,10 +85,6 @@ module PulpcoreClient
90
85
  if attributes.key?(:'suffix')
91
86
  self.suffix = attributes[:'suffix']
92
87
  end
93
-
94
- if attributes.key?(:'task')
95
- self.task = attributes[:'task']
96
- end
97
88
  end
98
89
 
99
90
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -108,6 +99,10 @@ module PulpcoreClient
108
99
  invalid_properties.push('invalid value for "state", the character length must be great than or equal to 1.')
109
100
  end
110
101
 
102
+ if !@suffix.nil? && @suffix.to_s.length < 1
103
+ invalid_properties.push('invalid value for "suffix", the character length must be great than or equal to 1.')
104
+ end
105
+
111
106
  invalid_properties
112
107
  end
113
108
 
@@ -116,6 +111,7 @@ module PulpcoreClient
116
111
  def valid?
117
112
  return false if !@message.nil? && @message.to_s.length < 1
118
113
  return false if !@state.nil? && @state.to_s.length < 1
114
+ return false if !@suffix.nil? && @suffix.to_s.length < 1
119
115
  true
120
116
  end
121
117
 
@@ -139,6 +135,16 @@ module PulpcoreClient
139
135
  @state = state
140
136
  end
141
137
 
138
+ # Custom attribute writer method with validation
139
+ # @param [Object] suffix Value to be assigned
140
+ def suffix=(suffix)
141
+ if !suffix.nil? && suffix.to_s.length < 1
142
+ fail ArgumentError, 'invalid value for "suffix", the character length must be great than or equal to 1.'
143
+ end
144
+
145
+ @suffix = suffix
146
+ end
147
+
142
148
  # Checks equality by comparing each attribute.
143
149
  # @param [Object] Object to be compared
144
150
  def ==(o)
@@ -148,8 +154,7 @@ module PulpcoreClient
148
154
  state == o.state &&
149
155
  total == o.total &&
150
156
  done == o.done &&
151
- suffix == o.suffix &&
152
- task == o.task
157
+ suffix == o.suffix
153
158
  end
154
159
 
155
160
  # @see the `==` method
@@ -161,7 +166,7 @@ module PulpcoreClient
161
166
  # Calculates hash code according to all attributes.
162
167
  # @return [Integer] Hash code
163
168
  def hash
164
- [message, state, total, done, suffix, task].hash
169
+ [message, state, total, done, suffix].hash
165
170
  end
166
171
 
167
172
  # Builds the object from hash
@@ -0,0 +1,203 @@
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.0.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module PulpcoreClient
16
+ # Redis connection information
17
+ class RedisConnection
18
+ # Info about whether the app can connect to Redis
19
+ attr_accessor :connected
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'connected' => :'connected'
25
+ }
26
+ end
27
+
28
+ # Attribute type mapping.
29
+ def self.openapi_types
30
+ {
31
+ :'connected' => :'Boolean'
32
+ }
33
+ end
34
+
35
+ # Initializes the object
36
+ # @param [Hash] attributes Model attributes in the form of hash
37
+ def initialize(attributes = {})
38
+ if (!attributes.is_a?(Hash))
39
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpcoreClient::RedisConnection` initialize method"
40
+ end
41
+
42
+ # check to see if the attribute exists and convert string to symbol for hash key
43
+ attributes = attributes.each_with_object({}) { |(k, v), h|
44
+ if (!self.class.attribute_map.key?(k.to_sym))
45
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpcoreClient::RedisConnection`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
46
+ end
47
+ h[k.to_sym] = v
48
+ }
49
+
50
+ if attributes.key?(:'connected')
51
+ self.connected = attributes[:'connected']
52
+ end
53
+ end
54
+
55
+ # Show invalid properties with the reasons. Usually used together with valid?
56
+ # @return Array for valid properties with the reasons
57
+ def list_invalid_properties
58
+ invalid_properties = Array.new
59
+ if @connected.nil?
60
+ invalid_properties.push('invalid value for "connected", connected cannot be nil.')
61
+ end
62
+
63
+ invalid_properties
64
+ end
65
+
66
+ # Check to see if the all the properties in the model are valid
67
+ # @return true if the model is valid
68
+ def valid?
69
+ return false if @connected.nil?
70
+ true
71
+ end
72
+
73
+ # Checks equality by comparing each attribute.
74
+ # @param [Object] Object to be compared
75
+ def ==(o)
76
+ return true if self.equal?(o)
77
+ self.class == o.class &&
78
+ connected == o.connected
79
+ end
80
+
81
+ # @see the `==` method
82
+ # @param [Object] Object to be compared
83
+ def eql?(o)
84
+ self == o
85
+ end
86
+
87
+ # Calculates hash code according to all attributes.
88
+ # @return [Integer] Hash code
89
+ def hash
90
+ [connected].hash
91
+ end
92
+
93
+ # Builds the object from hash
94
+ # @param [Hash] attributes Model attributes in the form of hash
95
+ # @return [Object] Returns the model itself
96
+ def self.build_from_hash(attributes)
97
+ new.build_from_hash(attributes)
98
+ end
99
+
100
+ # Builds the object from hash
101
+ # @param [Hash] attributes Model attributes in the form of hash
102
+ # @return [Object] Returns the model itself
103
+ def build_from_hash(attributes)
104
+ return nil unless attributes.is_a?(Hash)
105
+ self.class.openapi_types.each_pair do |key, type|
106
+ if type =~ /\AArray<(.*)>/i
107
+ # check to ensure the input is an array given that the attribute
108
+ # is documented as an array but the input is not
109
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
110
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
111
+ end
112
+ elsif !attributes[self.class.attribute_map[key]].nil?
113
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
114
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
115
+ end
116
+
117
+ self
118
+ end
119
+
120
+ # Deserializes the data based on type
121
+ # @param string type Data type
122
+ # @param string value Value to be deserialized
123
+ # @return [Object] Deserialized data
124
+ def _deserialize(type, value)
125
+ case type.to_sym
126
+ when :DateTime
127
+ DateTime.parse(value)
128
+ when :Date
129
+ Date.parse(value)
130
+ when :String
131
+ value.to_s
132
+ when :Integer
133
+ value.to_i
134
+ when :Float
135
+ value.to_f
136
+ when :Boolean
137
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
138
+ true
139
+ else
140
+ false
141
+ end
142
+ when :Object
143
+ # generic object (usually a Hash), return directly
144
+ value
145
+ when /\AArray<(?<inner_type>.+)>\z/
146
+ inner_type = Regexp.last_match[:inner_type]
147
+ value.map { |v| _deserialize(inner_type, v) }
148
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
149
+ k_type = Regexp.last_match[:k_type]
150
+ v_type = Regexp.last_match[:v_type]
151
+ {}.tap do |hash|
152
+ value.each do |k, v|
153
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
154
+ end
155
+ end
156
+ else # model
157
+ PulpcoreClient.const_get(type).build_from_hash(value)
158
+ end
159
+ end
160
+
161
+ # Returns the string representation of the object
162
+ # @return [String] String presentation of the object
163
+ def to_s
164
+ to_hash.to_s
165
+ end
166
+
167
+ # to_body is an alias to to_hash (backward compatibility)
168
+ # @return [Hash] Returns the object in the form of hash
169
+ def to_body
170
+ to_hash
171
+ end
172
+
173
+ # Returns the object in the form of hash
174
+ # @return [Hash] Returns the object in the form of hash
175
+ def to_hash
176
+ hash = {}
177
+ self.class.attribute_map.each_pair do |attr, param|
178
+ value = self.send(attr)
179
+ next if value.nil?
180
+ hash[param] = _to_hash(value)
181
+ end
182
+ hash
183
+ end
184
+
185
+ # Outputs non-array value in the form of hash
186
+ # For object, use to_hash. Otherwise, just return the value
187
+ # @param [Object] value Any valid value
188
+ # @return [Hash] Returns the value in the form of hash
189
+ def _to_hash(value)
190
+ if value.is_a?(Array)
191
+ value.compact.map { |v| _to_hash(v) }
192
+ elsif value.is_a?(Hash)
193
+ {}.tap do |hash|
194
+ value.each { |k, v| hash[k] = _to_hash(v) }
195
+ end
196
+ elsif value.respond_to? :to_hash
197
+ value.to_hash
198
+ else
199
+ value
200
+ end
201
+ end
202
+ end
203
+ 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.0.1-SNAPSHOT
9
+ OpenAPI Generator version: 4.0.0
10
10
 
11
11
  =end
12
12
 
@@ -105,6 +105,10 @@ module PulpcoreClient
105
105
  invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
106
106
  end
107
107
 
108
+ if !@description.nil? && @description.to_s.length < 1
109
+ invalid_properties.push('invalid value for "description", the character length must be great than or equal to 1.')
110
+ end
111
+
108
112
  invalid_properties
109
113
  end
110
114
 
@@ -113,6 +117,7 @@ module PulpcoreClient
113
117
  def valid?
114
118
  return false if @name.nil?
115
119
  return false if @name.to_s.length < 1
120
+ return false if !@description.nil? && @description.to_s.length < 1
116
121
  true
117
122
  end
118
123
 
@@ -130,6 +135,16 @@ module PulpcoreClient
130
135
  @name = name
131
136
  end
132
137
 
138
+ # Custom attribute writer method with validation
139
+ # @param [Object] description Value to be assigned
140
+ def description=(description)
141
+ if !description.nil? && description.to_s.length < 1
142
+ fail ArgumentError, 'invalid value for "description", the character length must be great than or equal to 1.'
143
+ end
144
+
145
+ @description = description
146
+ end
147
+
133
148
  # Checks equality by comparing each attribute.
134
149
  # @param [Object] Object to be compared
135
150
  def ==(o)
@@ -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.0.1-SNAPSHOT
9
+ OpenAPI Generator version: 4.0.0
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.0.1-SNAPSHOT
9
+ OpenAPI Generator version: 4.0.0
10
10
 
11
11
  =end
12
12
 
@@ -14,10 +14,10 @@ require 'date'
14
14
 
15
15
  module PulpcoreClient
16
16
  class RepositoryVersionCreate
17
- # A list of content units to add to a new repository version
17
+ # A list of content units to add to a new repository version. This content is added after remove_content_units are removed.
18
18
  attr_accessor :add_content_units
19
19
 
20
- # A list of content units to remove from the latest repository version
20
+ # A list of content units to remove from the latest repository version. You may also specify '*' as an entry to remove all content. This content is removed before add_content_units are added.
21
21
  attr_accessor :remove_content_units
22
22
 
23
23
  # A repository version whose content will be used as the initial set of content for the new repository version
@@ -77,22 +77,12 @@ module PulpcoreClient
77
77
  # @return Array for valid properties with the reasons
78
78
  def list_invalid_properties
79
79
  invalid_properties = Array.new
80
- if @add_content_units.nil?
81
- invalid_properties.push('invalid value for "add_content_units", add_content_units cannot be nil.')
82
- end
83
-
84
- if @remove_content_units.nil?
85
- invalid_properties.push('invalid value for "remove_content_units", remove_content_units cannot be nil.')
86
- end
87
-
88
80
  invalid_properties
89
81
  end
90
82
 
91
83
  # Check to see if the all the properties in the model are valid
92
84
  # @return true if the model is valid
93
85
  def valid?
94
- return false if @add_content_units.nil?
95
- return false if @remove_content_units.nil?
96
86
  true
97
87
  end
98
88
 
@@ -0,0 +1,283 @@
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.0.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module PulpcoreClient
16
+ class Status
17
+ # Version information of Pulp components
18
+ attr_accessor :versions
19
+
20
+ # List of online workers known to the application. An online worker is actively heartbeating and can respond to new work
21
+ attr_accessor :online_workers
22
+
23
+ # List of missing workers known to the application. A missing worker is a worker that was online, but has now stopped heartbeating and has potentially died
24
+ attr_accessor :missing_workers
25
+
26
+ # List of online content apps known to the application. An online worker is actively heartbeating
27
+ attr_accessor :online_content_apps
28
+
29
+ attr_accessor :database_connection
30
+
31
+ attr_accessor :redis_connection
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+ :'versions' => :'versions',
37
+ :'online_workers' => :'online_workers',
38
+ :'missing_workers' => :'missing_workers',
39
+ :'online_content_apps' => :'online_content_apps',
40
+ :'database_connection' => :'database_connection',
41
+ :'redis_connection' => :'redis_connection'
42
+ }
43
+ end
44
+
45
+ # Attribute type mapping.
46
+ def self.openapi_types
47
+ {
48
+ :'versions' => :'Array<Version>',
49
+ :'online_workers' => :'Array<Worker>',
50
+ :'missing_workers' => :'Array<Worker>',
51
+ :'online_content_apps' => :'Array<ContentAppStatus>',
52
+ :'database_connection' => :'DatabaseConnection',
53
+ :'redis_connection' => :'RedisConnection'
54
+ }
55
+ end
56
+
57
+ # Initializes the object
58
+ # @param [Hash] attributes Model attributes in the form of hash
59
+ def initialize(attributes = {})
60
+ if (!attributes.is_a?(Hash))
61
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PulpcoreClient::Status` initialize method"
62
+ end
63
+
64
+ # check to see if the attribute exists and convert string to symbol for hash key
65
+ attributes = attributes.each_with_object({}) { |(k, v), h|
66
+ if (!self.class.attribute_map.key?(k.to_sym))
67
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PulpcoreClient::Status`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
68
+ end
69
+ h[k.to_sym] = v
70
+ }
71
+
72
+ if attributes.key?(:'versions')
73
+ if (value = attributes[:'versions']).is_a?(Array)
74
+ self.versions = value
75
+ end
76
+ end
77
+
78
+ if attributes.key?(:'online_workers')
79
+ if (value = attributes[:'online_workers']).is_a?(Array)
80
+ self.online_workers = value
81
+ end
82
+ end
83
+
84
+ if attributes.key?(:'missing_workers')
85
+ if (value = attributes[:'missing_workers']).is_a?(Array)
86
+ self.missing_workers = value
87
+ end
88
+ end
89
+
90
+ if attributes.key?(:'online_content_apps')
91
+ if (value = attributes[:'online_content_apps']).is_a?(Array)
92
+ self.online_content_apps = value
93
+ end
94
+ end
95
+
96
+ if attributes.key?(:'database_connection')
97
+ self.database_connection = attributes[:'database_connection']
98
+ end
99
+
100
+ if attributes.key?(:'redis_connection')
101
+ self.redis_connection = attributes[:'redis_connection']
102
+ end
103
+ end
104
+
105
+ # Show invalid properties with the reasons. Usually used together with valid?
106
+ # @return Array for valid properties with the reasons
107
+ def list_invalid_properties
108
+ invalid_properties = Array.new
109
+ if @versions.nil?
110
+ invalid_properties.push('invalid value for "versions", versions cannot be nil.')
111
+ end
112
+
113
+ if @online_workers.nil?
114
+ invalid_properties.push('invalid value for "online_workers", online_workers cannot be nil.')
115
+ end
116
+
117
+ if @missing_workers.nil?
118
+ invalid_properties.push('invalid value for "missing_workers", missing_workers cannot be nil.')
119
+ end
120
+
121
+ if @online_content_apps.nil?
122
+ invalid_properties.push('invalid value for "online_content_apps", online_content_apps cannot be nil.')
123
+ end
124
+
125
+ if @database_connection.nil?
126
+ invalid_properties.push('invalid value for "database_connection", database_connection cannot be nil.')
127
+ end
128
+
129
+ if @redis_connection.nil?
130
+ invalid_properties.push('invalid value for "redis_connection", redis_connection cannot be nil.')
131
+ end
132
+
133
+ invalid_properties
134
+ end
135
+
136
+ # Check to see if the all the properties in the model are valid
137
+ # @return true if the model is valid
138
+ def valid?
139
+ return false if @versions.nil?
140
+ return false if @online_workers.nil?
141
+ return false if @missing_workers.nil?
142
+ return false if @online_content_apps.nil?
143
+ return false if @database_connection.nil?
144
+ return false if @redis_connection.nil?
145
+ true
146
+ end
147
+
148
+ # Checks equality by comparing each attribute.
149
+ # @param [Object] Object to be compared
150
+ def ==(o)
151
+ return true if self.equal?(o)
152
+ self.class == o.class &&
153
+ versions == o.versions &&
154
+ online_workers == o.online_workers &&
155
+ missing_workers == o.missing_workers &&
156
+ online_content_apps == o.online_content_apps &&
157
+ database_connection == o.database_connection &&
158
+ redis_connection == o.redis_connection
159
+ end
160
+
161
+ # @see the `==` method
162
+ # @param [Object] Object to be compared
163
+ def eql?(o)
164
+ self == o
165
+ end
166
+
167
+ # Calculates hash code according to all attributes.
168
+ # @return [Integer] Hash code
169
+ def hash
170
+ [versions, online_workers, missing_workers, online_content_apps, database_connection, redis_connection].hash
171
+ end
172
+
173
+ # Builds the object from hash
174
+ # @param [Hash] attributes Model attributes in the form of hash
175
+ # @return [Object] Returns the model itself
176
+ def self.build_from_hash(attributes)
177
+ new.build_from_hash(attributes)
178
+ end
179
+
180
+ # Builds the object from hash
181
+ # @param [Hash] attributes Model attributes in the form of hash
182
+ # @return [Object] Returns the model itself
183
+ def build_from_hash(attributes)
184
+ return nil unless attributes.is_a?(Hash)
185
+ self.class.openapi_types.each_pair do |key, type|
186
+ if type =~ /\AArray<(.*)>/i
187
+ # check to ensure the input is an array given that the attribute
188
+ # is documented as an array but the input is not
189
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
190
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
191
+ end
192
+ elsif !attributes[self.class.attribute_map[key]].nil?
193
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
194
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
195
+ end
196
+
197
+ self
198
+ end
199
+
200
+ # Deserializes the data based on type
201
+ # @param string type Data type
202
+ # @param string value Value to be deserialized
203
+ # @return [Object] Deserialized data
204
+ def _deserialize(type, value)
205
+ case type.to_sym
206
+ when :DateTime
207
+ DateTime.parse(value)
208
+ when :Date
209
+ Date.parse(value)
210
+ when :String
211
+ value.to_s
212
+ when :Integer
213
+ value.to_i
214
+ when :Float
215
+ value.to_f
216
+ when :Boolean
217
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
218
+ true
219
+ else
220
+ false
221
+ end
222
+ when :Object
223
+ # generic object (usually a Hash), return directly
224
+ value
225
+ when /\AArray<(?<inner_type>.+)>\z/
226
+ inner_type = Regexp.last_match[:inner_type]
227
+ value.map { |v| _deserialize(inner_type, v) }
228
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
229
+ k_type = Regexp.last_match[:k_type]
230
+ v_type = Regexp.last_match[:v_type]
231
+ {}.tap do |hash|
232
+ value.each do |k, v|
233
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
234
+ end
235
+ end
236
+ else # model
237
+ PulpcoreClient.const_get(type).build_from_hash(value)
238
+ end
239
+ end
240
+
241
+ # Returns the string representation of the object
242
+ # @return [String] String presentation of the object
243
+ def to_s
244
+ to_hash.to_s
245
+ end
246
+
247
+ # to_body is an alias to to_hash (backward compatibility)
248
+ # @return [Hash] Returns the object in the form of hash
249
+ def to_body
250
+ to_hash
251
+ end
252
+
253
+ # Returns the object in the form of hash
254
+ # @return [Hash] Returns the object in the form of hash
255
+ def to_hash
256
+ hash = {}
257
+ self.class.attribute_map.each_pair do |attr, param|
258
+ value = self.send(attr)
259
+ next if value.nil?
260
+ hash[param] = _to_hash(value)
261
+ end
262
+ hash
263
+ end
264
+
265
+ # Outputs non-array value in the form of hash
266
+ # For object, use to_hash. Otherwise, just return the value
267
+ # @param [Object] value Any valid value
268
+ # @return [Hash] Returns the value in the form of hash
269
+ def _to_hash(value)
270
+ if value.is_a?(Array)
271
+ value.compact.map { |v| _to_hash(v) }
272
+ elsif value.is_a?(Hash)
273
+ {}.tap do |hash|
274
+ value.each { |k, v| hash[k] = _to_hash(v) }
275
+ end
276
+ elsif value.respond_to? :to_hash
277
+ value.to_hash
278
+ else
279
+ value
280
+ end
281
+ end
282
+ end
283
+ 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.0.1-SNAPSHOT
9
+ OpenAPI Generator version: 4.0.0
10
10
 
11
11
  =end
12
12