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,188 @@
1
+ # Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+
5
+ module OracleBMC
6
+ class Core::Models::CreateImageDetails
7
+ # The OCID of the compartment containing the instance you want to use as the basis for the image.
8
+ # @return [String]
9
+ attr_accessor :compartment_id
10
+
11
+ # A user-friendly name for the image. It does not have to be unique, and it's changeable. You cannot use an
12
+ # Oracle-provided image name as a custom image name.
13
+ #
14
+ # Example: `My Oracle Linux image`
15
+ #
16
+ # @return [String]
17
+ attr_accessor :display_name
18
+
19
+ # The OCID of the instance you want to use as the basis for the image.
20
+ # @return [String]
21
+ attr_accessor :instance_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[:'instanceId']
42
+ self.instance_id = attributes[:'instanceId']
43
+ end
44
+
45
+ end
46
+
47
+ # Checks equality by comparing each attribute.
48
+ # @param [Object] other_object to be compared
49
+ def ==(other_object)
50
+ return true if self.equal?(other_object)
51
+ self.class == other_object.class &&
52
+ compartment_id == other_object.compartment_id &&
53
+ display_name == other_object.display_name &&
54
+ instance_id == other_object.instance_id
55
+ end
56
+
57
+ # @see the `==` method
58
+ # @param [Object] other_object to be compared
59
+ def eql?(other_object)
60
+ self == other_object
61
+ end
62
+
63
+ # Calculates hash code according to all attributes.
64
+ # @return [Fixnum] Hash code
65
+ def hash
66
+ [compartment_id, display_name, instance_id].hash
67
+ end
68
+
69
+ # Builds the object from hash
70
+ # @param [Hash] attributes Model attributes in the form of hash
71
+ # @return [Object] Returns the model itself
72
+ def build_from_hash(attributes)
73
+ return nil unless attributes.is_a?(Hash)
74
+ self.class.swagger_types.each_pair do |key, type|
75
+ if type =~ /^Array<(.*)>/i
76
+ # check to ensure the input is an array given that the the attribute
77
+ # is documented as an array but the input is not
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) } )
80
+ end
81
+ elsif !attributes[self.class.attribute_map[key]].nil?
82
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
83
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
84
+ end
85
+
86
+ self
87
+ end
88
+
89
+ # Returns the string representation of the object
90
+ # @return [String] String presentation of the object
91
+ def to_s
92
+ to_hash.to_s
93
+ end
94
+
95
+ # Returns the object in the form of hash
96
+ # @return [Hash] Returns the object in the form of hash
97
+ def to_hash
98
+ hash = {}
99
+ self.class.attribute_map.each_pair do |attr, param|
100
+ value = self.send(attr)
101
+ next if value.nil?
102
+ hash[param] = _to_hash(value)
103
+ end
104
+ hash
105
+ end
106
+
107
+ private
108
+
109
+ # Outputs non-array value in the form of hash
110
+ # For object, use to_hash. Otherwise, just return the value
111
+ # @param [Object] value Any valid value
112
+ # @return [Hash] Returns the value in the form of hash
113
+ def _to_hash(value)
114
+ if value.is_a?(Array)
115
+ value.compact.map{ |v| _to_hash(v) }
116
+ elsif value.is_a?(Hash)
117
+ {}.tap do |hash|
118
+ value.each { |k, v| hash[k] = _to_hash(v) }
119
+ end
120
+ elsif value.respond_to? :to_hash
121
+ value.to_hash
122
+ else
123
+ value
124
+ end
125
+ end
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
+
169
+
170
+ # Attribute mapping from ruby-style variable name to JSON key.
171
+ def self.attribute_map
172
+ {
173
+ :'compartment_id' => :'compartmentId',
174
+ :'display_name' => :'displayName',
175
+ :'instance_id' => :'instanceId'
176
+ }
177
+ end
178
+
179
+ # Attribute type mapping.
180
+ def self.swagger_types
181
+ {
182
+ :'compartment_id' => :'String',
183
+ :'display_name' => :'String',
184
+ :'instance_id' => :'String'
185
+ }
186
+ end
187
+ end
188
+ 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::CreateInternetGatewayDetails
7
+ # The OCID of the compartment to contain the Internet Gateway.
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
+ # Whether the gateway is enabled upon creation.
16
+ # @return [BOOLEAN]
17
+ attr_accessor :is_enabled
18
+
19
+ # The OCID of the VCN the Internet Gateway is attached 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[:'isEnabled']
42
+ self.is_enabled = attributes[:'isEnabled']
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
+ is_enabled == other_object.is_enabled &&
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, is_enabled, 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
+ :'is_enabled' => :'isEnabled',
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
+ :'is_enabled' => :'BOOLEAN',
191
+ :'vcn_id' => :'String'
192
+ }
193
+ end
194
+ end
195
+ end
@@ -0,0 +1,210 @@
1
+ # Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+
5
+ module OracleBMC
6
+ class Core::Models::CreateIPSecConnectionDetails
7
+ # The OCID of the compartment to contain the IPSec connection.
8
+ # @return [String]
9
+ attr_accessor :compartment_id
10
+
11
+ # The OCID of the CPE.
12
+ # @return [String]
13
+ attr_accessor :cpe_id
14
+
15
+ # A user-friendly name. Does not have to be unique, and it's changeable.
16
+ # @return [String]
17
+ attr_accessor :display_name
18
+
19
+ # The OCID of the DRG.
20
+ # @return [String]
21
+ attr_accessor :drg_id
22
+
23
+ # Static routes to the CPE. At least one route must be included. The CIDR must not be a
24
+ # multicast address or class E address.
25
+ #
26
+ # Example: `10.0.1.0/24`
27
+ #
28
+ # @return [Array<String>]
29
+ attr_accessor :static_routes
30
+
31
+
32
+ # Initializes the object
33
+ # @param [Hash] attributes Model attributes in the form of hash
34
+ def initialize(attributes = {})
35
+ return unless attributes.is_a?(Hash)
36
+
37
+ # convert string to symbol for hash key
38
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
39
+
40
+
41
+ if attributes[:'compartmentId']
42
+ self.compartment_id = attributes[:'compartmentId']
43
+ end
44
+
45
+ if attributes[:'cpeId']
46
+ self.cpe_id = attributes[:'cpeId']
47
+ end
48
+
49
+ if attributes[:'displayName']
50
+ self.display_name = attributes[:'displayName']
51
+ end
52
+
53
+ if attributes[:'drgId']
54
+ self.drg_id = attributes[:'drgId']
55
+ end
56
+
57
+ if attributes[:'staticRoutes']
58
+ self.static_routes = attributes[:'staticRoutes']
59
+ end
60
+
61
+ end
62
+
63
+ # Checks equality by comparing each attribute.
64
+ # @param [Object] other_object to be compared
65
+ def ==(other_object)
66
+ return true if self.equal?(other_object)
67
+ self.class == other_object.class &&
68
+ compartment_id == other_object.compartment_id &&
69
+ cpe_id == other_object.cpe_id &&
70
+ display_name == other_object.display_name &&
71
+ drg_id == other_object.drg_id &&
72
+ static_routes == other_object.static_routes
73
+ end
74
+
75
+ # @see the `==` method
76
+ # @param [Object] other_object to be compared
77
+ def eql?(other_object)
78
+ self == other_object
79
+ end
80
+
81
+ # Calculates hash code according to all attributes.
82
+ # @return [Fixnum] Hash code
83
+ def hash
84
+ [compartment_id, cpe_id, display_name, drg_id, static_routes].hash
85
+ end
86
+
87
+ # Builds the object from hash
88
+ # @param [Hash] attributes Model attributes in the form of hash
89
+ # @return [Object] Returns the model itself
90
+ def build_from_hash(attributes)
91
+ return nil unless attributes.is_a?(Hash)
92
+ self.class.swagger_types.each_pair do |key, type|
93
+ if type =~ /^Array<(.*)>/i
94
+ # check to ensure the input is an array given that the the attribute
95
+ # is documented as an array but the input is not
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) } )
98
+ end
99
+ elsif !attributes[self.class.attribute_map[key]].nil?
100
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
101
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
102
+ end
103
+
104
+ self
105
+ end
106
+
107
+ # Returns the string representation of the object
108
+ # @return [String] String presentation of the object
109
+ def to_s
110
+ to_hash.to_s
111
+ end
112
+
113
+ # Returns the object in the form of hash
114
+ # @return [Hash] Returns the object in the form of hash
115
+ def to_hash
116
+ hash = {}
117
+ self.class.attribute_map.each_pair do |attr, param|
118
+ value = self.send(attr)
119
+ next if value.nil?
120
+ hash[param] = _to_hash(value)
121
+ end
122
+ hash
123
+ end
124
+
125
+ private
126
+
127
+ # Outputs non-array value in the form of hash
128
+ # For object, use to_hash. Otherwise, just return the value
129
+ # @param [Object] value Any valid value
130
+ # @return [Hash] Returns the value in the form of hash
131
+ def _to_hash(value)
132
+ if value.is_a?(Array)
133
+ value.compact.map{ |v| _to_hash(v) }
134
+ elsif value.is_a?(Hash)
135
+ {}.tap do |hash|
136
+ value.each { |k, v| hash[k] = _to_hash(v) }
137
+ end
138
+ elsif value.respond_to? :to_hash
139
+ value.to_hash
140
+ else
141
+ value
142
+ end
143
+ end
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
+
187
+
188
+ # Attribute mapping from ruby-style variable name to JSON key.
189
+ def self.attribute_map
190
+ {
191
+ :'compartment_id' => :'compartmentId',
192
+ :'cpe_id' => :'cpeId',
193
+ :'display_name' => :'displayName',
194
+ :'drg_id' => :'drgId',
195
+ :'static_routes' => :'staticRoutes'
196
+ }
197
+ end
198
+
199
+ # Attribute type mapping.
200
+ def self.swagger_types
201
+ {
202
+ :'compartment_id' => :'String',
203
+ :'cpe_id' => :'String',
204
+ :'display_name' => :'String',
205
+ :'drg_id' => :'String',
206
+ :'static_routes' => :'Array<String>'
207
+ }
208
+ end
209
+ end
210
+ end