oci 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
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,121 @@
1
+ # Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+
5
+ module OCI
6
+ class Identity::Models::CreateCustomerSecretKeyDetails
7
+ # The name you assign to the secret key during creation. Does not have to be unique, and it's changeable.
8
+ #
9
+ # @return [String]
10
+ attr_accessor :display_name
11
+
12
+
13
+ # Initializes the object
14
+ # @param [Hash] attributes Model attributes in the form of hash
15
+ def initialize(attributes = {})
16
+ return unless attributes.is_a?(Hash)
17
+
18
+ # convert string to symbol for hash key
19
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
20
+
21
+ if attributes[:'displayName']
22
+ self.display_name = attributes[:'displayName']
23
+ end
24
+
25
+ end
26
+
27
+ # Checks equality by comparing each attribute.
28
+ # @param [Object] other_object to be compared
29
+ def ==(other_object)
30
+ return true if self.equal?(other_object)
31
+ self.class == other_object.class &&
32
+ display_name == other_object.display_name
33
+ end
34
+
35
+ # @see the `==` method
36
+ # @param [Object] other_object to be compared
37
+ def eql?(other_object)
38
+ self == other_object
39
+ end
40
+
41
+ # Calculates hash code according to all attributes.
42
+ # @return [Fixnum] Hash code
43
+ def hash
44
+ [display_name].hash
45
+ end
46
+
47
+ # Builds the object from hash
48
+ # @param [Hash] attributes Model attributes in the form of hash
49
+ # @return [Object] Returns the model itself
50
+ def build_from_hash(attributes)
51
+ return nil unless attributes.is_a?(Hash)
52
+ self.class.swagger_types.each_pair do |key, type|
53
+ if type =~ /^Array<(.*)>/i
54
+ # check to ensure the input is an array given that the the attribute
55
+ # is documented as an array but the input is not
56
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
57
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OCI::Internal::Util.convert_to_type($1, v) } )
58
+ end
59
+ elsif !attributes[self.class.attribute_map[key]].nil?
60
+ self.send("#{key}=", OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
61
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
62
+ end
63
+
64
+ self
65
+ end
66
+
67
+ # Returns the string representation of the object
68
+ # @return [String] String presentation of the object
69
+ def to_s
70
+ to_hash.to_s
71
+ end
72
+
73
+ # Returns the object in the form of hash
74
+ # @return [Hash] Returns the object in the form of hash
75
+ def to_hash
76
+ hash = {}
77
+ self.class.attribute_map.each_pair do |attr, param|
78
+ value = self.send(attr)
79
+ next if value.nil?
80
+ hash[param] = _to_hash(value)
81
+ end
82
+ hash
83
+ end
84
+
85
+ private
86
+
87
+ # Outputs non-array value in the form of hash
88
+ # For object, use to_hash. Otherwise, just return the value
89
+ # @param [Object] value Any valid value
90
+ # @return [Hash] Returns the value in the form of hash
91
+ def _to_hash(value)
92
+ if value.is_a?(Array)
93
+ value.compact.map{ |v| _to_hash(v) }
94
+ elsif value.is_a?(Hash)
95
+ {}.tap do |hash|
96
+ value.each { |k, v| hash[k] = _to_hash(v) }
97
+ end
98
+ elsif value.respond_to? :to_hash
99
+ value.to_hash
100
+ else
101
+ value
102
+ end
103
+ end
104
+
105
+
106
+
107
+ # Attribute mapping from ruby-style variable name to JSON key.
108
+ def self.attribute_map
109
+ {
110
+ :'display_name' => :'displayName'
111
+ }
112
+ end
113
+
114
+ # Attribute type mapping.
115
+ def self.swagger_types
116
+ {
117
+ :'display_name' => :'String'
118
+ }
119
+ end
120
+ end
121
+ end
@@ -0,0 +1,144 @@
1
+ # Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+
5
+ module OCI
6
+ class Identity::Models::CreateGroupDetails
7
+ # The OCID of the tenancy containing the group.
8
+ # @return [String]
9
+ attr_accessor :compartment_id
10
+
11
+ # The name you assign to the group during creation. The name must be unique across all groups
12
+ # in the tenancy and cannot be changed.
13
+ #
14
+ # @return [String]
15
+ attr_accessor :name
16
+
17
+ # The description you assign to the group during creation. Does not have to be unique, and it's changeable.
18
+ # @return [String]
19
+ attr_accessor :description
20
+
21
+
22
+ # Initializes the object
23
+ # @param [Hash] attributes Model attributes in the form of hash
24
+ def initialize(attributes = {})
25
+ return unless attributes.is_a?(Hash)
26
+
27
+ # convert string to symbol for hash key
28
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
29
+
30
+ if attributes[:'compartmentId']
31
+ self.compartment_id = attributes[:'compartmentId']
32
+ end
33
+
34
+ if attributes[:'name']
35
+ self.name = attributes[:'name']
36
+ end
37
+
38
+ if attributes[:'description']
39
+ self.description = attributes[:'description']
40
+ end
41
+
42
+ end
43
+
44
+ # Checks equality by comparing each attribute.
45
+ # @param [Object] other_object to be compared
46
+ def ==(other_object)
47
+ return true if self.equal?(other_object)
48
+ self.class == other_object.class &&
49
+ compartment_id == other_object.compartment_id &&
50
+ name == other_object.name &&
51
+ description == other_object.description
52
+ end
53
+
54
+ # @see the `==` method
55
+ # @param [Object] other_object to be compared
56
+ def eql?(other_object)
57
+ self == other_object
58
+ end
59
+
60
+ # Calculates hash code according to all attributes.
61
+ # @return [Fixnum] Hash code
62
+ def hash
63
+ [compartment_id, name, description].hash
64
+ end
65
+
66
+ # Builds the object from hash
67
+ # @param [Hash] attributes Model attributes in the form of hash
68
+ # @return [Object] Returns the model itself
69
+ def build_from_hash(attributes)
70
+ return nil unless attributes.is_a?(Hash)
71
+ self.class.swagger_types.each_pair do |key, type|
72
+ if type =~ /^Array<(.*)>/i
73
+ # check to ensure the input is an array given that the the attribute
74
+ # is documented as an array but the input is not
75
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
76
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OCI::Internal::Util.convert_to_type($1, v) } )
77
+ end
78
+ elsif !attributes[self.class.attribute_map[key]].nil?
79
+ self.send("#{key}=", OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
80
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
81
+ end
82
+
83
+ self
84
+ end
85
+
86
+ # Returns the string representation of the object
87
+ # @return [String] String presentation of the object
88
+ def to_s
89
+ to_hash.to_s
90
+ end
91
+
92
+ # Returns the object in the form of hash
93
+ # @return [Hash] Returns the object in the form of hash
94
+ def to_hash
95
+ hash = {}
96
+ self.class.attribute_map.each_pair do |attr, param|
97
+ value = self.send(attr)
98
+ next if value.nil?
99
+ hash[param] = _to_hash(value)
100
+ end
101
+ hash
102
+ end
103
+
104
+ private
105
+
106
+ # Outputs non-array value in the form of hash
107
+ # For object, use to_hash. Otherwise, just return the value
108
+ # @param [Object] value Any valid value
109
+ # @return [Hash] Returns the value in the form of hash
110
+ def _to_hash(value)
111
+ if value.is_a?(Array)
112
+ value.compact.map{ |v| _to_hash(v) }
113
+ elsif value.is_a?(Hash)
114
+ {}.tap do |hash|
115
+ value.each { |k, v| hash[k] = _to_hash(v) }
116
+ end
117
+ elsif value.respond_to? :to_hash
118
+ value.to_hash
119
+ else
120
+ value
121
+ end
122
+ end
123
+
124
+
125
+
126
+ # Attribute mapping from ruby-style variable name to JSON key.
127
+ def self.attribute_map
128
+ {
129
+ :'compartment_id' => :'compartmentId',
130
+ :'name' => :'name',
131
+ :'description' => :'description'
132
+ }
133
+ end
134
+
135
+ # Attribute type mapping.
136
+ def self.swagger_types
137
+ {
138
+ :'compartment_id' => :'String',
139
+ :'name' => :'String',
140
+ :'description' => :'String'
141
+ }
142
+ end
143
+ end
144
+ end
@@ -0,0 +1,215 @@
1
+ # Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+
5
+ module OCI
6
+ class Identity::Models::CreateIdentityProviderDetails
7
+
8
+ PRODUCT_TYPE_ENUM = [PRODUCT_TYPE_IDCS = 'IDCS',
9
+ PRODUCT_TYPE_ADFS = 'ADFS']
10
+
11
+
12
+ PROTOCOL_ENUM = [PROTOCOL_SAML2 = 'SAML2']
13
+
14
+ # The OCID of your tenancy.
15
+ # @return [String]
16
+ attr_accessor :compartment_id
17
+
18
+ # The name you assign to the `IdentityProvider` during creation.
19
+ # The name must be unique across all `IdentityProvider` objects in the
20
+ # tenancy and cannot be changed.
21
+ #
22
+ # @return [String]
23
+ attr_accessor :name
24
+
25
+ # The description you assign to the `IdentityProvider` during creation.
26
+ # Does not have to be unique, and it's changeable.
27
+ #
28
+ # @return [String]
29
+ attr_accessor :description
30
+
31
+ # The identity provider service or product.
32
+ # Supported identity providers are Oracle Identity Cloud Service (IDCS) and Microsoft
33
+ # Active Directory Federation Services (ADFS).
34
+ #
35
+ # Example: `IDCS`
36
+ #
37
+ # @return [String]
38
+ attr_accessor :product_type
39
+
40
+ # The protocol used for federation.
41
+ #
42
+ # Example: `SAML2`
43
+ #
44
+ # @return [String]
45
+ attr_accessor :protocol
46
+
47
+
48
+ # Given the hash representation of a subtype of this class,
49
+ # use the info in the hash to return the class of the subtype.
50
+ def self.get_subtype(object_hash)
51
+ type = object_hash[:'protocol']
52
+
53
+ return 'OCI::Identity::Models::CreateSaml2IdentityProviderDetails' if type == 'SAML2'
54
+
55
+ # TODO: Log a warning when the subtype is not found.
56
+ return 'OCI::Identity::Models::CreateIdentityProviderDetails'
57
+ end
58
+
59
+ # Initializes the object
60
+ # @param [Hash] attributes Model attributes in the form of hash
61
+ def initialize(attributes = {})
62
+ return unless attributes.is_a?(Hash)
63
+
64
+ # convert string to symbol for hash key
65
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
66
+
67
+ if attributes[:'compartmentId']
68
+ self.compartment_id = attributes[:'compartmentId']
69
+ end
70
+
71
+ if attributes[:'name']
72
+ self.name = attributes[:'name']
73
+ end
74
+
75
+ if attributes[:'description']
76
+ self.description = attributes[:'description']
77
+ end
78
+
79
+ if attributes[:'productType']
80
+ self.product_type = attributes[:'productType']
81
+ end
82
+
83
+ if attributes[:'protocol']
84
+ self.protocol = attributes[:'protocol']
85
+ end
86
+
87
+ end
88
+
89
+ # Custom attribute writer method checking allowed values (enum).
90
+ # @param [Object] product_type Object to be assigned
91
+ def product_type=(product_type)
92
+ if product_type && !PRODUCT_TYPE_ENUM.include?(product_type)
93
+ fail "Invalid value for 'product_type': this must be one of the values in PRODUCT_TYPE_ENUM."
94
+ else
95
+ @product_type = product_type
96
+ end
97
+ end
98
+
99
+ # Custom attribute writer method checking allowed values (enum).
100
+ # @param [Object] protocol Object to be assigned
101
+ def protocol=(protocol)
102
+ if protocol && !PROTOCOL_ENUM.include?(protocol)
103
+ fail "Invalid value for 'protocol': this must be one of the values in PROTOCOL_ENUM."
104
+ else
105
+ @protocol = protocol
106
+ end
107
+ end
108
+
109
+ # Checks equality by comparing each attribute.
110
+ # @param [Object] other_object to be compared
111
+ def ==(other_object)
112
+ return true if self.equal?(other_object)
113
+ self.class == other_object.class &&
114
+ compartment_id == other_object.compartment_id &&
115
+ name == other_object.name &&
116
+ description == other_object.description &&
117
+ product_type == other_object.product_type &&
118
+ protocol == other_object.protocol
119
+ end
120
+
121
+ # @see the `==` method
122
+ # @param [Object] other_object to be compared
123
+ def eql?(other_object)
124
+ self == other_object
125
+ end
126
+
127
+ # Calculates hash code according to all attributes.
128
+ # @return [Fixnum] Hash code
129
+ def hash
130
+ [compartment_id, name, description, product_type, protocol].hash
131
+ end
132
+
133
+ # Builds the object from hash
134
+ # @param [Hash] attributes Model attributes in the form of hash
135
+ # @return [Object] Returns the model itself
136
+ def build_from_hash(attributes)
137
+ return nil unless attributes.is_a?(Hash)
138
+ self.class.swagger_types.each_pair do |key, type|
139
+ if type =~ /^Array<(.*)>/i
140
+ # check to ensure the input is an array given that the the attribute
141
+ # is documented as an array but the input is not
142
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
143
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OCI::Internal::Util.convert_to_type($1, v) } )
144
+ end
145
+ elsif !attributes[self.class.attribute_map[key]].nil?
146
+ self.send("#{key}=", OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
147
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
148
+ end
149
+
150
+ self
151
+ end
152
+
153
+ # Returns the string representation of the object
154
+ # @return [String] String presentation of the object
155
+ def to_s
156
+ to_hash.to_s
157
+ end
158
+
159
+ # Returns the object in the form of hash
160
+ # @return [Hash] Returns the object in the form of hash
161
+ def to_hash
162
+ hash = {}
163
+ self.class.attribute_map.each_pair do |attr, param|
164
+ value = self.send(attr)
165
+ next if value.nil?
166
+ hash[param] = _to_hash(value)
167
+ end
168
+ hash
169
+ end
170
+
171
+ private
172
+
173
+ # Outputs non-array value in the form of hash
174
+ # For object, use to_hash. Otherwise, just return the value
175
+ # @param [Object] value Any valid value
176
+ # @return [Hash] Returns the value in the form of hash
177
+ def _to_hash(value)
178
+ if value.is_a?(Array)
179
+ value.compact.map{ |v| _to_hash(v) }
180
+ elsif value.is_a?(Hash)
181
+ {}.tap do |hash|
182
+ value.each { |k, v| hash[k] = _to_hash(v) }
183
+ end
184
+ elsif value.respond_to? :to_hash
185
+ value.to_hash
186
+ else
187
+ value
188
+ end
189
+ end
190
+
191
+
192
+
193
+ # Attribute mapping from ruby-style variable name to JSON key.
194
+ def self.attribute_map
195
+ {
196
+ :'compartment_id' => :'compartmentId',
197
+ :'name' => :'name',
198
+ :'description' => :'description',
199
+ :'product_type' => :'productType',
200
+ :'protocol' => :'protocol'
201
+ }
202
+ end
203
+
204
+ # Attribute type mapping.
205
+ def self.swagger_types
206
+ {
207
+ :'compartment_id' => :'String',
208
+ :'name' => :'String',
209
+ :'description' => :'String',
210
+ :'product_type' => :'String',
211
+ :'protocol' => :'String'
212
+ }
213
+ end
214
+ end
215
+ end