oci 2.0.0

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 (217) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +82 -0
  3. data/README.md +262 -0
  4. data/lib/oci.rb +25 -0
  5. data/lib/oci/api_client.rb +389 -0
  6. data/lib/oci/config.rb +118 -0
  7. data/lib/oci/config_file_loader.rb +96 -0
  8. data/lib/oci/core/blockstorage_client.rb +462 -0
  9. data/lib/oci/core/compute_client.rb +1415 -0
  10. data/lib/oci/core/core.rb +114 -0
  11. data/lib/oci/core/models/attach_i_scsi_volume_details.rb +137 -0
  12. data/lib/oci/core/models/attach_vnic_details.rb +144 -0
  13. data/lib/oci/core/models/attach_volume_details.rb +165 -0
  14. data/lib/oci/core/models/capture_console_history_details.rb +120 -0
  15. data/lib/oci/core/models/console_history.rb +213 -0
  16. data/lib/oci/core/models/cpe.rb +169 -0
  17. data/lib/oci/core/models/create_cpe_details.rb +145 -0
  18. data/lib/oci/core/models/create_cross_connect_details.rb +204 -0
  19. data/lib/oci/core/models/create_cross_connect_group_details.rb +133 -0
  20. data/lib/oci/core/models/create_dhcp_details.rb +153 -0
  21. data/lib/oci/core/models/create_drg_attachment_details.rb +142 -0
  22. data/lib/oci/core/models/create_drg_details.rb +131 -0
  23. data/lib/oci/core/models/create_image_details.rb +159 -0
  24. data/lib/oci/core/models/create_instance_console_connection_details.rb +131 -0
  25. data/lib/oci/core/models/create_internet_gateway_details.rb +153 -0
  26. data/lib/oci/core/models/create_ip_sec_connection_details.rb +168 -0
  27. data/lib/oci/core/models/create_private_ip_details.rb +173 -0
  28. data/lib/oci/core/models/create_route_table_details.rb +153 -0
  29. data/lib/oci/core/models/create_security_list_details.rb +164 -0
  30. data/lib/oci/core/models/create_subnet_details.rb +257 -0
  31. data/lib/oci/core/models/create_vcn_details.rb +171 -0
  32. data/lib/oci/core/models/create_virtual_circuit_details.rb +260 -0
  33. data/lib/oci/core/models/create_vnic_details.rb +214 -0
  34. data/lib/oci/core/models/create_volume_backup_details.rb +133 -0
  35. data/lib/oci/core/models/create_volume_details.rb +170 -0
  36. data/lib/oci/core/models/cross_connect.rb +235 -0
  37. data/lib/oci/core/models/cross_connect_group.rb +187 -0
  38. data/lib/oci/core/models/cross_connect_location.rb +134 -0
  39. data/lib/oci/core/models/cross_connect_mapping.rb +190 -0
  40. data/lib/oci/core/models/cross_connect_port_speed_shape.rb +137 -0
  41. data/lib/oci/core/models/cross_connect_status.rb +200 -0
  42. data/lib/oci/core/models/dhcp_dns_option.rb +171 -0
  43. data/lib/oci/core/models/dhcp_option.rb +135 -0
  44. data/lib/oci/core/models/dhcp_options.rb +208 -0
  45. data/lib/oci/core/models/dhcp_search_domain_option.rb +141 -0
  46. data/lib/oci/core/models/drg.rb +186 -0
  47. data/lib/oci/core/models/drg_attachment.rb +208 -0
  48. data/lib/oci/core/models/egress_security_rule.rb +198 -0
  49. data/lib/oci/core/models/export_image_details.rb +134 -0
  50. data/lib/oci/core/models/export_image_via_object_storage_tuple_details.rb +150 -0
  51. data/lib/oci/core/models/export_image_via_object_storage_uri_details.rb +130 -0
  52. data/lib/oci/core/models/fast_connect_provider_service.rb +145 -0
  53. data/lib/oci/core/models/i_scsi_volume_attachment.rb +212 -0
  54. data/lib/oci/core/models/icmp_options.rb +131 -0
  55. data/lib/oci/core/models/image.rb +245 -0
  56. data/lib/oci/core/models/image_source_details.rb +134 -0
  57. data/lib/oci/core/models/image_source_via_object_storage_tuple_details.rb +150 -0
  58. data/lib/oci/core/models/image_source_via_object_storage_uri_details.rb +128 -0
  59. data/lib/oci/core/models/ingress_security_rule.rb +198 -0
  60. data/lib/oci/core/models/instance.rb +307 -0
  61. data/lib/oci/core/models/instance_console_connection.rb +193 -0
  62. data/lib/oci/core/models/instance_credentials.rb +131 -0
  63. data/lib/oci/core/models/internet_gateway.rb +210 -0
  64. data/lib/oci/core/models/ip_sec_connection.rb +223 -0
  65. data/lib/oci/core/models/ip_sec_connection_device_config.rb +153 -0
  66. data/lib/oci/core/models/ip_sec_connection_device_status.rb +156 -0
  67. data/lib/oci/core/models/launch_instance_details.rb +336 -0
  68. data/lib/oci/core/models/letter_of_authority.rb +194 -0
  69. data/lib/oci/core/models/port_range.rb +133 -0
  70. data/lib/oci/core/models/private_ip.rb +248 -0
  71. data/lib/oci/core/models/route_rule.rb +135 -0
  72. data/lib/oci/core/models/route_table.rb +208 -0
  73. data/lib/oci/core/models/security_list.rb +219 -0
  74. data/lib/oci/core/models/shape.rb +122 -0
  75. data/lib/oci/core/models/subnet.rb +351 -0
  76. data/lib/oci/core/models/tcp_options.rb +135 -0
  77. data/lib/oci/core/models/tunnel_config.rb +151 -0
  78. data/lib/oci/core/models/tunnel_status.rb +178 -0
  79. data/lib/oci/core/models/udp_options.rb +135 -0
  80. data/lib/oci/core/models/update_cpe_details.rb +122 -0
  81. data/lib/oci/core/models/update_cross_connect_details.rb +138 -0
  82. data/lib/oci/core/models/update_cross_connect_group_details.rb +122 -0
  83. data/lib/oci/core/models/update_dhcp_details.rb +132 -0
  84. data/lib/oci/core/models/update_drg_attachment_details.rb +122 -0
  85. data/lib/oci/core/models/update_drg_details.rb +122 -0
  86. data/lib/oci/core/models/update_image_details.rb +124 -0
  87. data/lib/oci/core/models/update_instance_details.rb +124 -0
  88. data/lib/oci/core/models/update_internet_gateway_details.rb +133 -0
  89. data/lib/oci/core/models/update_ip_sec_connection_details.rb +122 -0
  90. data/lib/oci/core/models/update_private_ip_details.rb +157 -0
  91. data/lib/oci/core/models/update_route_table_details.rb +133 -0
  92. data/lib/oci/core/models/update_security_list_details.rb +144 -0
  93. data/lib/oci/core/models/update_subnet_details.rb +122 -0
  94. data/lib/oci/core/models/update_vcn_details.rb +122 -0
  95. data/lib/oci/core/models/update_virtual_circuit_details.rb +240 -0
  96. data/lib/oci/core/models/update_vnic_details.rb +144 -0
  97. data/lib/oci/core/models/update_volume_backup_details.rb +122 -0
  98. data/lib/oci/core/models/update_volume_details.rb +122 -0
  99. data/lib/oci/core/models/vcn.rb +276 -0
  100. data/lib/oci/core/models/virtual_circuit.rb +395 -0
  101. data/lib/oci/core/models/virtual_circuit_bandwidth_shape.rb +137 -0
  102. data/lib/oci/core/models/vnic.rb +287 -0
  103. data/lib/oci/core/models/vnic_attachment.rb +250 -0
  104. data/lib/oci/core/models/volume.rb +210 -0
  105. data/lib/oci/core/models/volume_attachment.rb +246 -0
  106. data/lib/oci/core/models/volume_backup.rb +235 -0
  107. data/lib/oci/core/util.rb +1 -0
  108. data/lib/oci/core/virtual_network_client.rb +3421 -0
  109. data/lib/oci/errors.rb +78 -0
  110. data/lib/oci/global_context.rb +20 -0
  111. data/lib/oci/identity/identity.rb +55 -0
  112. data/lib/oci/identity/identity_client.rb +2148 -0
  113. data/lib/oci/identity/models/add_user_to_group_details.rb +131 -0
  114. data/lib/oci/identity/models/api_key.rb +211 -0
  115. data/lib/oci/identity/models/availability_domain.rb +131 -0
  116. data/lib/oci/identity/models/compartment.rb +211 -0
  117. data/lib/oci/identity/models/create_api_key_details.rb +120 -0
  118. data/lib/oci/identity/models/create_compartment_details.rb +145 -0
  119. data/lib/oci/identity/models/create_customer_secret_key_details.rb +121 -0
  120. data/lib/oci/identity/models/create_group_details.rb +144 -0
  121. data/lib/oci/identity/models/create_identity_provider_details.rb +215 -0
  122. data/lib/oci/identity/models/create_idp_group_mapping_details.rb +133 -0
  123. data/lib/oci/identity/models/create_policy_details.rb +173 -0
  124. data/lib/oci/identity/models/create_region_subscription_details.rb +128 -0
  125. data/lib/oci/identity/models/create_saml2_identity_provider_details.rb +154 -0
  126. data/lib/oci/identity/models/create_swift_password_details.rb +121 -0
  127. data/lib/oci/identity/models/create_user_details.rb +144 -0
  128. data/lib/oci/identity/models/customer_secret_key.rb +225 -0
  129. data/lib/oci/identity/models/customer_secret_key_summary.rb +213 -0
  130. data/lib/oci/identity/models/group.rb +211 -0
  131. data/lib/oci/identity/models/identity_provider.rb +261 -0
  132. data/lib/oci/identity/models/idp_group_mapping.rb +220 -0
  133. data/lib/oci/identity/models/policy.rb +237 -0
  134. data/lib/oci/identity/models/region.rb +143 -0
  135. data/lib/oci/identity/models/region_subscription.rb +180 -0
  136. data/lib/oci/identity/models/saml2_identity_provider.rb +180 -0
  137. data/lib/oci/identity/models/swift_password.rb +226 -0
  138. data/lib/oci/identity/models/tenancy.rb +159 -0
  139. data/lib/oci/identity/models/ui_password.rb +187 -0
  140. data/lib/oci/identity/models/update_compartment_details.rb +132 -0
  141. data/lib/oci/identity/models/update_customer_secret_key_details.rb +120 -0
  142. data/lib/oci/identity/models/update_group_details.rb +120 -0
  143. data/lib/oci/identity/models/update_identity_provider_details.rb +160 -0
  144. data/lib/oci/identity/models/update_idp_group_mapping_details.rb +131 -0
  145. data/lib/oci/identity/models/update_policy_details.rb +148 -0
  146. data/lib/oci/identity/models/update_saml2_identity_provider_details.rb +145 -0
  147. data/lib/oci/identity/models/update_state_details.rb +121 -0
  148. data/lib/oci/identity/models/update_swift_password_details.rb +120 -0
  149. data/lib/oci/identity/models/update_user_details.rb +120 -0
  150. data/lib/oci/identity/models/user.rb +217 -0
  151. data/lib/oci/identity/models/user_group_membership.rb +209 -0
  152. data/lib/oci/identity/util.rb +1 -0
  153. data/lib/oci/internal/internal.rb +10 -0
  154. data/lib/oci/internal/util.rb +69 -0
  155. data/lib/oci/load_balancer/load_balancer.rb +51 -0
  156. data/lib/oci/load_balancer/load_balancer_client.rb +1449 -0
  157. data/lib/oci/load_balancer/models/backend.rb +220 -0
  158. data/lib/oci/load_balancer/models/backend_details.rb +206 -0
  159. data/lib/oci/load_balancer/models/backend_health.rb +158 -0
  160. data/lib/oci/load_balancer/models/backend_set.rb +182 -0
  161. data/lib/oci/load_balancer/models/backend_set_details.rb +165 -0
  162. data/lib/oci/load_balancer/models/backend_set_health.rb +207 -0
  163. data/lib/oci/load_balancer/models/certificate.rb +169 -0
  164. data/lib/oci/load_balancer/models/certificate_details.rb +205 -0
  165. data/lib/oci/load_balancer/models/create_backend_details.rb +206 -0
  166. data/lib/oci/load_balancer/models/create_backend_set_details.rb +181 -0
  167. data/lib/oci/load_balancer/models/create_certificate_details.rb +205 -0
  168. data/lib/oci/load_balancer/models/create_listener_details.rb +175 -0
  169. data/lib/oci/load_balancer/models/create_load_balancer_details.rb +220 -0
  170. data/lib/oci/load_balancer/models/health_check_result.rb +183 -0
  171. data/lib/oci/load_balancer/models/health_checker.rb +224 -0
  172. data/lib/oci/load_balancer/models/health_checker_details.rb +223 -0
  173. data/lib/oci/load_balancer/models/ip_address.rb +139 -0
  174. data/lib/oci/load_balancer/models/listener.rb +174 -0
  175. data/lib/oci/load_balancer/models/listener_details.rb +160 -0
  176. data/lib/oci/load_balancer/models/load_balancer.rb +280 -0
  177. data/lib/oci/load_balancer/models/load_balancer_health.rb +215 -0
  178. data/lib/oci/load_balancer/models/load_balancer_health_summary.rb +168 -0
  179. data/lib/oci/load_balancer/models/load_balancer_policy.rb +120 -0
  180. data/lib/oci/load_balancer/models/load_balancer_protocol.rb +120 -0
  181. data/lib/oci/load_balancer/models/load_balancer_shape.rb +120 -0
  182. data/lib/oci/load_balancer/models/session_persistence_configuration_details.rb +141 -0
  183. data/lib/oci/load_balancer/models/ssl_configuration.rb +155 -0
  184. data/lib/oci/load_balancer/models/ssl_configuration_details.rb +155 -0
  185. data/lib/oci/load_balancer/models/update_backend_details.rb +178 -0
  186. data/lib/oci/load_balancer/models/update_backend_set_details.rb +165 -0
  187. data/lib/oci/load_balancer/models/update_health_checker_details.rb +222 -0
  188. data/lib/oci/load_balancer/models/update_listener_details.rb +160 -0
  189. data/lib/oci/load_balancer/models/update_load_balancer_details.rb +124 -0
  190. data/lib/oci/load_balancer/models/work_request.rb +229 -0
  191. data/lib/oci/load_balancer/models/work_request_error.rb +145 -0
  192. data/lib/oci/load_balancer/util.rb +58 -0
  193. data/lib/oci/object_storage/models/bucket.rb +216 -0
  194. data/lib/oci/object_storage/models/bucket_summary.rb +175 -0
  195. data/lib/oci/object_storage/models/commit_multipart_upload_details.rb +133 -0
  196. data/lib/oci/object_storage/models/commit_multipart_upload_part_details.rb +131 -0
  197. data/lib/oci/object_storage/models/create_bucket_details.rb +173 -0
  198. data/lib/oci/object_storage/models/create_multipart_upload_details.rb +166 -0
  199. data/lib/oci/object_storage/models/create_preauthenticated_request_details.rb +171 -0
  200. data/lib/oci/object_storage/models/list_objects.rb +146 -0
  201. data/lib/oci/object_storage/models/multipart_upload.rb +164 -0
  202. data/lib/oci/object_storage/models/multipart_upload_part_summary.rb +153 -0
  203. data/lib/oci/object_storage/models/object_summary.rb +153 -0
  204. data/lib/oci/object_storage/models/preauthenticated_request.rb +207 -0
  205. data/lib/oci/object_storage/models/preauthenticated_request_summary.rb +196 -0
  206. data/lib/oci/object_storage/models/update_bucket_details.rb +171 -0
  207. data/lib/oci/object_storage/object_storage.rb +30 -0
  208. data/lib/oci/object_storage/object_storage_client.rb +1185 -0
  209. data/lib/oci/object_storage/util.rb +1 -0
  210. data/lib/oci/regions.rb +43 -0
  211. data/lib/oci/response.rb +80 -0
  212. data/lib/oci/response_headers.rb +144 -0
  213. data/lib/oci/signer.rb +157 -0
  214. data/lib/oci/version.rb +5 -0
  215. data/lib/oci/waiter.rb +101 -0
  216. data/lib/oraclebmc.rb +3 -0
  217. metadata +375 -0
@@ -0,0 +1,122 @@
1
+ # Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+
5
+ module OCI
6
+ class Core::Models::UpdateVolumeDetails
7
+ # A user-friendly name. Does not have to be unique, and it's changeable.
8
+ # Avoid entering confidential information.
9
+ #
10
+ # @return [String]
11
+ attr_accessor :display_name
12
+
13
+
14
+ # Initializes the object
15
+ # @param [Hash] attributes Model attributes in the form of hash
16
+ def initialize(attributes = {})
17
+ return unless attributes.is_a?(Hash)
18
+
19
+ # convert string to symbol for hash key
20
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
21
+
22
+ if attributes[:'displayName']
23
+ self.display_name = attributes[:'displayName']
24
+ end
25
+
26
+ end
27
+
28
+ # Checks equality by comparing each attribute.
29
+ # @param [Object] other_object to be compared
30
+ def ==(other_object)
31
+ return true if self.equal?(other_object)
32
+ self.class == other_object.class &&
33
+ display_name == other_object.display_name
34
+ end
35
+
36
+ # @see the `==` method
37
+ # @param [Object] other_object to be compared
38
+ def eql?(other_object)
39
+ self == other_object
40
+ end
41
+
42
+ # Calculates hash code according to all attributes.
43
+ # @return [Fixnum] Hash code
44
+ def hash
45
+ [display_name].hash
46
+ end
47
+
48
+ # Builds the object from hash
49
+ # @param [Hash] attributes Model attributes in the form of hash
50
+ # @return [Object] Returns the model itself
51
+ def build_from_hash(attributes)
52
+ return nil unless attributes.is_a?(Hash)
53
+ self.class.swagger_types.each_pair do |key, type|
54
+ if type =~ /^Array<(.*)>/i
55
+ # check to ensure the input is an array given that the the attribute
56
+ # is documented as an array but the input is not
57
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
58
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OCI::Internal::Util.convert_to_type($1, v) } )
59
+ end
60
+ elsif !attributes[self.class.attribute_map[key]].nil?
61
+ self.send("#{key}=", OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
62
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
63
+ end
64
+
65
+ self
66
+ end
67
+
68
+ # Returns the string representation of the object
69
+ # @return [String] String presentation of the object
70
+ def to_s
71
+ to_hash.to_s
72
+ end
73
+
74
+ # Returns the object in the form of hash
75
+ # @return [Hash] Returns the object in the form of hash
76
+ def to_hash
77
+ hash = {}
78
+ self.class.attribute_map.each_pair do |attr, param|
79
+ value = self.send(attr)
80
+ next if value.nil?
81
+ hash[param] = _to_hash(value)
82
+ end
83
+ hash
84
+ end
85
+
86
+ private
87
+
88
+ # Outputs non-array value in the form of hash
89
+ # For object, use to_hash. Otherwise, just return the value
90
+ # @param [Object] value Any valid value
91
+ # @return [Hash] Returns the value in the form of hash
92
+ def _to_hash(value)
93
+ if value.is_a?(Array)
94
+ value.compact.map{ |v| _to_hash(v) }
95
+ elsif value.is_a?(Hash)
96
+ {}.tap do |hash|
97
+ value.each { |k, v| hash[k] = _to_hash(v) }
98
+ end
99
+ elsif value.respond_to? :to_hash
100
+ value.to_hash
101
+ else
102
+ value
103
+ end
104
+ end
105
+
106
+
107
+
108
+ # Attribute mapping from ruby-style variable name to JSON key.
109
+ def self.attribute_map
110
+ {
111
+ :'display_name' => :'displayName'
112
+ }
113
+ end
114
+
115
+ # Attribute type mapping.
116
+ def self.swagger_types
117
+ {
118
+ :'display_name' => :'String'
119
+ }
120
+ end
121
+ end
122
+ end
@@ -0,0 +1,276 @@
1
+ # Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+
5
+ module OCI
6
+ class Core::Models::Vcn
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
+ LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE']
13
+
14
+ # The CIDR IP address block of the VCN.
15
+ #
16
+ # Example: `172.16.0.0/16`
17
+ #
18
+ # @return [String]
19
+ attr_accessor :cidr_block
20
+
21
+ # The OCID of the compartment containing the VCN.
22
+ # @return [String]
23
+ attr_accessor :compartment_id
24
+
25
+ # The OCID for the VCN's default set of DHCP options.
26
+ #
27
+ # @return [String]
28
+ attr_accessor :default_dhcp_options_id
29
+
30
+ # The OCID for the VCN's default route table.
31
+ # @return [String]
32
+ attr_accessor :default_route_table_id
33
+
34
+ # The OCID for the VCN's default security list.
35
+ # @return [String]
36
+ attr_accessor :default_security_list_id
37
+
38
+ # A user-friendly name. Does not have to be unique, and it's changeable.
39
+ # Avoid entering confidential information.
40
+ #
41
+ # @return [String]
42
+ attr_accessor :display_name
43
+
44
+ # A DNS label for the VCN, used in conjunction with the VNIC's hostname and
45
+ # subnet's DNS label to form a fully qualified domain name (FQDN) for each VNIC
46
+ # within this subnet (for example, `bminstance-1.subnet123.vcn1.oraclevcn.com`).
47
+ # Must be an alphanumeric string that begins with a letter.
48
+ # The value cannot be changed.
49
+ #
50
+ # The absence of this parameter means the Internet and VCN Resolver will
51
+ # not work for this VCN.
52
+ #
53
+ # For more information, see
54
+ # [DNS in Your Virtual Cloud Network](https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/dns.htm).
55
+ #
56
+ # Example: `vcn1`
57
+ #
58
+ # @return [String]
59
+ attr_accessor :dns_label
60
+
61
+ # The VCN's Oracle ID (OCID).
62
+ # @return [String]
63
+ attr_accessor :id
64
+
65
+ # The VCN's current state.
66
+ # @return [String]
67
+ attr_accessor :lifecycle_state
68
+
69
+ # The date and time the VCN was created, in the format defined by RFC3339.
70
+ #
71
+ # Example: `2016-08-25T21:10:29.600Z`
72
+ #
73
+ # @return [DateTime]
74
+ attr_accessor :time_created
75
+
76
+ # The VCN's domain name, which consists of the VCN's DNS label, and the
77
+ # `oraclevcn.com` domain.
78
+ #
79
+ # For more information, see
80
+ # [DNS in Your Virtual Cloud Network](https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/dns.htm).
81
+ #
82
+ # Example: `vcn1.oraclevcn.com`
83
+ #
84
+ # @return [String]
85
+ attr_accessor :vcn_domain_name
86
+
87
+
88
+ # Initializes the object
89
+ # @param [Hash] attributes Model attributes in the form of hash
90
+ def initialize(attributes = {})
91
+ return unless attributes.is_a?(Hash)
92
+
93
+ # convert string to symbol for hash key
94
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
95
+
96
+ if attributes[:'cidrBlock']
97
+ self.cidr_block = attributes[:'cidrBlock']
98
+ end
99
+
100
+ if attributes[:'compartmentId']
101
+ self.compartment_id = attributes[:'compartmentId']
102
+ end
103
+
104
+ if attributes[:'defaultDhcpOptionsId']
105
+ self.default_dhcp_options_id = attributes[:'defaultDhcpOptionsId']
106
+ end
107
+
108
+ if attributes[:'defaultRouteTableId']
109
+ self.default_route_table_id = attributes[:'defaultRouteTableId']
110
+ end
111
+
112
+ if attributes[:'defaultSecurityListId']
113
+ self.default_security_list_id = attributes[:'defaultSecurityListId']
114
+ end
115
+
116
+ if attributes[:'displayName']
117
+ self.display_name = attributes[:'displayName']
118
+ end
119
+
120
+ if attributes[:'dnsLabel']
121
+ self.dns_label = attributes[:'dnsLabel']
122
+ end
123
+
124
+ if attributes[:'id']
125
+ self.id = attributes[:'id']
126
+ end
127
+
128
+ if attributes[:'lifecycleState']
129
+ self.lifecycle_state = attributes[:'lifecycleState']
130
+ end
131
+
132
+ if attributes[:'timeCreated']
133
+ self.time_created = attributes[:'timeCreated']
134
+ end
135
+
136
+ if attributes[:'vcnDomainName']
137
+ self.vcn_domain_name = attributes[:'vcnDomainName']
138
+ end
139
+
140
+ end
141
+
142
+ # Custom attribute writer method checking allowed values (enum).
143
+ # @param [Object] lifecycle_state Object to be assigned
144
+ def lifecycle_state=(lifecycle_state)
145
+ if lifecycle_state && !LIFECYCLE_STATE_ENUM.include?(lifecycle_state)
146
+ @lifecycle_state = LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE
147
+ else
148
+ @lifecycle_state = lifecycle_state
149
+ end
150
+ end
151
+
152
+ # Checks equality by comparing each attribute.
153
+ # @param [Object] other_object to be compared
154
+ def ==(other_object)
155
+ return true if self.equal?(other_object)
156
+ self.class == other_object.class &&
157
+ cidr_block == other_object.cidr_block &&
158
+ compartment_id == other_object.compartment_id &&
159
+ default_dhcp_options_id == other_object.default_dhcp_options_id &&
160
+ default_route_table_id == other_object.default_route_table_id &&
161
+ default_security_list_id == other_object.default_security_list_id &&
162
+ display_name == other_object.display_name &&
163
+ dns_label == other_object.dns_label &&
164
+ id == other_object.id &&
165
+ lifecycle_state == other_object.lifecycle_state &&
166
+ time_created == other_object.time_created &&
167
+ vcn_domain_name == other_object.vcn_domain_name
168
+ end
169
+
170
+ # @see the `==` method
171
+ # @param [Object] other_object to be compared
172
+ def eql?(other_object)
173
+ self == other_object
174
+ end
175
+
176
+ # Calculates hash code according to all attributes.
177
+ # @return [Fixnum] Hash code
178
+ def hash
179
+ [cidr_block, compartment_id, default_dhcp_options_id, default_route_table_id, default_security_list_id, display_name, dns_label, id, lifecycle_state, time_created, vcn_domain_name].hash
180
+ end
181
+
182
+ # Builds the object from hash
183
+ # @param [Hash] attributes Model attributes in the form of hash
184
+ # @return [Object] Returns the model itself
185
+ def build_from_hash(attributes)
186
+ return nil unless attributes.is_a?(Hash)
187
+ self.class.swagger_types.each_pair do |key, type|
188
+ if type =~ /^Array<(.*)>/i
189
+ # check to ensure the input is an array given that the the attribute
190
+ # is documented as an array but the input is not
191
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
192
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OCI::Internal::Util.convert_to_type($1, v) } )
193
+ end
194
+ elsif !attributes[self.class.attribute_map[key]].nil?
195
+ self.send("#{key}=", OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
196
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
197
+ end
198
+
199
+ self
200
+ end
201
+
202
+ # Returns the string representation of the object
203
+ # @return [String] String presentation of the object
204
+ def to_s
205
+ to_hash.to_s
206
+ end
207
+
208
+ # Returns the object in the form of hash
209
+ # @return [Hash] Returns the object in the form of hash
210
+ def to_hash
211
+ hash = {}
212
+ self.class.attribute_map.each_pair do |attr, param|
213
+ value = self.send(attr)
214
+ next if value.nil?
215
+ hash[param] = _to_hash(value)
216
+ end
217
+ hash
218
+ end
219
+
220
+ private
221
+
222
+ # Outputs non-array value in the form of hash
223
+ # For object, use to_hash. Otherwise, just return the value
224
+ # @param [Object] value Any valid value
225
+ # @return [Hash] Returns the value in the form of hash
226
+ def _to_hash(value)
227
+ if value.is_a?(Array)
228
+ value.compact.map{ |v| _to_hash(v) }
229
+ elsif value.is_a?(Hash)
230
+ {}.tap do |hash|
231
+ value.each { |k, v| hash[k] = _to_hash(v) }
232
+ end
233
+ elsif value.respond_to? :to_hash
234
+ value.to_hash
235
+ else
236
+ value
237
+ end
238
+ end
239
+
240
+
241
+
242
+ # Attribute mapping from ruby-style variable name to JSON key.
243
+ def self.attribute_map
244
+ {
245
+ :'cidr_block' => :'cidrBlock',
246
+ :'compartment_id' => :'compartmentId',
247
+ :'default_dhcp_options_id' => :'defaultDhcpOptionsId',
248
+ :'default_route_table_id' => :'defaultRouteTableId',
249
+ :'default_security_list_id' => :'defaultSecurityListId',
250
+ :'display_name' => :'displayName',
251
+ :'dns_label' => :'dnsLabel',
252
+ :'id' => :'id',
253
+ :'lifecycle_state' => :'lifecycleState',
254
+ :'time_created' => :'timeCreated',
255
+ :'vcn_domain_name' => :'vcnDomainName'
256
+ }
257
+ end
258
+
259
+ # Attribute type mapping.
260
+ def self.swagger_types
261
+ {
262
+ :'cidr_block' => :'String',
263
+ :'compartment_id' => :'String',
264
+ :'default_dhcp_options_id' => :'String',
265
+ :'default_route_table_id' => :'String',
266
+ :'default_security_list_id' => :'String',
267
+ :'display_name' => :'String',
268
+ :'dns_label' => :'String',
269
+ :'id' => :'String',
270
+ :'lifecycle_state' => :'String',
271
+ :'time_created' => :'DateTime',
272
+ :'vcn_domain_name' => :'String'
273
+ }
274
+ end
275
+ end
276
+ end
@@ -0,0 +1,395 @@
1
+ # Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+
5
+ module OCI
6
+ class Core::Models::VirtualCircuit
7
+
8
+ BGP_SESSION_STATE_ENUM = [BGP_SESSION_STATE_UP = 'UP',
9
+ BGP_SESSION_STATE_DOWN = 'DOWN',
10
+ BGP_SESSION_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE']
11
+
12
+
13
+ LIFECYCLE_STATE_ENUM = [LIFECYCLE_STATE_PENDING_PROVIDER = 'PENDING_PROVIDER',
14
+ LIFECYCLE_STATE_VERIFYING = 'VERIFYING',
15
+ LIFECYCLE_STATE_PROVISIONING = 'PROVISIONING',
16
+ LIFECYCLE_STATE_PROVISIONED = 'PROVISIONED',
17
+ LIFECYCLE_STATE_FAILED = 'FAILED',
18
+ LIFECYCLE_STATE_INACTIVE = 'INACTIVE',
19
+ LIFECYCLE_STATE_TERMINATING = 'TERMINATING',
20
+ LIFECYCLE_STATE_TERMINATED = 'TERMINATED',
21
+ LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE']
22
+
23
+
24
+ PROVIDER_STATE_ENUM = [PROVIDER_STATE_ACTIVE = 'ACTIVE',
25
+ PROVIDER_STATE_INACTIVE = 'INACTIVE',
26
+ PROVIDER_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE']
27
+
28
+
29
+ TYPE_ENUM = [TYPE_PUBLIC = 'PUBLIC',
30
+ TYPE_PRIVATE = 'PRIVATE',
31
+ TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE']
32
+
33
+ # The provisioned data rate of the connection.
34
+ # @return [String]
35
+ attr_accessor :bandwidth_shape_name
36
+
37
+ # The state of the BGP session associated with the virtual circuit.
38
+ # @return [String]
39
+ attr_accessor :bgp_session_state
40
+
41
+ # The OCID of the compartment containing the virtual circuit.
42
+ # @return [String]
43
+ attr_accessor :compartment_id
44
+
45
+ # An array of mappings, each containing properties for a
46
+ # cross-connect or cross-connect group that is associated with this
47
+ # virtual circuit.
48
+ #
49
+ # @return [Array<OCI::Core::Models::CrossConnectMapping>]
50
+ attr_accessor :cross_connect_mappings
51
+
52
+ # The BGP ASN of the network at the other end of the BGP
53
+ # session from Oracle. If the session is between the customer's
54
+ # edge router and Oracle, the value is the customer's ASN. If the BGP
55
+ # session is between the provider's edge router and Oracle, the value
56
+ # is the provider's ASN.
57
+ #
58
+ # @return [Integer]
59
+ attr_accessor :customer_bgp_asn
60
+
61
+ # A user-friendly name. Does not have to be unique, and it's changeable.
62
+ # Avoid entering confidential information.
63
+ #
64
+ # @return [String]
65
+ attr_accessor :display_name
66
+
67
+ # The OCID of the customer's {Drg}
68
+ # that this virtual circuit uses.
69
+ #
70
+ # @return [String]
71
+ attr_accessor :gateway_id
72
+
73
+ # The virtual circuit's Oracle ID (OCID).
74
+ # @return [String]
75
+ attr_accessor :id
76
+
77
+ # The virtual circuit's current state. For information about
78
+ # the different states, see
79
+ # [FastConnect Overview](https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Concepts/fastconnect.htm).
80
+ #
81
+ # @return [String]
82
+ attr_accessor :lifecycle_state
83
+
84
+ # The Oracle BGP ASN.
85
+ # @return [Integer]
86
+ attr_accessor :oracle_bgp_asn
87
+
88
+ # The name of the provider (if the customer is connecting via a provider).
89
+ #
90
+ # @return [String]
91
+ attr_accessor :provider_name
92
+
93
+ # The name of the service offered by the provider (if the customer is connecting via a provider).
94
+ #
95
+ # @return [String]
96
+ attr_accessor :provider_service_name
97
+
98
+ # The provider's state in relation to this virtual circuit (if the
99
+ # customer is connecting via a provider). ACTIVE means
100
+ # the provider has provisioned the virtual circuit from their end.
101
+ # INACTIVE means the provider has not yet provisioned the virtual
102
+ # circuit, or has de-provisioned it.
103
+ #
104
+ # @return [String]
105
+ attr_accessor :provider_state
106
+
107
+ # Provider-supplied reference information about this virtual circuit
108
+ # (if the customer is connecting via a provider).
109
+ #
110
+ # @return [String]
111
+ attr_accessor :reference_comment
112
+
113
+ # The Oracle Bare Metal Cloud Services region where this virtual
114
+ # circuit is located.
115
+ #
116
+ # @return [String]
117
+ attr_accessor :region
118
+
119
+ # The date and time the virtual circuit was created,
120
+ # in the format defined by RFC3339.
121
+ #
122
+ # Example: `2016-08-25T21:10:29.600Z`
123
+ #
124
+ # @return [DateTime]
125
+ attr_accessor :time_created
126
+
127
+ # The type of IP addresses used in this virtual circuit. PRIVATE means
128
+ # [RFC 1918](https://tools.ietf.org/html/rfc1918) addresses
129
+ # (10.0.0.0/8, 172.16/12, and 192.168/16). Only PRIVATE is supported.
130
+ #
131
+ # @return [String]
132
+ attr_accessor :type
133
+
134
+
135
+ # Initializes the object
136
+ # @param [Hash] attributes Model attributes in the form of hash
137
+ def initialize(attributes = {})
138
+ return unless attributes.is_a?(Hash)
139
+
140
+ # convert string to symbol for hash key
141
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
142
+
143
+ if attributes[:'bandwidthShapeName']
144
+ self.bandwidth_shape_name = attributes[:'bandwidthShapeName']
145
+ end
146
+
147
+ if attributes[:'bgpSessionState']
148
+ self.bgp_session_state = attributes[:'bgpSessionState']
149
+ end
150
+
151
+ if attributes[:'compartmentId']
152
+ self.compartment_id = attributes[:'compartmentId']
153
+ end
154
+
155
+ if attributes[:'crossConnectMappings']
156
+ self.cross_connect_mappings = attributes[:'crossConnectMappings']
157
+ end
158
+
159
+ if attributes[:'customerBgpAsn']
160
+ self.customer_bgp_asn = attributes[:'customerBgpAsn']
161
+ end
162
+
163
+ if attributes[:'displayName']
164
+ self.display_name = attributes[:'displayName']
165
+ end
166
+
167
+ if attributes[:'gatewayId']
168
+ self.gateway_id = attributes[:'gatewayId']
169
+ end
170
+
171
+ if attributes[:'id']
172
+ self.id = attributes[:'id']
173
+ end
174
+
175
+ if attributes[:'lifecycleState']
176
+ self.lifecycle_state = attributes[:'lifecycleState']
177
+ end
178
+
179
+ if attributes[:'oracleBgpAsn']
180
+ self.oracle_bgp_asn = attributes[:'oracleBgpAsn']
181
+ end
182
+
183
+ if attributes[:'providerName']
184
+ self.provider_name = attributes[:'providerName']
185
+ end
186
+
187
+ if attributes[:'providerServiceName']
188
+ self.provider_service_name = attributes[:'providerServiceName']
189
+ end
190
+
191
+ if attributes[:'providerState']
192
+ self.provider_state = attributes[:'providerState']
193
+ end
194
+
195
+ if attributes[:'referenceComment']
196
+ self.reference_comment = attributes[:'referenceComment']
197
+ end
198
+
199
+ if attributes[:'region']
200
+ self.region = attributes[:'region']
201
+ end
202
+
203
+ if attributes[:'timeCreated']
204
+ self.time_created = attributes[:'timeCreated']
205
+ end
206
+
207
+ if attributes[:'type']
208
+ self.type = attributes[:'type']
209
+ end
210
+
211
+ end
212
+
213
+ # Custom attribute writer method checking allowed values (enum).
214
+ # @param [Object] bgp_session_state Object to be assigned
215
+ def bgp_session_state=(bgp_session_state)
216
+ if bgp_session_state && !BGP_SESSION_STATE_ENUM.include?(bgp_session_state)
217
+ @bgp_session_state = BGP_SESSION_STATE_UNKNOWN_ENUM_VALUE
218
+ else
219
+ @bgp_session_state = bgp_session_state
220
+ end
221
+ end
222
+
223
+ # Custom attribute writer method checking allowed values (enum).
224
+ # @param [Object] lifecycle_state Object to be assigned
225
+ def lifecycle_state=(lifecycle_state)
226
+ if lifecycle_state && !LIFECYCLE_STATE_ENUM.include?(lifecycle_state)
227
+ @lifecycle_state = LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE
228
+ else
229
+ @lifecycle_state = lifecycle_state
230
+ end
231
+ end
232
+
233
+ # Custom attribute writer method checking allowed values (enum).
234
+ # @param [Object] provider_state Object to be assigned
235
+ def provider_state=(provider_state)
236
+ if provider_state && !PROVIDER_STATE_ENUM.include?(provider_state)
237
+ @provider_state = PROVIDER_STATE_UNKNOWN_ENUM_VALUE
238
+ else
239
+ @provider_state = provider_state
240
+ end
241
+ end
242
+
243
+ # Custom attribute writer method checking allowed values (enum).
244
+ # @param [Object] type Object to be assigned
245
+ def type=(type)
246
+ if type && !TYPE_ENUM.include?(type)
247
+ @type = TYPE_UNKNOWN_ENUM_VALUE
248
+ else
249
+ @type = type
250
+ end
251
+ end
252
+
253
+ # Checks equality by comparing each attribute.
254
+ # @param [Object] other_object to be compared
255
+ def ==(other_object)
256
+ return true if self.equal?(other_object)
257
+ self.class == other_object.class &&
258
+ bandwidth_shape_name == other_object.bandwidth_shape_name &&
259
+ bgp_session_state == other_object.bgp_session_state &&
260
+ compartment_id == other_object.compartment_id &&
261
+ cross_connect_mappings == other_object.cross_connect_mappings &&
262
+ customer_bgp_asn == other_object.customer_bgp_asn &&
263
+ display_name == other_object.display_name &&
264
+ gateway_id == other_object.gateway_id &&
265
+ id == other_object.id &&
266
+ lifecycle_state == other_object.lifecycle_state &&
267
+ oracle_bgp_asn == other_object.oracle_bgp_asn &&
268
+ provider_name == other_object.provider_name &&
269
+ provider_service_name == other_object.provider_service_name &&
270
+ provider_state == other_object.provider_state &&
271
+ reference_comment == other_object.reference_comment &&
272
+ region == other_object.region &&
273
+ time_created == other_object.time_created &&
274
+ type == other_object.type
275
+ end
276
+
277
+ # @see the `==` method
278
+ # @param [Object] other_object to be compared
279
+ def eql?(other_object)
280
+ self == other_object
281
+ end
282
+
283
+ # Calculates hash code according to all attributes.
284
+ # @return [Fixnum] Hash code
285
+ def hash
286
+ [bandwidth_shape_name, bgp_session_state, compartment_id, cross_connect_mappings, customer_bgp_asn, display_name, gateway_id, id, lifecycle_state, oracle_bgp_asn, provider_name, provider_service_name, provider_state, reference_comment, region, time_created, type].hash
287
+ end
288
+
289
+ # Builds the object from hash
290
+ # @param [Hash] attributes Model attributes in the form of hash
291
+ # @return [Object] Returns the model itself
292
+ def build_from_hash(attributes)
293
+ return nil unless attributes.is_a?(Hash)
294
+ self.class.swagger_types.each_pair do |key, type|
295
+ if type =~ /^Array<(.*)>/i
296
+ # check to ensure the input is an array given that the the attribute
297
+ # is documented as an array but the input is not
298
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
299
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OCI::Internal::Util.convert_to_type($1, v) } )
300
+ end
301
+ elsif !attributes[self.class.attribute_map[key]].nil?
302
+ self.send("#{key}=", OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
303
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
304
+ end
305
+
306
+ self
307
+ end
308
+
309
+ # Returns the string representation of the object
310
+ # @return [String] String presentation of the object
311
+ def to_s
312
+ to_hash.to_s
313
+ end
314
+
315
+ # Returns the object in the form of hash
316
+ # @return [Hash] Returns the object in the form of hash
317
+ def to_hash
318
+ hash = {}
319
+ self.class.attribute_map.each_pair do |attr, param|
320
+ value = self.send(attr)
321
+ next if value.nil?
322
+ hash[param] = _to_hash(value)
323
+ end
324
+ hash
325
+ end
326
+
327
+ private
328
+
329
+ # Outputs non-array value in the form of hash
330
+ # For object, use to_hash. Otherwise, just return the value
331
+ # @param [Object] value Any valid value
332
+ # @return [Hash] Returns the value in the form of hash
333
+ def _to_hash(value)
334
+ if value.is_a?(Array)
335
+ value.compact.map{ |v| _to_hash(v) }
336
+ elsif value.is_a?(Hash)
337
+ {}.tap do |hash|
338
+ value.each { |k, v| hash[k] = _to_hash(v) }
339
+ end
340
+ elsif value.respond_to? :to_hash
341
+ value.to_hash
342
+ else
343
+ value
344
+ end
345
+ end
346
+
347
+
348
+
349
+ # Attribute mapping from ruby-style variable name to JSON key.
350
+ def self.attribute_map
351
+ {
352
+ :'bandwidth_shape_name' => :'bandwidthShapeName',
353
+ :'bgp_session_state' => :'bgpSessionState',
354
+ :'compartment_id' => :'compartmentId',
355
+ :'cross_connect_mappings' => :'crossConnectMappings',
356
+ :'customer_bgp_asn' => :'customerBgpAsn',
357
+ :'display_name' => :'displayName',
358
+ :'gateway_id' => :'gatewayId',
359
+ :'id' => :'id',
360
+ :'lifecycle_state' => :'lifecycleState',
361
+ :'oracle_bgp_asn' => :'oracleBgpAsn',
362
+ :'provider_name' => :'providerName',
363
+ :'provider_service_name' => :'providerServiceName',
364
+ :'provider_state' => :'providerState',
365
+ :'reference_comment' => :'referenceComment',
366
+ :'region' => :'region',
367
+ :'time_created' => :'timeCreated',
368
+ :'type' => :'type'
369
+ }
370
+ end
371
+
372
+ # Attribute type mapping.
373
+ def self.swagger_types
374
+ {
375
+ :'bandwidth_shape_name' => :'String',
376
+ :'bgp_session_state' => :'String',
377
+ :'compartment_id' => :'String',
378
+ :'cross_connect_mappings' => :'Array<OCI::Core::Models::CrossConnectMapping>',
379
+ :'customer_bgp_asn' => :'Integer',
380
+ :'display_name' => :'String',
381
+ :'gateway_id' => :'String',
382
+ :'id' => :'String',
383
+ :'lifecycle_state' => :'String',
384
+ :'oracle_bgp_asn' => :'Integer',
385
+ :'provider_name' => :'String',
386
+ :'provider_service_name' => :'String',
387
+ :'provider_state' => :'String',
388
+ :'reference_comment' => :'String',
389
+ :'region' => :'String',
390
+ :'time_created' => :'DateTime',
391
+ :'type' => :'String'
392
+ }
393
+ end
394
+ end
395
+ end