oraclebmc 1.2.1 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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
@@ -45,10 +45,10 @@ module OracleBMC
45
45
  # Must be an alphanumeric string that begins with a letter.
46
46
  # The value cannot be changed.
47
47
  #
48
- # The absence of this parameter means the Internet and VCN Resolver will
48
+ # The absence of this parameter means the Internet and VCN Resolver will
49
49
  # not work for this VCN.
50
50
  #
51
- # For more information, see
51
+ # For more information, see
52
52
  # [DNS in Your Virtual Cloud Network](https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/dns.htm).
53
53
  #
54
54
  # Example: `vcn1`
@@ -72,9 +72,9 @@ module OracleBMC
72
72
  attr_accessor :time_created
73
73
 
74
74
  # The VCN's domain name, which consists of the VCN's DNS label, and the
75
- # `oraclevcn.com` domain.
75
+ # `oraclevcn.com` domain.
76
76
  #
77
- # For more information, see
77
+ # For more information, see
78
78
  # [DNS in Your Virtual Cloud Network](https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/dns.htm).
79
79
  #
80
80
  # Example: `vcn1.oraclevcn.com`
@@ -0,0 +1,395 @@
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::VirtualCircuit
7
+
8
+ BGP_SESSION_STATE_ENUM = [BGP_SESSION_STATE_UP = 'UP',
9
+ BGP_SESSION_STATE_DOWN = 'DOWN',
10
+ BGP_SESSION_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE']
11
+
12
+
13
+ LIFECYCLE_STATE_ENUM = [LIFECYCLE_STATE_PENDING_PROVIDER = 'PENDING_PROVIDER',
14
+ LIFECYCLE_STATE_VERIFYING = 'VERIFYING',
15
+ LIFECYCLE_STATE_PROVISIONING = 'PROVISIONING',
16
+ LIFECYCLE_STATE_PROVISIONED = 'PROVISIONED',
17
+ LIFECYCLE_STATE_FAILED = 'FAILED',
18
+ LIFECYCLE_STATE_INACTIVE = 'INACTIVE',
19
+ LIFECYCLE_STATE_TERMINATING = 'TERMINATING',
20
+ LIFECYCLE_STATE_TERMINATED = 'TERMINATED',
21
+ LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE']
22
+
23
+
24
+ PROVIDER_STATE_ENUM = [PROVIDER_STATE_ACTIVE = 'ACTIVE',
25
+ PROVIDER_STATE_INACTIVE = 'INACTIVE',
26
+ PROVIDER_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE']
27
+
28
+
29
+ TYPE_ENUM = [TYPE_PUBLIC = 'PUBLIC',
30
+ TYPE_PRIVATE = 'PRIVATE',
31
+ TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE']
32
+
33
+ # The provisioned data rate of the connection.
34
+ # @return [String]
35
+ attr_accessor :bandwidth_shape_name
36
+
37
+ # The state of the BGP session associated with the virtual circuit.
38
+ # @return [String]
39
+ attr_accessor :bgp_session_state
40
+
41
+ # The OCID of the compartment containing the virtual circuit.
42
+ # @return [String]
43
+ attr_accessor :compartment_id
44
+
45
+ # An array of mappings, each containing properties for a
46
+ # cross-connect or cross-connect group that is associated with this
47
+ # virtual circuit.
48
+ #
49
+ # @return [Array<OracleBMC::Core::Models::CrossConnectMapping>]
50
+ attr_accessor :cross_connect_mappings
51
+
52
+ # The BGP ASN of the network at the other end of the BGP
53
+ # session from Oracle. If the session is between the customer's
54
+ # edge router and Oracle, the value is the customer's ASN. If the BGP
55
+ # session is between the provider's edge router and Oracle, the value
56
+ # is the provider's ASN.
57
+ #
58
+ # @return [Integer]
59
+ attr_accessor :customer_bgp_asn
60
+
61
+ # A user-friendly name. Does not have to be unique, and it's changeable.
62
+ #
63
+ # @return [String]
64
+ attr_accessor :display_name
65
+
66
+ # The OCID of the customer's {Drg}
67
+ # that this virtual circuit uses.
68
+ #
69
+ # @return [String]
70
+ attr_accessor :gateway_id
71
+
72
+ # The virtual circuit's Oracle ID (OCID).
73
+ # @return [String]
74
+ attr_accessor :id
75
+
76
+ # The virtual circuit's current state. For information about
77
+ # the different states, see
78
+ # [FastConnect Overview](https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/fastconnect.htm).
79
+ #
80
+ # @return [String]
81
+ attr_accessor :lifecycle_state
82
+
83
+ # The Oracle BGP ASN.
84
+ # @return [Integer]
85
+ attr_accessor :oracle_bgp_asn
86
+
87
+ # The name of the provider (if the customer is connecting via a provider).
88
+ #
89
+ # @return [String]
90
+ attr_accessor :provider_name
91
+
92
+ # The name of the service offered by the provider (if the customer is connecting via a provider).
93
+ #
94
+ # @return [String]
95
+ attr_accessor :provider_service_name
96
+
97
+ # The provider's state in relation to this virtual circuit (if the
98
+ # customer is connecting via a provider). ACTIVE means
99
+ # the provider has provisioned the virtual circuit from their end.
100
+ # INACTIVE means the provider has not yet provisioned the virtual
101
+ # circuit, or has de-provisioned it.
102
+ #
103
+ # @return [String]
104
+ attr_accessor :provider_state
105
+
106
+ # Provider-supplied reference information about this virtual circuit
107
+ # (if the customer is connecting via a provider).
108
+ #
109
+ # @return [String]
110
+ attr_accessor :reference_comment
111
+
112
+ # The Oracle Bare Metal Cloud Services region where this virtual
113
+ # circuit is located.
114
+ #
115
+ # @return [String]
116
+ attr_accessor :region
117
+
118
+ # The date and time the virtual circuit was created,
119
+ # in the format defined by RFC3339.
120
+ #
121
+ # Example: `2016-08-25T21:10:29.600Z`
122
+ #
123
+ # @return [DateTime]
124
+ attr_accessor :time_created
125
+
126
+ # The type of IP addresses used in this virtual circuit. PRIVATE means
127
+ # [RFC 1918](https://tools.ietf.org/html/rfc1918) addresses
128
+ # (10.0.0.0/8, 172.16/12, and 192.168/16). Only PRIVATE is supported.
129
+ #
130
+ # @return [String]
131
+ attr_accessor :type
132
+
133
+
134
+ # Initializes the object
135
+ # @param [Hash] attributes Model attributes in the form of hash
136
+ def initialize(attributes = {})
137
+ return unless attributes.is_a?(Hash)
138
+
139
+ # convert string to symbol for hash key
140
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
141
+
142
+
143
+ if attributes[:'bandwidthShapeName']
144
+ self.bandwidth_shape_name = attributes[:'bandwidthShapeName']
145
+ end
146
+
147
+ if attributes[:'bgpSessionState']
148
+ self.bgp_session_state = attributes[:'bgpSessionState']
149
+ end
150
+
151
+ if attributes[:'compartmentId']
152
+ self.compartment_id = attributes[:'compartmentId']
153
+ end
154
+
155
+ if attributes[:'crossConnectMappings']
156
+ self.cross_connect_mappings = attributes[:'crossConnectMappings']
157
+ end
158
+
159
+ if attributes[:'customerBgpAsn']
160
+ self.customer_bgp_asn = attributes[:'customerBgpAsn']
161
+ end
162
+
163
+ if attributes[:'displayName']
164
+ self.display_name = attributes[:'displayName']
165
+ end
166
+
167
+ if attributes[:'gatewayId']
168
+ self.gateway_id = attributes[:'gatewayId']
169
+ end
170
+
171
+ if attributes[:'id']
172
+ self.id = attributes[:'id']
173
+ end
174
+
175
+ if attributes[:'lifecycleState']
176
+ self.lifecycle_state = attributes[:'lifecycleState']
177
+ end
178
+
179
+ if attributes[:'oracleBgpAsn']
180
+ self.oracle_bgp_asn = attributes[:'oracleBgpAsn']
181
+ end
182
+
183
+ if attributes[:'providerName']
184
+ self.provider_name = attributes[:'providerName']
185
+ end
186
+
187
+ if attributes[:'providerServiceName']
188
+ self.provider_service_name = attributes[:'providerServiceName']
189
+ end
190
+
191
+ if attributes[:'providerState']
192
+ self.provider_state = attributes[:'providerState']
193
+ end
194
+
195
+ if attributes[:'referenceComment']
196
+ self.reference_comment = attributes[:'referenceComment']
197
+ end
198
+
199
+ if attributes[:'region']
200
+ self.region = attributes[:'region']
201
+ end
202
+
203
+ if attributes[:'timeCreated']
204
+ self.time_created = attributes[:'timeCreated']
205
+ end
206
+
207
+ if attributes[:'type']
208
+ self.type = attributes[:'type']
209
+ end
210
+
211
+ end
212
+
213
+ # Custom attribute writer method checking allowed values (enum).
214
+ # @param [Object] bgp_session_state Object to be assigned
215
+ def bgp_session_state=(bgp_session_state)
216
+ if bgp_session_state && !BGP_SESSION_STATE_ENUM.include?(bgp_session_state)
217
+ @bgp_session_state = BGP_SESSION_STATE_UNKNOWN_ENUM_VALUE
218
+ else
219
+ @bgp_session_state = bgp_session_state
220
+ end
221
+ end
222
+
223
+ # Custom attribute writer method checking allowed values (enum).
224
+ # @param [Object] lifecycle_state Object to be assigned
225
+ def lifecycle_state=(lifecycle_state)
226
+ if lifecycle_state && !LIFECYCLE_STATE_ENUM.include?(lifecycle_state)
227
+ @lifecycle_state = LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE
228
+ else
229
+ @lifecycle_state = lifecycle_state
230
+ end
231
+ end
232
+
233
+ # Custom attribute writer method checking allowed values (enum).
234
+ # @param [Object] provider_state Object to be assigned
235
+ def provider_state=(provider_state)
236
+ if provider_state && !PROVIDER_STATE_ENUM.include?(provider_state)
237
+ @provider_state = PROVIDER_STATE_UNKNOWN_ENUM_VALUE
238
+ else
239
+ @provider_state = provider_state
240
+ end
241
+ end
242
+
243
+ # Custom attribute writer method checking allowed values (enum).
244
+ # @param [Object] type Object to be assigned
245
+ def type=(type)
246
+ if type && !TYPE_ENUM.include?(type)
247
+ @type = TYPE_UNKNOWN_ENUM_VALUE
248
+ else
249
+ @type = type
250
+ end
251
+ end
252
+
253
+ # Checks equality by comparing each attribute.
254
+ # @param [Object] other_object to be compared
255
+ def ==(other_object)
256
+ return true if self.equal?(other_object)
257
+ self.class == other_object.class &&
258
+ bandwidth_shape_name == other_object.bandwidth_shape_name &&
259
+ bgp_session_state == other_object.bgp_session_state &&
260
+ compartment_id == other_object.compartment_id &&
261
+ cross_connect_mappings == other_object.cross_connect_mappings &&
262
+ customer_bgp_asn == other_object.customer_bgp_asn &&
263
+ display_name == other_object.display_name &&
264
+ gateway_id == other_object.gateway_id &&
265
+ id == other_object.id &&
266
+ lifecycle_state == other_object.lifecycle_state &&
267
+ oracle_bgp_asn == other_object.oracle_bgp_asn &&
268
+ provider_name == other_object.provider_name &&
269
+ provider_service_name == other_object.provider_service_name &&
270
+ provider_state == other_object.provider_state &&
271
+ reference_comment == other_object.reference_comment &&
272
+ region == other_object.region &&
273
+ time_created == other_object.time_created &&
274
+ type == other_object.type
275
+ end
276
+
277
+ # @see the `==` method
278
+ # @param [Object] other_object to be compared
279
+ def eql?(other_object)
280
+ self == other_object
281
+ end
282
+
283
+ # Calculates hash code according to all attributes.
284
+ # @return [Fixnum] Hash code
285
+ def hash
286
+ [bandwidth_shape_name, bgp_session_state, compartment_id, cross_connect_mappings, customer_bgp_asn, display_name, gateway_id, id, lifecycle_state, oracle_bgp_asn, provider_name, provider_service_name, provider_state, reference_comment, region, time_created, type].hash
287
+ end
288
+
289
+ # Builds the object from hash
290
+ # @param [Hash] attributes Model attributes in the form of hash
291
+ # @return [Object] Returns the model itself
292
+ def build_from_hash(attributes)
293
+ return nil unless attributes.is_a?(Hash)
294
+ self.class.swagger_types.each_pair do |key, type|
295
+ if type =~ /^Array<(.*)>/i
296
+ # check to ensure the input is an array given that the the attribute
297
+ # is documented as an array but the input is not
298
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
299
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OracleBMC::Internal::Util.convert_to_type($1, v) } )
300
+ end
301
+ elsif !attributes[self.class.attribute_map[key]].nil?
302
+ self.send("#{key}=", OracleBMC::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
303
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
304
+ end
305
+
306
+ self
307
+ end
308
+
309
+ # Returns the string representation of the object
310
+ # @return [String] String presentation of the object
311
+ def to_s
312
+ to_hash.to_s
313
+ end
314
+
315
+ # Returns the object in the form of hash
316
+ # @return [Hash] Returns the object in the form of hash
317
+ def to_hash
318
+ hash = {}
319
+ self.class.attribute_map.each_pair do |attr, param|
320
+ value = self.send(attr)
321
+ next if value.nil?
322
+ hash[param] = _to_hash(value)
323
+ end
324
+ hash
325
+ end
326
+
327
+ private
328
+
329
+ # Outputs non-array value in the form of hash
330
+ # For object, use to_hash. Otherwise, just return the value
331
+ # @param [Object] value Any valid value
332
+ # @return [Hash] Returns the value in the form of hash
333
+ def _to_hash(value)
334
+ if value.is_a?(Array)
335
+ value.compact.map{ |v| _to_hash(v) }
336
+ elsif value.is_a?(Hash)
337
+ {}.tap do |hash|
338
+ value.each { |k, v| hash[k] = _to_hash(v) }
339
+ end
340
+ elsif value.respond_to? :to_hash
341
+ value.to_hash
342
+ else
343
+ value
344
+ end
345
+ end
346
+
347
+
348
+
349
+ # Attribute mapping from ruby-style variable name to JSON key.
350
+ def self.attribute_map
351
+ {
352
+ :'bandwidth_shape_name' => :'bandwidthShapeName',
353
+ :'bgp_session_state' => :'bgpSessionState',
354
+ :'compartment_id' => :'compartmentId',
355
+ :'cross_connect_mappings' => :'crossConnectMappings',
356
+ :'customer_bgp_asn' => :'customerBgpAsn',
357
+ :'display_name' => :'displayName',
358
+ :'gateway_id' => :'gatewayId',
359
+ :'id' => :'id',
360
+ :'lifecycle_state' => :'lifecycleState',
361
+ :'oracle_bgp_asn' => :'oracleBgpAsn',
362
+ :'provider_name' => :'providerName',
363
+ :'provider_service_name' => :'providerServiceName',
364
+ :'provider_state' => :'providerState',
365
+ :'reference_comment' => :'referenceComment',
366
+ :'region' => :'region',
367
+ :'time_created' => :'timeCreated',
368
+ :'type' => :'type'
369
+ }
370
+ end
371
+
372
+ # Attribute type mapping.
373
+ def self.swagger_types
374
+ {
375
+ :'bandwidth_shape_name' => :'String',
376
+ :'bgp_session_state' => :'String',
377
+ :'compartment_id' => :'String',
378
+ :'cross_connect_mappings' => :'Array<OracleBMC::Core::Models::CrossConnectMapping>',
379
+ :'customer_bgp_asn' => :'Integer',
380
+ :'display_name' => :'String',
381
+ :'gateway_id' => :'String',
382
+ :'id' => :'String',
383
+ :'lifecycle_state' => :'String',
384
+ :'oracle_bgp_asn' => :'Integer',
385
+ :'provider_name' => :'String',
386
+ :'provider_service_name' => :'String',
387
+ :'provider_state' => :'String',
388
+ :'reference_comment' => :'String',
389
+ :'region' => :'String',
390
+ :'time_created' => :'DateTime',
391
+ :'type' => :'String'
392
+ }
393
+ end
394
+ end
395
+ end
@@ -0,0 +1,138 @@
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::VirtualCircuitBandwidthShape
7
+ # The bandwidth in Mbps.
8
+ #
9
+ # Example: `10000`
10
+ #
11
+ # @return [Integer]
12
+ attr_accessor :bandwidth_in_mbps
13
+
14
+ # The name of the bandwidth shape.
15
+ #
16
+ # Example: `10 Gbps`
17
+ #
18
+ # @return [String]
19
+ attr_accessor :name
20
+
21
+
22
+ # Initializes the object
23
+ # @param [Hash] attributes Model attributes in the form of hash
24
+ def initialize(attributes = {})
25
+ return unless attributes.is_a?(Hash)
26
+
27
+ # convert string to symbol for hash key
28
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
29
+
30
+
31
+ if attributes[:'bandwidthInMbps']
32
+ self.bandwidth_in_mbps = attributes[:'bandwidthInMbps']
33
+ end
34
+
35
+ if attributes[:'name']
36
+ self.name = attributes[:'name']
37
+ end
38
+
39
+ end
40
+
41
+ # Checks equality by comparing each attribute.
42
+ # @param [Object] other_object to be compared
43
+ def ==(other_object)
44
+ return true if self.equal?(other_object)
45
+ self.class == other_object.class &&
46
+ bandwidth_in_mbps == other_object.bandwidth_in_mbps &&
47
+ name == other_object.name
48
+ end
49
+
50
+ # @see the `==` method
51
+ # @param [Object] other_object to be compared
52
+ def eql?(other_object)
53
+ self == other_object
54
+ end
55
+
56
+ # Calculates hash code according to all attributes.
57
+ # @return [Fixnum] Hash code
58
+ def hash
59
+ [bandwidth_in_mbps, name].hash
60
+ end
61
+
62
+ # Builds the object from hash
63
+ # @param [Hash] attributes Model attributes in the form of hash
64
+ # @return [Object] Returns the model itself
65
+ def build_from_hash(attributes)
66
+ return nil unless attributes.is_a?(Hash)
67
+ self.class.swagger_types.each_pair do |key, type|
68
+ if type =~ /^Array<(.*)>/i
69
+ # check to ensure the input is an array given that the the attribute
70
+ # is documented as an array but the input is not
71
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
72
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OracleBMC::Internal::Util.convert_to_type($1, v) } )
73
+ end
74
+ elsif !attributes[self.class.attribute_map[key]].nil?
75
+ self.send("#{key}=", OracleBMC::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
76
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
77
+ end
78
+
79
+ self
80
+ end
81
+
82
+ # Returns the string representation of the object
83
+ # @return [String] String presentation of the object
84
+ def to_s
85
+ to_hash.to_s
86
+ end
87
+
88
+ # Returns the object in the form of hash
89
+ # @return [Hash] Returns the object in the form of hash
90
+ def to_hash
91
+ hash = {}
92
+ self.class.attribute_map.each_pair do |attr, param|
93
+ value = self.send(attr)
94
+ next if value.nil?
95
+ hash[param] = _to_hash(value)
96
+ end
97
+ hash
98
+ end
99
+
100
+ private
101
+
102
+ # Outputs non-array value in the form of hash
103
+ # For object, use to_hash. Otherwise, just return the value
104
+ # @param [Object] value Any valid value
105
+ # @return [Hash] Returns the value in the form of hash
106
+ def _to_hash(value)
107
+ if value.is_a?(Array)
108
+ value.compact.map{ |v| _to_hash(v) }
109
+ elsif value.is_a?(Hash)
110
+ {}.tap do |hash|
111
+ value.each { |k, v| hash[k] = _to_hash(v) }
112
+ end
113
+ elsif value.respond_to? :to_hash
114
+ value.to_hash
115
+ else
116
+ value
117
+ end
118
+ end
119
+
120
+
121
+
122
+ # Attribute mapping from ruby-style variable name to JSON key.
123
+ def self.attribute_map
124
+ {
125
+ :'bandwidth_in_mbps' => :'bandwidthInMbps',
126
+ :'name' => :'name'
127
+ }
128
+ end
129
+
130
+ # Attribute type mapping.
131
+ def self.swagger_types
132
+ {
133
+ :'bandwidth_in_mbps' => :'Integer',
134
+ :'name' => :'String'
135
+ }
136
+ end
137
+ end
138
+ end