oci 2.0.8 → 2.0.9
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.
- checksums.yaml +4 -4
- data/README.md +2 -1
- data/lib/oci.rb +1 -0
- data/lib/oci/api_client.rb +22 -4
- data/lib/oci/audit/audit_client.rb +7 -7
- data/lib/oci/core/blockstorage_client.rb +30 -30
- data/lib/oci/core/compute_client.rb +55 -54
- data/lib/oci/core/core.rb +2 -0
- data/lib/oci/core/models/attach_paravirtualized_volume_details.rb +133 -0
- data/lib/oci/core/models/attach_volume_details.rb +2 -1
- data/lib/oci/core/models/create_image_details.rb +1 -1
- data/lib/oci/core/models/create_public_ip_details.rb +1 -1
- data/lib/oci/core/models/create_virtual_circuit_details.rb +1 -1
- data/lib/oci/core/models/create_volume_backup_details.rb +1 -1
- data/lib/oci/core/models/image.rb +22 -1
- data/lib/oci/core/models/image_source_details.rb +1 -1
- data/lib/oci/core/models/instance_source_via_image_details.rb +20 -1
- data/lib/oci/core/models/paravirtualized_volume_attachment.rb +154 -0
- data/lib/oci/core/models/update_virtual_circuit_details.rb +1 -1
- data/lib/oci/core/models/volume_attachment.rb +1 -0
- data/lib/oci/core/virtual_network_client.rb +154 -154
- data/lib/oci/database/database_client.rb +59 -59
- data/lib/oci/database/models/create_data_guard_association_details.rb +2 -2
- data/lib/oci/database/models/create_database_details.rb +1 -1
- data/lib/oci/database/models/create_db_home_with_db_system_id_base.rb +1 -1
- data/lib/oci/database/models/launch_db_system_details.rb +3 -3
- data/lib/oci/database/models/patch_details.rb +1 -1
- data/lib/oci/dns/dns_client.rb +44 -44
- data/lib/oci/dns/models/create_zone_details.rb +1 -1
- data/lib/oci/dns/models/record_operation.rb +1 -1
- data/lib/oci/email/email.rb +22 -0
- data/lib/oci/email/email_client.rb +417 -0
- data/lib/oci/email/models/create_sender_details.rb +147 -0
- data/lib/oci/email/models/create_suppression_details.rb +149 -0
- data/lib/oci/email/models/sender.rb +219 -0
- data/lib/oci/email/models/sender_summary.rb +195 -0
- data/lib/oci/email/models/suppression.rb +191 -0
- data/lib/oci/email/models/suppression_summary.rb +192 -0
- data/lib/oci/email/util.rb +2 -0
- data/lib/oci/file_storage/file_storage_client.rb +42 -42
- data/lib/oci/identity/identity.rb +4 -0
- data/lib/oci/identity/identity_client.rb +250 -94
- data/lib/oci/identity/models/compartment.rb +1 -1
- data/lib/oci/identity/models/create_compartment_details.rb +1 -1
- data/lib/oci/identity/models/create_identity_provider_details.rb +2 -2
- data/lib/oci/identity/models/create_smtp_credential_details.rb +122 -0
- data/lib/oci/identity/models/smtp_credential.rb +285 -0
- data/lib/oci/identity/models/smtp_credential_summary.rb +267 -0
- data/lib/oci/identity/models/update_compartment_details.rb +1 -0
- data/lib/oci/identity/models/update_identity_provider_details.rb +1 -1
- data/lib/oci/identity/models/update_smtp_credential_details.rb +121 -0
- data/lib/oci/load_balancer/load_balancer_client.rb +74 -74
- data/lib/oci/object_storage/models/create_bucket_details.rb +2 -2
- data/lib/oci/object_storage/models/create_preauthenticated_request_details.rb +1 -1
- data/lib/oci/object_storage/models/update_bucket_details.rb +1 -1
- data/lib/oci/object_storage/object_storage_client.rb +73 -73
- data/lib/oci/regions.rb +2 -1
- data/lib/oci/response.rb +1 -0
- data/lib/oci/version.rb +1 -1
- metadata +17 -20
@@ -0,0 +1,147 @@
|
|
1
|
+
# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
|
2
|
+
|
3
|
+
require 'date'
|
4
|
+
|
5
|
+
module OCI
|
6
|
+
# The details needed for creating a sender.
|
7
|
+
#
|
8
|
+
class Email::Models::CreateSenderDetails
|
9
|
+
# The OCID of the compartment that contains the sender.
|
10
|
+
# @return [String]
|
11
|
+
attr_accessor :compartment_id
|
12
|
+
|
13
|
+
# The email address of the sender.
|
14
|
+
# @return [String]
|
15
|
+
attr_accessor :email_address
|
16
|
+
|
17
|
+
|
18
|
+
# Initializes the object
|
19
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
20
|
+
# @option attributes [String] :compartment_id The value to assign to the {#compartment_id} property
|
21
|
+
# @option attributes [String] :email_address The value to assign to the {#email_address} property
|
22
|
+
def initialize(attributes = {})
|
23
|
+
return unless attributes.is_a?(Hash)
|
24
|
+
|
25
|
+
# convert string to symbol for hash key
|
26
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
27
|
+
|
28
|
+
if attributes[:'compartmentId']
|
29
|
+
self.compartment_id = attributes[:'compartmentId']
|
30
|
+
end
|
31
|
+
|
32
|
+
raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id')
|
33
|
+
|
34
|
+
if attributes[:'compartment_id']
|
35
|
+
self.compartment_id = attributes[:'compartment_id']
|
36
|
+
end
|
37
|
+
|
38
|
+
if attributes[:'emailAddress']
|
39
|
+
self.email_address = attributes[:'emailAddress']
|
40
|
+
end
|
41
|
+
|
42
|
+
raise 'You cannot provide both :emailAddress and :email_address' if attributes.key?(:'emailAddress') && attributes.key?(:'email_address')
|
43
|
+
|
44
|
+
if attributes[:'email_address']
|
45
|
+
self.email_address = attributes[:'email_address']
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
49
|
+
|
50
|
+
# Checks equality by comparing each attribute.
|
51
|
+
# @param [Object] other_object to be compared
|
52
|
+
def ==(other_object)
|
53
|
+
return true if self.equal?(other_object)
|
54
|
+
self.class == other_object.class &&
|
55
|
+
compartment_id == other_object.compartment_id &&
|
56
|
+
email_address == other_object.email_address
|
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
|
+
[compartment_id, email_address].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
|
+
:'compartment_id' => :'compartmentId',
|
135
|
+
:'email_address' => :'emailAddress'
|
136
|
+
}
|
137
|
+
end
|
138
|
+
|
139
|
+
# Attribute type mapping.
|
140
|
+
def self.swagger_types
|
141
|
+
{
|
142
|
+
:'compartment_id' => :'String',
|
143
|
+
:'email_address' => :'String'
|
144
|
+
}
|
145
|
+
end
|
146
|
+
end
|
147
|
+
end
|
@@ -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
|
+
# The details needed for creating a single suppression.
|
7
|
+
class Email::Models::CreateSuppressionDetails
|
8
|
+
# The OCID of the compartment to contain the suppression. Since
|
9
|
+
# suppressions are at the customer level, this must be the tenancy
|
10
|
+
# OCID.
|
11
|
+
#
|
12
|
+
# @return [String]
|
13
|
+
attr_accessor :compartment_id
|
14
|
+
|
15
|
+
# The recipient email address of the suppression.
|
16
|
+
# @return [String]
|
17
|
+
attr_accessor :email_address
|
18
|
+
|
19
|
+
|
20
|
+
# Initializes the object
|
21
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
22
|
+
# @option attributes [String] :compartment_id The value to assign to the {#compartment_id} property
|
23
|
+
# @option attributes [String] :email_address The value to assign to the {#email_address} property
|
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
|
+
raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id')
|
35
|
+
|
36
|
+
if attributes[:'compartment_id']
|
37
|
+
self.compartment_id = attributes[:'compartment_id']
|
38
|
+
end
|
39
|
+
|
40
|
+
if attributes[:'emailAddress']
|
41
|
+
self.email_address = attributes[:'emailAddress']
|
42
|
+
end
|
43
|
+
|
44
|
+
raise 'You cannot provide both :emailAddress and :email_address' if attributes.key?(:'emailAddress') && attributes.key?(:'email_address')
|
45
|
+
|
46
|
+
if attributes[:'email_address']
|
47
|
+
self.email_address = attributes[:'email_address']
|
48
|
+
end
|
49
|
+
|
50
|
+
end
|
51
|
+
|
52
|
+
# Checks equality by comparing each attribute.
|
53
|
+
# @param [Object] other_object to be compared
|
54
|
+
def ==(other_object)
|
55
|
+
return true if self.equal?(other_object)
|
56
|
+
self.class == other_object.class &&
|
57
|
+
compartment_id == other_object.compartment_id &&
|
58
|
+
email_address == other_object.email_address
|
59
|
+
end
|
60
|
+
|
61
|
+
# @see the `==` method
|
62
|
+
# @param [Object] other_object to be compared
|
63
|
+
def eql?(other_object)
|
64
|
+
self == other_object
|
65
|
+
end
|
66
|
+
|
67
|
+
# Calculates hash code according to all attributes.
|
68
|
+
# @return [Fixnum] Hash code
|
69
|
+
def hash
|
70
|
+
[compartment_id, email_address].hash
|
71
|
+
end
|
72
|
+
|
73
|
+
# Builds the object from hash
|
74
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
75
|
+
# @return [Object] Returns the model itself
|
76
|
+
def build_from_hash(attributes)
|
77
|
+
return nil unless attributes.is_a?(Hash)
|
78
|
+
self.class.swagger_types.each_pair do |key, type|
|
79
|
+
if type =~ /^Array<(.*)>/i
|
80
|
+
# check to ensure the input is an array given that the the attribute
|
81
|
+
# is documented as an array but the input is not
|
82
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
83
|
+
self.public_method("#{key}=").call(attributes[self.class.attribute_map[key]].map{ |v| OCI::Internal::Util.convert_to_type($1, v) } )
|
84
|
+
end
|
85
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
86
|
+
self.public_method("#{key}=").call(OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
|
87
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
88
|
+
end
|
89
|
+
|
90
|
+
self
|
91
|
+
end
|
92
|
+
|
93
|
+
# Returns the string representation of the object
|
94
|
+
# @return [String] String presentation of the object
|
95
|
+
def to_s
|
96
|
+
to_hash.to_s
|
97
|
+
end
|
98
|
+
|
99
|
+
# Returns the object in the form of hash
|
100
|
+
# @return [Hash] Returns the object in the form of hash
|
101
|
+
def to_hash
|
102
|
+
hash = {}
|
103
|
+
self.class.attribute_map.each_pair do |attr, param|
|
104
|
+
value = public_method(attr).call
|
105
|
+
next if value.nil? && !instance_variable_defined?("@#{attr}")
|
106
|
+
hash[param] = _to_hash(value)
|
107
|
+
end
|
108
|
+
hash
|
109
|
+
end
|
110
|
+
|
111
|
+
private
|
112
|
+
|
113
|
+
# Outputs non-array value in the form of hash
|
114
|
+
# For object, use to_hash. Otherwise, just return the value
|
115
|
+
# @param [Object] value Any valid value
|
116
|
+
# @return [Hash] Returns the value in the form of hash
|
117
|
+
def _to_hash(value)
|
118
|
+
if value.is_a?(Array)
|
119
|
+
value.compact.map{ |v| _to_hash(v) }
|
120
|
+
elsif value.is_a?(Hash)
|
121
|
+
{}.tap do |hash|
|
122
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
123
|
+
end
|
124
|
+
elsif value.respond_to? :to_hash
|
125
|
+
value.to_hash
|
126
|
+
else
|
127
|
+
value
|
128
|
+
end
|
129
|
+
end
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
134
|
+
def self.attribute_map
|
135
|
+
{
|
136
|
+
:'compartment_id' => :'compartmentId',
|
137
|
+
:'email_address' => :'emailAddress'
|
138
|
+
}
|
139
|
+
end
|
140
|
+
|
141
|
+
# Attribute type mapping.
|
142
|
+
def self.swagger_types
|
143
|
+
{
|
144
|
+
:'compartment_id' => :'String',
|
145
|
+
:'email_address' => :'String'
|
146
|
+
}
|
147
|
+
end
|
148
|
+
end
|
149
|
+
end
|
@@ -0,0 +1,219 @@
|
|
1
|
+
# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
|
2
|
+
|
3
|
+
require 'date'
|
4
|
+
|
5
|
+
module OCI
|
6
|
+
# The full information representing an approved sender.
|
7
|
+
class Email::Models::Sender
|
8
|
+
|
9
|
+
LIFECYCLE_STATE_ENUM = [LIFECYCLE_STATE_CREATING = 'CREATING',
|
10
|
+
LIFECYCLE_STATE_ACTIVE = 'ACTIVE',
|
11
|
+
LIFECYCLE_STATE_DELETING = 'DELETING',
|
12
|
+
LIFECYCLE_STATE_DELETED = 'DELETED',
|
13
|
+
LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE']
|
14
|
+
|
15
|
+
# Email address of the sender.
|
16
|
+
# @return [String]
|
17
|
+
attr_accessor :email_address
|
18
|
+
|
19
|
+
# The unique OCID of the sender.
|
20
|
+
# @return [String]
|
21
|
+
attr_accessor :id
|
22
|
+
|
23
|
+
# Value of the SPF field. For more information about SPF, please see
|
24
|
+
# [SPF Authentication](https://docs.us-phoenix-1.oraclecloud.com/Content/Email/Concepts/emaildeliveryoverview.htm#spf).
|
25
|
+
#
|
26
|
+
# @return [BOOLEAN]
|
27
|
+
attr_accessor :is_spf
|
28
|
+
|
29
|
+
# The sender's current lifecycle state.
|
30
|
+
# @return [String]
|
31
|
+
attr_accessor :lifecycle_state
|
32
|
+
|
33
|
+
# The date and time the approved sender was added in \"YYYY-MM-ddThh:mmZ\"
|
34
|
+
# format with a Z offset, as defined by RFC 3339.
|
35
|
+
#
|
36
|
+
# @return [DateTime]
|
37
|
+
attr_accessor :time_created
|
38
|
+
|
39
|
+
|
40
|
+
# Initializes the object
|
41
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
42
|
+
# @option attributes [String] :email_address The value to assign to the {#email_address} property
|
43
|
+
# @option attributes [String] :id The value to assign to the {#id} property
|
44
|
+
# @option attributes [BOOLEAN] :is_spf The value to assign to the {#is_spf} property
|
45
|
+
# @option attributes [String] :lifecycle_state The value to assign to the {#lifecycle_state} property
|
46
|
+
# @option attributes [DateTime] :time_created The value to assign to the {#time_created} property
|
47
|
+
def initialize(attributes = {})
|
48
|
+
return unless attributes.is_a?(Hash)
|
49
|
+
|
50
|
+
# convert string to symbol for hash key
|
51
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
52
|
+
|
53
|
+
if attributes[:'emailAddress']
|
54
|
+
self.email_address = attributes[:'emailAddress']
|
55
|
+
end
|
56
|
+
|
57
|
+
raise 'You cannot provide both :emailAddress and :email_address' if attributes.key?(:'emailAddress') && attributes.key?(:'email_address')
|
58
|
+
|
59
|
+
if attributes[:'email_address']
|
60
|
+
self.email_address = attributes[:'email_address']
|
61
|
+
end
|
62
|
+
|
63
|
+
if attributes[:'id']
|
64
|
+
self.id = attributes[:'id']
|
65
|
+
end
|
66
|
+
|
67
|
+
unless attributes[:'isSpf'].nil?
|
68
|
+
self.is_spf = attributes[:'isSpf']
|
69
|
+
else
|
70
|
+
self.is_spf = false
|
71
|
+
end
|
72
|
+
|
73
|
+
raise 'You cannot provide both :isSpf and :is_spf' if attributes.key?(:'isSpf') && attributes.key?(:'is_spf')
|
74
|
+
|
75
|
+
unless attributes[:'is_spf'].nil?
|
76
|
+
self.is_spf = attributes[:'is_spf']
|
77
|
+
else
|
78
|
+
self.is_spf = false
|
79
|
+
end
|
80
|
+
|
81
|
+
if attributes[:'lifecycleState']
|
82
|
+
self.lifecycle_state = attributes[:'lifecycleState']
|
83
|
+
end
|
84
|
+
|
85
|
+
raise 'You cannot provide both :lifecycleState and :lifecycle_state' if attributes.key?(:'lifecycleState') && attributes.key?(:'lifecycle_state')
|
86
|
+
|
87
|
+
if attributes[:'lifecycle_state']
|
88
|
+
self.lifecycle_state = attributes[:'lifecycle_state']
|
89
|
+
end
|
90
|
+
|
91
|
+
if attributes[:'timeCreated']
|
92
|
+
self.time_created = attributes[:'timeCreated']
|
93
|
+
end
|
94
|
+
|
95
|
+
raise 'You cannot provide both :timeCreated and :time_created' if attributes.key?(:'timeCreated') && attributes.key?(:'time_created')
|
96
|
+
|
97
|
+
if attributes[:'time_created']
|
98
|
+
self.time_created = attributes[:'time_created']
|
99
|
+
end
|
100
|
+
|
101
|
+
end
|
102
|
+
|
103
|
+
# Custom attribute writer method checking allowed values (enum).
|
104
|
+
# @param [Object] lifecycle_state Object to be assigned
|
105
|
+
def lifecycle_state=(lifecycle_state)
|
106
|
+
if lifecycle_state && !LIFECYCLE_STATE_ENUM.include?(lifecycle_state)
|
107
|
+
@lifecycle_state = LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE
|
108
|
+
else
|
109
|
+
@lifecycle_state = lifecycle_state
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
113
|
+
# Checks equality by comparing each attribute.
|
114
|
+
# @param [Object] other_object to be compared
|
115
|
+
def ==(other_object)
|
116
|
+
return true if self.equal?(other_object)
|
117
|
+
self.class == other_object.class &&
|
118
|
+
email_address == other_object.email_address &&
|
119
|
+
id == other_object.id &&
|
120
|
+
is_spf == other_object.is_spf &&
|
121
|
+
lifecycle_state == other_object.lifecycle_state &&
|
122
|
+
time_created == other_object.time_created
|
123
|
+
end
|
124
|
+
|
125
|
+
# @see the `==` method
|
126
|
+
# @param [Object] other_object to be compared
|
127
|
+
def eql?(other_object)
|
128
|
+
self == other_object
|
129
|
+
end
|
130
|
+
|
131
|
+
# Calculates hash code according to all attributes.
|
132
|
+
# @return [Fixnum] Hash code
|
133
|
+
def hash
|
134
|
+
[email_address, id, is_spf, lifecycle_state, time_created].hash
|
135
|
+
end
|
136
|
+
|
137
|
+
# Builds the object from hash
|
138
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
139
|
+
# @return [Object] Returns the model itself
|
140
|
+
def build_from_hash(attributes)
|
141
|
+
return nil unless attributes.is_a?(Hash)
|
142
|
+
self.class.swagger_types.each_pair do |key, type|
|
143
|
+
if type =~ /^Array<(.*)>/i
|
144
|
+
# check to ensure the input is an array given that the the attribute
|
145
|
+
# is documented as an array but the input is not
|
146
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
147
|
+
self.public_method("#{key}=").call(attributes[self.class.attribute_map[key]].map{ |v| OCI::Internal::Util.convert_to_type($1, v) } )
|
148
|
+
end
|
149
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
150
|
+
self.public_method("#{key}=").call(OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
|
151
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
152
|
+
end
|
153
|
+
|
154
|
+
self
|
155
|
+
end
|
156
|
+
|
157
|
+
# Returns the string representation of the object
|
158
|
+
# @return [String] String presentation of the object
|
159
|
+
def to_s
|
160
|
+
to_hash.to_s
|
161
|
+
end
|
162
|
+
|
163
|
+
# Returns the object in the form of hash
|
164
|
+
# @return [Hash] Returns the object in the form of hash
|
165
|
+
def to_hash
|
166
|
+
hash = {}
|
167
|
+
self.class.attribute_map.each_pair do |attr, param|
|
168
|
+
value = public_method(attr).call
|
169
|
+
next if value.nil? && !instance_variable_defined?("@#{attr}")
|
170
|
+
hash[param] = _to_hash(value)
|
171
|
+
end
|
172
|
+
hash
|
173
|
+
end
|
174
|
+
|
175
|
+
private
|
176
|
+
|
177
|
+
# Outputs non-array value in the form of hash
|
178
|
+
# For object, use to_hash. Otherwise, just return the value
|
179
|
+
# @param [Object] value Any valid value
|
180
|
+
# @return [Hash] Returns the value in the form of hash
|
181
|
+
def _to_hash(value)
|
182
|
+
if value.is_a?(Array)
|
183
|
+
value.compact.map{ |v| _to_hash(v) }
|
184
|
+
elsif value.is_a?(Hash)
|
185
|
+
{}.tap do |hash|
|
186
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
187
|
+
end
|
188
|
+
elsif value.respond_to? :to_hash
|
189
|
+
value.to_hash
|
190
|
+
else
|
191
|
+
value
|
192
|
+
end
|
193
|
+
end
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
198
|
+
def self.attribute_map
|
199
|
+
{
|
200
|
+
:'email_address' => :'emailAddress',
|
201
|
+
:'id' => :'id',
|
202
|
+
:'is_spf' => :'isSpf',
|
203
|
+
:'lifecycle_state' => :'lifecycleState',
|
204
|
+
:'time_created' => :'timeCreated'
|
205
|
+
}
|
206
|
+
end
|
207
|
+
|
208
|
+
# Attribute type mapping.
|
209
|
+
def self.swagger_types
|
210
|
+
{
|
211
|
+
:'email_address' => :'String',
|
212
|
+
:'id' => :'String',
|
213
|
+
:'is_spf' => :'BOOLEAN',
|
214
|
+
:'lifecycle_state' => :'String',
|
215
|
+
:'time_created' => :'DateTime'
|
216
|
+
}
|
217
|
+
end
|
218
|
+
end
|
219
|
+
end
|