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
@@ -44,10 +44,10 @@ module OracleBMC
44
44
  # Must be an alphanumeric string that begins with a letter and is unique within the VCN.
45
45
  # The value cannot be changed.
46
46
  #
47
- # The absence of this parameter means the Internet and VCN Resolver
47
+ # The absence of this parameter means the Internet and VCN Resolver
48
48
  # will not resolve hostnames of instances in this subnet.
49
49
  #
50
- # For more information, see
50
+ # For more information, see
51
51
  # [DNS in Your Virtual Cloud Network](https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/dns.htm).
52
52
  #
53
53
  # Example: `subnet123`
@@ -63,6 +63,20 @@ module OracleBMC
63
63
  # @return [String]
64
64
  attr_accessor :lifecycle_state
65
65
 
66
+ # Whether VNICs within this subnet can have public IP addresses.
67
+ # Defaults to false, which means VNICs created in this subnet will
68
+ # automatically be assigned public IP addresses unless specified
69
+ # otherwise during instance launch (with the `assignPublicIp` flag in
70
+ # {CreateVnicDetails}).
71
+ # If `prohibitPublicIpOnVnic` is set to true, VNICs created in this
72
+ # subnet cannot have public IP addresses (i.e., it's a private
73
+ # subnet).
74
+ #
75
+ # Example: `true`
76
+ #
77
+ # @return [BOOLEAN]
78
+ attr_accessor :prohibit_public_ip_on_vnic
79
+
66
80
  # The OCID of the route table the subnet is using.
67
81
  # @return [String]
68
82
  attr_accessor :route_table_id
@@ -72,9 +86,9 @@ module OracleBMC
72
86
  attr_accessor :security_list_ids
73
87
 
74
88
  # The subnet's domain name, which consists of the subnet's DNS label,
75
- # the VCN's DNS label, and the `oraclevcn.com` domain.
89
+ # the VCN's DNS label, and the `oraclevcn.com` domain.
76
90
  #
77
- # For more information, see
91
+ # For more information, see
78
92
  # [DNS in Your Virtual Cloud Network](https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/dns.htm).
79
93
  #
80
94
  # Example: `subnet123.vcn1.oraclevcn.com`
@@ -149,6 +163,10 @@ module OracleBMC
149
163
  self.lifecycle_state = attributes[:'lifecycleState']
150
164
  end
151
165
 
166
+ if attributes[:'prohibitPublicIpOnVnic']
167
+ self.prohibit_public_ip_on_vnic = attributes[:'prohibitPublicIpOnVnic']
168
+ end
169
+
152
170
  if attributes[:'routeTableId']
153
171
  self.route_table_id = attributes[:'routeTableId']
154
172
  end
@@ -202,6 +220,7 @@ module OracleBMC
202
220
  dns_label == other_object.dns_label &&
203
221
  id == other_object.id &&
204
222
  lifecycle_state == other_object.lifecycle_state &&
223
+ prohibit_public_ip_on_vnic == other_object.prohibit_public_ip_on_vnic &&
205
224
  route_table_id == other_object.route_table_id &&
206
225
  security_list_ids == other_object.security_list_ids &&
207
226
  subnet_domain_name == other_object.subnet_domain_name &&
@@ -220,7 +239,7 @@ module OracleBMC
220
239
  # Calculates hash code according to all attributes.
221
240
  # @return [Fixnum] Hash code
222
241
  def hash
223
- [availability_domain, cidr_block, compartment_id, dhcp_options_id, display_name, dns_label, id, lifecycle_state, route_table_id, security_list_ids, subnet_domain_name, time_created, vcn_id, virtual_router_ip, virtual_router_mac].hash
242
+ [availability_domain, cidr_block, compartment_id, dhcp_options_id, display_name, dns_label, id, lifecycle_state, prohibit_public_ip_on_vnic, route_table_id, security_list_ids, subnet_domain_name, time_created, vcn_id, virtual_router_ip, virtual_router_mac].hash
224
243
  end
225
244
 
226
245
  # Builds the object from hash
@@ -294,6 +313,7 @@ module OracleBMC
294
313
  :'dns_label' => :'dnsLabel',
295
314
  :'id' => :'id',
296
315
  :'lifecycle_state' => :'lifecycleState',
316
+ :'prohibit_public_ip_on_vnic' => :'prohibitPublicIpOnVnic',
297
317
  :'route_table_id' => :'routeTableId',
298
318
  :'security_list_ids' => :'securityListIds',
299
319
  :'subnet_domain_name' => :'subnetDomainName',
@@ -315,6 +335,7 @@ module OracleBMC
315
335
  :'dns_label' => :'String',
316
336
  :'id' => :'String',
317
337
  :'lifecycle_state' => :'String',
338
+ :'prohibit_public_ip_on_vnic' => :'BOOLEAN',
318
339
  :'route_table_id' => :'String',
319
340
  :'security_list_ids' => :'Array<String>',
320
341
  :'subnet_domain_name' => :'String',
@@ -0,0 +1,137 @@
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::UpdateCrossConnectDetails
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
+ # Set to true to activate the cross-connect. You activate it after the physical cabling
12
+ # is complete, and you've confirmed the cross-connect's light levels are good and your side
13
+ # of the interface is up. Activation indicates to Oracle that the physical connection is ready.
14
+ #
15
+ # Example: `true`
16
+ #
17
+ # @return [BOOLEAN]
18
+ attr_accessor :is_active
19
+
20
+
21
+ # Initializes the object
22
+ # @param [Hash] attributes Model attributes in the form of hash
23
+ def initialize(attributes = {})
24
+ return unless attributes.is_a?(Hash)
25
+
26
+ # convert string to symbol for hash key
27
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
28
+
29
+
30
+ if attributes[:'displayName']
31
+ self.display_name = attributes[:'displayName']
32
+ end
33
+
34
+ if attributes[:'isActive']
35
+ self.is_active = attributes[:'isActive']
36
+ end
37
+
38
+ end
39
+
40
+ # Checks equality by comparing each attribute.
41
+ # @param [Object] other_object to be compared
42
+ def ==(other_object)
43
+ return true if self.equal?(other_object)
44
+ self.class == other_object.class &&
45
+ display_name == other_object.display_name &&
46
+ is_active == other_object.is_active
47
+ end
48
+
49
+ # @see the `==` method
50
+ # @param [Object] other_object to be compared
51
+ def eql?(other_object)
52
+ self == other_object
53
+ end
54
+
55
+ # Calculates hash code according to all attributes.
56
+ # @return [Fixnum] Hash code
57
+ def hash
58
+ [display_name, is_active].hash
59
+ end
60
+
61
+ # Builds the object from hash
62
+ # @param [Hash] attributes Model attributes in the form of hash
63
+ # @return [Object] Returns the model itself
64
+ def build_from_hash(attributes)
65
+ return nil unless attributes.is_a?(Hash)
66
+ self.class.swagger_types.each_pair do |key, type|
67
+ if type =~ /^Array<(.*)>/i
68
+ # check to ensure the input is an array given that the the attribute
69
+ # is documented as an array but the input is not
70
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
71
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OracleBMC::Internal::Util.convert_to_type($1, v) } )
72
+ end
73
+ elsif !attributes[self.class.attribute_map[key]].nil?
74
+ self.send("#{key}=", OracleBMC::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
75
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
76
+ end
77
+
78
+ self
79
+ end
80
+
81
+ # Returns the string representation of the object
82
+ # @return [String] String presentation of the object
83
+ def to_s
84
+ to_hash.to_s
85
+ end
86
+
87
+ # Returns the object in the form of hash
88
+ # @return [Hash] Returns the object in the form of hash
89
+ def to_hash
90
+ hash = {}
91
+ self.class.attribute_map.each_pair do |attr, param|
92
+ value = self.send(attr)
93
+ next if value.nil?
94
+ hash[param] = _to_hash(value)
95
+ end
96
+ hash
97
+ end
98
+
99
+ private
100
+
101
+ # Outputs non-array value in the form of hash
102
+ # For object, use to_hash. Otherwise, just return the value
103
+ # @param [Object] value Any valid value
104
+ # @return [Hash] Returns the value in the form of hash
105
+ def _to_hash(value)
106
+ if value.is_a?(Array)
107
+ value.compact.map{ |v| _to_hash(v) }
108
+ elsif value.is_a?(Hash)
109
+ {}.tap do |hash|
110
+ value.each { |k, v| hash[k] = _to_hash(v) }
111
+ end
112
+ elsif value.respond_to? :to_hash
113
+ value.to_hash
114
+ else
115
+ value
116
+ end
117
+ end
118
+
119
+
120
+
121
+ # Attribute mapping from ruby-style variable name to JSON key.
122
+ def self.attribute_map
123
+ {
124
+ :'display_name' => :'displayName',
125
+ :'is_active' => :'isActive'
126
+ }
127
+ end
128
+
129
+ # Attribute type mapping.
130
+ def self.swagger_types
131
+ {
132
+ :'display_name' => :'String',
133
+ :'is_active' => :'BOOLEAN'
134
+ }
135
+ end
136
+ end
137
+ end
@@ -0,0 +1,121 @@
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::UpdateCrossConnectGroupDetails
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| OracleBMC::Internal::Util.convert_to_type($1, v) } )
58
+ end
59
+ elsif !attributes[self.class.attribute_map[key]].nil?
60
+ self.send("#{key}=", OracleBMC::Internal::Util.convert_to_type(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
+
106
+
107
+ # Attribute mapping from ruby-style variable name to JSON key.
108
+ def self.attribute_map
109
+ {
110
+ :'display_name' => :'displayName'
111
+ }
112
+ end
113
+
114
+ # Attribute type mapping.
115
+ def self.swagger_types
116
+ {
117
+ :'display_name' => :'String'
118
+ }
119
+ end
120
+ end
121
+ end
@@ -0,0 +1,240 @@
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::UpdateVirtualCircuitDetails
7
+
8
+ PROVIDER_STATE_ENUM = [PROVIDER_STATE_ACTIVE = 'ACTIVE',
9
+ PROVIDER_STATE_INACTIVE = 'INACTIVE']
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
+ # To be updated only by the customer who owns the virtual circuit.
16
+ #
17
+ # @return [String]
18
+ attr_accessor :bandwidth_shape_name
19
+
20
+ # An array of mappings, each containing properties for a cross-connect or
21
+ # cross-connect group associated with this virtual circuit.
22
+ #
23
+ # The customer and provider can update different properties in the mapping
24
+ # depending on the situation. See the description of the
25
+ # {CrossConnectMapping}.
26
+ #
27
+ # @return [Array<OracleBMC::Core::Models::CrossConnectMapping>]
28
+ attr_accessor :cross_connect_mappings
29
+
30
+ # The BGP ASN of the network at the other end of the BGP
31
+ # session from Oracle.
32
+ #
33
+ # If the BGP session is from the customer's edge router to Oracle, the
34
+ # required value is the customer's ASN, and it can be updated only
35
+ # by the customer.
36
+ #
37
+ # If the BGP session is from the provider's edge router to Oracle, the
38
+ # required value is the provider's ASN, and it can be updated only
39
+ # by the provider.
40
+ #
41
+ # @return [Integer]
42
+ attr_accessor :customer_bgp_asn
43
+
44
+ # A user-friendly name. Does not have to be unique.
45
+ #
46
+ # To be updated only by the customer who owns the virtual circuit.
47
+ #
48
+ # @return [String]
49
+ attr_accessor :display_name
50
+
51
+ # The OCID of the {Drg}
52
+ # that this virtual circuit uses.
53
+ #
54
+ # To be updated only by the customer who owns the virtual circuit.
55
+ #
56
+ # @return [String]
57
+ attr_accessor :gateway_id
58
+
59
+ # The provider's state in relation to this virtual circuit. Relevant only
60
+ # if the customer is using FastConnect via a provider. ACTIVE
61
+ # means the provider has provisioned the virtual circuit from their
62
+ # end. INACTIVE means the provider has not yet provisioned the virtual
63
+ # circuit, or has de-provisioned it.
64
+ #
65
+ # To be updated only by the provider.
66
+ #
67
+ # @return [String]
68
+ attr_accessor :provider_state
69
+
70
+ # Provider-supplied reference information about this virtual circuit.
71
+ # Relevant only if the customer is using FastConnect via a provider.
72
+ #
73
+ # To be updated only by the provider.
74
+ #
75
+ # @return [String]
76
+ attr_accessor :reference_comment
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[:'crossConnectMappings']
93
+ self.cross_connect_mappings = attributes[:'crossConnectMappings']
94
+ end
95
+
96
+ if attributes[:'customerBgpAsn']
97
+ self.customer_bgp_asn = attributes[:'customerBgpAsn']
98
+ end
99
+
100
+ if attributes[:'displayName']
101
+ self.display_name = attributes[:'displayName']
102
+ end
103
+
104
+ if attributes[:'gatewayId']
105
+ self.gateway_id = attributes[:'gatewayId']
106
+ end
107
+
108
+ if attributes[:'providerState']
109
+ self.provider_state = attributes[:'providerState']
110
+ end
111
+
112
+ if attributes[:'referenceComment']
113
+ self.reference_comment = attributes[:'referenceComment']
114
+ end
115
+
116
+ end
117
+
118
+ # Custom attribute writer method checking allowed values (enum).
119
+ # @param [Object] provider_state Object to be assigned
120
+ def provider_state=(provider_state)
121
+ if provider_state && !PROVIDER_STATE_ENUM.include?(provider_state)
122
+ fail "Invalid value for 'provider_state': this must be one of the values in PROVIDER_STATE_ENUM."
123
+ else
124
+ @provider_state = provider_state
125
+ end
126
+ end
127
+
128
+ # Checks equality by comparing each attribute.
129
+ # @param [Object] other_object to be compared
130
+ def ==(other_object)
131
+ return true if self.equal?(other_object)
132
+ self.class == other_object.class &&
133
+ bandwidth_shape_name == other_object.bandwidth_shape_name &&
134
+ cross_connect_mappings == other_object.cross_connect_mappings &&
135
+ customer_bgp_asn == other_object.customer_bgp_asn &&
136
+ display_name == other_object.display_name &&
137
+ gateway_id == other_object.gateway_id &&
138
+ provider_state == other_object.provider_state &&
139
+ reference_comment == other_object.reference_comment
140
+ end
141
+
142
+ # @see the `==` method
143
+ # @param [Object] other_object to be compared
144
+ def eql?(other_object)
145
+ self == other_object
146
+ end
147
+
148
+ # Calculates hash code according to all attributes.
149
+ # @return [Fixnum] Hash code
150
+ def hash
151
+ [bandwidth_shape_name, cross_connect_mappings, customer_bgp_asn, display_name, gateway_id, provider_state, reference_comment].hash
152
+ end
153
+
154
+ # Builds the object from hash
155
+ # @param [Hash] attributes Model attributes in the form of hash
156
+ # @return [Object] Returns the model itself
157
+ def build_from_hash(attributes)
158
+ return nil unless attributes.is_a?(Hash)
159
+ self.class.swagger_types.each_pair do |key, type|
160
+ if type =~ /^Array<(.*)>/i
161
+ # check to ensure the input is an array given that the the attribute
162
+ # is documented as an array but the input is not
163
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
164
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OracleBMC::Internal::Util.convert_to_type($1, v) } )
165
+ end
166
+ elsif !attributes[self.class.attribute_map[key]].nil?
167
+ self.send("#{key}=", OracleBMC::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
168
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
169
+ end
170
+
171
+ self
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
+ # Returns the object in the form of hash
181
+ # @return [Hash] Returns the object in the form of hash
182
+ def to_hash
183
+ hash = {}
184
+ self.class.attribute_map.each_pair do |attr, param|
185
+ value = self.send(attr)
186
+ next if value.nil?
187
+ hash[param] = _to_hash(value)
188
+ end
189
+ hash
190
+ end
191
+
192
+ private
193
+
194
+ # Outputs non-array value in the form of hash
195
+ # For object, use to_hash. Otherwise, just return the value
196
+ # @param [Object] value Any valid value
197
+ # @return [Hash] Returns the value in the form of hash
198
+ def _to_hash(value)
199
+ if value.is_a?(Array)
200
+ value.compact.map{ |v| _to_hash(v) }
201
+ elsif value.is_a?(Hash)
202
+ {}.tap do |hash|
203
+ value.each { |k, v| hash[k] = _to_hash(v) }
204
+ end
205
+ elsif value.respond_to? :to_hash
206
+ value.to_hash
207
+ else
208
+ value
209
+ end
210
+ end
211
+
212
+
213
+
214
+ # Attribute mapping from ruby-style variable name to JSON key.
215
+ def self.attribute_map
216
+ {
217
+ :'bandwidth_shape_name' => :'bandwidthShapeName',
218
+ :'cross_connect_mappings' => :'crossConnectMappings',
219
+ :'customer_bgp_asn' => :'customerBgpAsn',
220
+ :'display_name' => :'displayName',
221
+ :'gateway_id' => :'gatewayId',
222
+ :'provider_state' => :'providerState',
223
+ :'reference_comment' => :'referenceComment'
224
+ }
225
+ end
226
+
227
+ # Attribute type mapping.
228
+ def self.swagger_types
229
+ {
230
+ :'bandwidth_shape_name' => :'String',
231
+ :'cross_connect_mappings' => :'Array<OracleBMC::Core::Models::CrossConnectMapping>',
232
+ :'customer_bgp_asn' => :'Integer',
233
+ :'display_name' => :'String',
234
+ :'gateway_id' => :'String',
235
+ :'provider_state' => :'String',
236
+ :'reference_comment' => :'String'
237
+ }
238
+ end
239
+ end
240
+ end