oraclebmc 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE.txt +82 -0
- data/README.md +220 -0
- data/lib/oraclebmc/api_client.rb +349 -0
- data/lib/oraclebmc/config.rb +80 -0
- data/lib/oraclebmc/config_file_loader.rb +85 -0
- data/lib/oraclebmc/core/blockstorage_client.rb +459 -0
- data/lib/oraclebmc/core/compute_client.rb +1053 -0
- data/lib/oraclebmc/core/core.rb +82 -0
- data/lib/oraclebmc/core/models/attach_i_scsi_volume_details.rb +179 -0
- data/lib/oraclebmc/core/models/attach_volume_details.rb +206 -0
- data/lib/oraclebmc/core/models/capture_console_history_details.rb +162 -0
- data/lib/oraclebmc/core/models/console_history.rb +252 -0
- data/lib/oraclebmc/core/models/cpe.rb +209 -0
- data/lib/oraclebmc/core/models/create_cpe_details.rb +187 -0
- data/lib/oraclebmc/core/models/create_dhcp_details.rb +195 -0
- data/lib/oraclebmc/core/models/create_drg_attachment_details.rb +184 -0
- data/lib/oraclebmc/core/models/create_drg_details.rb +173 -0
- data/lib/oraclebmc/core/models/create_image_details.rb +188 -0
- data/lib/oraclebmc/core/models/create_internet_gateway_details.rb +195 -0
- data/lib/oraclebmc/core/models/create_ip_sec_connection_details.rb +210 -0
- data/lib/oraclebmc/core/models/create_route_table_details.rb +195 -0
- data/lib/oraclebmc/core/models/create_security_list_details.rb +206 -0
- data/lib/oraclebmc/core/models/create_subnet_details.rb +253 -0
- data/lib/oraclebmc/core/models/create_vcn_details.rb +187 -0
- data/lib/oraclebmc/core/models/create_volume_backup_details.rb +173 -0
- data/lib/oraclebmc/core/models/create_volume_details.rb +211 -0
- data/lib/oraclebmc/core/models/dhcp_dns_option.rb +203 -0
- data/lib/oraclebmc/core/models/dhcp_option.rb +171 -0
- data/lib/oraclebmc/core/models/dhcp_options.rb +246 -0
- data/lib/oraclebmc/core/models/drg.rb +224 -0
- data/lib/oraclebmc/core/models/drg_attachment.rb +246 -0
- data/lib/oraclebmc/core/models/egress_security_rule.rb +240 -0
- data/lib/oraclebmc/core/models/i_scsi_volume_attachment.rb +254 -0
- data/lib/oraclebmc/core/models/icmp_options.rb +173 -0
- data/lib/oraclebmc/core/models/image.rb +282 -0
- data/lib/oraclebmc/core/models/ingress_security_rule.rb +240 -0
- data/lib/oraclebmc/core/models/instance.rb +326 -0
- data/lib/oraclebmc/core/models/internet_gateway.rb +248 -0
- data/lib/oraclebmc/core/models/ip_sec_connection.rb +261 -0
- data/lib/oraclebmc/core/models/ip_sec_connection_device_config.rb +195 -0
- data/lib/oraclebmc/core/models/ip_sec_connection_device_status.rb +198 -0
- data/lib/oraclebmc/core/models/launch_instance_details.rb +327 -0
- data/lib/oraclebmc/core/models/port_range.rb +175 -0
- data/lib/oraclebmc/core/models/route_rule.rb +177 -0
- data/lib/oraclebmc/core/models/route_table.rb +246 -0
- data/lib/oraclebmc/core/models/security_list.rb +257 -0
- data/lib/oraclebmc/core/models/shape.rb +164 -0
- data/lib/oraclebmc/core/models/subnet.rb +325 -0
- data/lib/oraclebmc/core/models/tcp_options.rb +177 -0
- data/lib/oraclebmc/core/models/tunnel_config.rb +193 -0
- data/lib/oraclebmc/core/models/tunnel_status.rb +218 -0
- data/lib/oraclebmc/core/models/udp_options.rb +177 -0
- data/lib/oraclebmc/core/models/update_cpe_details.rb +162 -0
- data/lib/oraclebmc/core/models/update_dhcp_details.rb +172 -0
- data/lib/oraclebmc/core/models/update_drg_attachment_details.rb +162 -0
- data/lib/oraclebmc/core/models/update_drg_details.rb +162 -0
- data/lib/oraclebmc/core/models/update_image_details.rb +165 -0
- data/lib/oraclebmc/core/models/update_instance_details.rb +165 -0
- data/lib/oraclebmc/core/models/update_internet_gateway_details.rb +173 -0
- data/lib/oraclebmc/core/models/update_ip_sec_connection_details.rb +162 -0
- data/lib/oraclebmc/core/models/update_route_table_details.rb +173 -0
- data/lib/oraclebmc/core/models/update_security_list_details.rb +184 -0
- data/lib/oraclebmc/core/models/update_subnet_details.rb +162 -0
- data/lib/oraclebmc/core/models/update_vcn_details.rb +162 -0
- data/lib/oraclebmc/core/models/update_volume_backup_details.rb +162 -0
- data/lib/oraclebmc/core/models/update_volume_details.rb +163 -0
- data/lib/oraclebmc/core/models/vcn.rb +272 -0
- data/lib/oraclebmc/core/models/vnic.rb +274 -0
- data/lib/oraclebmc/core/models/vnic_attachment.rb +271 -0
- data/lib/oraclebmc/core/models/volume.rb +249 -0
- data/lib/oraclebmc/core/models/volume_attachment.rb +284 -0
- data/lib/oraclebmc/core/models/volume_backup.rb +273 -0
- data/lib/oraclebmc/core/util.rb +1 -0
- data/lib/oraclebmc/core/virtual_network_client.rb +2263 -0
- data/lib/oraclebmc/errors.rb +62 -0
- data/lib/oraclebmc/global_context.rb +21 -0
- data/lib/oraclebmc/identity/identity.rb +38 -0
- data/lib/oraclebmc/identity/identity_client.rb +1462 -0
- data/lib/oraclebmc/identity/models/add_user_to_group_details.rb +173 -0
- data/lib/oraclebmc/identity/models/api_key.rb +251 -0
- data/lib/oraclebmc/identity/models/availability_domain.rb +173 -0
- data/lib/oraclebmc/identity/models/compartment.rb +251 -0
- data/lib/oraclebmc/identity/models/create_api_key_details.rb +162 -0
- data/lib/oraclebmc/identity/models/create_compartment_details.rb +187 -0
- data/lib/oraclebmc/identity/models/create_group_details.rb +186 -0
- data/lib/oraclebmc/identity/models/create_policy_details.rb +215 -0
- data/lib/oraclebmc/identity/models/create_swift_password_details.rb +163 -0
- data/lib/oraclebmc/identity/models/create_user_details.rb +186 -0
- data/lib/oraclebmc/identity/models/group.rb +251 -0
- data/lib/oraclebmc/identity/models/policy.rb +277 -0
- data/lib/oraclebmc/identity/models/swift_password.rb +266 -0
- data/lib/oraclebmc/identity/models/ui_password.rb +227 -0
- data/lib/oraclebmc/identity/models/update_compartment_details.rb +162 -0
- data/lib/oraclebmc/identity/models/update_group_details.rb +162 -0
- data/lib/oraclebmc/identity/models/update_policy_details.rb +190 -0
- data/lib/oraclebmc/identity/models/update_state_details.rb +163 -0
- data/lib/oraclebmc/identity/models/update_swift_password_details.rb +162 -0
- data/lib/oraclebmc/identity/models/update_user_details.rb +162 -0
- data/lib/oraclebmc/identity/models/user.rb +257 -0
- data/lib/oraclebmc/identity/models/user_group_membership.rb +249 -0
- data/lib/oraclebmc/identity/util.rb +1 -0
- data/lib/oraclebmc/load_balancer/load_balancer.rb +45 -0
- data/lib/oraclebmc/load_balancer/load_balancer_client.rb +1218 -0
- data/lib/oraclebmc/load_balancer/models/backend.rb +262 -0
- data/lib/oraclebmc/load_balancer/models/backend_details.rb +248 -0
- data/lib/oraclebmc/load_balancer/models/backend_set.rb +211 -0
- data/lib/oraclebmc/load_balancer/models/backend_set_details.rb +197 -0
- data/lib/oraclebmc/load_balancer/models/certificate.rb +209 -0
- data/lib/oraclebmc/load_balancer/models/certificate_details.rb +245 -0
- data/lib/oraclebmc/load_balancer/models/create_backend_details.rb +248 -0
- data/lib/oraclebmc/load_balancer/models/create_backend_set_details.rb +210 -0
- data/lib/oraclebmc/load_balancer/models/create_certificate_details.rb +245 -0
- data/lib/oraclebmc/load_balancer/models/create_listener_details.rb +216 -0
- data/lib/oraclebmc/load_balancer/models/create_load_balancer_details.rb +233 -0
- data/lib/oraclebmc/load_balancer/models/health_checker.rb +265 -0
- data/lib/oraclebmc/load_balancer/models/health_checker_details.rb +264 -0
- data/lib/oraclebmc/load_balancer/models/ip_address.rb +165 -0
- data/lib/oraclebmc/load_balancer/models/listener.rb +216 -0
- data/lib/oraclebmc/load_balancer/models/listener_details.rb +202 -0
- data/lib/oraclebmc/load_balancer/models/load_balancer.rb +296 -0
- data/lib/oraclebmc/load_balancer/models/load_balancer_policy.rb +162 -0
- data/lib/oraclebmc/load_balancer/models/load_balancer_protocol.rb +162 -0
- data/lib/oraclebmc/load_balancer/models/load_balancer_shape.rb +162 -0
- data/lib/oraclebmc/load_balancer/models/ssl_configuration.rb +195 -0
- data/lib/oraclebmc/load_balancer/models/ssl_configuration_details.rb +195 -0
- data/lib/oraclebmc/load_balancer/models/update_backend_details.rb +220 -0
- data/lib/oraclebmc/load_balancer/models/update_backend_set_details.rb +197 -0
- data/lib/oraclebmc/load_balancer/models/update_health_checker_details.rb +263 -0
- data/lib/oraclebmc/load_balancer/models/update_listener_details.rb +202 -0
- data/lib/oraclebmc/load_balancer/models/update_load_balancer_details.rb +165 -0
- data/lib/oraclebmc/load_balancer/models/work_request.rb +269 -0
- data/lib/oraclebmc/load_balancer/models/work_request_error.rb +185 -0
- data/lib/oraclebmc/load_balancer/util.rb +55 -0
- data/lib/oraclebmc/regions.rb +41 -0
- data/lib/oraclebmc/response.rb +86 -0
- data/lib/oraclebmc/signer.rb +119 -0
- data/lib/oraclebmc/version.rb +5 -0
- data/lib/oraclebmc/waiter.rb +111 -0
- data/lib/oraclebmc.rb +20 -0
- metadata +265 -0
@@ -0,0 +1,165 @@
|
|
1
|
+
# Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved.
|
2
|
+
|
3
|
+
require 'date'
|
4
|
+
|
5
|
+
module OracleBMC
|
6
|
+
class Core::Models::UpdateImageDetails
|
7
|
+
# The non-unique, changeable name of the image.
|
8
|
+
#
|
9
|
+
# Example: `My custom Oracle Linux image`
|
10
|
+
#
|
11
|
+
# @return [String]
|
12
|
+
attr_accessor :display_name
|
13
|
+
|
14
|
+
|
15
|
+
# Initializes the object
|
16
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
17
|
+
def initialize(attributes = {})
|
18
|
+
return unless attributes.is_a?(Hash)
|
19
|
+
|
20
|
+
# convert string to symbol for hash key
|
21
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
22
|
+
|
23
|
+
|
24
|
+
if attributes[:'displayName']
|
25
|
+
self.display_name = attributes[:'displayName']
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
# Checks equality by comparing each attribute.
|
31
|
+
# @param [Object] other_object to be compared
|
32
|
+
def ==(other_object)
|
33
|
+
return true if self.equal?(other_object)
|
34
|
+
self.class == other_object.class &&
|
35
|
+
display_name == other_object.display_name
|
36
|
+
end
|
37
|
+
|
38
|
+
# @see the `==` method
|
39
|
+
# @param [Object] other_object to be compared
|
40
|
+
def eql?(other_object)
|
41
|
+
self == other_object
|
42
|
+
end
|
43
|
+
|
44
|
+
# Calculates hash code according to all attributes.
|
45
|
+
# @return [Fixnum] Hash code
|
46
|
+
def hash
|
47
|
+
[display_name].hash
|
48
|
+
end
|
49
|
+
|
50
|
+
# Builds the object from hash
|
51
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
52
|
+
# @return [Object] Returns the model itself
|
53
|
+
def build_from_hash(attributes)
|
54
|
+
return nil unless attributes.is_a?(Hash)
|
55
|
+
self.class.swagger_types.each_pair do |key, type|
|
56
|
+
if type =~ /^Array<(.*)>/i
|
57
|
+
# check to ensure the input is an array given that the the attribute
|
58
|
+
# is documented as an array but the input is not
|
59
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
60
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
61
|
+
end
|
62
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
63
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
64
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
65
|
+
end
|
66
|
+
|
67
|
+
self
|
68
|
+
end
|
69
|
+
|
70
|
+
# Returns the string representation of the object
|
71
|
+
# @return [String] String presentation of the object
|
72
|
+
def to_s
|
73
|
+
to_hash.to_s
|
74
|
+
end
|
75
|
+
|
76
|
+
# Returns the object in the form of hash
|
77
|
+
# @return [Hash] Returns the object in the form of hash
|
78
|
+
def to_hash
|
79
|
+
hash = {}
|
80
|
+
self.class.attribute_map.each_pair do |attr, param|
|
81
|
+
value = self.send(attr)
|
82
|
+
next if value.nil?
|
83
|
+
hash[param] = _to_hash(value)
|
84
|
+
end
|
85
|
+
hash
|
86
|
+
end
|
87
|
+
|
88
|
+
private
|
89
|
+
|
90
|
+
# Outputs non-array value in the form of hash
|
91
|
+
# For object, use to_hash. Otherwise, just return the value
|
92
|
+
# @param [Object] value Any valid value
|
93
|
+
# @return [Hash] Returns the value in the form of hash
|
94
|
+
def _to_hash(value)
|
95
|
+
if value.is_a?(Array)
|
96
|
+
value.compact.map{ |v| _to_hash(v) }
|
97
|
+
elsif value.is_a?(Hash)
|
98
|
+
{}.tap do |hash|
|
99
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
100
|
+
end
|
101
|
+
elsif value.respond_to? :to_hash
|
102
|
+
value.to_hash
|
103
|
+
else
|
104
|
+
value
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
# Deserializes the data based on type
|
109
|
+
# @param [String] type Data type
|
110
|
+
# @param [String] value Value to be deserialized
|
111
|
+
# @return [Object] Deserialized data
|
112
|
+
def _deserialize(type, value)
|
113
|
+
case type.to_sym
|
114
|
+
when :DateTime
|
115
|
+
DateTime.parse(value)
|
116
|
+
when :Date
|
117
|
+
Date.parse(value)
|
118
|
+
when :String
|
119
|
+
value.to_s
|
120
|
+
when :Integer
|
121
|
+
value.to_i
|
122
|
+
when :Float
|
123
|
+
value.to_f
|
124
|
+
when :BOOLEAN
|
125
|
+
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
126
|
+
true
|
127
|
+
else
|
128
|
+
false
|
129
|
+
end
|
130
|
+
when :Object
|
131
|
+
# generic object (usually a Hash), return directly
|
132
|
+
value
|
133
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
134
|
+
inner_type = Regexp.last_match[:inner_type]
|
135
|
+
value.map { |v| _deserialize(inner_type, v) }
|
136
|
+
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
137
|
+
k_type = Regexp.last_match[:k_type]
|
138
|
+
v_type = Regexp.last_match[:v_type]
|
139
|
+
{}.tap do |hash|
|
140
|
+
value.each do |k, v|
|
141
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
142
|
+
end
|
143
|
+
end
|
144
|
+
else # model
|
145
|
+
temp_model = OracleBMC.const_get(type.to_s).new
|
146
|
+
temp_model.build_from_hash(value)
|
147
|
+
end
|
148
|
+
end
|
149
|
+
|
150
|
+
|
151
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
152
|
+
def self.attribute_map
|
153
|
+
{
|
154
|
+
:'display_name' => :'displayName'
|
155
|
+
}
|
156
|
+
end
|
157
|
+
|
158
|
+
# Attribute type mapping.
|
159
|
+
def self.swagger_types
|
160
|
+
{
|
161
|
+
:'display_name' => :'String'
|
162
|
+
}
|
163
|
+
end
|
164
|
+
end
|
165
|
+
end
|
@@ -0,0 +1,165 @@
|
|
1
|
+
# Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved.
|
2
|
+
|
3
|
+
require 'date'
|
4
|
+
|
5
|
+
module OracleBMC
|
6
|
+
class Core::Models::UpdateInstanceDetails
|
7
|
+
# A user-friendly name. Does not have to be unique, and it's changeable.
|
8
|
+
#
|
9
|
+
# Example: `My bare metal instance`
|
10
|
+
#
|
11
|
+
# @return [String]
|
12
|
+
attr_accessor :display_name
|
13
|
+
|
14
|
+
|
15
|
+
# Initializes the object
|
16
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
17
|
+
def initialize(attributes = {})
|
18
|
+
return unless attributes.is_a?(Hash)
|
19
|
+
|
20
|
+
# convert string to symbol for hash key
|
21
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
22
|
+
|
23
|
+
|
24
|
+
if attributes[:'displayName']
|
25
|
+
self.display_name = attributes[:'displayName']
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
# Checks equality by comparing each attribute.
|
31
|
+
# @param [Object] other_object to be compared
|
32
|
+
def ==(other_object)
|
33
|
+
return true if self.equal?(other_object)
|
34
|
+
self.class == other_object.class &&
|
35
|
+
display_name == other_object.display_name
|
36
|
+
end
|
37
|
+
|
38
|
+
# @see the `==` method
|
39
|
+
# @param [Object] other_object to be compared
|
40
|
+
def eql?(other_object)
|
41
|
+
self == other_object
|
42
|
+
end
|
43
|
+
|
44
|
+
# Calculates hash code according to all attributes.
|
45
|
+
# @return [Fixnum] Hash code
|
46
|
+
def hash
|
47
|
+
[display_name].hash
|
48
|
+
end
|
49
|
+
|
50
|
+
# Builds the object from hash
|
51
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
52
|
+
# @return [Object] Returns the model itself
|
53
|
+
def build_from_hash(attributes)
|
54
|
+
return nil unless attributes.is_a?(Hash)
|
55
|
+
self.class.swagger_types.each_pair do |key, type|
|
56
|
+
if type =~ /^Array<(.*)>/i
|
57
|
+
# check to ensure the input is an array given that the the attribute
|
58
|
+
# is documented as an array but the input is not
|
59
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
60
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
61
|
+
end
|
62
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
63
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
64
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
65
|
+
end
|
66
|
+
|
67
|
+
self
|
68
|
+
end
|
69
|
+
|
70
|
+
# Returns the string representation of the object
|
71
|
+
# @return [String] String presentation of the object
|
72
|
+
def to_s
|
73
|
+
to_hash.to_s
|
74
|
+
end
|
75
|
+
|
76
|
+
# Returns the object in the form of hash
|
77
|
+
# @return [Hash] Returns the object in the form of hash
|
78
|
+
def to_hash
|
79
|
+
hash = {}
|
80
|
+
self.class.attribute_map.each_pair do |attr, param|
|
81
|
+
value = self.send(attr)
|
82
|
+
next if value.nil?
|
83
|
+
hash[param] = _to_hash(value)
|
84
|
+
end
|
85
|
+
hash
|
86
|
+
end
|
87
|
+
|
88
|
+
private
|
89
|
+
|
90
|
+
# Outputs non-array value in the form of hash
|
91
|
+
# For object, use to_hash. Otherwise, just return the value
|
92
|
+
# @param [Object] value Any valid value
|
93
|
+
# @return [Hash] Returns the value in the form of hash
|
94
|
+
def _to_hash(value)
|
95
|
+
if value.is_a?(Array)
|
96
|
+
value.compact.map{ |v| _to_hash(v) }
|
97
|
+
elsif value.is_a?(Hash)
|
98
|
+
{}.tap do |hash|
|
99
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
100
|
+
end
|
101
|
+
elsif value.respond_to? :to_hash
|
102
|
+
value.to_hash
|
103
|
+
else
|
104
|
+
value
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
# Deserializes the data based on type
|
109
|
+
# @param [String] type Data type
|
110
|
+
# @param [String] value Value to be deserialized
|
111
|
+
# @return [Object] Deserialized data
|
112
|
+
def _deserialize(type, value)
|
113
|
+
case type.to_sym
|
114
|
+
when :DateTime
|
115
|
+
DateTime.parse(value)
|
116
|
+
when :Date
|
117
|
+
Date.parse(value)
|
118
|
+
when :String
|
119
|
+
value.to_s
|
120
|
+
when :Integer
|
121
|
+
value.to_i
|
122
|
+
when :Float
|
123
|
+
value.to_f
|
124
|
+
when :BOOLEAN
|
125
|
+
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
126
|
+
true
|
127
|
+
else
|
128
|
+
false
|
129
|
+
end
|
130
|
+
when :Object
|
131
|
+
# generic object (usually a Hash), return directly
|
132
|
+
value
|
133
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
134
|
+
inner_type = Regexp.last_match[:inner_type]
|
135
|
+
value.map { |v| _deserialize(inner_type, v) }
|
136
|
+
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
137
|
+
k_type = Regexp.last_match[:k_type]
|
138
|
+
v_type = Regexp.last_match[:v_type]
|
139
|
+
{}.tap do |hash|
|
140
|
+
value.each do |k, v|
|
141
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
142
|
+
end
|
143
|
+
end
|
144
|
+
else # model
|
145
|
+
temp_model = OracleBMC.const_get(type.to_s).new
|
146
|
+
temp_model.build_from_hash(value)
|
147
|
+
end
|
148
|
+
end
|
149
|
+
|
150
|
+
|
151
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
152
|
+
def self.attribute_map
|
153
|
+
{
|
154
|
+
:'display_name' => :'displayName'
|
155
|
+
}
|
156
|
+
end
|
157
|
+
|
158
|
+
# Attribute type mapping.
|
159
|
+
def self.swagger_types
|
160
|
+
{
|
161
|
+
:'display_name' => :'String'
|
162
|
+
}
|
163
|
+
end
|
164
|
+
end
|
165
|
+
end
|
@@ -0,0 +1,173 @@
|
|
1
|
+
# Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved.
|
2
|
+
|
3
|
+
require 'date'
|
4
|
+
|
5
|
+
module OracleBMC
|
6
|
+
class Core::Models::UpdateInternetGatewayDetails
|
7
|
+
# A user-friendly name. Does not have to be unique, and it's changeable.
|
8
|
+
# @return [String]
|
9
|
+
attr_accessor :display_name
|
10
|
+
|
11
|
+
# Whether the gateway is enabled.
|
12
|
+
# @return [BOOLEAN]
|
13
|
+
attr_accessor :is_enabled
|
14
|
+
|
15
|
+
|
16
|
+
# Initializes the object
|
17
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
18
|
+
def initialize(attributes = {})
|
19
|
+
return unless attributes.is_a?(Hash)
|
20
|
+
|
21
|
+
# convert string to symbol for hash key
|
22
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
23
|
+
|
24
|
+
|
25
|
+
if attributes[:'displayName']
|
26
|
+
self.display_name = attributes[:'displayName']
|
27
|
+
end
|
28
|
+
|
29
|
+
if attributes[:'isEnabled']
|
30
|
+
self.is_enabled = attributes[:'isEnabled']
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
34
|
+
|
35
|
+
# Checks equality by comparing each attribute.
|
36
|
+
# @param [Object] other_object to be compared
|
37
|
+
def ==(other_object)
|
38
|
+
return true if self.equal?(other_object)
|
39
|
+
self.class == other_object.class &&
|
40
|
+
display_name == other_object.display_name &&
|
41
|
+
is_enabled == other_object.is_enabled
|
42
|
+
end
|
43
|
+
|
44
|
+
# @see the `==` method
|
45
|
+
# @param [Object] other_object to be compared
|
46
|
+
def eql?(other_object)
|
47
|
+
self == other_object
|
48
|
+
end
|
49
|
+
|
50
|
+
# Calculates hash code according to all attributes.
|
51
|
+
# @return [Fixnum] Hash code
|
52
|
+
def hash
|
53
|
+
[display_name, is_enabled].hash
|
54
|
+
end
|
55
|
+
|
56
|
+
# Builds the object from hash
|
57
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
58
|
+
# @return [Object] Returns the model itself
|
59
|
+
def build_from_hash(attributes)
|
60
|
+
return nil unless attributes.is_a?(Hash)
|
61
|
+
self.class.swagger_types.each_pair do |key, type|
|
62
|
+
if type =~ /^Array<(.*)>/i
|
63
|
+
# check to ensure the input is an array given that the the attribute
|
64
|
+
# is documented as an array but the input is not
|
65
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
66
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
67
|
+
end
|
68
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
69
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
70
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
71
|
+
end
|
72
|
+
|
73
|
+
self
|
74
|
+
end
|
75
|
+
|
76
|
+
# Returns the string representation of the object
|
77
|
+
# @return [String] String presentation of the object
|
78
|
+
def to_s
|
79
|
+
to_hash.to_s
|
80
|
+
end
|
81
|
+
|
82
|
+
# Returns the object in the form of hash
|
83
|
+
# @return [Hash] Returns the object in the form of hash
|
84
|
+
def to_hash
|
85
|
+
hash = {}
|
86
|
+
self.class.attribute_map.each_pair do |attr, param|
|
87
|
+
value = self.send(attr)
|
88
|
+
next if value.nil?
|
89
|
+
hash[param] = _to_hash(value)
|
90
|
+
end
|
91
|
+
hash
|
92
|
+
end
|
93
|
+
|
94
|
+
private
|
95
|
+
|
96
|
+
# Outputs non-array value in the form of hash
|
97
|
+
# For object, use to_hash. Otherwise, just return the value
|
98
|
+
# @param [Object] value Any valid value
|
99
|
+
# @return [Hash] Returns the value in the form of hash
|
100
|
+
def _to_hash(value)
|
101
|
+
if value.is_a?(Array)
|
102
|
+
value.compact.map{ |v| _to_hash(v) }
|
103
|
+
elsif value.is_a?(Hash)
|
104
|
+
{}.tap do |hash|
|
105
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
106
|
+
end
|
107
|
+
elsif value.respond_to? :to_hash
|
108
|
+
value.to_hash
|
109
|
+
else
|
110
|
+
value
|
111
|
+
end
|
112
|
+
end
|
113
|
+
|
114
|
+
# Deserializes the data based on type
|
115
|
+
# @param [String] type Data type
|
116
|
+
# @param [String] value Value to be deserialized
|
117
|
+
# @return [Object] Deserialized data
|
118
|
+
def _deserialize(type, value)
|
119
|
+
case type.to_sym
|
120
|
+
when :DateTime
|
121
|
+
DateTime.parse(value)
|
122
|
+
when :Date
|
123
|
+
Date.parse(value)
|
124
|
+
when :String
|
125
|
+
value.to_s
|
126
|
+
when :Integer
|
127
|
+
value.to_i
|
128
|
+
when :Float
|
129
|
+
value.to_f
|
130
|
+
when :BOOLEAN
|
131
|
+
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
132
|
+
true
|
133
|
+
else
|
134
|
+
false
|
135
|
+
end
|
136
|
+
when :Object
|
137
|
+
# generic object (usually a Hash), return directly
|
138
|
+
value
|
139
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
140
|
+
inner_type = Regexp.last_match[:inner_type]
|
141
|
+
value.map { |v| _deserialize(inner_type, v) }
|
142
|
+
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
143
|
+
k_type = Regexp.last_match[:k_type]
|
144
|
+
v_type = Regexp.last_match[:v_type]
|
145
|
+
{}.tap do |hash|
|
146
|
+
value.each do |k, v|
|
147
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
148
|
+
end
|
149
|
+
end
|
150
|
+
else # model
|
151
|
+
temp_model = OracleBMC.const_get(type.to_s).new
|
152
|
+
temp_model.build_from_hash(value)
|
153
|
+
end
|
154
|
+
end
|
155
|
+
|
156
|
+
|
157
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
158
|
+
def self.attribute_map
|
159
|
+
{
|
160
|
+
:'display_name' => :'displayName',
|
161
|
+
:'is_enabled' => :'isEnabled'
|
162
|
+
}
|
163
|
+
end
|
164
|
+
|
165
|
+
# Attribute type mapping.
|
166
|
+
def self.swagger_types
|
167
|
+
{
|
168
|
+
:'display_name' => :'String',
|
169
|
+
:'is_enabled' => :'BOOLEAN'
|
170
|
+
}
|
171
|
+
end
|
172
|
+
end
|
173
|
+
end
|
@@ -0,0 +1,162 @@
|
|
1
|
+
# Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved.
|
2
|
+
|
3
|
+
require 'date'
|
4
|
+
|
5
|
+
module OracleBMC
|
6
|
+
class Core::Models::UpdateIPSecConnectionDetails
|
7
|
+
# A user-friendly name. Does not have to be unique, and it's changeable.
|
8
|
+
# @return [String]
|
9
|
+
attr_accessor :display_name
|
10
|
+
|
11
|
+
|
12
|
+
# Initializes the object
|
13
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
14
|
+
def initialize(attributes = {})
|
15
|
+
return unless attributes.is_a?(Hash)
|
16
|
+
|
17
|
+
# convert string to symbol for hash key
|
18
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
19
|
+
|
20
|
+
|
21
|
+
if attributes[:'displayName']
|
22
|
+
self.display_name = attributes[:'displayName']
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
|
27
|
+
# Checks equality by comparing each attribute.
|
28
|
+
# @param [Object] other_object to be compared
|
29
|
+
def ==(other_object)
|
30
|
+
return true if self.equal?(other_object)
|
31
|
+
self.class == other_object.class &&
|
32
|
+
display_name == other_object.display_name
|
33
|
+
end
|
34
|
+
|
35
|
+
# @see the `==` method
|
36
|
+
# @param [Object] other_object to be compared
|
37
|
+
def eql?(other_object)
|
38
|
+
self == other_object
|
39
|
+
end
|
40
|
+
|
41
|
+
# Calculates hash code according to all attributes.
|
42
|
+
# @return [Fixnum] Hash code
|
43
|
+
def hash
|
44
|
+
[display_name].hash
|
45
|
+
end
|
46
|
+
|
47
|
+
# Builds the object from hash
|
48
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
49
|
+
# @return [Object] Returns the model itself
|
50
|
+
def build_from_hash(attributes)
|
51
|
+
return nil unless attributes.is_a?(Hash)
|
52
|
+
self.class.swagger_types.each_pair do |key, type|
|
53
|
+
if type =~ /^Array<(.*)>/i
|
54
|
+
# check to ensure the input is an array given that the the attribute
|
55
|
+
# is documented as an array but the input is not
|
56
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
57
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
58
|
+
end
|
59
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
60
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
61
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
62
|
+
end
|
63
|
+
|
64
|
+
self
|
65
|
+
end
|
66
|
+
|
67
|
+
# Returns the string representation of the object
|
68
|
+
# @return [String] String presentation of the object
|
69
|
+
def to_s
|
70
|
+
to_hash.to_s
|
71
|
+
end
|
72
|
+
|
73
|
+
# Returns the object in the form of hash
|
74
|
+
# @return [Hash] Returns the object in the form of hash
|
75
|
+
def to_hash
|
76
|
+
hash = {}
|
77
|
+
self.class.attribute_map.each_pair do |attr, param|
|
78
|
+
value = self.send(attr)
|
79
|
+
next if value.nil?
|
80
|
+
hash[param] = _to_hash(value)
|
81
|
+
end
|
82
|
+
hash
|
83
|
+
end
|
84
|
+
|
85
|
+
private
|
86
|
+
|
87
|
+
# Outputs non-array value in the form of hash
|
88
|
+
# For object, use to_hash. Otherwise, just return the value
|
89
|
+
# @param [Object] value Any valid value
|
90
|
+
# @return [Hash] Returns the value in the form of hash
|
91
|
+
def _to_hash(value)
|
92
|
+
if value.is_a?(Array)
|
93
|
+
value.compact.map{ |v| _to_hash(v) }
|
94
|
+
elsif value.is_a?(Hash)
|
95
|
+
{}.tap do |hash|
|
96
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
97
|
+
end
|
98
|
+
elsif value.respond_to? :to_hash
|
99
|
+
value.to_hash
|
100
|
+
else
|
101
|
+
value
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
# Deserializes the data based on type
|
106
|
+
# @param [String] type Data type
|
107
|
+
# @param [String] value Value to be deserialized
|
108
|
+
# @return [Object] Deserialized data
|
109
|
+
def _deserialize(type, value)
|
110
|
+
case type.to_sym
|
111
|
+
when :DateTime
|
112
|
+
DateTime.parse(value)
|
113
|
+
when :Date
|
114
|
+
Date.parse(value)
|
115
|
+
when :String
|
116
|
+
value.to_s
|
117
|
+
when :Integer
|
118
|
+
value.to_i
|
119
|
+
when :Float
|
120
|
+
value.to_f
|
121
|
+
when :BOOLEAN
|
122
|
+
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
123
|
+
true
|
124
|
+
else
|
125
|
+
false
|
126
|
+
end
|
127
|
+
when :Object
|
128
|
+
# generic object (usually a Hash), return directly
|
129
|
+
value
|
130
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
131
|
+
inner_type = Regexp.last_match[:inner_type]
|
132
|
+
value.map { |v| _deserialize(inner_type, v) }
|
133
|
+
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
134
|
+
k_type = Regexp.last_match[:k_type]
|
135
|
+
v_type = Regexp.last_match[:v_type]
|
136
|
+
{}.tap do |hash|
|
137
|
+
value.each do |k, v|
|
138
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
139
|
+
end
|
140
|
+
end
|
141
|
+
else # model
|
142
|
+
temp_model = OracleBMC.const_get(type.to_s).new
|
143
|
+
temp_model.build_from_hash(value)
|
144
|
+
end
|
145
|
+
end
|
146
|
+
|
147
|
+
|
148
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
149
|
+
def self.attribute_map
|
150
|
+
{
|
151
|
+
:'display_name' => :'displayName'
|
152
|
+
}
|
153
|
+
end
|
154
|
+
|
155
|
+
# Attribute type mapping.
|
156
|
+
def self.swagger_types
|
157
|
+
{
|
158
|
+
:'display_name' => :'String'
|
159
|
+
}
|
160
|
+
end
|
161
|
+
end
|
162
|
+
end
|