oraclebmc 1.2.1 → 1.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +6 -2
  3. data/lib/oraclebmc/core/blockstorage_client.rb +2 -2
  4. data/lib/oraclebmc/core/compute_client.rb +8 -7
  5. data/lib/oraclebmc/core/core.rb +17 -0
  6. data/lib/oraclebmc/core/models/create_cross_connect_details.rb +203 -0
  7. data/lib/oraclebmc/core/models/create_cross_connect_group_details.rb +132 -0
  8. data/lib/oraclebmc/core/models/create_subnet_details.rb +24 -3
  9. data/lib/oraclebmc/core/models/create_vcn_details.rb +2 -2
  10. data/lib/oraclebmc/core/models/create_virtual_circuit_details.rb +261 -0
  11. data/lib/oraclebmc/core/models/create_vnic_details.rb +202 -0
  12. data/lib/oraclebmc/core/models/cross_connect.rb +234 -0
  13. data/lib/oraclebmc/core/models/cross_connect_group.rb +187 -0
  14. data/lib/oraclebmc/core/models/cross_connect_location.rb +135 -0
  15. data/lib/oraclebmc/core/models/cross_connect_mapping.rb +191 -0
  16. data/lib/oraclebmc/core/models/cross_connect_port_speed_shape.rb +138 -0
  17. data/lib/oraclebmc/core/models/cross_connect_status.rb +201 -0
  18. data/lib/oraclebmc/core/models/dhcp_dns_option.rb +7 -7
  19. data/lib/oraclebmc/core/models/dhcp_option.rb +1 -1
  20. data/lib/oraclebmc/core/models/dhcp_search_domain_option.rb +6 -7
  21. data/lib/oraclebmc/core/models/fast_connect_provider_service.rb +146 -0
  22. data/lib/oraclebmc/core/models/image.rb +1 -1
  23. data/lib/oraclebmc/core/models/instance.rb +6 -7
  24. data/lib/oraclebmc/core/models/launch_instance_details.rb +22 -19
  25. data/lib/oraclebmc/core/models/letter_of_authority.rb +195 -0
  26. data/lib/oraclebmc/core/models/subnet.rb +26 -5
  27. data/lib/oraclebmc/core/models/update_cross_connect_details.rb +137 -0
  28. data/lib/oraclebmc/core/models/update_cross_connect_group_details.rb +121 -0
  29. data/lib/oraclebmc/core/models/update_virtual_circuit_details.rb +240 -0
  30. data/lib/oraclebmc/core/models/vcn.rb +4 -4
  31. data/lib/oraclebmc/core/models/virtual_circuit.rb +395 -0
  32. data/lib/oraclebmc/core/models/virtual_circuit_bandwidth_shape.rb +138 -0
  33. data/lib/oraclebmc/core/models/vnic.rb +4 -4
  34. data/lib/oraclebmc/core/virtual_network_client.rb +962 -85
  35. data/lib/oraclebmc/identity/identity.rb +13 -0
  36. data/lib/oraclebmc/identity/identity_client.rb +533 -8
  37. data/lib/oraclebmc/identity/models/create_identity_provider_details.rb +213 -0
  38. data/lib/oraclebmc/identity/models/create_idp_group_mapping_details.rb +134 -0
  39. data/lib/oraclebmc/identity/models/create_region_subscription_details.rb +128 -0
  40. data/lib/oraclebmc/identity/models/create_saml2_identity_provider_details.rb +155 -0
  41. data/lib/oraclebmc/identity/models/create_user_details.rb +1 -1
  42. data/lib/oraclebmc/identity/models/identity_provider.rb +257 -0
  43. data/lib/oraclebmc/identity/models/idp_group_mapping.rb +221 -0
  44. data/lib/oraclebmc/identity/models/region.rb +142 -0
  45. data/lib/oraclebmc/identity/models/region_subscription.rb +179 -0
  46. data/lib/oraclebmc/identity/models/saml2_identity_provider.rb +181 -0
  47. data/lib/oraclebmc/identity/models/tenancy.rb +159 -0
  48. data/lib/oraclebmc/identity/models/update_identity_provider_details.rb +161 -0
  49. data/lib/oraclebmc/identity/models/update_idp_group_mapping_details.rb +132 -0
  50. data/lib/oraclebmc/identity/models/update_saml2_identity_provider_details.rb +146 -0
  51. data/lib/oraclebmc/regions.rb +1 -1
  52. data/lib/oraclebmc/version.rb +1 -1
  53. metadata +32 -2
@@ -38,11 +38,11 @@ module OracleBMC
38
38
  # Must be an alphanumeric string that begins with a letter and is unique within the VCN.
39
39
  # The value cannot be changed.
40
40
  #
41
- # This value must be set if you want to use the Internet and VCN Resolver to resolve the
41
+ # This value must be set if you want to use the Internet and VCN Resolver to resolve the
42
42
  # hostnames of instances in the subnet. It can only be set if the VCN itself
43
43
  # was created with a DNS label.
44
44
  #
45
- # For more information, see
45
+ # For more information, see
46
46
  # [DNS in Your Virtual Cloud Network](https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/dns.htm).
47
47
  #
48
48
  # Example: `subnet123`
@@ -50,6 +50,20 @@ module OracleBMC
50
50
  # @return [String]
51
51
  attr_accessor :dns_label
52
52
 
53
+ # Whether VNICs within this subnet can have public IP addresses.
54
+ # Defaults to false, which means VNICs created in this subnet will
55
+ # automatically be assigned public IP addresses unless specified
56
+ # otherwise during instance launch (with the `assignPublicIp` flag in
57
+ # {CreateVnicDetails}).
58
+ # If `prohibitPublicIpOnVnic` is set to true, VNICs created in this
59
+ # subnet cannot have public IP addresses (i.e., it's a private
60
+ # subnet).
61
+ #
62
+ # Example: `true`
63
+ #
64
+ # @return [BOOLEAN]
65
+ attr_accessor :prohibit_public_ip_on_vnic
66
+
53
67
  # The OCID of the route table the subnet will use. If you don't provide a value,
54
68
  # the subnet will use the VCN's default route table.
55
69
  #
@@ -102,6 +116,10 @@ module OracleBMC
102
116
  self.dns_label = attributes[:'dnsLabel']
103
117
  end
104
118
 
119
+ if attributes[:'prohibitPublicIpOnVnic']
120
+ self.prohibit_public_ip_on_vnic = attributes[:'prohibitPublicIpOnVnic']
121
+ end
122
+
105
123
  if attributes[:'routeTableId']
106
124
  self.route_table_id = attributes[:'routeTableId']
107
125
  end
@@ -127,6 +145,7 @@ module OracleBMC
127
145
  dhcp_options_id == other_object.dhcp_options_id &&
128
146
  display_name == other_object.display_name &&
129
147
  dns_label == other_object.dns_label &&
148
+ prohibit_public_ip_on_vnic == other_object.prohibit_public_ip_on_vnic &&
130
149
  route_table_id == other_object.route_table_id &&
131
150
  security_list_ids == other_object.security_list_ids &&
132
151
  vcn_id == other_object.vcn_id
@@ -141,7 +160,7 @@ module OracleBMC
141
160
  # Calculates hash code according to all attributes.
142
161
  # @return [Fixnum] Hash code
143
162
  def hash
144
- [availability_domain, cidr_block, compartment_id, dhcp_options_id, display_name, dns_label, route_table_id, security_list_ids, vcn_id].hash
163
+ [availability_domain, cidr_block, compartment_id, dhcp_options_id, display_name, dns_label, prohibit_public_ip_on_vnic, route_table_id, security_list_ids, vcn_id].hash
145
164
  end
146
165
 
147
166
  # Builds the object from hash
@@ -213,6 +232,7 @@ module OracleBMC
213
232
  :'dhcp_options_id' => :'dhcpOptionsId',
214
233
  :'display_name' => :'displayName',
215
234
  :'dns_label' => :'dnsLabel',
235
+ :'prohibit_public_ip_on_vnic' => :'prohibitPublicIpOnVnic',
216
236
  :'route_table_id' => :'routeTableId',
217
237
  :'security_list_ids' => :'securityListIds',
218
238
  :'vcn_id' => :'vcnId'
@@ -228,6 +248,7 @@ module OracleBMC
228
248
  :'dhcp_options_id' => :'String',
229
249
  :'display_name' => :'String',
230
250
  :'dns_label' => :'String',
251
+ :'prohibit_public_ip_on_vnic' => :'BOOLEAN',
231
252
  :'route_table_id' => :'String',
232
253
  :'security_list_ids' => :'Array<String>',
233
254
  :'vcn_id' => :'String'
@@ -28,10 +28,10 @@ module OracleBMC
28
28
  # The value cannot be changed.
29
29
  #
30
30
  # You must set this value if you want instances to be able to use hostnames to
31
- # resolve other instances in the VCN. Otherwise the Internet and VCN Resolver
31
+ # resolve other instances in the VCN. Otherwise the Internet and VCN Resolver
32
32
  # will not work.
33
33
  #
34
- # For more information, see
34
+ # For more information, see
35
35
  # [DNS in Your Virtual Cloud Network](https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/dns.htm).
36
36
  #
37
37
  # Example: `vcn1`
@@ -0,0 +1,261 @@
1
+ # Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+
5
+ module OracleBMC
6
+ class Core::Models::CreateVirtualCircuitDetails
7
+
8
+ TYPE_ENUM = [TYPE_PUBLIC = 'PUBLIC',
9
+ TYPE_PRIVATE = 'PRIVATE']
10
+
11
+ # The provisioned data rate of the connection. To get a list of the
12
+ # available bandwidth levels (i.e., shapes), see
13
+ # {#list_virtual_circuit_bandwidth_shapes list_virtual_circuit_bandwidth_shapes}.
14
+ #
15
+ # Example: `10 Gbps`
16
+ #
17
+ # @return [String]
18
+ attr_accessor :bandwidth_shape_name
19
+
20
+ # The OCID of the compartment to contain the virtual circuit.
21
+ #
22
+ # @return [String]
23
+ attr_accessor :compartment_id
24
+
25
+ # Create a `CrossConnectMapping` for each cross-connect or cross-connect
26
+ # group this virtual circuit will run on.
27
+ #
28
+ # @return [Array<OracleBMC::Core::Models::CrossConnectMapping>]
29
+ attr_accessor :cross_connect_mappings
30
+
31
+ # Your BGP ASN (either public or private). Provide this value only if
32
+ # there's a BGP session that goes from your edge router to Oracle.
33
+ # Otherwise, leave this empty or null.
34
+ #
35
+ # @return [Integer]
36
+ attr_accessor :customer_bgp_asn
37
+
38
+ # A user-friendly name. Does not have to be unique, and it's changeable.
39
+ #
40
+ # @return [String]
41
+ attr_accessor :display_name
42
+
43
+ # The OCID of the {Drg}
44
+ # that this virtual circuit uses.
45
+ #
46
+ # @return [String]
47
+ attr_accessor :gateway_id
48
+
49
+ # The name of the provider (if you're connecting via a provider).
50
+ # To get a list of the provider names, see
51
+ # {#list_fast_connect_provider_services list_fast_connect_provider_services}.
52
+ #
53
+ # @return [String]
54
+ attr_accessor :provider_name
55
+
56
+ # The name of the service offered by the provider (if you're connecting
57
+ # via a provider). To get a list of the available service offerings, see
58
+ # {#list_fast_connect_provider_services list_fast_connect_provider_services}.
59
+ #
60
+ # @return [String]
61
+ attr_accessor :provider_service_name
62
+
63
+ # The Oracle Bare Metal Cloud Services region where this virtual
64
+ # circuit is located.
65
+ #
66
+ # Example: `phx`
67
+ #
68
+ # @return [String]
69
+ attr_accessor :region
70
+
71
+ # The type of IP addresses used in this virtual circuit. PRIVATE
72
+ # means [RFC 1918](https://tools.ietf.org/html/rfc1918) addresses
73
+ # (10.0.0.0/8, 172.16/12, and 192.168/16). Only PRIVATE is supported.
74
+ #
75
+ # @return [String]
76
+ attr_accessor :type
77
+
78
+
79
+ # Initializes the object
80
+ # @param [Hash] attributes Model attributes in the form of hash
81
+ def initialize(attributes = {})
82
+ return unless attributes.is_a?(Hash)
83
+
84
+ # convert string to symbol for hash key
85
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
86
+
87
+
88
+ if attributes[:'bandwidthShapeName']
89
+ self.bandwidth_shape_name = attributes[:'bandwidthShapeName']
90
+ end
91
+
92
+ if attributes[:'compartmentId']
93
+ self.compartment_id = attributes[:'compartmentId']
94
+ end
95
+
96
+ if attributes[:'crossConnectMappings']
97
+ self.cross_connect_mappings = attributes[:'crossConnectMappings']
98
+ end
99
+
100
+ if attributes[:'customerBgpAsn']
101
+ self.customer_bgp_asn = attributes[:'customerBgpAsn']
102
+ end
103
+
104
+ if attributes[:'displayName']
105
+ self.display_name = attributes[:'displayName']
106
+ end
107
+
108
+ if attributes[:'gatewayId']
109
+ self.gateway_id = attributes[:'gatewayId']
110
+ end
111
+
112
+ if attributes[:'providerName']
113
+ self.provider_name = attributes[:'providerName']
114
+ end
115
+
116
+ if attributes[:'providerServiceName']
117
+ self.provider_service_name = attributes[:'providerServiceName']
118
+ end
119
+
120
+ if attributes[:'region']
121
+ self.region = attributes[:'region']
122
+ end
123
+
124
+ if attributes[:'type']
125
+ self.type = attributes[:'type']
126
+ end
127
+
128
+ end
129
+
130
+ # Custom attribute writer method checking allowed values (enum).
131
+ # @param [Object] type Object to be assigned
132
+ def type=(type)
133
+ if type && !TYPE_ENUM.include?(type)
134
+ fail "Invalid value for 'type': this must be one of the values in TYPE_ENUM."
135
+ else
136
+ @type = type
137
+ end
138
+ end
139
+
140
+ # Checks equality by comparing each attribute.
141
+ # @param [Object] other_object to be compared
142
+ def ==(other_object)
143
+ return true if self.equal?(other_object)
144
+ self.class == other_object.class &&
145
+ bandwidth_shape_name == other_object.bandwidth_shape_name &&
146
+ compartment_id == other_object.compartment_id &&
147
+ cross_connect_mappings == other_object.cross_connect_mappings &&
148
+ customer_bgp_asn == other_object.customer_bgp_asn &&
149
+ display_name == other_object.display_name &&
150
+ gateway_id == other_object.gateway_id &&
151
+ provider_name == other_object.provider_name &&
152
+ provider_service_name == other_object.provider_service_name &&
153
+ region == other_object.region &&
154
+ type == other_object.type
155
+ end
156
+
157
+ # @see the `==` method
158
+ # @param [Object] other_object to be compared
159
+ def eql?(other_object)
160
+ self == other_object
161
+ end
162
+
163
+ # Calculates hash code according to all attributes.
164
+ # @return [Fixnum] Hash code
165
+ def hash
166
+ [bandwidth_shape_name, compartment_id, cross_connect_mappings, customer_bgp_asn, display_name, gateway_id, provider_name, provider_service_name, region, type].hash
167
+ end
168
+
169
+ # Builds the object from hash
170
+ # @param [Hash] attributes Model attributes in the form of hash
171
+ # @return [Object] Returns the model itself
172
+ def build_from_hash(attributes)
173
+ return nil unless attributes.is_a?(Hash)
174
+ self.class.swagger_types.each_pair do |key, type|
175
+ if type =~ /^Array<(.*)>/i
176
+ # check to ensure the input is an array given that the the attribute
177
+ # is documented as an array but the input is not
178
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
179
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OracleBMC::Internal::Util.convert_to_type($1, v) } )
180
+ end
181
+ elsif !attributes[self.class.attribute_map[key]].nil?
182
+ self.send("#{key}=", OracleBMC::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
183
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
184
+ end
185
+
186
+ self
187
+ end
188
+
189
+ # Returns the string representation of the object
190
+ # @return [String] String presentation of the object
191
+ def to_s
192
+ to_hash.to_s
193
+ end
194
+
195
+ # Returns the object in the form of hash
196
+ # @return [Hash] Returns the object in the form of hash
197
+ def to_hash
198
+ hash = {}
199
+ self.class.attribute_map.each_pair do |attr, param|
200
+ value = self.send(attr)
201
+ next if value.nil?
202
+ hash[param] = _to_hash(value)
203
+ end
204
+ hash
205
+ end
206
+
207
+ private
208
+
209
+ # Outputs non-array value in the form of hash
210
+ # For object, use to_hash. Otherwise, just return the value
211
+ # @param [Object] value Any valid value
212
+ # @return [Hash] Returns the value in the form of hash
213
+ def _to_hash(value)
214
+ if value.is_a?(Array)
215
+ value.compact.map{ |v| _to_hash(v) }
216
+ elsif value.is_a?(Hash)
217
+ {}.tap do |hash|
218
+ value.each { |k, v| hash[k] = _to_hash(v) }
219
+ end
220
+ elsif value.respond_to? :to_hash
221
+ value.to_hash
222
+ else
223
+ value
224
+ end
225
+ end
226
+
227
+
228
+
229
+ # Attribute mapping from ruby-style variable name to JSON key.
230
+ def self.attribute_map
231
+ {
232
+ :'bandwidth_shape_name' => :'bandwidthShapeName',
233
+ :'compartment_id' => :'compartmentId',
234
+ :'cross_connect_mappings' => :'crossConnectMappings',
235
+ :'customer_bgp_asn' => :'customerBgpAsn',
236
+ :'display_name' => :'displayName',
237
+ :'gateway_id' => :'gatewayId',
238
+ :'provider_name' => :'providerName',
239
+ :'provider_service_name' => :'providerServiceName',
240
+ :'region' => :'region',
241
+ :'type' => :'type'
242
+ }
243
+ end
244
+
245
+ # Attribute type mapping.
246
+ def self.swagger_types
247
+ {
248
+ :'bandwidth_shape_name' => :'String',
249
+ :'compartment_id' => :'String',
250
+ :'cross_connect_mappings' => :'Array<OracleBMC::Core::Models::CrossConnectMapping>',
251
+ :'customer_bgp_asn' => :'Integer',
252
+ :'display_name' => :'String',
253
+ :'gateway_id' => :'String',
254
+ :'provider_name' => :'String',
255
+ :'provider_service_name' => :'String',
256
+ :'region' => :'String',
257
+ :'type' => :'String'
258
+ }
259
+ end
260
+ end
261
+ end
@@ -0,0 +1,202 @@
1
+ # Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+
5
+ module OracleBMC
6
+ class Core::Models::CreateVnicDetails
7
+ # Whether the VNIC should be assigned a public IP address. Defaults to whether
8
+ # the subnet is public or private. If not set and the VNIC is being created
9
+ # in a private subnet (i.e., where `prohibitPublicIpOnVnic`=true in the
10
+ # {Subnet}), then no public IP address is assigned.
11
+ # If not set and the subnet is public (`prohibitPublicIpOnVnic`=false), then
12
+ # a public IP address is assigned. If set to true and
13
+ # `prohibitPublicIpOnVnic`=true, an error is returned.
14
+ #
15
+ # Example: `false`
16
+ #
17
+ # @return [BOOLEAN]
18
+ attr_accessor :assign_public_ip
19
+
20
+ # A user-friendly name for the VNIC. Does not have to be unique.
21
+ # @return [String]
22
+ attr_accessor :display_name
23
+
24
+ # The hostname for the VNIC that is created during instance launch.
25
+ # Used for DNS. The value is the hostname portion of the instance's
26
+ # fully qualified domain name (FQDN) (e.g., `bminstance-1` in FQDN
27
+ # `bminstance-1.subnet123.vcn1.oraclevcn.com`).
28
+ # Must be unique across all VNICs in the subnet and comply with
29
+ # [RFC 952](https://tools.ietf.org/html/rfc952) and
30
+ # [RFC 1123](https://tools.ietf.org/html/rfc1123).
31
+ # The value cannot be changed, and it can be retrieved from the
32
+ # {Vnic}.
33
+ #
34
+ # For more information, see
35
+ # [DNS in Your Virtual Cloud Network](https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/dns.htm).
36
+ #
37
+ # Use this `hostnameLabel` instead
38
+ # of the deprecated `hostnameLabel` in
39
+ # {#launch_instance_details launch_instance_details}.
40
+ # If you provide both, the values must match.
41
+ #
42
+ # Example: `bminstance-1`
43
+ #
44
+ # @return [String]
45
+ attr_accessor :hostname_label
46
+
47
+ # A private IP address of your choice to assign to the VNIC. Must be an
48
+ # available IP address within the subnet's CIDR. If no value is specified,
49
+ # a private IP address from the subnet will be automatically assigned.
50
+ #
51
+ # Example: `10.0.3.1`
52
+ #
53
+ # @return [String]
54
+ attr_accessor :private_ip
55
+
56
+ # The OCID of the subnet to create the VNIC in. Use this `subnetId` instead
57
+ # of the deprecated `subnetId` in
58
+ # {#launch_instance_details launch_instance_details}.
59
+ # At least one of them is required; if you provide both, the values must match.
60
+ #
61
+ # @return [String]
62
+ attr_accessor :subnet_id
63
+
64
+
65
+ # Initializes the object
66
+ # @param [Hash] attributes Model attributes in the form of hash
67
+ def initialize(attributes = {})
68
+ return unless attributes.is_a?(Hash)
69
+
70
+ # convert string to symbol for hash key
71
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
72
+
73
+
74
+ if attributes[:'assignPublicIp']
75
+ self.assign_public_ip = attributes[:'assignPublicIp']
76
+ end
77
+
78
+ if attributes[:'displayName']
79
+ self.display_name = attributes[:'displayName']
80
+ end
81
+
82
+ if attributes[:'hostnameLabel']
83
+ self.hostname_label = attributes[:'hostnameLabel']
84
+ end
85
+
86
+ if attributes[:'privateIp']
87
+ self.private_ip = attributes[:'privateIp']
88
+ end
89
+
90
+ if attributes[:'subnetId']
91
+ self.subnet_id = attributes[:'subnetId']
92
+ end
93
+
94
+ end
95
+
96
+ # Checks equality by comparing each attribute.
97
+ # @param [Object] other_object to be compared
98
+ def ==(other_object)
99
+ return true if self.equal?(other_object)
100
+ self.class == other_object.class &&
101
+ assign_public_ip == other_object.assign_public_ip &&
102
+ display_name == other_object.display_name &&
103
+ hostname_label == other_object.hostname_label &&
104
+ private_ip == other_object.private_ip &&
105
+ subnet_id == other_object.subnet_id
106
+ end
107
+
108
+ # @see the `==` method
109
+ # @param [Object] other_object to be compared
110
+ def eql?(other_object)
111
+ self == other_object
112
+ end
113
+
114
+ # Calculates hash code according to all attributes.
115
+ # @return [Fixnum] Hash code
116
+ def hash
117
+ [assign_public_ip, display_name, hostname_label, private_ip, subnet_id].hash
118
+ end
119
+
120
+ # Builds the object from hash
121
+ # @param [Hash] attributes Model attributes in the form of hash
122
+ # @return [Object] Returns the model itself
123
+ def build_from_hash(attributes)
124
+ return nil unless attributes.is_a?(Hash)
125
+ self.class.swagger_types.each_pair do |key, type|
126
+ if type =~ /^Array<(.*)>/i
127
+ # check to ensure the input is an array given that the the attribute
128
+ # is documented as an array but the input is not
129
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
130
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OracleBMC::Internal::Util.convert_to_type($1, v) } )
131
+ end
132
+ elsif !attributes[self.class.attribute_map[key]].nil?
133
+ self.send("#{key}=", OracleBMC::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
134
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
135
+ end
136
+
137
+ self
138
+ end
139
+
140
+ # Returns the string representation of the object
141
+ # @return [String] String presentation of the object
142
+ def to_s
143
+ to_hash.to_s
144
+ end
145
+
146
+ # Returns the object in the form of hash
147
+ # @return [Hash] Returns the object in the form of hash
148
+ def to_hash
149
+ hash = {}
150
+ self.class.attribute_map.each_pair do |attr, param|
151
+ value = self.send(attr)
152
+ next if value.nil?
153
+ hash[param] = _to_hash(value)
154
+ end
155
+ hash
156
+ end
157
+
158
+ private
159
+
160
+ # Outputs non-array value in the form of hash
161
+ # For object, use to_hash. Otherwise, just return the value
162
+ # @param [Object] value Any valid value
163
+ # @return [Hash] Returns the value in the form of hash
164
+ def _to_hash(value)
165
+ if value.is_a?(Array)
166
+ value.compact.map{ |v| _to_hash(v) }
167
+ elsif value.is_a?(Hash)
168
+ {}.tap do |hash|
169
+ value.each { |k, v| hash[k] = _to_hash(v) }
170
+ end
171
+ elsif value.respond_to? :to_hash
172
+ value.to_hash
173
+ else
174
+ value
175
+ end
176
+ end
177
+
178
+
179
+
180
+ # Attribute mapping from ruby-style variable name to JSON key.
181
+ def self.attribute_map
182
+ {
183
+ :'assign_public_ip' => :'assignPublicIp',
184
+ :'display_name' => :'displayName',
185
+ :'hostname_label' => :'hostnameLabel',
186
+ :'private_ip' => :'privateIp',
187
+ :'subnet_id' => :'subnetId'
188
+ }
189
+ end
190
+
191
+ # Attribute type mapping.
192
+ def self.swagger_types
193
+ {
194
+ :'assign_public_ip' => :'BOOLEAN',
195
+ :'display_name' => :'String',
196
+ :'hostname_label' => :'String',
197
+ :'private_ip' => :'String',
198
+ :'subnet_id' => :'String'
199
+ }
200
+ end
201
+ end
202
+ end