Skip to content

Commit f3eb791

Browse files
committed
Merge pull request #22 from miq-bot/openapi_generate
Update kubevirt gem
2 parents 6cabe9d + ba7ee5d commit f3eb791

File tree

11 files changed

+301
-3
lines changed

11 files changed

+301
-3
lines changed

.openapi-generator/FILES

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ docs/V1DataVolumeSource.md
8585
docs/V1DataVolumeTemplateSpec.md
8686
docs/V1DeveloperConfiguration.md
8787
docs/V1Devices.md
88+
docs/V1Diag288Watchdog.md
8889
docs/V1Disk.md
8990
docs/V1DiskIOThreads.md
9091
docs/V1DiskTarget.md
@@ -432,6 +433,7 @@ lib/kubevirt/models/v1_developer_configuration.rb
432433
lib/kubevirt/models/v1_devices.rb
433434
lib/kubevirt/models/v1_dhcp_options.rb
434435
lib/kubevirt/models/v1_dhcp_private_options.rb
436+
lib/kubevirt/models/v1_diag288_watchdog.rb
435437
lib/kubevirt/models/v1_disk.rb
436438
lib/kubevirt/models/v1_disk_io_threads.rb
437439
lib/kubevirt/models/v1_disk_target.rb
@@ -774,6 +776,7 @@ spec/models/v1_developer_configuration_spec.rb
774776
spec/models/v1_devices_spec.rb
775777
spec/models/v1_dhcp_options_spec.rb
776778
spec/models/v1_dhcp_private_options_spec.rb
779+
spec/models/v1_diag288_watchdog_spec.rb
777780
spec/models/v1_disk_io_threads_spec.rb
778781
spec/models/v1_disk_spec.rb
779782
spec/models/v1_disk_target_spec.rb

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,7 @@ Class | Method | HTTP request | Description
428428
- [Kubevirt::V1DataVolumeTemplateSpec](docs/V1DataVolumeTemplateSpec.md)
429429
- [Kubevirt::V1DeveloperConfiguration](docs/V1DeveloperConfiguration.md)
430430
- [Kubevirt::V1Devices](docs/V1Devices.md)
431+
- [Kubevirt::V1Diag288Watchdog](docs/V1Diag288Watchdog.md)
431432
- [Kubevirt::V1Disk](docs/V1Disk.md)
432433
- [Kubevirt::V1DiskIOThreads](docs/V1DiskIOThreads.md)
433434
- [Kubevirt::V1DiskTarget](docs/V1DiskTarget.md)

docs/V1Diag288Watchdog.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Kubevirt::V1Diag288Watchdog
2+
3+
## Properties
4+
5+
| Name | Type | Description | Notes |
6+
| ---- | ---- | ----------- | ----- |
7+
| **action** | **String** | The action to take. Valid values are poweroff, reset, shutdown. Defaults to reset. | [optional] |
8+
9+
## Example
10+
11+
```ruby
12+
require 'kubevirt'
13+
14+
instance = Kubevirt::V1Diag288Watchdog.new(
15+
action: null
16+
)
17+
```
18+

docs/V1DomainSpec.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
| **features** | [**V1Features**](V1Features.md) | | [optional] |
1212
| **firmware** | [**V1Firmware**](V1Firmware.md) | | [optional] |
1313
| **io_threads** | [**V1DiskIOThreads**](V1DiskIOThreads.md) | | [optional] |
14-
| **io_threads_policy** | **String** | Controls whether or not disks will share IOThreads. Omitting IOThreadsPolicy disables use of IOThreads. One of: shared, auto | [optional] |
14+
| **io_threads_policy** | **String** | Controls whether or not disks will share IOThreads. Omitting IOThreadsPolicy disables use of IOThreads. One of: shared, auto, supplementalPool | [optional] |
1515
| **launch_security** | [**V1LaunchSecurity**](V1LaunchSecurity.md) | | [optional] |
1616
| **machine** | [**V1Machine**](V1Machine.md) | | [optional] |
1717
| **memory** | [**V1Memory**](V1Memory.md) | | [optional] |

docs/V1Watchdog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
| Name | Type | Description | Notes |
66
| ---- | ---- | ----------- | ----- |
7+
| **diag288** | [**V1Diag288Watchdog**](V1Diag288Watchdog.md) | | [optional] |
78
| **i6300esb** | [**V1I6300ESBWatchdog**](V1I6300ESBWatchdog.md) | | [optional] |
89
| **name** | **String** | Name of the watchdog. | [default to ''] |
910

@@ -13,6 +14,7 @@
1314
require 'kubevirt'
1415

1516
instance = Kubevirt::V1Watchdog.new(
17+
diag288: null,
1618
i6300esb: null,
1719
name: null
1820
)

lib/kubevirt.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@
9999
Kubevirt.autoload :V1DataVolumeTemplateSpec, 'kubevirt/models/v1_data_volume_template_spec'
100100
Kubevirt.autoload :V1DeveloperConfiguration, 'kubevirt/models/v1_developer_configuration'
101101
Kubevirt.autoload :V1Devices, 'kubevirt/models/v1_devices'
102+
Kubevirt.autoload :V1Diag288Watchdog, 'kubevirt/models/v1_diag288_watchdog'
102103
Kubevirt.autoload :V1Disk, 'kubevirt/models/v1_disk'
103104
Kubevirt.autoload :V1DiskIOThreads, 'kubevirt/models/v1_disk_io_threads'
104105
Kubevirt.autoload :V1DiskTarget, 'kubevirt/models/v1_disk_target'
Lines changed: 222 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,222 @@
1+
=begin
2+
#KubeVirt API
3+
4+
#This is KubeVirt API an add-on for Kubernetes.
5+
6+
The version of the OpenAPI document: 1.0.0
7+
8+
Generated by: https://openapi-generator.tech
9+
Generator version: 7.12.0
10+
11+
=end
12+
13+
require 'date'
14+
require 'time'
15+
16+
module Kubevirt
17+
# diag288 watchdog device.
18+
class V1Diag288Watchdog
19+
# The action to take. Valid values are poweroff, reset, shutdown. Defaults to reset.
20+
attr_accessor :action
21+
22+
# Attribute mapping from ruby-style variable name to JSON key.
23+
def self.attribute_map
24+
{
25+
:'action' => :'action'
26+
}
27+
end
28+
29+
# Returns attribute mapping this model knows about
30+
def self.acceptable_attribute_map
31+
attribute_map
32+
end
33+
34+
# Returns all the JSON keys this model knows about
35+
def self.acceptable_attributes
36+
acceptable_attribute_map.values
37+
end
38+
39+
# Attribute type mapping.
40+
def self.openapi_types
41+
{
42+
:'action' => :'String'
43+
}
44+
end
45+
46+
# List of attributes with nullable: true
47+
def self.openapi_nullable
48+
Set.new([
49+
])
50+
end
51+
52+
# Initializes the object
53+
# @param [Hash] attributes Model attributes in the form of hash
54+
def initialize(attributes = {})
55+
if (!attributes.is_a?(Hash))
56+
fail ArgumentError, "The input argument (attributes) must be a hash in `Kubevirt::V1Diag288Watchdog` initialize method"
57+
end
58+
59+
# check to see if the attribute exists and convert string to symbol for hash key
60+
acceptable_attribute_map = self.class.acceptable_attribute_map
61+
attributes = attributes.each_with_object({}) { |(k, v), h|
62+
if (!acceptable_attribute_map.key?(k.to_sym))
63+
fail ArgumentError, "`#{k}` is not a valid attribute in `Kubevirt::V1Diag288Watchdog`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
64+
end
65+
h[k.to_sym] = v
66+
}
67+
68+
if attributes.key?(:'action')
69+
self.action = attributes[:'action']
70+
end
71+
end
72+
73+
# Show invalid properties with the reasons. Usually used together with valid?
74+
# @return Array for valid properties with the reasons
75+
def list_invalid_properties
76+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
77+
invalid_properties = Array.new
78+
invalid_properties
79+
end
80+
81+
# Check to see if the all the properties in the model are valid
82+
# @return true if the model is valid
83+
def valid?
84+
warn '[DEPRECATED] the `valid?` method is obsolete'
85+
true
86+
end
87+
88+
# Checks equality by comparing each attribute.
89+
# @param [Object] Object to be compared
90+
def ==(o)
91+
return true if self.equal?(o)
92+
self.class == o.class &&
93+
action == o.action
94+
end
95+
96+
# @see the `==` method
97+
# @param [Object] Object to be compared
98+
def eql?(o)
99+
self == o
100+
end
101+
102+
# Calculates hash code according to all attributes.
103+
# @return [Integer] Hash code
104+
def hash
105+
[action].hash
106+
end
107+
108+
# Builds the object from hash
109+
# @param [Hash] attributes Model attributes in the form of hash
110+
# @return [Object] Returns the model itself
111+
def self.build_from_hash(attributes)
112+
return nil unless attributes.is_a?(Hash)
113+
attributes = attributes.transform_keys(&:to_sym)
114+
transformed_hash = {}
115+
openapi_types.each_pair do |key, type|
116+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
117+
transformed_hash["#{key}"] = nil
118+
elsif type =~ /\AArray<(.*)>/i
119+
# check to ensure the input is an array given that the attribute
120+
# is documented as an array but the input is not
121+
if attributes[attribute_map[key]].is_a?(Array)
122+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
123+
end
124+
elsif !attributes[attribute_map[key]].nil?
125+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
126+
end
127+
end
128+
new(transformed_hash)
129+
end
130+
131+
# Deserializes the data based on type
132+
# @param string type Data type
133+
# @param string value Value to be deserialized
134+
# @return [Object] Deserialized data
135+
def self._deserialize(type, value)
136+
case type.to_sym
137+
when :Time
138+
Time.parse(value)
139+
when :Date
140+
Date.parse(value)
141+
when :String
142+
value.to_s
143+
when :Integer
144+
value.to_i
145+
when :Float
146+
value.to_f
147+
when :Boolean
148+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
149+
true
150+
else
151+
false
152+
end
153+
when :Object
154+
# generic object (usually a Hash), return directly
155+
value
156+
when /\AArray<(?<inner_type>.+)>\z/
157+
inner_type = Regexp.last_match[:inner_type]
158+
value.map { |v| _deserialize(inner_type, v) }
159+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
160+
k_type = Regexp.last_match[:k_type]
161+
v_type = Regexp.last_match[:v_type]
162+
{}.tap do |hash|
163+
value.each do |k, v|
164+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
165+
end
166+
end
167+
else # model
168+
# models (e.g. Pet) or oneOf
169+
klass = Kubevirt.const_get(type)
170+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
171+
end
172+
end
173+
174+
# Returns the string representation of the object
175+
# @return [String] String presentation of the object
176+
def to_s
177+
to_hash.to_s
178+
end
179+
180+
# to_body is an alias to to_hash (backward compatibility)
181+
# @return [Hash] Returns the object in the form of hash
182+
def to_body
183+
to_hash
184+
end
185+
186+
# Returns the object in the form of hash
187+
# @return [Hash] Returns the object in the form of hash
188+
def to_hash
189+
hash = {}
190+
self.class.attribute_map.each_pair do |attr, param|
191+
value = self.send(attr)
192+
if value.nil?
193+
is_nullable = self.class.openapi_nullable.include?(attr)
194+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
195+
end
196+
197+
hash[param] = _to_hash(value)
198+
end
199+
hash
200+
end
201+
202+
# Outputs non-array value in the form of hash
203+
# For object, use to_hash. Otherwise, just return the value
204+
# @param [Object] value Any valid value
205+
# @return [Hash] Returns the value in the form of hash
206+
def _to_hash(value)
207+
if value.is_a?(Array)
208+
value.compact.map { |v| _to_hash(v) }
209+
elsif value.is_a?(Hash)
210+
{}.tap do |hash|
211+
value.each { |k, v| hash[k] = _to_hash(v) }
212+
end
213+
elsif value.respond_to? :to_hash
214+
value.to_hash
215+
else
216+
value
217+
end
218+
end
219+
220+
end
221+
222+
end

lib/kubevirt/models/v1_domain_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class V1DomainSpec
2929

3030
attr_accessor :io_threads
3131

32-
# Controls whether or not disks will share IOThreads. Omitting IOThreadsPolicy disables use of IOThreads. One of: shared, auto
32+
# Controls whether or not disks will share IOThreads. Omitting IOThreadsPolicy disables use of IOThreads. One of: shared, auto, supplementalPool
3333
attr_accessor :io_threads_policy
3434

3535
attr_accessor :launch_security

lib/kubevirt/models/v1_watchdog.rb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
module Kubevirt
1717
# Named watchdog device.
1818
class V1Watchdog
19+
attr_accessor :diag288
20+
1921
attr_accessor :i6300esb
2022

2123
# Name of the watchdog.
@@ -24,6 +26,7 @@ class V1Watchdog
2426
# Attribute mapping from ruby-style variable name to JSON key.
2527
def self.attribute_map
2628
{
29+
:'diag288' => :'diag288',
2730
:'i6300esb' => :'i6300esb',
2831
:'name' => :'name'
2932
}
@@ -42,6 +45,7 @@ def self.acceptable_attributes
4245
# Attribute type mapping.
4346
def self.openapi_types
4447
{
48+
:'diag288' => :'V1Diag288Watchdog',
4549
:'i6300esb' => :'V1I6300ESBWatchdog',
4650
:'name' => :'String'
4751
}
@@ -69,6 +73,10 @@ def initialize(attributes = {})
6973
h[k.to_sym] = v
7074
}
7175

76+
if attributes.key?(:'diag288')
77+
self.diag288 = attributes[:'diag288']
78+
end
79+
7280
if attributes.key?(:'i6300esb')
7381
self.i6300esb = attributes[:'i6300esb']
7482
end
@@ -115,6 +123,7 @@ def name=(name)
115123
def ==(o)
116124
return true if self.equal?(o)
117125
self.class == o.class &&
126+
diag288 == o.diag288 &&
118127
i6300esb == o.i6300esb &&
119128
name == o.name
120129
end
@@ -128,7 +137,7 @@ def eql?(o)
128137
# Calculates hash code according to all attributes.
129138
# @return [Integer] Hash code
130139
def hash
131-
[i6300esb, name].hash
140+
[diag288, i6300esb, name].hash
132141
end
133142

134143
# Builds the object from hash

0 commit comments

Comments
 (0)