oraclebmc 1.1.2 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (129) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE.txt +2 -2
  3. data/README.md +2 -2
  4. data/lib/oraclebmc/api_client.rb +1 -50
  5. data/lib/oraclebmc/core/compute_client.rb +33 -0
  6. data/lib/oraclebmc/core/core.rb +2 -0
  7. data/lib/oraclebmc/core/models/attach_i_scsi_volume_details.rb +2 -43
  8. data/lib/oraclebmc/core/models/attach_volume_details.rb +2 -43
  9. data/lib/oraclebmc/core/models/capture_console_history_details.rb +2 -43
  10. data/lib/oraclebmc/core/models/console_history.rb +2 -43
  11. data/lib/oraclebmc/core/models/cpe.rb +2 -43
  12. data/lib/oraclebmc/core/models/create_cpe_details.rb +2 -43
  13. data/lib/oraclebmc/core/models/create_dhcp_details.rb +2 -43
  14. data/lib/oraclebmc/core/models/create_drg_attachment_details.rb +2 -43
  15. data/lib/oraclebmc/core/models/create_drg_details.rb +2 -43
  16. data/lib/oraclebmc/core/models/create_image_details.rb +2 -43
  17. data/lib/oraclebmc/core/models/create_internet_gateway_details.rb +2 -43
  18. data/lib/oraclebmc/core/models/create_ip_sec_connection_details.rb +2 -43
  19. data/lib/oraclebmc/core/models/create_route_table_details.rb +2 -43
  20. data/lib/oraclebmc/core/models/create_security_list_details.rb +2 -43
  21. data/lib/oraclebmc/core/models/create_subnet_details.rb +28 -44
  22. data/lib/oraclebmc/core/models/create_vcn_details.rb +33 -47
  23. data/lib/oraclebmc/core/models/create_volume_backup_details.rb +2 -43
  24. data/lib/oraclebmc/core/models/create_volume_details.rb +2 -43
  25. data/lib/oraclebmc/core/models/dhcp_dns_option.rb +16 -49
  26. data/lib/oraclebmc/core/models/dhcp_option.rb +7 -43
  27. data/lib/oraclebmc/core/models/dhcp_options.rb +2 -43
  28. data/lib/oraclebmc/core/models/dhcp_search_domain_option.rb +143 -0
  29. data/lib/oraclebmc/core/models/drg.rb +2 -43
  30. data/lib/oraclebmc/core/models/drg_attachment.rb +2 -43
  31. data/lib/oraclebmc/core/models/egress_security_rule.rb +2 -43
  32. data/lib/oraclebmc/core/models/i_scsi_volume_attachment.rb +2 -43
  33. data/lib/oraclebmc/core/models/icmp_options.rb +2 -43
  34. data/lib/oraclebmc/core/models/image.rb +2 -43
  35. data/lib/oraclebmc/core/models/ingress_security_rule.rb +2 -43
  36. data/lib/oraclebmc/core/models/instance.rb +7 -43
  37. data/lib/oraclebmc/core/models/instance_credentials.rb +132 -0
  38. data/lib/oraclebmc/core/models/internet_gateway.rb +2 -43
  39. data/lib/oraclebmc/core/models/ip_sec_connection.rb +2 -43
  40. data/lib/oraclebmc/core/models/ip_sec_connection_device_config.rb +2 -43
  41. data/lib/oraclebmc/core/models/ip_sec_connection_device_status.rb +2 -43
  42. data/lib/oraclebmc/core/models/launch_instance_details.rb +32 -44
  43. data/lib/oraclebmc/core/models/port_range.rb +2 -43
  44. data/lib/oraclebmc/core/models/route_rule.rb +2 -43
  45. data/lib/oraclebmc/core/models/route_table.rb +2 -43
  46. data/lib/oraclebmc/core/models/security_list.rb +2 -43
  47. data/lib/oraclebmc/core/models/shape.rb +2 -43
  48. data/lib/oraclebmc/core/models/subnet.rb +45 -44
  49. data/lib/oraclebmc/core/models/tcp_options.rb +2 -43
  50. data/lib/oraclebmc/core/models/tunnel_config.rb +2 -43
  51. data/lib/oraclebmc/core/models/tunnel_status.rb +2 -43
  52. data/lib/oraclebmc/core/models/udp_options.rb +2 -43
  53. data/lib/oraclebmc/core/models/update_cpe_details.rb +2 -43
  54. data/lib/oraclebmc/core/models/update_dhcp_details.rb +2 -43
  55. data/lib/oraclebmc/core/models/update_drg_attachment_details.rb +2 -43
  56. data/lib/oraclebmc/core/models/update_drg_details.rb +2 -43
  57. data/lib/oraclebmc/core/models/update_image_details.rb +2 -43
  58. data/lib/oraclebmc/core/models/update_instance_details.rb +2 -43
  59. data/lib/oraclebmc/core/models/update_internet_gateway_details.rb +2 -43
  60. data/lib/oraclebmc/core/models/update_ip_sec_connection_details.rb +2 -43
  61. data/lib/oraclebmc/core/models/update_route_table_details.rb +2 -43
  62. data/lib/oraclebmc/core/models/update_security_list_details.rb +2 -43
  63. data/lib/oraclebmc/core/models/update_subnet_details.rb +2 -43
  64. data/lib/oraclebmc/core/models/update_vcn_details.rb +2 -43
  65. data/lib/oraclebmc/core/models/update_volume_backup_details.rb +2 -43
  66. data/lib/oraclebmc/core/models/update_volume_details.rb +2 -43
  67. data/lib/oraclebmc/core/models/vcn.rb +48 -47
  68. data/lib/oraclebmc/core/models/vnic.rb +30 -47
  69. data/lib/oraclebmc/core/models/vnic_attachment.rb +2 -43
  70. data/lib/oraclebmc/core/models/volume.rb +2 -43
  71. data/lib/oraclebmc/core/models/volume_attachment.rb +2 -43
  72. data/lib/oraclebmc/core/models/volume_backup.rb +2 -43
  73. data/lib/oraclebmc/core/virtual_network_client.rb +10 -4
  74. data/lib/oraclebmc/identity/models/add_user_to_group_details.rb +2 -43
  75. data/lib/oraclebmc/identity/models/api_key.rb +2 -43
  76. data/lib/oraclebmc/identity/models/availability_domain.rb +2 -43
  77. data/lib/oraclebmc/identity/models/compartment.rb +2 -43
  78. data/lib/oraclebmc/identity/models/create_api_key_details.rb +2 -43
  79. data/lib/oraclebmc/identity/models/create_compartment_details.rb +2 -43
  80. data/lib/oraclebmc/identity/models/create_group_details.rb +2 -43
  81. data/lib/oraclebmc/identity/models/create_policy_details.rb +2 -43
  82. data/lib/oraclebmc/identity/models/create_swift_password_details.rb +2 -43
  83. data/lib/oraclebmc/identity/models/create_user_details.rb +2 -43
  84. data/lib/oraclebmc/identity/models/group.rb +2 -43
  85. data/lib/oraclebmc/identity/models/policy.rb +2 -43
  86. data/lib/oraclebmc/identity/models/swift_password.rb +2 -43
  87. data/lib/oraclebmc/identity/models/ui_password.rb +2 -43
  88. data/lib/oraclebmc/identity/models/update_compartment_details.rb +2 -43
  89. data/lib/oraclebmc/identity/models/update_group_details.rb +2 -43
  90. data/lib/oraclebmc/identity/models/update_policy_details.rb +2 -43
  91. data/lib/oraclebmc/identity/models/update_state_details.rb +2 -43
  92. data/lib/oraclebmc/identity/models/update_swift_password_details.rb +2 -43
  93. data/lib/oraclebmc/identity/models/update_user_details.rb +2 -43
  94. data/lib/oraclebmc/identity/models/user.rb +2 -43
  95. data/lib/oraclebmc/identity/models/user_group_membership.rb +2 -43
  96. data/lib/oraclebmc/internal/internal.rb +11 -0
  97. data/lib/oraclebmc/internal/util.rb +69 -0
  98. data/lib/oraclebmc/load_balancer/models/backend.rb +2 -43
  99. data/lib/oraclebmc/load_balancer/models/backend_details.rb +2 -43
  100. data/lib/oraclebmc/load_balancer/models/backend_set.rb +2 -43
  101. data/lib/oraclebmc/load_balancer/models/backend_set_details.rb +2 -43
  102. data/lib/oraclebmc/load_balancer/models/certificate.rb +2 -43
  103. data/lib/oraclebmc/load_balancer/models/certificate_details.rb +2 -43
  104. data/lib/oraclebmc/load_balancer/models/create_backend_details.rb +2 -43
  105. data/lib/oraclebmc/load_balancer/models/create_backend_set_details.rb +2 -43
  106. data/lib/oraclebmc/load_balancer/models/create_certificate_details.rb +2 -43
  107. data/lib/oraclebmc/load_balancer/models/create_listener_details.rb +2 -43
  108. data/lib/oraclebmc/load_balancer/models/create_load_balancer_details.rb +2 -43
  109. data/lib/oraclebmc/load_balancer/models/health_checker.rb +2 -43
  110. data/lib/oraclebmc/load_balancer/models/health_checker_details.rb +2 -43
  111. data/lib/oraclebmc/load_balancer/models/ip_address.rb +2 -43
  112. data/lib/oraclebmc/load_balancer/models/listener.rb +2 -43
  113. data/lib/oraclebmc/load_balancer/models/listener_details.rb +2 -43
  114. data/lib/oraclebmc/load_balancer/models/load_balancer.rb +2 -43
  115. data/lib/oraclebmc/load_balancer/models/load_balancer_policy.rb +2 -43
  116. data/lib/oraclebmc/load_balancer/models/load_balancer_protocol.rb +2 -43
  117. data/lib/oraclebmc/load_balancer/models/load_balancer_shape.rb +2 -43
  118. data/lib/oraclebmc/load_balancer/models/ssl_configuration.rb +2 -43
  119. data/lib/oraclebmc/load_balancer/models/ssl_configuration_details.rb +2 -43
  120. data/lib/oraclebmc/load_balancer/models/update_backend_details.rb +2 -43
  121. data/lib/oraclebmc/load_balancer/models/update_backend_set_details.rb +2 -43
  122. data/lib/oraclebmc/load_balancer/models/update_health_checker_details.rb +2 -43
  123. data/lib/oraclebmc/load_balancer/models/update_listener_details.rb +2 -43
  124. data/lib/oraclebmc/load_balancer/models/update_load_balancer_details.rb +2 -43
  125. data/lib/oraclebmc/load_balancer/models/work_request.rb +2 -43
  126. data/lib/oraclebmc/load_balancer/models/work_request_error.rb +2 -43
  127. data/lib/oraclebmc/version.rb +1 -1
  128. data/lib/oraclebmc.rb +1 -0
  129. metadata +6 -2
@@ -63,10 +63,10 @@ module OracleBMC
63
63
  # check to ensure the input is an array given that the the attribute
64
64
  # is documented as an array but the input is not
65
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) } )
66
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OracleBMC::Internal::Util.convert_to_type($1, v) } )
67
67
  end
68
68
  elsif !attributes[self.class.attribute_map[key]].nil?
69
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
69
+ self.send("#{key}=", OracleBMC::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
70
70
  end # or else data not found in attributes(hash), not an issue as the data can be optional
71
71
  end
72
72
 
@@ -111,47 +111,6 @@ module OracleBMC
111
111
  end
112
112
  end
113
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
114
 
156
115
 
157
116
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -76,10 +76,10 @@ module OracleBMC
76
76
  # check to ensure the input is an array given that the the attribute
77
77
  # is documented as an array but the input is not
78
78
  if attributes[self.class.attribute_map[key]].is_a?(Array)
79
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
79
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OracleBMC::Internal::Util.convert_to_type($1, v) } )
80
80
  end
81
81
  elsif !attributes[self.class.attribute_map[key]].nil?
82
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
82
+ self.send("#{key}=", OracleBMC::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
83
83
  end # or else data not found in attributes(hash), not an issue as the data can be optional
84
84
  end
85
85
 
@@ -124,47 +124,6 @@ module OracleBMC
124
124
  end
125
125
  end
126
126
 
127
- # Deserializes the data based on type
128
- # @param [String] type Data type
129
- # @param [String] value Value to be deserialized
130
- # @return [Object] Deserialized data
131
- def _deserialize(type, value)
132
- case type.to_sym
133
- when :DateTime
134
- DateTime.parse(value)
135
- when :Date
136
- Date.parse(value)
137
- when :String
138
- value.to_s
139
- when :Integer
140
- value.to_i
141
- when :Float
142
- value.to_f
143
- when :BOOLEAN
144
- if value.to_s =~ /^(true|t|yes|y|1)$/i
145
- true
146
- else
147
- false
148
- end
149
- when :Object
150
- # generic object (usually a Hash), return directly
151
- value
152
- when /\AArray<(?<inner_type>.+)>\z/
153
- inner_type = Regexp.last_match[:inner_type]
154
- value.map { |v| _deserialize(inner_type, v) }
155
- when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
156
- k_type = Regexp.last_match[:k_type]
157
- v_type = Regexp.last_match[:v_type]
158
- {}.tap do |hash|
159
- value.each do |k, v|
160
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
161
- end
162
- end
163
- else # model
164
- temp_model = OracleBMC.const_get(type.to_s).new
165
- temp_model.build_from_hash(value)
166
- end
167
- end
168
127
 
169
128
 
170
129
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -81,10 +81,10 @@ module OracleBMC
81
81
  # check to ensure the input is an array given that the the attribute
82
82
  # is documented as an array but the input is not
83
83
  if attributes[self.class.attribute_map[key]].is_a?(Array)
84
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
84
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OracleBMC::Internal::Util.convert_to_type($1, v) } )
85
85
  end
86
86
  elsif !attributes[self.class.attribute_map[key]].nil?
87
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
87
+ self.send("#{key}=", OracleBMC::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
88
88
  end # or else data not found in attributes(hash), not an issue as the data can be optional
89
89
  end
90
90
 
@@ -129,47 +129,6 @@ module OracleBMC
129
129
  end
130
130
  end
131
131
 
132
- # Deserializes the data based on type
133
- # @param [String] type Data type
134
- # @param [String] value Value to be deserialized
135
- # @return [Object] Deserialized data
136
- def _deserialize(type, value)
137
- case type.to_sym
138
- when :DateTime
139
- DateTime.parse(value)
140
- when :Date
141
- Date.parse(value)
142
- when :String
143
- value.to_s
144
- when :Integer
145
- value.to_i
146
- when :Float
147
- value.to_f
148
- when :BOOLEAN
149
- if value.to_s =~ /^(true|t|yes|y|1)$/i
150
- true
151
- else
152
- false
153
- end
154
- when :Object
155
- # generic object (usually a Hash), return directly
156
- value
157
- when /\AArray<(?<inner_type>.+)>\z/
158
- inner_type = Regexp.last_match[:inner_type]
159
- value.map { |v| _deserialize(inner_type, v) }
160
- when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
161
- k_type = Regexp.last_match[:k_type]
162
- v_type = Regexp.last_match[:v_type]
163
- {}.tap do |hash|
164
- value.each do |k, v|
165
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
166
- end
167
- end
168
- else # model
169
- temp_model = OracleBMC.const_get(type.to_s).new
170
- temp_model.build_from_hash(value)
171
- end
172
- end
173
132
 
174
133
 
175
134
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -94,10 +94,10 @@ module OracleBMC
94
94
  # check to ensure the input is an array given that the the attribute
95
95
  # is documented as an array but the input is not
96
96
  if attributes[self.class.attribute_map[key]].is_a?(Array)
97
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
97
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OracleBMC::Internal::Util.convert_to_type($1, v) } )
98
98
  end
99
99
  elsif !attributes[self.class.attribute_map[key]].nil?
100
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
100
+ self.send("#{key}=", OracleBMC::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
101
101
  end # or else data not found in attributes(hash), not an issue as the data can be optional
102
102
  end
103
103
 
@@ -142,47 +142,6 @@ module OracleBMC
142
142
  end
143
143
  end
144
144
 
145
- # Deserializes the data based on type
146
- # @param [String] type Data type
147
- # @param [String] value Value to be deserialized
148
- # @return [Object] Deserialized data
149
- def _deserialize(type, value)
150
- case type.to_sym
151
- when :DateTime
152
- DateTime.parse(value)
153
- when :Date
154
- Date.parse(value)
155
- when :String
156
- value.to_s
157
- when :Integer
158
- value.to_i
159
- when :Float
160
- value.to_f
161
- when :BOOLEAN
162
- if value.to_s =~ /^(true|t|yes|y|1)$/i
163
- true
164
- else
165
- false
166
- end
167
- when :Object
168
- # generic object (usually a Hash), return directly
169
- value
170
- when /\AArray<(?<inner_type>.+)>\z/
171
- inner_type = Regexp.last_match[:inner_type]
172
- value.map { |v| _deserialize(inner_type, v) }
173
- when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
174
- k_type = Regexp.last_match[:k_type]
175
- v_type = Regexp.last_match[:v_type]
176
- {}.tap do |hash|
177
- value.each do |k, v|
178
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
179
- end
180
- end
181
- else # model
182
- temp_model = OracleBMC.const_get(type.to_s).new
183
- temp_model.build_from_hash(value)
184
- end
185
- end
186
145
 
187
146
 
188
147
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -81,10 +81,10 @@ module OracleBMC
81
81
  # check to ensure the input is an array given that the the attribute
82
82
  # is documented as an array but the input is not
83
83
  if attributes[self.class.attribute_map[key]].is_a?(Array)
84
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
84
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OracleBMC::Internal::Util.convert_to_type($1, v) } )
85
85
  end
86
86
  elsif !attributes[self.class.attribute_map[key]].nil?
87
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
87
+ self.send("#{key}=", OracleBMC::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
88
88
  end # or else data not found in attributes(hash), not an issue as the data can be optional
89
89
  end
90
90
 
@@ -129,47 +129,6 @@ module OracleBMC
129
129
  end
130
130
  end
131
131
 
132
- # Deserializes the data based on type
133
- # @param [String] type Data type
134
- # @param [String] value Value to be deserialized
135
- # @return [Object] Deserialized data
136
- def _deserialize(type, value)
137
- case type.to_sym
138
- when :DateTime
139
- DateTime.parse(value)
140
- when :Date
141
- Date.parse(value)
142
- when :String
143
- value.to_s
144
- when :Integer
145
- value.to_i
146
- when :Float
147
- value.to_f
148
- when :BOOLEAN
149
- if value.to_s =~ /^(true|t|yes|y|1)$/i
150
- true
151
- else
152
- false
153
- end
154
- when :Object
155
- # generic object (usually a Hash), return directly
156
- value
157
- when /\AArray<(?<inner_type>.+)>\z/
158
- inner_type = Regexp.last_match[:inner_type]
159
- value.map { |v| _deserialize(inner_type, v) }
160
- when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
161
- k_type = Regexp.last_match[:k_type]
162
- v_type = Regexp.last_match[:v_type]
163
- {}.tap do |hash|
164
- value.each do |k, v|
165
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
166
- end
167
- end
168
- else # model
169
- temp_model = OracleBMC.const_get(type.to_s).new
170
- temp_model.build_from_hash(value)
171
- end
172
- end
173
132
 
174
133
 
175
134
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -90,10 +90,10 @@ module OracleBMC
90
90
  # check to ensure the input is an array given that the the attribute
91
91
  # is documented as an array but the input is not
92
92
  if attributes[self.class.attribute_map[key]].is_a?(Array)
93
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
93
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OracleBMC::Internal::Util.convert_to_type($1, v) } )
94
94
  end
95
95
  elsif !attributes[self.class.attribute_map[key]].nil?
96
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
96
+ self.send("#{key}=", OracleBMC::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
97
97
  end # or else data not found in attributes(hash), not an issue as the data can be optional
98
98
  end
99
99
 
@@ -138,47 +138,6 @@ module OracleBMC
138
138
  end
139
139
  end
140
140
 
141
- # Deserializes the data based on type
142
- # @param [String] type Data type
143
- # @param [String] value Value to be deserialized
144
- # @return [Object] Deserialized data
145
- def _deserialize(type, value)
146
- case type.to_sym
147
- when :DateTime
148
- DateTime.parse(value)
149
- when :Date
150
- Date.parse(value)
151
- when :String
152
- value.to_s
153
- when :Integer
154
- value.to_i
155
- when :Float
156
- value.to_f
157
- when :BOOLEAN
158
- if value.to_s =~ /^(true|t|yes|y|1)$/i
159
- true
160
- else
161
- false
162
- end
163
- when :Object
164
- # generic object (usually a Hash), return directly
165
- value
166
- when /\AArray<(?<inner_type>.+)>\z/
167
- inner_type = Regexp.last_match[:inner_type]
168
- value.map { |v| _deserialize(inner_type, v) }
169
- when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
170
- k_type = Regexp.last_match[:k_type]
171
- v_type = Regexp.last_match[:v_type]
172
- {}.tap do |hash|
173
- value.each do |k, v|
174
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
175
- end
176
- end
177
- else # model
178
- temp_model = OracleBMC.const_get(type.to_s).new
179
- temp_model.build_from_hash(value)
180
- end
181
- end
182
141
 
183
142
 
184
143
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -32,6 +32,24 @@ module OracleBMC
32
32
  # @return [String]
33
33
  attr_accessor :display_name
34
34
 
35
+ # A DNS label for the subnet, used in conjunction with the VNIC's hostname and
36
+ # VCN's DNS label to form a fully qualified domain name (FQDN) for each VNIC
37
+ # within this subnet (e.g., `bminstance-1.subnet123.vcn1.oraclevcn.com`).
38
+ # Must be an alphanumeric string that begins with a letter and is unique within the VCN.
39
+ # The value cannot be changed.
40
+ #
41
+ # This value must be set if you want to use the Internet and VCN Resolver to resolve the
42
+ # hostnames of instances in the subnet. It can only be set if the VCN itself
43
+ # was created with a DNS label.
44
+ #
45
+ # For more information, see
46
+ # [DNS in Your Virtual Cloud Network](https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/dns.htm).
47
+ #
48
+ # Example: `subnet123`
49
+ #
50
+ # @return [String]
51
+ attr_accessor :dns_label
52
+
35
53
  # The OCID of the route table the subnet will use. If you don't provide a value,
36
54
  # the subnet will use the VCN's default route table.
37
55
  #
@@ -80,6 +98,10 @@ module OracleBMC
80
98
  self.display_name = attributes[:'displayName']
81
99
  end
82
100
 
101
+ if attributes[:'dnsLabel']
102
+ self.dns_label = attributes[:'dnsLabel']
103
+ end
104
+
83
105
  if attributes[:'routeTableId']
84
106
  self.route_table_id = attributes[:'routeTableId']
85
107
  end
@@ -104,6 +126,7 @@ module OracleBMC
104
126
  compartment_id == other_object.compartment_id &&
105
127
  dhcp_options_id == other_object.dhcp_options_id &&
106
128
  display_name == other_object.display_name &&
129
+ dns_label == other_object.dns_label &&
107
130
  route_table_id == other_object.route_table_id &&
108
131
  security_list_ids == other_object.security_list_ids &&
109
132
  vcn_id == other_object.vcn_id
@@ -118,7 +141,7 @@ module OracleBMC
118
141
  # Calculates hash code according to all attributes.
119
142
  # @return [Fixnum] Hash code
120
143
  def hash
121
- [availability_domain, cidr_block, compartment_id, dhcp_options_id, display_name, route_table_id, security_list_ids, vcn_id].hash
144
+ [availability_domain, cidr_block, compartment_id, dhcp_options_id, display_name, dns_label, route_table_id, security_list_ids, vcn_id].hash
122
145
  end
123
146
 
124
147
  # Builds the object from hash
@@ -131,10 +154,10 @@ module OracleBMC
131
154
  # check to ensure the input is an array given that the the attribute
132
155
  # is documented as an array but the input is not
133
156
  if attributes[self.class.attribute_map[key]].is_a?(Array)
134
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
157
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OracleBMC::Internal::Util.convert_to_type($1, v) } )
135
158
  end
136
159
  elsif !attributes[self.class.attribute_map[key]].nil?
137
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
160
+ self.send("#{key}=", OracleBMC::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
138
161
  end # or else data not found in attributes(hash), not an issue as the data can be optional
139
162
  end
140
163
 
@@ -179,47 +202,6 @@ module OracleBMC
179
202
  end
180
203
  end
181
204
 
182
- # Deserializes the data based on type
183
- # @param [String] type Data type
184
- # @param [String] value Value to be deserialized
185
- # @return [Object] Deserialized data
186
- def _deserialize(type, value)
187
- case type.to_sym
188
- when :DateTime
189
- DateTime.parse(value)
190
- when :Date
191
- Date.parse(value)
192
- when :String
193
- value.to_s
194
- when :Integer
195
- value.to_i
196
- when :Float
197
- value.to_f
198
- when :BOOLEAN
199
- if value.to_s =~ /^(true|t|yes|y|1)$/i
200
- true
201
- else
202
- false
203
- end
204
- when :Object
205
- # generic object (usually a Hash), return directly
206
- value
207
- when /\AArray<(?<inner_type>.+)>\z/
208
- inner_type = Regexp.last_match[:inner_type]
209
- value.map { |v| _deserialize(inner_type, v) }
210
- when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
211
- k_type = Regexp.last_match[:k_type]
212
- v_type = Regexp.last_match[:v_type]
213
- {}.tap do |hash|
214
- value.each do |k, v|
215
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
216
- end
217
- end
218
- else # model
219
- temp_model = OracleBMC.const_get(type.to_s).new
220
- temp_model.build_from_hash(value)
221
- end
222
- end
223
205
 
224
206
 
225
207
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -230,6 +212,7 @@ module OracleBMC
230
212
  :'compartment_id' => :'compartmentId',
231
213
  :'dhcp_options_id' => :'dhcpOptionsId',
232
214
  :'display_name' => :'displayName',
215
+ :'dns_label' => :'dnsLabel',
233
216
  :'route_table_id' => :'routeTableId',
234
217
  :'security_list_ids' => :'securityListIds',
235
218
  :'vcn_id' => :'vcnId'
@@ -244,6 +227,7 @@ module OracleBMC
244
227
  :'compartment_id' => :'String',
245
228
  :'dhcp_options_id' => :'String',
246
229
  :'display_name' => :'String',
230
+ :'dns_label' => :'String',
247
231
  :'route_table_id' => :'String',
248
232
  :'security_list_ids' => :'Array<String>',
249
233
  :'vcn_id' => :'String'
@@ -19,6 +19,26 @@ module OracleBMC
19
19
  # @return [String]
20
20
  attr_accessor :display_name
21
21
 
22
+ # A DNS label for the VCN, used in conjunction with the VNIC's hostname and
23
+ # subnet's DNS label to form a fully qualified domain name (FQDN) for each VNIC
24
+ # within this subnet (e.g., `bminstance-1.subnet123.vcn1.oraclevcn.com`).
25
+ # Not required to be unique, but it's a best practice to set unique DNS labels
26
+ # for VCNs in your tenancy.
27
+ # Must be an alphanumeric string that begins with a letter.
28
+ # The value cannot be changed.
29
+ #
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
32
+ # will not work.
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
+ # Example: `vcn1`
38
+ #
39
+ # @return [String]
40
+ attr_accessor :dns_label
41
+
22
42
 
23
43
  # Initializes the object
24
44
  # @param [Hash] attributes Model attributes in the form of hash
@@ -41,6 +61,10 @@ module OracleBMC
41
61
  self.display_name = attributes[:'displayName']
42
62
  end
43
63
 
64
+ if attributes[:'dnsLabel']
65
+ self.dns_label = attributes[:'dnsLabel']
66
+ end
67
+
44
68
  end
45
69
 
46
70
  # Checks equality by comparing each attribute.
@@ -50,7 +74,8 @@ module OracleBMC
50
74
  self.class == other_object.class &&
51
75
  cidr_block == other_object.cidr_block &&
52
76
  compartment_id == other_object.compartment_id &&
53
- display_name == other_object.display_name
77
+ display_name == other_object.display_name &&
78
+ dns_label == other_object.dns_label
54
79
  end
55
80
 
56
81
  # @see the `==` method
@@ -62,7 +87,7 @@ module OracleBMC
62
87
  # Calculates hash code according to all attributes.
63
88
  # @return [Fixnum] Hash code
64
89
  def hash
65
- [cidr_block, compartment_id, display_name].hash
90
+ [cidr_block, compartment_id, display_name, dns_label].hash
66
91
  end
67
92
 
68
93
  # Builds the object from hash
@@ -75,10 +100,10 @@ module OracleBMC
75
100
  # check to ensure the input is an array given that the the attribute
76
101
  # is documented as an array but the input is not
77
102
  if attributes[self.class.attribute_map[key]].is_a?(Array)
78
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
103
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OracleBMC::Internal::Util.convert_to_type($1, v) } )
79
104
  end
80
105
  elsif !attributes[self.class.attribute_map[key]].nil?
81
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
106
+ self.send("#{key}=", OracleBMC::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
82
107
  end # or else data not found in attributes(hash), not an issue as the data can be optional
83
108
  end
84
109
 
@@ -123,47 +148,6 @@ module OracleBMC
123
148
  end
124
149
  end
125
150
 
126
- # Deserializes the data based on type
127
- # @param [String] type Data type
128
- # @param [String] value Value to be deserialized
129
- # @return [Object] Deserialized data
130
- def _deserialize(type, value)
131
- case type.to_sym
132
- when :DateTime
133
- DateTime.parse(value)
134
- when :Date
135
- Date.parse(value)
136
- when :String
137
- value.to_s
138
- when :Integer
139
- value.to_i
140
- when :Float
141
- value.to_f
142
- when :BOOLEAN
143
- if value.to_s =~ /^(true|t|yes|y|1)$/i
144
- true
145
- else
146
- false
147
- end
148
- when :Object
149
- # generic object (usually a Hash), return directly
150
- value
151
- when /\AArray<(?<inner_type>.+)>\z/
152
- inner_type = Regexp.last_match[:inner_type]
153
- value.map { |v| _deserialize(inner_type, v) }
154
- when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
155
- k_type = Regexp.last_match[:k_type]
156
- v_type = Regexp.last_match[:v_type]
157
- {}.tap do |hash|
158
- value.each do |k, v|
159
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
160
- end
161
- end
162
- else # model
163
- temp_model = OracleBMC.const_get(type.to_s).new
164
- temp_model.build_from_hash(value)
165
- end
166
- end
167
151
 
168
152
 
169
153
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -171,7 +155,8 @@ module OracleBMC
171
155
  {
172
156
  :'cidr_block' => :'cidrBlock',
173
157
  :'compartment_id' => :'compartmentId',
174
- :'display_name' => :'displayName'
158
+ :'display_name' => :'displayName',
159
+ :'dns_label' => :'dnsLabel'
175
160
  }
176
161
  end
177
162
 
@@ -180,7 +165,8 @@ module OracleBMC
180
165
  {
181
166
  :'cidr_block' => :'String',
182
167
  :'compartment_id' => :'String',
183
- :'display_name' => :'String'
168
+ :'display_name' => :'String',
169
+ :'dns_label' => :'String'
184
170
  }
185
171
  end
186
172
  end
@@ -63,10 +63,10 @@ module OracleBMC
63
63
  # check to ensure the input is an array given that the the attribute
64
64
  # is documented as an array but the input is not
65
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) } )
66
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OracleBMC::Internal::Util.convert_to_type($1, v) } )
67
67
  end
68
68
  elsif !attributes[self.class.attribute_map[key]].nil?
69
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
69
+ self.send("#{key}=", OracleBMC::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
70
70
  end # or else data not found in attributes(hash), not an issue as the data can be optional
71
71
  end
72
72
 
@@ -111,47 +111,6 @@ module OracleBMC
111
111
  end
112
112
  end
113
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
114
 
156
115
 
157
116
  # Attribute mapping from ruby-style variable name to JSON key.