oraclebmc 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (141) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +82 -0
  3. data/README.md +220 -0
  4. data/lib/oraclebmc/api_client.rb +349 -0
  5. data/lib/oraclebmc/config.rb +80 -0
  6. data/lib/oraclebmc/config_file_loader.rb +85 -0
  7. data/lib/oraclebmc/core/blockstorage_client.rb +459 -0
  8. data/lib/oraclebmc/core/compute_client.rb +1053 -0
  9. data/lib/oraclebmc/core/core.rb +82 -0
  10. data/lib/oraclebmc/core/models/attach_i_scsi_volume_details.rb +179 -0
  11. data/lib/oraclebmc/core/models/attach_volume_details.rb +206 -0
  12. data/lib/oraclebmc/core/models/capture_console_history_details.rb +162 -0
  13. data/lib/oraclebmc/core/models/console_history.rb +252 -0
  14. data/lib/oraclebmc/core/models/cpe.rb +209 -0
  15. data/lib/oraclebmc/core/models/create_cpe_details.rb +187 -0
  16. data/lib/oraclebmc/core/models/create_dhcp_details.rb +195 -0
  17. data/lib/oraclebmc/core/models/create_drg_attachment_details.rb +184 -0
  18. data/lib/oraclebmc/core/models/create_drg_details.rb +173 -0
  19. data/lib/oraclebmc/core/models/create_image_details.rb +188 -0
  20. data/lib/oraclebmc/core/models/create_internet_gateway_details.rb +195 -0
  21. data/lib/oraclebmc/core/models/create_ip_sec_connection_details.rb +210 -0
  22. data/lib/oraclebmc/core/models/create_route_table_details.rb +195 -0
  23. data/lib/oraclebmc/core/models/create_security_list_details.rb +206 -0
  24. data/lib/oraclebmc/core/models/create_subnet_details.rb +253 -0
  25. data/lib/oraclebmc/core/models/create_vcn_details.rb +187 -0
  26. data/lib/oraclebmc/core/models/create_volume_backup_details.rb +173 -0
  27. data/lib/oraclebmc/core/models/create_volume_details.rb +211 -0
  28. data/lib/oraclebmc/core/models/dhcp_dns_option.rb +203 -0
  29. data/lib/oraclebmc/core/models/dhcp_option.rb +171 -0
  30. data/lib/oraclebmc/core/models/dhcp_options.rb +246 -0
  31. data/lib/oraclebmc/core/models/drg.rb +224 -0
  32. data/lib/oraclebmc/core/models/drg_attachment.rb +246 -0
  33. data/lib/oraclebmc/core/models/egress_security_rule.rb +240 -0
  34. data/lib/oraclebmc/core/models/i_scsi_volume_attachment.rb +254 -0
  35. data/lib/oraclebmc/core/models/icmp_options.rb +173 -0
  36. data/lib/oraclebmc/core/models/image.rb +282 -0
  37. data/lib/oraclebmc/core/models/ingress_security_rule.rb +240 -0
  38. data/lib/oraclebmc/core/models/instance.rb +326 -0
  39. data/lib/oraclebmc/core/models/internet_gateway.rb +248 -0
  40. data/lib/oraclebmc/core/models/ip_sec_connection.rb +261 -0
  41. data/lib/oraclebmc/core/models/ip_sec_connection_device_config.rb +195 -0
  42. data/lib/oraclebmc/core/models/ip_sec_connection_device_status.rb +198 -0
  43. data/lib/oraclebmc/core/models/launch_instance_details.rb +327 -0
  44. data/lib/oraclebmc/core/models/port_range.rb +175 -0
  45. data/lib/oraclebmc/core/models/route_rule.rb +177 -0
  46. data/lib/oraclebmc/core/models/route_table.rb +246 -0
  47. data/lib/oraclebmc/core/models/security_list.rb +257 -0
  48. data/lib/oraclebmc/core/models/shape.rb +164 -0
  49. data/lib/oraclebmc/core/models/subnet.rb +325 -0
  50. data/lib/oraclebmc/core/models/tcp_options.rb +177 -0
  51. data/lib/oraclebmc/core/models/tunnel_config.rb +193 -0
  52. data/lib/oraclebmc/core/models/tunnel_status.rb +218 -0
  53. data/lib/oraclebmc/core/models/udp_options.rb +177 -0
  54. data/lib/oraclebmc/core/models/update_cpe_details.rb +162 -0
  55. data/lib/oraclebmc/core/models/update_dhcp_details.rb +172 -0
  56. data/lib/oraclebmc/core/models/update_drg_attachment_details.rb +162 -0
  57. data/lib/oraclebmc/core/models/update_drg_details.rb +162 -0
  58. data/lib/oraclebmc/core/models/update_image_details.rb +165 -0
  59. data/lib/oraclebmc/core/models/update_instance_details.rb +165 -0
  60. data/lib/oraclebmc/core/models/update_internet_gateway_details.rb +173 -0
  61. data/lib/oraclebmc/core/models/update_ip_sec_connection_details.rb +162 -0
  62. data/lib/oraclebmc/core/models/update_route_table_details.rb +173 -0
  63. data/lib/oraclebmc/core/models/update_security_list_details.rb +184 -0
  64. data/lib/oraclebmc/core/models/update_subnet_details.rb +162 -0
  65. data/lib/oraclebmc/core/models/update_vcn_details.rb +162 -0
  66. data/lib/oraclebmc/core/models/update_volume_backup_details.rb +162 -0
  67. data/lib/oraclebmc/core/models/update_volume_details.rb +163 -0
  68. data/lib/oraclebmc/core/models/vcn.rb +272 -0
  69. data/lib/oraclebmc/core/models/vnic.rb +274 -0
  70. data/lib/oraclebmc/core/models/vnic_attachment.rb +271 -0
  71. data/lib/oraclebmc/core/models/volume.rb +249 -0
  72. data/lib/oraclebmc/core/models/volume_attachment.rb +284 -0
  73. data/lib/oraclebmc/core/models/volume_backup.rb +273 -0
  74. data/lib/oraclebmc/core/util.rb +1 -0
  75. data/lib/oraclebmc/core/virtual_network_client.rb +2263 -0
  76. data/lib/oraclebmc/errors.rb +62 -0
  77. data/lib/oraclebmc/global_context.rb +21 -0
  78. data/lib/oraclebmc/identity/identity.rb +38 -0
  79. data/lib/oraclebmc/identity/identity_client.rb +1462 -0
  80. data/lib/oraclebmc/identity/models/add_user_to_group_details.rb +173 -0
  81. data/lib/oraclebmc/identity/models/api_key.rb +251 -0
  82. data/lib/oraclebmc/identity/models/availability_domain.rb +173 -0
  83. data/lib/oraclebmc/identity/models/compartment.rb +251 -0
  84. data/lib/oraclebmc/identity/models/create_api_key_details.rb +162 -0
  85. data/lib/oraclebmc/identity/models/create_compartment_details.rb +187 -0
  86. data/lib/oraclebmc/identity/models/create_group_details.rb +186 -0
  87. data/lib/oraclebmc/identity/models/create_policy_details.rb +215 -0
  88. data/lib/oraclebmc/identity/models/create_swift_password_details.rb +163 -0
  89. data/lib/oraclebmc/identity/models/create_user_details.rb +186 -0
  90. data/lib/oraclebmc/identity/models/group.rb +251 -0
  91. data/lib/oraclebmc/identity/models/policy.rb +277 -0
  92. data/lib/oraclebmc/identity/models/swift_password.rb +266 -0
  93. data/lib/oraclebmc/identity/models/ui_password.rb +227 -0
  94. data/lib/oraclebmc/identity/models/update_compartment_details.rb +162 -0
  95. data/lib/oraclebmc/identity/models/update_group_details.rb +162 -0
  96. data/lib/oraclebmc/identity/models/update_policy_details.rb +190 -0
  97. data/lib/oraclebmc/identity/models/update_state_details.rb +163 -0
  98. data/lib/oraclebmc/identity/models/update_swift_password_details.rb +162 -0
  99. data/lib/oraclebmc/identity/models/update_user_details.rb +162 -0
  100. data/lib/oraclebmc/identity/models/user.rb +257 -0
  101. data/lib/oraclebmc/identity/models/user_group_membership.rb +249 -0
  102. data/lib/oraclebmc/identity/util.rb +1 -0
  103. data/lib/oraclebmc/load_balancer/load_balancer.rb +45 -0
  104. data/lib/oraclebmc/load_balancer/load_balancer_client.rb +1218 -0
  105. data/lib/oraclebmc/load_balancer/models/backend.rb +262 -0
  106. data/lib/oraclebmc/load_balancer/models/backend_details.rb +248 -0
  107. data/lib/oraclebmc/load_balancer/models/backend_set.rb +211 -0
  108. data/lib/oraclebmc/load_balancer/models/backend_set_details.rb +197 -0
  109. data/lib/oraclebmc/load_balancer/models/certificate.rb +209 -0
  110. data/lib/oraclebmc/load_balancer/models/certificate_details.rb +245 -0
  111. data/lib/oraclebmc/load_balancer/models/create_backend_details.rb +248 -0
  112. data/lib/oraclebmc/load_balancer/models/create_backend_set_details.rb +210 -0
  113. data/lib/oraclebmc/load_balancer/models/create_certificate_details.rb +245 -0
  114. data/lib/oraclebmc/load_balancer/models/create_listener_details.rb +216 -0
  115. data/lib/oraclebmc/load_balancer/models/create_load_balancer_details.rb +233 -0
  116. data/lib/oraclebmc/load_balancer/models/health_checker.rb +265 -0
  117. data/lib/oraclebmc/load_balancer/models/health_checker_details.rb +264 -0
  118. data/lib/oraclebmc/load_balancer/models/ip_address.rb +165 -0
  119. data/lib/oraclebmc/load_balancer/models/listener.rb +216 -0
  120. data/lib/oraclebmc/load_balancer/models/listener_details.rb +202 -0
  121. data/lib/oraclebmc/load_balancer/models/load_balancer.rb +296 -0
  122. data/lib/oraclebmc/load_balancer/models/load_balancer_policy.rb +162 -0
  123. data/lib/oraclebmc/load_balancer/models/load_balancer_protocol.rb +162 -0
  124. data/lib/oraclebmc/load_balancer/models/load_balancer_shape.rb +162 -0
  125. data/lib/oraclebmc/load_balancer/models/ssl_configuration.rb +195 -0
  126. data/lib/oraclebmc/load_balancer/models/ssl_configuration_details.rb +195 -0
  127. data/lib/oraclebmc/load_balancer/models/update_backend_details.rb +220 -0
  128. data/lib/oraclebmc/load_balancer/models/update_backend_set_details.rb +197 -0
  129. data/lib/oraclebmc/load_balancer/models/update_health_checker_details.rb +263 -0
  130. data/lib/oraclebmc/load_balancer/models/update_listener_details.rb +202 -0
  131. data/lib/oraclebmc/load_balancer/models/update_load_balancer_details.rb +165 -0
  132. data/lib/oraclebmc/load_balancer/models/work_request.rb +269 -0
  133. data/lib/oraclebmc/load_balancer/models/work_request_error.rb +185 -0
  134. data/lib/oraclebmc/load_balancer/util.rb +55 -0
  135. data/lib/oraclebmc/regions.rb +41 -0
  136. data/lib/oraclebmc/response.rb +86 -0
  137. data/lib/oraclebmc/signer.rb +119 -0
  138. data/lib/oraclebmc/version.rb +5 -0
  139. data/lib/oraclebmc/waiter.rb +111 -0
  140. data/lib/oraclebmc.rb +20 -0
  141. metadata +265 -0
@@ -0,0 +1,195 @@
1
+ # Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+
5
+ module OracleBMC
6
+ class Core::Models::CreateRouteTableDetails
7
+ # The OCID of the compartment to contain the route table.
8
+ # @return [String]
9
+ attr_accessor :compartment_id
10
+
11
+ # A user-friendly name. Does not have to be unique, and it's changeable.
12
+ # @return [String]
13
+ attr_accessor :display_name
14
+
15
+ # The collection of rules used for routing destination IPs to network devices.
16
+ # @return [Array<OracleBMC::Core::Models::RouteRule>]
17
+ attr_accessor :route_rules
18
+
19
+ # The OCID of the VCN the route table belongs to.
20
+ # @return [String]
21
+ attr_accessor :vcn_id
22
+
23
+
24
+ # Initializes the object
25
+ # @param [Hash] attributes Model attributes in the form of hash
26
+ def initialize(attributes = {})
27
+ return unless attributes.is_a?(Hash)
28
+
29
+ # convert string to symbol for hash key
30
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
31
+
32
+
33
+ if attributes[:'compartmentId']
34
+ self.compartment_id = attributes[:'compartmentId']
35
+ end
36
+
37
+ if attributes[:'displayName']
38
+ self.display_name = attributes[:'displayName']
39
+ end
40
+
41
+ if attributes[:'routeRules']
42
+ self.route_rules = attributes[:'routeRules']
43
+ end
44
+
45
+ if attributes[:'vcnId']
46
+ self.vcn_id = attributes[:'vcnId']
47
+ end
48
+
49
+ end
50
+
51
+ # Checks equality by comparing each attribute.
52
+ # @param [Object] other_object to be compared
53
+ def ==(other_object)
54
+ return true if self.equal?(other_object)
55
+ self.class == other_object.class &&
56
+ compartment_id == other_object.compartment_id &&
57
+ display_name == other_object.display_name &&
58
+ route_rules == other_object.route_rules &&
59
+ vcn_id == other_object.vcn_id
60
+ end
61
+
62
+ # @see the `==` method
63
+ # @param [Object] other_object to be compared
64
+ def eql?(other_object)
65
+ self == other_object
66
+ end
67
+
68
+ # Calculates hash code according to all attributes.
69
+ # @return [Fixnum] Hash code
70
+ def hash
71
+ [compartment_id, display_name, route_rules, vcn_id].hash
72
+ end
73
+
74
+ # Builds the object from hash
75
+ # @param [Hash] attributes Model attributes in the form of hash
76
+ # @return [Object] Returns the model itself
77
+ def build_from_hash(attributes)
78
+ return nil unless attributes.is_a?(Hash)
79
+ self.class.swagger_types.each_pair do |key, type|
80
+ if type =~ /^Array<(.*)>/i
81
+ # check to ensure the input is an array given that the the attribute
82
+ # is documented as an array but the input is not
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) } )
85
+ end
86
+ elsif !attributes[self.class.attribute_map[key]].nil?
87
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
88
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
89
+ end
90
+
91
+ self
92
+ end
93
+
94
+ # Returns the string representation of the object
95
+ # @return [String] String presentation of the object
96
+ def to_s
97
+ to_hash.to_s
98
+ end
99
+
100
+ # Returns the object in the form of hash
101
+ # @return [Hash] Returns the object in the form of hash
102
+ def to_hash
103
+ hash = {}
104
+ self.class.attribute_map.each_pair do |attr, param|
105
+ value = self.send(attr)
106
+ next if value.nil?
107
+ hash[param] = _to_hash(value)
108
+ end
109
+ hash
110
+ end
111
+
112
+ private
113
+
114
+ # Outputs non-array value in the form of hash
115
+ # For object, use to_hash. Otherwise, just return the value
116
+ # @param [Object] value Any valid value
117
+ # @return [Hash] Returns the value in the form of hash
118
+ def _to_hash(value)
119
+ if value.is_a?(Array)
120
+ value.compact.map{ |v| _to_hash(v) }
121
+ elsif value.is_a?(Hash)
122
+ {}.tap do |hash|
123
+ value.each { |k, v| hash[k] = _to_hash(v) }
124
+ end
125
+ elsif value.respond_to? :to_hash
126
+ value.to_hash
127
+ else
128
+ value
129
+ end
130
+ end
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
+
174
+
175
+ # Attribute mapping from ruby-style variable name to JSON key.
176
+ def self.attribute_map
177
+ {
178
+ :'compartment_id' => :'compartmentId',
179
+ :'display_name' => :'displayName',
180
+ :'route_rules' => :'routeRules',
181
+ :'vcn_id' => :'vcnId'
182
+ }
183
+ end
184
+
185
+ # Attribute type mapping.
186
+ def self.swagger_types
187
+ {
188
+ :'compartment_id' => :'String',
189
+ :'display_name' => :'String',
190
+ :'route_rules' => :'Array<OracleBMC::Core::Models::RouteRule>',
191
+ :'vcn_id' => :'String'
192
+ }
193
+ end
194
+ end
195
+ end
@@ -0,0 +1,206 @@
1
+ # Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+
5
+ module OracleBMC
6
+ class Core::Models::CreateSecurityListDetails
7
+ # The OCID of the compartment to contain the security list.
8
+ # @return [String]
9
+ attr_accessor :compartment_id
10
+
11
+ # A user-friendly name. Does not have to be unique, and it's changeable.
12
+ # @return [String]
13
+ attr_accessor :display_name
14
+
15
+ # Rules for allowing egress IP packets.
16
+ # @return [Array<OracleBMC::Core::Models::EgressSecurityRule>]
17
+ attr_accessor :egress_security_rules
18
+
19
+ # Rules for allowing ingress IP packets.
20
+ # @return [Array<OracleBMC::Core::Models::IngressSecurityRule>]
21
+ attr_accessor :ingress_security_rules
22
+
23
+ # The OCID of the VCN the security list belongs to.
24
+ # @return [String]
25
+ attr_accessor :vcn_id
26
+
27
+
28
+ # Initializes the object
29
+ # @param [Hash] attributes Model attributes in the form of hash
30
+ def initialize(attributes = {})
31
+ return unless attributes.is_a?(Hash)
32
+
33
+ # convert string to symbol for hash key
34
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
35
+
36
+
37
+ if attributes[:'compartmentId']
38
+ self.compartment_id = attributes[:'compartmentId']
39
+ end
40
+
41
+ if attributes[:'displayName']
42
+ self.display_name = attributes[:'displayName']
43
+ end
44
+
45
+ if attributes[:'egressSecurityRules']
46
+ self.egress_security_rules = attributes[:'egressSecurityRules']
47
+ end
48
+
49
+ if attributes[:'ingressSecurityRules']
50
+ self.ingress_security_rules = attributes[:'ingressSecurityRules']
51
+ end
52
+
53
+ if attributes[:'vcnId']
54
+ self.vcn_id = attributes[:'vcnId']
55
+ end
56
+
57
+ end
58
+
59
+ # Checks equality by comparing each attribute.
60
+ # @param [Object] other_object to be compared
61
+ def ==(other_object)
62
+ return true if self.equal?(other_object)
63
+ self.class == other_object.class &&
64
+ compartment_id == other_object.compartment_id &&
65
+ display_name == other_object.display_name &&
66
+ egress_security_rules == other_object.egress_security_rules &&
67
+ ingress_security_rules == other_object.ingress_security_rules &&
68
+ vcn_id == other_object.vcn_id
69
+ end
70
+
71
+ # @see the `==` method
72
+ # @param [Object] other_object to be compared
73
+ def eql?(other_object)
74
+ self == other_object
75
+ end
76
+
77
+ # Calculates hash code according to all attributes.
78
+ # @return [Fixnum] Hash code
79
+ def hash
80
+ [compartment_id, display_name, egress_security_rules, ingress_security_rules, vcn_id].hash
81
+ end
82
+
83
+ # Builds the object from hash
84
+ # @param [Hash] attributes Model attributes in the form of hash
85
+ # @return [Object] Returns the model itself
86
+ def build_from_hash(attributes)
87
+ return nil unless attributes.is_a?(Hash)
88
+ self.class.swagger_types.each_pair do |key, type|
89
+ if type =~ /^Array<(.*)>/i
90
+ # check to ensure the input is an array given that the the attribute
91
+ # is documented as an array but the input is not
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) } )
94
+ end
95
+ elsif !attributes[self.class.attribute_map[key]].nil?
96
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
97
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
98
+ end
99
+
100
+ self
101
+ end
102
+
103
+ # Returns the string representation of the object
104
+ # @return [String] String presentation of the object
105
+ def to_s
106
+ to_hash.to_s
107
+ end
108
+
109
+ # Returns the object in the form of hash
110
+ # @return [Hash] Returns the object in the form of hash
111
+ def to_hash
112
+ hash = {}
113
+ self.class.attribute_map.each_pair do |attr, param|
114
+ value = self.send(attr)
115
+ next if value.nil?
116
+ hash[param] = _to_hash(value)
117
+ end
118
+ hash
119
+ end
120
+
121
+ private
122
+
123
+ # Outputs non-array value in the form of hash
124
+ # For object, use to_hash. Otherwise, just return the value
125
+ # @param [Object] value Any valid value
126
+ # @return [Hash] Returns the value in the form of hash
127
+ def _to_hash(value)
128
+ if value.is_a?(Array)
129
+ value.compact.map{ |v| _to_hash(v) }
130
+ elsif value.is_a?(Hash)
131
+ {}.tap do |hash|
132
+ value.each { |k, v| hash[k] = _to_hash(v) }
133
+ end
134
+ elsif value.respond_to? :to_hash
135
+ value.to_hash
136
+ else
137
+ value
138
+ end
139
+ end
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
+
183
+
184
+ # Attribute mapping from ruby-style variable name to JSON key.
185
+ def self.attribute_map
186
+ {
187
+ :'compartment_id' => :'compartmentId',
188
+ :'display_name' => :'displayName',
189
+ :'egress_security_rules' => :'egressSecurityRules',
190
+ :'ingress_security_rules' => :'ingressSecurityRules',
191
+ :'vcn_id' => :'vcnId'
192
+ }
193
+ end
194
+
195
+ # Attribute type mapping.
196
+ def self.swagger_types
197
+ {
198
+ :'compartment_id' => :'String',
199
+ :'display_name' => :'String',
200
+ :'egress_security_rules' => :'Array<OracleBMC::Core::Models::EgressSecurityRule>',
201
+ :'ingress_security_rules' => :'Array<OracleBMC::Core::Models::IngressSecurityRule>',
202
+ :'vcn_id' => :'String'
203
+ }
204
+ end
205
+ end
206
+ end
@@ -0,0 +1,253 @@
1
+ # Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+
5
+ module OracleBMC
6
+ class Core::Models::CreateSubnetDetails
7
+ # The Availability Domain to contain the subnet.
8
+ #
9
+ # Example: `Uocm:PHX-AD-1`
10
+ #
11
+ # @return [String]
12
+ attr_accessor :availability_domain
13
+
14
+ # The CIDR IP address range of the subnet.
15
+ #
16
+ # Example: `172.16.1.0/24`
17
+ #
18
+ # @return [String]
19
+ attr_accessor :cidr_block
20
+
21
+ # The OCID of the compartment to contain the subnet.
22
+ # @return [String]
23
+ attr_accessor :compartment_id
24
+
25
+ # The OCID of the set of DHCP options the subnet will use. If you don't
26
+ # provide a value, the subnet will use the VCN's default set of DHCP options.
27
+ #
28
+ # @return [String]
29
+ attr_accessor :dhcp_options_id
30
+
31
+ # A user-friendly name. Does not have to be unique, and it's changeable.
32
+ # @return [String]
33
+ attr_accessor :display_name
34
+
35
+ # The OCID of the route table the subnet will use. If you don't provide a value,
36
+ # the subnet will use the VCN's default route table.
37
+ #
38
+ # @return [String]
39
+ attr_accessor :route_table_id
40
+
41
+ # OCIDs for the security lists to associate with the subnet. If you don't
42
+ # provide a value, the VCN's default security list will be associated with
43
+ # the subnet. Remember that security lists are associated at the subnet
44
+ # level, but the rules are applied to the individual VNICs in the subnet.
45
+ #
46
+ # @return [Array<String>]
47
+ attr_accessor :security_list_ids
48
+
49
+ # The OCID of the VCN to contain the subnet.
50
+ # @return [String]
51
+ attr_accessor :vcn_id
52
+
53
+
54
+ # Initializes the object
55
+ # @param [Hash] attributes Model attributes in the form of hash
56
+ def initialize(attributes = {})
57
+ return unless attributes.is_a?(Hash)
58
+
59
+ # convert string to symbol for hash key
60
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
61
+
62
+
63
+ if attributes[:'availabilityDomain']
64
+ self.availability_domain = attributes[:'availabilityDomain']
65
+ end
66
+
67
+ if attributes[:'cidrBlock']
68
+ self.cidr_block = attributes[:'cidrBlock']
69
+ end
70
+
71
+ if attributes[:'compartmentId']
72
+ self.compartment_id = attributes[:'compartmentId']
73
+ end
74
+
75
+ if attributes[:'dhcpOptionsId']
76
+ self.dhcp_options_id = attributes[:'dhcpOptionsId']
77
+ end
78
+
79
+ if attributes[:'displayName']
80
+ self.display_name = attributes[:'displayName']
81
+ end
82
+
83
+ if attributes[:'routeTableId']
84
+ self.route_table_id = attributes[:'routeTableId']
85
+ end
86
+
87
+ if attributes[:'securityListIds']
88
+ self.security_list_ids = attributes[:'securityListIds']
89
+ end
90
+
91
+ if attributes[:'vcnId']
92
+ self.vcn_id = attributes[:'vcnId']
93
+ end
94
+
95
+ end
96
+
97
+ # Checks equality by comparing each attribute.
98
+ # @param [Object] other_object to be compared
99
+ def ==(other_object)
100
+ return true if self.equal?(other_object)
101
+ self.class == other_object.class &&
102
+ availability_domain == other_object.availability_domain &&
103
+ cidr_block == other_object.cidr_block &&
104
+ compartment_id == other_object.compartment_id &&
105
+ dhcp_options_id == other_object.dhcp_options_id &&
106
+ display_name == other_object.display_name &&
107
+ route_table_id == other_object.route_table_id &&
108
+ security_list_ids == other_object.security_list_ids &&
109
+ vcn_id == other_object.vcn_id
110
+ end
111
+
112
+ # @see the `==` method
113
+ # @param [Object] other_object to be compared
114
+ def eql?(other_object)
115
+ self == other_object
116
+ end
117
+
118
+ # Calculates hash code according to all attributes.
119
+ # @return [Fixnum] Hash code
120
+ def hash
121
+ [availability_domain, cidr_block, compartment_id, dhcp_options_id, display_name, route_table_id, security_list_ids, vcn_id].hash
122
+ end
123
+
124
+ # Builds the object from hash
125
+ # @param [Hash] attributes Model attributes in the form of hash
126
+ # @return [Object] Returns the model itself
127
+ def build_from_hash(attributes)
128
+ return nil unless attributes.is_a?(Hash)
129
+ self.class.swagger_types.each_pair do |key, type|
130
+ if type =~ /^Array<(.*)>/i
131
+ # check to ensure the input is an array given that the the attribute
132
+ # is documented as an array but the input is not
133
+ 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) } )
135
+ end
136
+ elsif !attributes[self.class.attribute_map[key]].nil?
137
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
138
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
139
+ end
140
+
141
+ self
142
+ end
143
+
144
+ # Returns the string representation of the object
145
+ # @return [String] String presentation of the object
146
+ def to_s
147
+ to_hash.to_s
148
+ end
149
+
150
+ # Returns the object in the form of hash
151
+ # @return [Hash] Returns the object in the form of hash
152
+ def to_hash
153
+ hash = {}
154
+ self.class.attribute_map.each_pair do |attr, param|
155
+ value = self.send(attr)
156
+ next if value.nil?
157
+ hash[param] = _to_hash(value)
158
+ end
159
+ hash
160
+ end
161
+
162
+ private
163
+
164
+ # Outputs non-array value in the form of hash
165
+ # For object, use to_hash. Otherwise, just return the value
166
+ # @param [Object] value Any valid value
167
+ # @return [Hash] Returns the value in the form of hash
168
+ def _to_hash(value)
169
+ if value.is_a?(Array)
170
+ value.compact.map{ |v| _to_hash(v) }
171
+ elsif value.is_a?(Hash)
172
+ {}.tap do |hash|
173
+ value.each { |k, v| hash[k] = _to_hash(v) }
174
+ end
175
+ elsif value.respond_to? :to_hash
176
+ value.to_hash
177
+ else
178
+ value
179
+ end
180
+ end
181
+
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
+
224
+
225
+ # Attribute mapping from ruby-style variable name to JSON key.
226
+ def self.attribute_map
227
+ {
228
+ :'availability_domain' => :'availabilityDomain',
229
+ :'cidr_block' => :'cidrBlock',
230
+ :'compartment_id' => :'compartmentId',
231
+ :'dhcp_options_id' => :'dhcpOptionsId',
232
+ :'display_name' => :'displayName',
233
+ :'route_table_id' => :'routeTableId',
234
+ :'security_list_ids' => :'securityListIds',
235
+ :'vcn_id' => :'vcnId'
236
+ }
237
+ end
238
+
239
+ # Attribute type mapping.
240
+ def self.swagger_types
241
+ {
242
+ :'availability_domain' => :'String',
243
+ :'cidr_block' => :'String',
244
+ :'compartment_id' => :'String',
245
+ :'dhcp_options_id' => :'String',
246
+ :'display_name' => :'String',
247
+ :'route_table_id' => :'String',
248
+ :'security_list_ids' => :'Array<String>',
249
+ :'vcn_id' => :'String'
250
+ }
251
+ end
252
+ end
253
+ end