oci 2.0.6 → 2.0.7

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 (93) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +23 -1
  3. data/lib/oci.rb +4 -7
  4. data/lib/oci/api_client.rb +51 -6
  5. data/lib/oci/auth/auth.rb +5 -2
  6. data/lib/oci/auth/federation_client.rb +2 -2
  7. data/lib/oci/auth/internal/auth_token_request_signer.rb +2 -2
  8. data/lib/oci/auth/security_token_container.rb +2 -2
  9. data/lib/oci/auth/session_key_supplier.rb +3 -4
  10. data/lib/oci/auth/signers/instance_principals_security_token_signer.rb +30 -17
  11. data/lib/oci/auth/signers/security_token_signer.rb +13 -6
  12. data/lib/oci/auth/signers/x509_federation_client_based_security_token_signer.rb +8 -4
  13. data/lib/oci/auth/url_based_certificate_retriever.rb +3 -4
  14. data/lib/oci/auth/util.rb +6 -4
  15. data/lib/oci/base_signer.rb +54 -50
  16. data/lib/oci/config_file_loader.rb +3 -11
  17. data/lib/oci/core/blockstorage_client.rb +211 -0
  18. data/lib/oci/core/compute_client.rb +4 -2
  19. data/lib/oci/core/core.rb +9 -0
  20. data/lib/oci/core/models/attach_i_scsi_volume_details.rb +5 -1
  21. data/lib/oci/core/models/attach_volume_details.rb +13 -1
  22. data/lib/oci/core/models/create_public_ip_details.rb +186 -0
  23. data/lib/oci/core/models/create_vnic_details.rb +8 -2
  24. data/lib/oci/core/models/create_volume_backup_details.rb +27 -1
  25. data/lib/oci/core/models/create_volume_backup_policy_assignment_details.rb +133 -0
  26. data/lib/oci/core/models/create_volume_details.rb +15 -1
  27. data/lib/oci/core/models/get_public_ip_by_ip_address_details.rb +125 -0
  28. data/lib/oci/core/models/get_public_ip_by_private_ip_id_details.rb +124 -0
  29. data/lib/oci/core/models/i_scsi_volume_attachment.rb +5 -1
  30. data/lib/oci/core/models/public_ip.rb +328 -0
  31. data/lib/oci/core/models/update_public_ip_details.rb +140 -0
  32. data/lib/oci/core/models/volume_attachment.rb +13 -1
  33. data/lib/oci/core/models/volume_backup.rb +72 -1
  34. data/lib/oci/core/models/volume_backup_policy.rb +161 -0
  35. data/lib/oci/core/models/volume_backup_policy_assignment.rb +159 -0
  36. data/lib/oci/core/models/volume_backup_schedule.rb +191 -0
  37. data/lib/oci/core/virtual_network_client.rb +374 -4
  38. data/lib/oci/database/database_client.rb +3 -1
  39. data/lib/oci/dns/dns.rb +34 -0
  40. data/lib/oci/dns/dns_client.rb +985 -0
  41. data/lib/oci/dns/models/create_zone_details.rb +174 -0
  42. data/lib/oci/dns/models/external_master.rb +145 -0
  43. data/lib/oci/dns/models/patch_domain_records_details.rb +120 -0
  44. data/lib/oci/dns/models/patch_rr_set_details.rb +120 -0
  45. data/lib/oci/dns/models/patch_zone_records_details.rb +120 -0
  46. data/lib/oci/dns/models/record.rb +204 -0
  47. data/lib/oci/dns/models/record_collection.rb +121 -0
  48. data/lib/oci/dns/models/record_details.rb +204 -0
  49. data/lib/oci/dns/models/record_operation.rb +253 -0
  50. data/lib/oci/dns/models/rr_set.rb +123 -0
  51. data/lib/oci/dns/models/sort_order.rb +12 -0
  52. data/lib/oci/dns/models/tsig.rb +149 -0
  53. data/lib/oci/dns/models/update_domain_records_details.rb +120 -0
  54. data/lib/oci/dns/models/update_rr_set_details.rb +120 -0
  55. data/lib/oci/dns/models/update_zone_details.rb +122 -0
  56. data/lib/oci/dns/models/update_zone_records_details.rb +120 -0
  57. data/lib/oci/dns/models/zone.rb +272 -0
  58. data/lib/oci/dns/models/zone_summary.rb +230 -0
  59. data/lib/oci/dns/util.rb +2 -0
  60. data/lib/oci/errors.rb +20 -0
  61. data/lib/oci/identity/identity_client.rb +1 -0
  62. data/lib/oci/identity/models/create_dynamic_group_details.rb +4 -2
  63. data/lib/oci/identity/models/dynamic_group.rb +9 -6
  64. data/lib/oci/identity/models/update_dynamic_group_details.rb +4 -2
  65. data/lib/oci/load_balancer/load_balancer.rb +6 -0
  66. data/lib/oci/load_balancer/load_balancer_client.rb +219 -0
  67. data/lib/oci/load_balancer/models/create_listener_details.rb +17 -1
  68. data/lib/oci/load_balancer/models/create_load_balancer_details.rb +12 -1
  69. data/lib/oci/load_balancer/models/create_path_route_set_details.rb +138 -0
  70. data/lib/oci/load_balancer/models/listener.rb +17 -1
  71. data/lib/oci/load_balancer/models/listener_details.rb +17 -1
  72. data/lib/oci/load_balancer/models/load_balancer.rb +12 -1
  73. data/lib/oci/load_balancer/models/path_match_type.rb +153 -0
  74. data/lib/oci/load_balancer/models/path_route.rb +161 -0
  75. data/lib/oci/load_balancer/models/path_route_set.rb +139 -0
  76. data/lib/oci/load_balancer/models/path_route_set_details.rb +122 -0
  77. data/lib/oci/load_balancer/models/update_listener_details.rb +17 -1
  78. data/lib/oci/load_balancer/models/update_path_route_set_details.rb +122 -0
  79. data/lib/oci/load_balancer/util.rb +1 -3
  80. data/lib/oci/object_storage/transfer/multipart/internal/file_part_io_wrapper.rb +111 -0
  81. data/lib/oci/object_storage/transfer/multipart/internal/multipart_upload_parts_collection.rb +41 -0
  82. data/lib/oci/object_storage/transfer/multipart/internal/seekable_non_file_part_io_wrapper.rb +48 -0
  83. data/lib/oci/object_storage/transfer/multipart/internal/stdin_part_io_wrapper.rb +54 -0
  84. data/lib/oci/object_storage/transfer/multipart/multipart_object_assembler.rb +545 -0
  85. data/lib/oci/object_storage/transfer/transfer.rb +31 -0
  86. data/lib/oci/object_storage/transfer/upload_manager.rb +212 -0
  87. data/lib/oci/object_storage/transfer/upload_manager_config.rb +60 -0
  88. data/lib/oci/regions.rb +3 -1
  89. data/lib/oci/response.rb +1 -3
  90. data/lib/oci/version.rb +1 -1
  91. data/lib/oci/waiter.rb +16 -11
  92. data/lib/oraclebmc.rb +1 -1
  93. metadata +46 -2
@@ -0,0 +1,253 @@
1
+ # Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+
5
+ module OCI
6
+ # An extension of the existing record resource, describing either a
7
+ # precondition, an add, or a remove. Preconditions check all fields,
8
+ # including read-only data like `recordHash` and `rrsetVersion`.
9
+ #
10
+ class Dns::Models::RecordOperation
11
+
12
+ OPERATION_ENUM = [OPERATION_REQUIRE = 'REQUIRE',
13
+ OPERATION_PROHIBIT = 'PROHIBIT',
14
+ OPERATION_ADD = 'ADD',
15
+ OPERATION_REMOVE = 'REMOVE']
16
+
17
+ # The fully qualified domain name where the record can be located.
18
+ #
19
+ # @return [String]
20
+ attr_accessor :domain
21
+
22
+ # A unique identifier for the record within its zone.
23
+ #
24
+ # @return [String]
25
+ attr_accessor :record_hash
26
+
27
+ # A Boolean flag indicating whether or not parts of the record
28
+ # are unable to be explicitly managed.
29
+ #
30
+ # @return [BOOLEAN]
31
+ attr_accessor :is_protected
32
+
33
+ # The record's data, as whitespace-delimited tokens in
34
+ # type-specific presentation format.
35
+ #
36
+ # @return [String]
37
+ attr_accessor :rdata
38
+
39
+ # The latest version of the record's zone in which its RRSet differs
40
+ # from the preceding version.
41
+ #
42
+ # @return [String]
43
+ attr_accessor :rrset_version
44
+
45
+ # The canonical name for the record's type, such as A or CNAME. For more
46
+ # information, see [Resource Record (RR) TYPEs](https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-4).
47
+ #
48
+ # @return [String]
49
+ attr_accessor :rtype
50
+
51
+ # The Time To Live for the record, in seconds.
52
+ # @return [Integer]
53
+ attr_accessor :ttl
54
+
55
+ # A description of how a record relates to a PATCH operation.
56
+ #
57
+ # - `REQUIRE` indicates a precondition that record data **must** already exist.
58
+ # - `PROHIBIT` indicates a precondition that record data **must not** already exist.
59
+ # - `ADD` indicates that record data **must** exist after successful application.
60
+ # - `REMOVE` indicates that record data **must not** exist after successful application.
61
+ #
62
+ # **Note:** `ADD` and `REMOVE` operations can succeed even if
63
+ # they require no changes when applied, such as when the described
64
+ # records are already present or absent.
65
+ #
66
+ # **Note:** `ADD` and `REMOVE` operations can describe changes for
67
+ # more than one record.
68
+ #
69
+ # **Example:** `{ \"domain\": \"www.example.com\", \"rtype\": \"AAAA\", \"ttl\": 60 }`
70
+ # specifies a new TTL for every record in the www.example.com AAAA RRSet.
71
+ #
72
+ # @return [String]
73
+ attr_accessor :operation
74
+
75
+
76
+ # Initializes the object
77
+ # @param [Hash] attributes Model attributes in the form of hash
78
+ # @option attributes [String] :domain The value to assign to the {#domain} property
79
+ # @option attributes [String] :recordHash The value to assign to the {#record_hash} property
80
+ # @option attributes [BOOLEAN] :isProtected The value to assign to the {#is_protected} property
81
+ # @option attributes [String] :rdata The value to assign to the {#rdata} property
82
+ # @option attributes [String] :rrsetVersion The value to assign to the {#rrset_version} property
83
+ # @option attributes [String] :rtype The value to assign to the {#rtype} property
84
+ # @option attributes [Integer] :ttl The value to assign to the {#ttl} property
85
+ # @option attributes [String] :operation The value to assign to the {#operation} property
86
+ def initialize(attributes = {})
87
+ return unless attributes.is_a?(Hash)
88
+
89
+ # convert string to symbol for hash key
90
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
91
+
92
+ if attributes[:'domain']
93
+ self.domain = attributes[:'domain']
94
+ end
95
+
96
+ if attributes[:'recordHash']
97
+ self.record_hash = attributes[:'recordHash']
98
+ end
99
+
100
+ unless attributes[:'isProtected'].nil?
101
+ self.is_protected = attributes[:'isProtected']
102
+ end
103
+
104
+ if attributes[:'rdata']
105
+ self.rdata = attributes[:'rdata']
106
+ end
107
+
108
+ if attributes[:'rrsetVersion']
109
+ self.rrset_version = attributes[:'rrsetVersion']
110
+ end
111
+
112
+ if attributes[:'rtype']
113
+ self.rtype = attributes[:'rtype']
114
+ end
115
+
116
+ if attributes[:'ttl']
117
+ self.ttl = attributes[:'ttl']
118
+ end
119
+
120
+ if attributes[:'operation']
121
+ self.operation = attributes[:'operation']
122
+ else
123
+ self.operation = "ADD"
124
+ end
125
+
126
+ end
127
+
128
+ # Custom attribute writer method checking allowed values (enum).
129
+ # @param [Object] operation Object to be assigned
130
+ def operation=(operation)
131
+ if operation && !OPERATION_ENUM.include?(operation)
132
+ fail "Invalid value for 'operation': this must be one of the values in OPERATION_ENUM."
133
+ else
134
+ @operation = operation
135
+ end
136
+ end
137
+
138
+ # Checks equality by comparing each attribute.
139
+ # @param [Object] other_object to be compared
140
+ def ==(other_object)
141
+ return true if self.equal?(other_object)
142
+ self.class == other_object.class &&
143
+ domain == other_object.domain &&
144
+ record_hash == other_object.record_hash &&
145
+ is_protected == other_object.is_protected &&
146
+ rdata == other_object.rdata &&
147
+ rrset_version == other_object.rrset_version &&
148
+ rtype == other_object.rtype &&
149
+ ttl == other_object.ttl &&
150
+ operation == other_object.operation
151
+ end
152
+
153
+ # @see the `==` method
154
+ # @param [Object] other_object to be compared
155
+ def eql?(other_object)
156
+ self == other_object
157
+ end
158
+
159
+ # Calculates hash code according to all attributes.
160
+ # @return [Fixnum] Hash code
161
+ def hash
162
+ [domain, record_hash, is_protected, rdata, rrset_version, rtype, ttl, operation].hash
163
+ end
164
+
165
+ # Builds the object from hash
166
+ # @param [Hash] attributes Model attributes in the form of hash
167
+ # @return [Object] Returns the model itself
168
+ def build_from_hash(attributes)
169
+ return nil unless attributes.is_a?(Hash)
170
+ self.class.swagger_types.each_pair do |key, type|
171
+ if type =~ /^Array<(.*)>/i
172
+ # check to ensure the input is an array given that the the attribute
173
+ # is documented as an array but the input is not
174
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
175
+ self.public_method("#{key}=").call(attributes[self.class.attribute_map[key]].map{ |v| OCI::Internal::Util.convert_to_type($1, v) } )
176
+ end
177
+ elsif !attributes[self.class.attribute_map[key]].nil?
178
+ self.public_method("#{key}=").call(OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
179
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
180
+ end
181
+
182
+ self
183
+ end
184
+
185
+ # Returns the string representation of the object
186
+ # @return [String] String presentation of the object
187
+ def to_s
188
+ to_hash.to_s
189
+ end
190
+
191
+ # Returns the object in the form of hash
192
+ # @return [Hash] Returns the object in the form of hash
193
+ def to_hash
194
+ hash = {}
195
+ self.class.attribute_map.each_pair do |attr, param|
196
+ value = public_method(attr).call
197
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
198
+ hash[param] = _to_hash(value)
199
+ end
200
+ hash
201
+ end
202
+
203
+ private
204
+
205
+ # Outputs non-array value in the form of hash
206
+ # For object, use to_hash. Otherwise, just return the value
207
+ # @param [Object] value Any valid value
208
+ # @return [Hash] Returns the value in the form of hash
209
+ def _to_hash(value)
210
+ if value.is_a?(Array)
211
+ value.compact.map{ |v| _to_hash(v) }
212
+ elsif value.is_a?(Hash)
213
+ {}.tap do |hash|
214
+ value.each { |k, v| hash[k] = _to_hash(v) }
215
+ end
216
+ elsif value.respond_to? :to_hash
217
+ value.to_hash
218
+ else
219
+ value
220
+ end
221
+ end
222
+
223
+
224
+
225
+ # Attribute mapping from ruby-style variable name to JSON key.
226
+ def self.attribute_map
227
+ {
228
+ :'domain' => :'domain',
229
+ :'record_hash' => :'recordHash',
230
+ :'is_protected' => :'isProtected',
231
+ :'rdata' => :'rdata',
232
+ :'rrset_version' => :'rrsetVersion',
233
+ :'rtype' => :'rtype',
234
+ :'ttl' => :'ttl',
235
+ :'operation' => :'operation'
236
+ }
237
+ end
238
+
239
+ # Attribute type mapping.
240
+ def self.swagger_types
241
+ {
242
+ :'domain' => :'String',
243
+ :'record_hash' => :'String',
244
+ :'is_protected' => :'BOOLEAN',
245
+ :'rdata' => :'String',
246
+ :'rrset_version' => :'String',
247
+ :'rtype' => :'String',
248
+ :'ttl' => :'Integer',
249
+ :'operation' => :'String'
250
+ }
251
+ end
252
+ end
253
+ end
@@ -0,0 +1,123 @@
1
+ # Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+
5
+ module OCI
6
+ # A collection of DNS records of the same domain and type. For more
7
+ # information about record types, see [Resource Record (RR) TYPEs](https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-4).
8
+ #
9
+ class Dns::Models::RRSet
10
+ # @return [Array<OCI::Dns::Models::Record>]
11
+ attr_accessor :items
12
+
13
+
14
+ # Initializes the object
15
+ # @param [Hash] attributes Model attributes in the form of hash
16
+ # @option attributes [Array<OCI::Dns::Models::Record>] :items The value to assign to the {#items} property
17
+ def initialize(attributes = {})
18
+ return unless attributes.is_a?(Hash)
19
+
20
+ # convert string to symbol for hash key
21
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
22
+
23
+ if attributes[:'items']
24
+ self.items = attributes[:'items']
25
+ end
26
+
27
+ end
28
+
29
+ # Checks equality by comparing each attribute.
30
+ # @param [Object] other_object to be compared
31
+ def ==(other_object)
32
+ return true if self.equal?(other_object)
33
+ self.class == other_object.class &&
34
+ items == other_object.items
35
+ end
36
+
37
+ # @see the `==` method
38
+ # @param [Object] other_object to be compared
39
+ def eql?(other_object)
40
+ self == other_object
41
+ end
42
+
43
+ # Calculates hash code according to all attributes.
44
+ # @return [Fixnum] Hash code
45
+ def hash
46
+ [items].hash
47
+ end
48
+
49
+ # Builds the object from hash
50
+ # @param [Hash] attributes Model attributes in the form of hash
51
+ # @return [Object] Returns the model itself
52
+ def build_from_hash(attributes)
53
+ return nil unless attributes.is_a?(Hash)
54
+ self.class.swagger_types.each_pair do |key, type|
55
+ if type =~ /^Array<(.*)>/i
56
+ # check to ensure the input is an array given that the the attribute
57
+ # is documented as an array but the input is not
58
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
59
+ self.public_method("#{key}=").call(attributes[self.class.attribute_map[key]].map{ |v| OCI::Internal::Util.convert_to_type($1, v) } )
60
+ end
61
+ elsif !attributes[self.class.attribute_map[key]].nil?
62
+ self.public_method("#{key}=").call(OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
63
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
64
+ end
65
+
66
+ self
67
+ end
68
+
69
+ # Returns the string representation of the object
70
+ # @return [String] String presentation of the object
71
+ def to_s
72
+ to_hash.to_s
73
+ end
74
+
75
+ # Returns the object in the form of hash
76
+ # @return [Hash] Returns the object in the form of hash
77
+ def to_hash
78
+ hash = {}
79
+ self.class.attribute_map.each_pair do |attr, param|
80
+ value = public_method(attr).call
81
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
82
+ hash[param] = _to_hash(value)
83
+ end
84
+ hash
85
+ end
86
+
87
+ private
88
+
89
+ # Outputs non-array value in the form of hash
90
+ # For object, use to_hash. Otherwise, just return the value
91
+ # @param [Object] value Any valid value
92
+ # @return [Hash] Returns the value in the form of hash
93
+ def _to_hash(value)
94
+ if value.is_a?(Array)
95
+ value.compact.map{ |v| _to_hash(v) }
96
+ elsif value.is_a?(Hash)
97
+ {}.tap do |hash|
98
+ value.each { |k, v| hash[k] = _to_hash(v) }
99
+ end
100
+ elsif value.respond_to? :to_hash
101
+ value.to_hash
102
+ else
103
+ value
104
+ end
105
+ end
106
+
107
+
108
+
109
+ # Attribute mapping from ruby-style variable name to JSON key.
110
+ def self.attribute_map
111
+ {
112
+ :'items' => :'items'
113
+ }
114
+ end
115
+
116
+ # Attribute type mapping.
117
+ def self.swagger_types
118
+ {
119
+ :'items' => :'Array<OCI::Dns::Models::Record>'
120
+ }
121
+ end
122
+ end
123
+ end
@@ -0,0 +1,12 @@
1
+ # Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ module OCI
4
+ module Dns::Models
5
+ SORT_ORDER_ENUM = [
6
+ SORT_ORDER_ASC = 'ASC'.freeze,
7
+ SORT_ORDER_DESC = 'DESC'.freeze
8
+ ].freeze
9
+ end
10
+ end
11
+
12
+
@@ -0,0 +1,149 @@
1
+ # Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+
5
+ module OCI
6
+ # A [TSIG](https://tools.ietf.org/html/rfc2845) key.
7
+ class Dns::Models::TSIG
8
+ # **[Required]** A domain name identifying the key for a given pair of hosts.
9
+ # @return [String]
10
+ attr_accessor :name
11
+
12
+ # **[Required]** A base64 string encoding the binary shared secret.
13
+ # @return [String]
14
+ attr_accessor :secret
15
+
16
+ # **[Required]** TSIG Algorithms are encoded as domain names, but most consist of only one
17
+ # non-empty label, which is not required to be explicitly absolute. For a
18
+ # full list of TSIG algorithms, see [Secret Key Transaction Authentication for DNS (TSIG) Algorithm Names](http://www.iana.org/assignments/tsig-algorithm-names/tsig-algorithm-names.xhtml#tsig-algorithm-names-1)
19
+ #
20
+ # @return [String]
21
+ attr_accessor :algorithm
22
+
23
+
24
+ # Initializes the object
25
+ # @param [Hash] attributes Model attributes in the form of hash
26
+ # @option attributes [String] :name The value to assign to the {#name} property
27
+ # @option attributes [String] :secret The value to assign to the {#secret} property
28
+ # @option attributes [String] :algorithm The value to assign to the {#algorithm} property
29
+ def initialize(attributes = {})
30
+ return unless attributes.is_a?(Hash)
31
+
32
+ # convert string to symbol for hash key
33
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
34
+
35
+ if attributes[:'name']
36
+ self.name = attributes[:'name']
37
+ end
38
+
39
+ if attributes[:'secret']
40
+ self.secret = attributes[:'secret']
41
+ end
42
+
43
+ if attributes[:'algorithm']
44
+ self.algorithm = attributes[:'algorithm']
45
+ end
46
+
47
+ end
48
+
49
+ # Checks equality by comparing each attribute.
50
+ # @param [Object] other_object to be compared
51
+ def ==(other_object)
52
+ return true if self.equal?(other_object)
53
+ self.class == other_object.class &&
54
+ name == other_object.name &&
55
+ secret == other_object.secret &&
56
+ algorithm == other_object.algorithm
57
+ end
58
+
59
+ # @see the `==` method
60
+ # @param [Object] other_object to be compared
61
+ def eql?(other_object)
62
+ self == other_object
63
+ end
64
+
65
+ # Calculates hash code according to all attributes.
66
+ # @return [Fixnum] Hash code
67
+ def hash
68
+ [name, secret, algorithm].hash
69
+ end
70
+
71
+ # Builds the object from hash
72
+ # @param [Hash] attributes Model attributes in the form of hash
73
+ # @return [Object] Returns the model itself
74
+ def build_from_hash(attributes)
75
+ return nil unless attributes.is_a?(Hash)
76
+ self.class.swagger_types.each_pair do |key, type|
77
+ if type =~ /^Array<(.*)>/i
78
+ # check to ensure the input is an array given that the the attribute
79
+ # is documented as an array but the input is not
80
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
81
+ self.public_method("#{key}=").call(attributes[self.class.attribute_map[key]].map{ |v| OCI::Internal::Util.convert_to_type($1, v) } )
82
+ end
83
+ elsif !attributes[self.class.attribute_map[key]].nil?
84
+ self.public_method("#{key}=").call(OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
85
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
86
+ end
87
+
88
+ self
89
+ end
90
+
91
+ # Returns the string representation of the object
92
+ # @return [String] String presentation of the object
93
+ def to_s
94
+ to_hash.to_s
95
+ end
96
+
97
+ # Returns the object in the form of hash
98
+ # @return [Hash] Returns the object in the form of hash
99
+ def to_hash
100
+ hash = {}
101
+ self.class.attribute_map.each_pair do |attr, param|
102
+ value = public_method(attr).call
103
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
104
+ hash[param] = _to_hash(value)
105
+ end
106
+ hash
107
+ end
108
+
109
+ private
110
+
111
+ # Outputs non-array value in the form of hash
112
+ # For object, use to_hash. Otherwise, just return the value
113
+ # @param [Object] value Any valid value
114
+ # @return [Hash] Returns the value in the form of hash
115
+ def _to_hash(value)
116
+ if value.is_a?(Array)
117
+ value.compact.map{ |v| _to_hash(v) }
118
+ elsif value.is_a?(Hash)
119
+ {}.tap do |hash|
120
+ value.each { |k, v| hash[k] = _to_hash(v) }
121
+ end
122
+ elsif value.respond_to? :to_hash
123
+ value.to_hash
124
+ else
125
+ value
126
+ end
127
+ end
128
+
129
+
130
+
131
+ # Attribute mapping from ruby-style variable name to JSON key.
132
+ def self.attribute_map
133
+ {
134
+ :'name' => :'name',
135
+ :'secret' => :'secret',
136
+ :'algorithm' => :'algorithm'
137
+ }
138
+ end
139
+
140
+ # Attribute type mapping.
141
+ def self.swagger_types
142
+ {
143
+ :'name' => :'String',
144
+ :'secret' => :'String',
145
+ :'algorithm' => :'String'
146
+ }
147
+ end
148
+ end
149
+ end