oraclebmc 1.1.1

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 (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,248 @@
1
+ # Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+
5
+ module OracleBMC
6
+ class Core::Models::InternetGateway
7
+
8
+ LIFECYCLE_STATE_ENUM = [LIFECYCLE_STATE_PROVISIONING = 'PROVISIONING',
9
+ LIFECYCLE_STATE_AVAILABLE = 'AVAILABLE',
10
+ LIFECYCLE_STATE_TERMINATING = 'TERMINATING',
11
+ LIFECYCLE_STATE_TERMINATED = 'TERMINATED']
12
+
13
+ # The OCID of the compartment containing the Internet Gateway.
14
+ # @return [String]
15
+ attr_accessor :compartment_id
16
+
17
+ # A user-friendly name. Does not have to be unique, and it's changeable.
18
+ # @return [String]
19
+ attr_accessor :display_name
20
+
21
+ # The Internet Gateway's Oracle ID (OCID).
22
+ # @return [String]
23
+ attr_accessor :id
24
+
25
+ # Whether the gateway is enabled. When the gateway is disabled, traffic is not
26
+ # routed to/from the Internet, regardless of route rules.
27
+ #
28
+ # @return [BOOLEAN]
29
+ attr_accessor :is_enabled
30
+
31
+ # The Internet Gateway's current state.
32
+ # @return [String]
33
+ attr_accessor :lifecycle_state
34
+
35
+ # The date and time the Internet Gateway was created, in the format defined by RFC3339.
36
+ #
37
+ # Example: `2016-08-25T21:10:29.600Z`
38
+ #
39
+ # @return [DateTime]
40
+ attr_accessor :time_created
41
+
42
+ # The OCID of the VCN the Internet Gateway belongs to.
43
+ # @return [String]
44
+ attr_accessor :vcn_id
45
+
46
+
47
+ # Initializes the object
48
+ # @param [Hash] attributes Model attributes in the form of hash
49
+ def initialize(attributes = {})
50
+ return unless attributes.is_a?(Hash)
51
+
52
+ # convert string to symbol for hash key
53
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
54
+
55
+
56
+ if attributes[:'compartmentId']
57
+ self.compartment_id = attributes[:'compartmentId']
58
+ end
59
+
60
+ if attributes[:'displayName']
61
+ self.display_name = attributes[:'displayName']
62
+ end
63
+
64
+ if attributes[:'id']
65
+ self.id = attributes[:'id']
66
+ end
67
+
68
+ if attributes[:'isEnabled']
69
+ self.is_enabled = attributes[:'isEnabled']
70
+ end
71
+
72
+ if attributes[:'lifecycleState']
73
+ self.lifecycle_state = attributes[:'lifecycleState']
74
+ end
75
+
76
+ if attributes[:'timeCreated']
77
+ self.time_created = attributes[:'timeCreated']
78
+ end
79
+
80
+ if attributes[:'vcnId']
81
+ self.vcn_id = attributes[:'vcnId']
82
+ end
83
+
84
+ end
85
+
86
+ # Custom attribute writer method checking allowed values (enum).
87
+ # @param [Object] lifecycle_state Object to be assigned
88
+ def lifecycle_state=(lifecycle_state)
89
+ if lifecycle_state && !LIFECYCLE_STATE_ENUM.include?(lifecycle_state)
90
+ fail "Invalid value for 'lifecycle_state': this must be one of the values in LIFECYCLE_STATE_ENUM."
91
+ end
92
+ @lifecycle_state = lifecycle_state
93
+ end
94
+
95
+ # Checks equality by comparing each attribute.
96
+ # @param [Object] other_object to be compared
97
+ def ==(other_object)
98
+ return true if self.equal?(other_object)
99
+ self.class == other_object.class &&
100
+ compartment_id == other_object.compartment_id &&
101
+ display_name == other_object.display_name &&
102
+ id == other_object.id &&
103
+ is_enabled == other_object.is_enabled &&
104
+ lifecycle_state == other_object.lifecycle_state &&
105
+ time_created == other_object.time_created &&
106
+ vcn_id == other_object.vcn_id
107
+ end
108
+
109
+ # @see the `==` method
110
+ # @param [Object] other_object to be compared
111
+ def eql?(other_object)
112
+ self == other_object
113
+ end
114
+
115
+ # Calculates hash code according to all attributes.
116
+ # @return [Fixnum] Hash code
117
+ def hash
118
+ [compartment_id, display_name, id, is_enabled, lifecycle_state, time_created, vcn_id].hash
119
+ end
120
+
121
+ # Builds the object from hash
122
+ # @param [Hash] attributes Model attributes in the form of hash
123
+ # @return [Object] Returns the model itself
124
+ def build_from_hash(attributes)
125
+ return nil unless attributes.is_a?(Hash)
126
+ self.class.swagger_types.each_pair do |key, type|
127
+ if type =~ /^Array<(.*)>/i
128
+ # check to ensure the input is an array given that the the attribute
129
+ # is documented as an array but the input is not
130
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
131
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
132
+ end
133
+ elsif !attributes[self.class.attribute_map[key]].nil?
134
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
135
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
136
+ end
137
+
138
+ self
139
+ end
140
+
141
+ # Returns the string representation of the object
142
+ # @return [String] String presentation of the object
143
+ def to_s
144
+ to_hash.to_s
145
+ end
146
+
147
+ # Returns the object in the form of hash
148
+ # @return [Hash] Returns the object in the form of hash
149
+ def to_hash
150
+ hash = {}
151
+ self.class.attribute_map.each_pair do |attr, param|
152
+ value = self.send(attr)
153
+ next if value.nil?
154
+ hash[param] = _to_hash(value)
155
+ end
156
+ hash
157
+ end
158
+
159
+ private
160
+
161
+ # Outputs non-array value in the form of hash
162
+ # For object, use to_hash. Otherwise, just return the value
163
+ # @param [Object] value Any valid value
164
+ # @return [Hash] Returns the value in the form of hash
165
+ def _to_hash(value)
166
+ if value.is_a?(Array)
167
+ value.compact.map{ |v| _to_hash(v) }
168
+ elsif value.is_a?(Hash)
169
+ {}.tap do |hash|
170
+ value.each { |k, v| hash[k] = _to_hash(v) }
171
+ end
172
+ elsif value.respond_to? :to_hash
173
+ value.to_hash
174
+ else
175
+ value
176
+ end
177
+ end
178
+
179
+ # Deserializes the data based on type
180
+ # @param [String] type Data type
181
+ # @param [String] value Value to be deserialized
182
+ # @return [Object] Deserialized data
183
+ def _deserialize(type, value)
184
+ case type.to_sym
185
+ when :DateTime
186
+ DateTime.parse(value)
187
+ when :Date
188
+ Date.parse(value)
189
+ when :String
190
+ value.to_s
191
+ when :Integer
192
+ value.to_i
193
+ when :Float
194
+ value.to_f
195
+ when :BOOLEAN
196
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
197
+ true
198
+ else
199
+ false
200
+ end
201
+ when :Object
202
+ # generic object (usually a Hash), return directly
203
+ value
204
+ when /\AArray<(?<inner_type>.+)>\z/
205
+ inner_type = Regexp.last_match[:inner_type]
206
+ value.map { |v| _deserialize(inner_type, v) }
207
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
208
+ k_type = Regexp.last_match[:k_type]
209
+ v_type = Regexp.last_match[:v_type]
210
+ {}.tap do |hash|
211
+ value.each do |k, v|
212
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
213
+ end
214
+ end
215
+ else # model
216
+ temp_model = OracleBMC.const_get(type.to_s).new
217
+ temp_model.build_from_hash(value)
218
+ end
219
+ end
220
+
221
+
222
+ # Attribute mapping from ruby-style variable name to JSON key.
223
+ def self.attribute_map
224
+ {
225
+ :'compartment_id' => :'compartmentId',
226
+ :'display_name' => :'displayName',
227
+ :'id' => :'id',
228
+ :'is_enabled' => :'isEnabled',
229
+ :'lifecycle_state' => :'lifecycleState',
230
+ :'time_created' => :'timeCreated',
231
+ :'vcn_id' => :'vcnId'
232
+ }
233
+ end
234
+
235
+ # Attribute type mapping.
236
+ def self.swagger_types
237
+ {
238
+ :'compartment_id' => :'String',
239
+ :'display_name' => :'String',
240
+ :'id' => :'String',
241
+ :'is_enabled' => :'BOOLEAN',
242
+ :'lifecycle_state' => :'String',
243
+ :'time_created' => :'DateTime',
244
+ :'vcn_id' => :'String'
245
+ }
246
+ end
247
+ end
248
+ end
@@ -0,0 +1,261 @@
1
+ # Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+
5
+ module OracleBMC
6
+ class Core::Models::IPSecConnection
7
+
8
+ LIFECYCLE_STATE_ENUM = [LIFECYCLE_STATE_PROVISIONING = 'PROVISIONING',
9
+ LIFECYCLE_STATE_AVAILABLE = 'AVAILABLE',
10
+ LIFECYCLE_STATE_TERMINATING = 'TERMINATING',
11
+ LIFECYCLE_STATE_TERMINATED = 'TERMINATED']
12
+
13
+ # The OCID of the compartment containing the IPSec connection.
14
+ # @return [String]
15
+ attr_accessor :compartment_id
16
+
17
+ # The OCID of the CPE.
18
+ # @return [String]
19
+ attr_accessor :cpe_id
20
+
21
+ # A user-friendly name. Does not have to be unique, and it's changeable.
22
+ # @return [String]
23
+ attr_accessor :display_name
24
+
25
+ # The OCID of the DRG.
26
+ # @return [String]
27
+ attr_accessor :drg_id
28
+
29
+ # The IPSec connection's Oracle ID (OCID).
30
+ # @return [String]
31
+ attr_accessor :id
32
+
33
+ # The IPSec connection's current state.
34
+ # @return [String]
35
+ attr_accessor :lifecycle_state
36
+
37
+ # Static routes to the CPE. At least one route must be included. The CIDR must not be a
38
+ # multicast address or class E address.
39
+ #
40
+ # Example: `10.0.1.0/24`
41
+ #
42
+ # @return [Array<String>]
43
+ attr_accessor :static_routes
44
+
45
+ # The date and time the IPSec connection was created, in the format defined by RFC3339.
46
+ #
47
+ # Example: `2016-08-25T21:10:29.600Z`
48
+ #
49
+ # @return [DateTime]
50
+ attr_accessor :time_created
51
+
52
+
53
+ # Initializes the object
54
+ # @param [Hash] attributes Model attributes in the form of hash
55
+ def initialize(attributes = {})
56
+ return unless attributes.is_a?(Hash)
57
+
58
+ # convert string to symbol for hash key
59
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
60
+
61
+
62
+ if attributes[:'compartmentId']
63
+ self.compartment_id = attributes[:'compartmentId']
64
+ end
65
+
66
+ if attributes[:'cpeId']
67
+ self.cpe_id = attributes[:'cpeId']
68
+ end
69
+
70
+ if attributes[:'displayName']
71
+ self.display_name = attributes[:'displayName']
72
+ end
73
+
74
+ if attributes[:'drgId']
75
+ self.drg_id = attributes[:'drgId']
76
+ end
77
+
78
+ if attributes[:'id']
79
+ self.id = attributes[:'id']
80
+ end
81
+
82
+ if attributes[:'lifecycleState']
83
+ self.lifecycle_state = attributes[:'lifecycleState']
84
+ end
85
+
86
+ if attributes[:'staticRoutes']
87
+ self.static_routes = attributes[:'staticRoutes']
88
+ end
89
+
90
+ if attributes[:'timeCreated']
91
+ self.time_created = attributes[:'timeCreated']
92
+ end
93
+
94
+ end
95
+
96
+ # Custom attribute writer method checking allowed values (enum).
97
+ # @param [Object] lifecycle_state Object to be assigned
98
+ def lifecycle_state=(lifecycle_state)
99
+ if lifecycle_state && !LIFECYCLE_STATE_ENUM.include?(lifecycle_state)
100
+ fail "Invalid value for 'lifecycle_state': this must be one of the values in LIFECYCLE_STATE_ENUM."
101
+ end
102
+ @lifecycle_state = lifecycle_state
103
+ end
104
+
105
+ # Checks equality by comparing each attribute.
106
+ # @param [Object] other_object to be compared
107
+ def ==(other_object)
108
+ return true if self.equal?(other_object)
109
+ self.class == other_object.class &&
110
+ compartment_id == other_object.compartment_id &&
111
+ cpe_id == other_object.cpe_id &&
112
+ display_name == other_object.display_name &&
113
+ drg_id == other_object.drg_id &&
114
+ id == other_object.id &&
115
+ lifecycle_state == other_object.lifecycle_state &&
116
+ static_routes == other_object.static_routes &&
117
+ time_created == other_object.time_created
118
+ end
119
+
120
+ # @see the `==` method
121
+ # @param [Object] other_object to be compared
122
+ def eql?(other_object)
123
+ self == other_object
124
+ end
125
+
126
+ # Calculates hash code according to all attributes.
127
+ # @return [Fixnum] Hash code
128
+ def hash
129
+ [compartment_id, cpe_id, display_name, drg_id, id, lifecycle_state, static_routes, time_created].hash
130
+ end
131
+
132
+ # Builds the object from hash
133
+ # @param [Hash] attributes Model attributes in the form of hash
134
+ # @return [Object] Returns the model itself
135
+ def build_from_hash(attributes)
136
+ return nil unless attributes.is_a?(Hash)
137
+ self.class.swagger_types.each_pair do |key, type|
138
+ if type =~ /^Array<(.*)>/i
139
+ # check to ensure the input is an array given that the the attribute
140
+ # is documented as an array but the input is not
141
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
142
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
143
+ end
144
+ elsif !attributes[self.class.attribute_map[key]].nil?
145
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
146
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
147
+ end
148
+
149
+ self
150
+ end
151
+
152
+ # Returns the string representation of the object
153
+ # @return [String] String presentation of the object
154
+ def to_s
155
+ to_hash.to_s
156
+ end
157
+
158
+ # Returns the object in the form of hash
159
+ # @return [Hash] Returns the object in the form of hash
160
+ def to_hash
161
+ hash = {}
162
+ self.class.attribute_map.each_pair do |attr, param|
163
+ value = self.send(attr)
164
+ next if value.nil?
165
+ hash[param] = _to_hash(value)
166
+ end
167
+ hash
168
+ end
169
+
170
+ private
171
+
172
+ # Outputs non-array value in the form of hash
173
+ # For object, use to_hash. Otherwise, just return the value
174
+ # @param [Object] value Any valid value
175
+ # @return [Hash] Returns the value in the form of hash
176
+ def _to_hash(value)
177
+ if value.is_a?(Array)
178
+ value.compact.map{ |v| _to_hash(v) }
179
+ elsif value.is_a?(Hash)
180
+ {}.tap do |hash|
181
+ value.each { |k, v| hash[k] = _to_hash(v) }
182
+ end
183
+ elsif value.respond_to? :to_hash
184
+ value.to_hash
185
+ else
186
+ value
187
+ end
188
+ end
189
+
190
+ # Deserializes the data based on type
191
+ # @param [String] type Data type
192
+ # @param [String] value Value to be deserialized
193
+ # @return [Object] Deserialized data
194
+ def _deserialize(type, value)
195
+ case type.to_sym
196
+ when :DateTime
197
+ DateTime.parse(value)
198
+ when :Date
199
+ Date.parse(value)
200
+ when :String
201
+ value.to_s
202
+ when :Integer
203
+ value.to_i
204
+ when :Float
205
+ value.to_f
206
+ when :BOOLEAN
207
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
208
+ true
209
+ else
210
+ false
211
+ end
212
+ when :Object
213
+ # generic object (usually a Hash), return directly
214
+ value
215
+ when /\AArray<(?<inner_type>.+)>\z/
216
+ inner_type = Regexp.last_match[:inner_type]
217
+ value.map { |v| _deserialize(inner_type, v) }
218
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
219
+ k_type = Regexp.last_match[:k_type]
220
+ v_type = Regexp.last_match[:v_type]
221
+ {}.tap do |hash|
222
+ value.each do |k, v|
223
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
224
+ end
225
+ end
226
+ else # model
227
+ temp_model = OracleBMC.const_get(type.to_s).new
228
+ temp_model.build_from_hash(value)
229
+ end
230
+ end
231
+
232
+
233
+ # Attribute mapping from ruby-style variable name to JSON key.
234
+ def self.attribute_map
235
+ {
236
+ :'compartment_id' => :'compartmentId',
237
+ :'cpe_id' => :'cpeId',
238
+ :'display_name' => :'displayName',
239
+ :'drg_id' => :'drgId',
240
+ :'id' => :'id',
241
+ :'lifecycle_state' => :'lifecycleState',
242
+ :'static_routes' => :'staticRoutes',
243
+ :'time_created' => :'timeCreated'
244
+ }
245
+ end
246
+
247
+ # Attribute type mapping.
248
+ def self.swagger_types
249
+ {
250
+ :'compartment_id' => :'String',
251
+ :'cpe_id' => :'String',
252
+ :'display_name' => :'String',
253
+ :'drg_id' => :'String',
254
+ :'id' => :'String',
255
+ :'lifecycle_state' => :'String',
256
+ :'static_routes' => :'Array<String>',
257
+ :'time_created' => :'DateTime'
258
+ }
259
+ end
260
+ end
261
+ end
@@ -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::IPSecConnectionDeviceConfig
7
+ # The OCID of the compartment containing the IPSec connection.
8
+ # @return [String]
9
+ attr_accessor :compartment_id
10
+
11
+ # The IPSec connection's Oracle ID (OCID).
12
+ # @return [String]
13
+ attr_accessor :id
14
+
15
+ # The date and time the IPSec connection was created.
16
+ # @return [DateTime]
17
+ attr_accessor :time_created
18
+
19
+ # Two {TunnelConfig} objects.
20
+ # @return [Array<OracleBMC::Core::Models::TunnelConfig>]
21
+ attr_accessor :tunnels
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[:'id']
38
+ self.id = attributes[:'id']
39
+ end
40
+
41
+ if attributes[:'timeCreated']
42
+ self.time_created = attributes[:'timeCreated']
43
+ end
44
+
45
+ if attributes[:'tunnels']
46
+ self.tunnels = attributes[:'tunnels']
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
+ id == other_object.id &&
58
+ time_created == other_object.time_created &&
59
+ tunnels == other_object.tunnels
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, id, time_created, tunnels].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
+ :'id' => :'id',
180
+ :'time_created' => :'timeCreated',
181
+ :'tunnels' => :'tunnels'
182
+ }
183
+ end
184
+
185
+ # Attribute type mapping.
186
+ def self.swagger_types
187
+ {
188
+ :'compartment_id' => :'String',
189
+ :'id' => :'String',
190
+ :'time_created' => :'DateTime',
191
+ :'tunnels' => :'Array<OracleBMC::Core::Models::TunnelConfig>'
192
+ }
193
+ end
194
+ end
195
+ end