oci 2.3.6 → 2.3.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +11 -10
- data/lib/oci.rb +1 -0
- data/lib/oci/api_client.rb +2 -2
- data/lib/oci/audit/audit_client.rb +11 -9
- data/lib/oci/base_signer.rb +13 -13
- data/lib/oci/container_engine/container_engine_client.rb +43 -39
- data/lib/oci/container_engine/models/node_error.rb +1 -1
- data/lib/oci/container_engine/models/work_request_error.rb +1 -1
- data/lib/oci/core/blockstorage_client.rb +421 -75
- data/lib/oci/core/compute_client.rb +77 -75
- data/lib/oci/core/compute_client_composite_operations.rb +40 -0
- data/lib/oci/core/core.rb +4 -0
- data/lib/oci/core/models/boot_volume.rb +18 -4
- data/lib/oci/core/models/boot_volume_kms_key.rb +152 -0
- data/lib/oci/core/models/create_boot_volume_details.rb +15 -1
- data/lib/oci/core/models/create_image_details.rb +2 -0
- data/lib/oci/core/models/create_volume_details.rb +15 -1
- data/lib/oci/core/models/fast_connect_provider_service.rb +1 -1
- data/lib/oci/core/models/image.rb +2 -0
- data/lib/oci/core/models/instance.rb +2 -0
- data/lib/oci/core/models/instance_source_via_image_details.rb +18 -4
- data/lib/oci/core/models/launch_options.rb +2 -0
- data/lib/oci/core/models/update_boot_volume_kms_key_details.rb +154 -0
- data/lib/oci/core/models/update_volume_kms_key_details.rb +154 -0
- data/lib/oci/core/models/volume.rb +15 -1
- data/lib/oci/core/models/volume_kms_key.rb +152 -0
- data/lib/oci/core/virtual_network_client.rb +233 -231
- data/lib/oci/core/virtual_network_client_composite_operations.rb +80 -0
- data/lib/oci/database/database_client.rb +123 -121
- data/lib/oci/database/database_client_composite_operations.rb +399 -0
- data/lib/oci/database/models/patch.rb +1 -1
- data/lib/oci/database/models/patch_summary.rb +1 -1
- data/lib/oci/dns/dns_client.rb +38 -36
- data/lib/oci/email/email_client.rb +21 -19
- data/lib/oci/email/models/sender.rb +1 -1
- data/lib/oci/email/models/suppression.rb +1 -1
- data/lib/oci/file_storage/file_storage_client.rb +49 -47
- data/lib/oci/identity/identity_client.rb +151 -149
- data/lib/oci/identity/identity_client_composite_operations.rb +40 -0
- data/lib/oci/key_management/key_management.rb +40 -0
- data/lib/oci/key_management/kms_crypto_client.rb +258 -0
- data/lib/oci/key_management/kms_crypto_client_composite_operations.rb +24 -0
- data/lib/oci/key_management/kms_management_client.rb +716 -0
- data/lib/oci/key_management/kms_management_client_composite_operations.rb +181 -0
- data/lib/oci/key_management/kms_vault_client.rb +533 -0
- data/lib/oci/key_management/kms_vault_client_composite_operations.rb +182 -0
- data/lib/oci/key_management/models/create_key_details.rb +180 -0
- data/lib/oci/key_management/models/create_vault_details.rb +194 -0
- data/lib/oci/key_management/models/decrypt_data_details.rb +177 -0
- data/lib/oci/key_management/models/decrypted_data.rb +160 -0
- data/lib/oci/key_management/models/encrypt_data_details.rb +177 -0
- data/lib/oci/key_management/models/encrypted_data.rb +146 -0
- data/lib/oci/key_management/models/generate_key_details.rb +195 -0
- data/lib/oci/key_management/models/generated_key.rb +177 -0
- data/lib/oci/key_management/models/key.rb +318 -0
- data/lib/oci/key_management/models/key_shape.rb +178 -0
- data/lib/oci/key_management/models/key_summary.rb +287 -0
- data/lib/oci/key_management/models/key_version.rb +205 -0
- data/lib/oci/key_management/models/key_version_summary.rb +205 -0
- data/lib/oci/key_management/models/schedule_vault_deletion_details.rb +153 -0
- data/lib/oci/key_management/models/update_key_details.rb +152 -0
- data/lib/oci/key_management/models/update_vault_details.rb +152 -0
- data/lib/oci/key_management/models/vault.rb +350 -0
- data/lib/oci/key_management/models/vault_summary.rb +334 -0
- data/lib/oci/key_management/util.rb +2 -0
- data/lib/oci/load_balancer/load_balancer_client.rb +89 -87
- data/lib/oci/object_storage/models/bucket.rb +18 -4
- data/lib/oci/object_storage/models/create_bucket_details.rb +18 -4
- data/lib/oci/object_storage/models/multipart_upload.rb +1 -1
- data/lib/oci/object_storage/models/preauthenticated_request.rb +1 -1
- data/lib/oci/object_storage/models/update_bucket_details.rb +22 -4
- data/lib/oci/object_storage/object_storage_client.rb +63 -58
- data/lib/oci/resource_search/resource_search_client.rb +11 -9
- data/lib/oci/version.rb +1 -1
- metadata +32 -2
@@ -0,0 +1,146 @@
|
|
1
|
+
# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
|
2
|
+
|
3
|
+
require 'date'
|
4
|
+
|
5
|
+
# rubocop:disable Lint/UnneededCopDisableDirective
|
6
|
+
module OCI
|
7
|
+
# EncryptedData model.
|
8
|
+
class KeyManagement::Models::EncryptedData # rubocop:disable Metrics/LineLength
|
9
|
+
# **[Required]** The encrypted data.
|
10
|
+
# @return [String]
|
11
|
+
attr_accessor :ciphertext
|
12
|
+
|
13
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
14
|
+
def self.attribute_map
|
15
|
+
{
|
16
|
+
# rubocop:disable Style/SymbolLiteral
|
17
|
+
'ciphertext': :'ciphertext'
|
18
|
+
# rubocop:enable Style/SymbolLiteral
|
19
|
+
}
|
20
|
+
end
|
21
|
+
|
22
|
+
# Attribute type mapping.
|
23
|
+
def self.swagger_types
|
24
|
+
{
|
25
|
+
# rubocop:disable Style/SymbolLiteral
|
26
|
+
'ciphertext': :'String'
|
27
|
+
# rubocop:enable Style/SymbolLiteral
|
28
|
+
}
|
29
|
+
end
|
30
|
+
|
31
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
32
|
+
# rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
33
|
+
|
34
|
+
|
35
|
+
# Initializes the object
|
36
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
37
|
+
# @option attributes [String] :ciphertext The value to assign to the {#ciphertext} property
|
38
|
+
def initialize(attributes = {})
|
39
|
+
return unless attributes.is_a?(Hash)
|
40
|
+
|
41
|
+
# convert string to symbol for hash key
|
42
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
43
|
+
|
44
|
+
self.ciphertext = attributes[:'ciphertext'] if attributes[:'ciphertext']
|
45
|
+
end
|
46
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
47
|
+
# rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
48
|
+
|
49
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
|
50
|
+
|
51
|
+
|
52
|
+
# Checks equality by comparing each attribute.
|
53
|
+
# @param [Object] other the other object to be compared
|
54
|
+
def ==(other)
|
55
|
+
return true if equal?(other)
|
56
|
+
self.class == other.class &&
|
57
|
+
ciphertext == other.ciphertext
|
58
|
+
end
|
59
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
|
60
|
+
|
61
|
+
# @see the `==` method
|
62
|
+
# @param [Object] other the other object to be compared
|
63
|
+
def eql?(other)
|
64
|
+
self == other
|
65
|
+
end
|
66
|
+
|
67
|
+
# rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
|
68
|
+
|
69
|
+
|
70
|
+
# Calculates hash code according to all attributes.
|
71
|
+
# @return [Fixnum] Hash code
|
72
|
+
def hash
|
73
|
+
[ciphertext].hash
|
74
|
+
end
|
75
|
+
# rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
|
76
|
+
|
77
|
+
# rubocop:disable Metrics/AbcSize, Layout/EmptyLines
|
78
|
+
|
79
|
+
|
80
|
+
# Builds the object from hash
|
81
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
82
|
+
# @return [Object] Returns the model itself
|
83
|
+
def build_from_hash(attributes)
|
84
|
+
return nil unless attributes.is_a?(Hash)
|
85
|
+
self.class.swagger_types.each_pair do |key, type|
|
86
|
+
if type =~ /^Array<(.*)>/i
|
87
|
+
# check to ensure the input is an array given that the the attribute
|
88
|
+
# is documented as an array but the input is not
|
89
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
90
|
+
public_method("#{key}=").call(
|
91
|
+
attributes[self.class.attribute_map[key]]
|
92
|
+
.map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
|
93
|
+
)
|
94
|
+
end
|
95
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
96
|
+
public_method("#{key}=").call(
|
97
|
+
OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
|
98
|
+
)
|
99
|
+
end
|
100
|
+
# or else data not found in attributes(hash), not an issue as the data can be optional
|
101
|
+
end
|
102
|
+
|
103
|
+
self
|
104
|
+
end
|
105
|
+
# rubocop:enable Metrics/AbcSize, Layout/EmptyLines
|
106
|
+
|
107
|
+
# Returns the string representation of the object
|
108
|
+
# @return [String] String presentation of the object
|
109
|
+
def to_s
|
110
|
+
to_hash.to_s
|
111
|
+
end
|
112
|
+
|
113
|
+
# Returns the object in the form of hash
|
114
|
+
# @return [Hash] Returns the object in the form of hash
|
115
|
+
def to_hash
|
116
|
+
hash = {}
|
117
|
+
self.class.attribute_map.each_pair do |attr, param|
|
118
|
+
value = public_method(attr).call
|
119
|
+
next if value.nil? && !instance_variable_defined?("@#{attr}")
|
120
|
+
hash[param] = _to_hash(value)
|
121
|
+
end
|
122
|
+
hash
|
123
|
+
end
|
124
|
+
|
125
|
+
private
|
126
|
+
|
127
|
+
# Outputs non-array value in the form of hash
|
128
|
+
# For object, use to_hash. Otherwise, just return the value
|
129
|
+
# @param [Object] value Any valid value
|
130
|
+
# @return [Hash] Returns the value in the form of hash
|
131
|
+
def _to_hash(value)
|
132
|
+
if value.is_a?(Array)
|
133
|
+
value.compact.map { |v| _to_hash(v) }
|
134
|
+
elsif value.is_a?(Hash)
|
135
|
+
{}.tap do |hash|
|
136
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
137
|
+
end
|
138
|
+
elsif value.respond_to? :to_hash
|
139
|
+
value.to_hash
|
140
|
+
else
|
141
|
+
value
|
142
|
+
end
|
143
|
+
end
|
144
|
+
end
|
145
|
+
end
|
146
|
+
# rubocop:enable Lint/UnneededCopDisableDirective
|
@@ -0,0 +1,195 @@
|
|
1
|
+
# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
|
2
|
+
|
3
|
+
require 'date'
|
4
|
+
|
5
|
+
# rubocop:disable Lint/UnneededCopDisableDirective
|
6
|
+
module OCI
|
7
|
+
# GenerateKeyDetails model.
|
8
|
+
class KeyManagement::Models::GenerateKeyDetails # rubocop:disable Metrics/LineLength
|
9
|
+
# Information that can be used to provide an encryption context for the
|
10
|
+
# encrypted data. The length of the string representation of the associatedData
|
11
|
+
# must be fewer than 4096 characters.
|
12
|
+
#
|
13
|
+
# @return [Hash<String, String>]
|
14
|
+
attr_accessor :associated_data
|
15
|
+
|
16
|
+
# **[Required]** If true, the generated key is also returned unencrypted.
|
17
|
+
# @return [BOOLEAN]
|
18
|
+
attr_accessor :include_plaintext_key
|
19
|
+
|
20
|
+
# **[Required]** The OCID of the master encryption key to encrypt the generated data encryption key with.
|
21
|
+
# @return [String]
|
22
|
+
attr_accessor :key_id
|
23
|
+
|
24
|
+
# This attribute is required.
|
25
|
+
# @return [OCI::KeyManagement::Models::KeyShape]
|
26
|
+
attr_accessor :key_shape
|
27
|
+
|
28
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
29
|
+
def self.attribute_map
|
30
|
+
{
|
31
|
+
# rubocop:disable Style/SymbolLiteral
|
32
|
+
'associated_data': :'associatedData',
|
33
|
+
'include_plaintext_key': :'includePlaintextKey',
|
34
|
+
'key_id': :'keyId',
|
35
|
+
'key_shape': :'keyShape'
|
36
|
+
# rubocop:enable Style/SymbolLiteral
|
37
|
+
}
|
38
|
+
end
|
39
|
+
|
40
|
+
# Attribute type mapping.
|
41
|
+
def self.swagger_types
|
42
|
+
{
|
43
|
+
# rubocop:disable Style/SymbolLiteral
|
44
|
+
'associated_data': :'Hash<String, String>',
|
45
|
+
'include_plaintext_key': :'BOOLEAN',
|
46
|
+
'key_id': :'String',
|
47
|
+
'key_shape': :'OCI::KeyManagement::Models::KeyShape'
|
48
|
+
# rubocop:enable Style/SymbolLiteral
|
49
|
+
}
|
50
|
+
end
|
51
|
+
|
52
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
53
|
+
# rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
54
|
+
|
55
|
+
|
56
|
+
# Initializes the object
|
57
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
58
|
+
# @option attributes [Hash<String, String>] :associated_data The value to assign to the {#associated_data} property
|
59
|
+
# @option attributes [BOOLEAN] :include_plaintext_key The value to assign to the {#include_plaintext_key} property
|
60
|
+
# @option attributes [String] :key_id The value to assign to the {#key_id} property
|
61
|
+
# @option attributes [OCI::KeyManagement::Models::KeyShape] :key_shape The value to assign to the {#key_shape} property
|
62
|
+
def initialize(attributes = {})
|
63
|
+
return unless attributes.is_a?(Hash)
|
64
|
+
|
65
|
+
# convert string to symbol for hash key
|
66
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
67
|
+
|
68
|
+
self.associated_data = attributes[:'associatedData'] if attributes[:'associatedData']
|
69
|
+
|
70
|
+
raise 'You cannot provide both :associatedData and :associated_data' if attributes.key?(:'associatedData') && attributes.key?(:'associated_data')
|
71
|
+
|
72
|
+
self.associated_data = attributes[:'associated_data'] if attributes[:'associated_data']
|
73
|
+
|
74
|
+
self.include_plaintext_key = attributes[:'includePlaintextKey'] unless attributes[:'includePlaintextKey'].nil?
|
75
|
+
|
76
|
+
raise 'You cannot provide both :includePlaintextKey and :include_plaintext_key' if attributes.key?(:'includePlaintextKey') && attributes.key?(:'include_plaintext_key')
|
77
|
+
|
78
|
+
self.include_plaintext_key = attributes[:'include_plaintext_key'] unless attributes[:'include_plaintext_key'].nil?
|
79
|
+
|
80
|
+
self.key_id = attributes[:'keyId'] if attributes[:'keyId']
|
81
|
+
|
82
|
+
raise 'You cannot provide both :keyId and :key_id' if attributes.key?(:'keyId') && attributes.key?(:'key_id')
|
83
|
+
|
84
|
+
self.key_id = attributes[:'key_id'] if attributes[:'key_id']
|
85
|
+
|
86
|
+
self.key_shape = attributes[:'keyShape'] if attributes[:'keyShape']
|
87
|
+
|
88
|
+
raise 'You cannot provide both :keyShape and :key_shape' if attributes.key?(:'keyShape') && attributes.key?(:'key_shape')
|
89
|
+
|
90
|
+
self.key_shape = attributes[:'key_shape'] if attributes[:'key_shape']
|
91
|
+
end
|
92
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
93
|
+
# rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
94
|
+
|
95
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
|
96
|
+
|
97
|
+
|
98
|
+
# Checks equality by comparing each attribute.
|
99
|
+
# @param [Object] other the other object to be compared
|
100
|
+
def ==(other)
|
101
|
+
return true if equal?(other)
|
102
|
+
self.class == other.class &&
|
103
|
+
associated_data == other.associated_data &&
|
104
|
+
include_plaintext_key == other.include_plaintext_key &&
|
105
|
+
key_id == other.key_id &&
|
106
|
+
key_shape == other.key_shape
|
107
|
+
end
|
108
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
|
109
|
+
|
110
|
+
# @see the `==` method
|
111
|
+
# @param [Object] other the other object to be compared
|
112
|
+
def eql?(other)
|
113
|
+
self == other
|
114
|
+
end
|
115
|
+
|
116
|
+
# rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
|
117
|
+
|
118
|
+
|
119
|
+
# Calculates hash code according to all attributes.
|
120
|
+
# @return [Fixnum] Hash code
|
121
|
+
def hash
|
122
|
+
[associated_data, include_plaintext_key, key_id, key_shape].hash
|
123
|
+
end
|
124
|
+
# rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
|
125
|
+
|
126
|
+
# rubocop:disable Metrics/AbcSize, Layout/EmptyLines
|
127
|
+
|
128
|
+
|
129
|
+
# Builds the object from hash
|
130
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
131
|
+
# @return [Object] Returns the model itself
|
132
|
+
def build_from_hash(attributes)
|
133
|
+
return nil unless attributes.is_a?(Hash)
|
134
|
+
self.class.swagger_types.each_pair do |key, type|
|
135
|
+
if type =~ /^Array<(.*)>/i
|
136
|
+
# check to ensure the input is an array given that the the attribute
|
137
|
+
# is documented as an array but the input is not
|
138
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
139
|
+
public_method("#{key}=").call(
|
140
|
+
attributes[self.class.attribute_map[key]]
|
141
|
+
.map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
|
142
|
+
)
|
143
|
+
end
|
144
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
145
|
+
public_method("#{key}=").call(
|
146
|
+
OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
|
147
|
+
)
|
148
|
+
end
|
149
|
+
# or else data not found in attributes(hash), not an issue as the data can be optional
|
150
|
+
end
|
151
|
+
|
152
|
+
self
|
153
|
+
end
|
154
|
+
# rubocop:enable Metrics/AbcSize, Layout/EmptyLines
|
155
|
+
|
156
|
+
# Returns the string representation of the object
|
157
|
+
# @return [String] String presentation of the object
|
158
|
+
def to_s
|
159
|
+
to_hash.to_s
|
160
|
+
end
|
161
|
+
|
162
|
+
# Returns the object in the form of hash
|
163
|
+
# @return [Hash] Returns the object in the form of hash
|
164
|
+
def to_hash
|
165
|
+
hash = {}
|
166
|
+
self.class.attribute_map.each_pair do |attr, param|
|
167
|
+
value = public_method(attr).call
|
168
|
+
next if value.nil? && !instance_variable_defined?("@#{attr}")
|
169
|
+
hash[param] = _to_hash(value)
|
170
|
+
end
|
171
|
+
hash
|
172
|
+
end
|
173
|
+
|
174
|
+
private
|
175
|
+
|
176
|
+
# Outputs non-array value in the form of hash
|
177
|
+
# For object, use to_hash. Otherwise, just return the value
|
178
|
+
# @param [Object] value Any valid value
|
179
|
+
# @return [Hash] Returns the value in the form of hash
|
180
|
+
def _to_hash(value)
|
181
|
+
if value.is_a?(Array)
|
182
|
+
value.compact.map { |v| _to_hash(v) }
|
183
|
+
elsif value.is_a?(Hash)
|
184
|
+
{}.tap do |hash|
|
185
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
186
|
+
end
|
187
|
+
elsif value.respond_to? :to_hash
|
188
|
+
value.to_hash
|
189
|
+
else
|
190
|
+
value
|
191
|
+
end
|
192
|
+
end
|
193
|
+
end
|
194
|
+
end
|
195
|
+
# rubocop:enable Lint/UnneededCopDisableDirective
|
@@ -0,0 +1,177 @@
|
|
1
|
+
# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
|
2
|
+
|
3
|
+
require 'date'
|
4
|
+
|
5
|
+
# rubocop:disable Lint/UnneededCopDisableDirective
|
6
|
+
module OCI
|
7
|
+
# GeneratedKey model.
|
8
|
+
class KeyManagement::Models::GeneratedKey # rubocop:disable Metrics/LineLength
|
9
|
+
# **[Required]** The encrypted generated data encryption key.
|
10
|
+
# @return [String]
|
11
|
+
attr_accessor :ciphertext
|
12
|
+
|
13
|
+
# The plaintext generated data encryption key, a base64-encoded
|
14
|
+
# sequence of random bytes, which is included if the
|
15
|
+
# GenerateDataEncryptionKey request includes the \"includePlaintextKey\"
|
16
|
+
# parameter and sets its value to 'true'.
|
17
|
+
#
|
18
|
+
# @return [String]
|
19
|
+
attr_accessor :plaintext
|
20
|
+
|
21
|
+
# The checksum of the plaintext generated data encryption key, which
|
22
|
+
# is included if the GenerateDataEncryptionKey request includes the
|
23
|
+
# \"includePlaintextKey parameter and sets its value to 'true'.
|
24
|
+
#
|
25
|
+
# @return [String]
|
26
|
+
attr_accessor :plaintext_checksum
|
27
|
+
|
28
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
29
|
+
def self.attribute_map
|
30
|
+
{
|
31
|
+
# rubocop:disable Style/SymbolLiteral
|
32
|
+
'ciphertext': :'ciphertext',
|
33
|
+
'plaintext': :'plaintext',
|
34
|
+
'plaintext_checksum': :'plaintextChecksum'
|
35
|
+
# rubocop:enable Style/SymbolLiteral
|
36
|
+
}
|
37
|
+
end
|
38
|
+
|
39
|
+
# Attribute type mapping.
|
40
|
+
def self.swagger_types
|
41
|
+
{
|
42
|
+
# rubocop:disable Style/SymbolLiteral
|
43
|
+
'ciphertext': :'String',
|
44
|
+
'plaintext': :'String',
|
45
|
+
'plaintext_checksum': :'String'
|
46
|
+
# rubocop:enable Style/SymbolLiteral
|
47
|
+
}
|
48
|
+
end
|
49
|
+
|
50
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
51
|
+
# rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
52
|
+
|
53
|
+
|
54
|
+
# Initializes the object
|
55
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
56
|
+
# @option attributes [String] :ciphertext The value to assign to the {#ciphertext} property
|
57
|
+
# @option attributes [String] :plaintext The value to assign to the {#plaintext} property
|
58
|
+
# @option attributes [String] :plaintext_checksum The value to assign to the {#plaintext_checksum} property
|
59
|
+
def initialize(attributes = {})
|
60
|
+
return unless attributes.is_a?(Hash)
|
61
|
+
|
62
|
+
# convert string to symbol for hash key
|
63
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
64
|
+
|
65
|
+
self.ciphertext = attributes[:'ciphertext'] if attributes[:'ciphertext']
|
66
|
+
|
67
|
+
self.plaintext = attributes[:'plaintext'] if attributes[:'plaintext']
|
68
|
+
|
69
|
+
self.plaintext_checksum = attributes[:'plaintextChecksum'] if attributes[:'plaintextChecksum']
|
70
|
+
|
71
|
+
raise 'You cannot provide both :plaintextChecksum and :plaintext_checksum' if attributes.key?(:'plaintextChecksum') && attributes.key?(:'plaintext_checksum')
|
72
|
+
|
73
|
+
self.plaintext_checksum = attributes[:'plaintext_checksum'] if attributes[:'plaintext_checksum']
|
74
|
+
end
|
75
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
76
|
+
# rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
77
|
+
|
78
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
|
79
|
+
|
80
|
+
|
81
|
+
# Checks equality by comparing each attribute.
|
82
|
+
# @param [Object] other the other object to be compared
|
83
|
+
def ==(other)
|
84
|
+
return true if equal?(other)
|
85
|
+
self.class == other.class &&
|
86
|
+
ciphertext == other.ciphertext &&
|
87
|
+
plaintext == other.plaintext &&
|
88
|
+
plaintext_checksum == other.plaintext_checksum
|
89
|
+
end
|
90
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
|
91
|
+
|
92
|
+
# @see the `==` method
|
93
|
+
# @param [Object] other the other object to be compared
|
94
|
+
def eql?(other)
|
95
|
+
self == other
|
96
|
+
end
|
97
|
+
|
98
|
+
# rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
|
99
|
+
|
100
|
+
|
101
|
+
# Calculates hash code according to all attributes.
|
102
|
+
# @return [Fixnum] Hash code
|
103
|
+
def hash
|
104
|
+
[ciphertext, plaintext, plaintext_checksum].hash
|
105
|
+
end
|
106
|
+
# rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
|
107
|
+
|
108
|
+
# rubocop:disable Metrics/AbcSize, Layout/EmptyLines
|
109
|
+
|
110
|
+
|
111
|
+
# Builds the object from hash
|
112
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
113
|
+
# @return [Object] Returns the model itself
|
114
|
+
def build_from_hash(attributes)
|
115
|
+
return nil unless attributes.is_a?(Hash)
|
116
|
+
self.class.swagger_types.each_pair do |key, type|
|
117
|
+
if type =~ /^Array<(.*)>/i
|
118
|
+
# check to ensure the input is an array given that the the attribute
|
119
|
+
# is documented as an array but the input is not
|
120
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
121
|
+
public_method("#{key}=").call(
|
122
|
+
attributes[self.class.attribute_map[key]]
|
123
|
+
.map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
|
124
|
+
)
|
125
|
+
end
|
126
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
127
|
+
public_method("#{key}=").call(
|
128
|
+
OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
|
129
|
+
)
|
130
|
+
end
|
131
|
+
# or else data not found in attributes(hash), not an issue as the data can be optional
|
132
|
+
end
|
133
|
+
|
134
|
+
self
|
135
|
+
end
|
136
|
+
# rubocop:enable Metrics/AbcSize, Layout/EmptyLines
|
137
|
+
|
138
|
+
# Returns the string representation of the object
|
139
|
+
# @return [String] String presentation of the object
|
140
|
+
def to_s
|
141
|
+
to_hash.to_s
|
142
|
+
end
|
143
|
+
|
144
|
+
# Returns the object in the form of hash
|
145
|
+
# @return [Hash] Returns the object in the form of hash
|
146
|
+
def to_hash
|
147
|
+
hash = {}
|
148
|
+
self.class.attribute_map.each_pair do |attr, param|
|
149
|
+
value = public_method(attr).call
|
150
|
+
next if value.nil? && !instance_variable_defined?("@#{attr}")
|
151
|
+
hash[param] = _to_hash(value)
|
152
|
+
end
|
153
|
+
hash
|
154
|
+
end
|
155
|
+
|
156
|
+
private
|
157
|
+
|
158
|
+
# Outputs non-array value in the form of hash
|
159
|
+
# For object, use to_hash. Otherwise, just return the value
|
160
|
+
# @param [Object] value Any valid value
|
161
|
+
# @return [Hash] Returns the value in the form of hash
|
162
|
+
def _to_hash(value)
|
163
|
+
if value.is_a?(Array)
|
164
|
+
value.compact.map { |v| _to_hash(v) }
|
165
|
+
elsif value.is_a?(Hash)
|
166
|
+
{}.tap do |hash|
|
167
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
168
|
+
end
|
169
|
+
elsif value.respond_to? :to_hash
|
170
|
+
value.to_hash
|
171
|
+
else
|
172
|
+
value
|
173
|
+
end
|
174
|
+
end
|
175
|
+
end
|
176
|
+
end
|
177
|
+
# rubocop:enable Lint/UnneededCopDisableDirective
|