13
13
require 'date'
14
14
15
15
module SibApiV3Sdk
16
- # Email sending credentials including subject, body, to, cc etc .
16
+ # Custom attributes for the report email .
17
17
class SendReportEmail
18
- # Subject of the email message
19
- attr_accessor :subject
20
-
21
18
# Email addresses of the recipients
22
19
attr_accessor :to
23
20
24
- # Type of the message body
25
- attr_accessor :content_type
26
-
27
- # Email addresses of the recipients in bcc
28
- attr_accessor :bcc
29
-
30
- # Email addresses of the recipients in cc
31
- attr_accessor :cc
32
-
33
- # Body of the email message
21
+ # Custom text message to be presented in the report email.
34
22
attr_accessor :body
35
23
36
- class EnumAttributeValidator
37
- attr_reader :datatype
38
- attr_reader :allowable_values
39
-
40
- def initialize ( datatype , allowable_values )
41
- @allowable_values = allowable_values . map do |value |
42
- case datatype . to_s
43
- when /Integer/i
44
- value . to_i
45
- when /Float/i
46
- value . to_f
47
- else
48
- value
49
- end
50
- end
51
- end
52
-
53
- def valid? ( value )
54
- !value || allowable_values . include? ( value )
55
- end
56
- end
57
-
58
24
# Attribute mapping from ruby-style variable name to JSON key.
59
25
def self . attribute_map
60
26
{
61
- :'subject' => :'subject' ,
62
27
:'to' => :'to' ,
63
- :'content_type' => :'contentType' ,
64
- :'bcc' => :'bcc' ,
65
- :'cc' => :'cc' ,
66
28
:'body' => :'body'
67
29
}
68
30
end
69
31
70
32
# Attribute type mapping.
71
33
def self . swagger_types
72
34
{
73
- :'subject' => :'String' ,
74
35
:'to' => :'Array<String>' ,
75
- :'content_type' => :'String' ,
76
- :'bcc' => :'Array<String>' ,
77
- :'cc' => :'Array<String>' ,
78
36
:'body' => :'String'
79
37
}
80
38
end
@@ -87,34 +45,12 @@ def initialize(attributes = {})
87
45
# convert string to symbol for hash key
88
46
attributes = attributes . each_with_object ( { } ) { |( k , v ) , h | h [ k . to_sym ] = v }
89
47
90
- if attributes . has_key? ( :'subject' )
91
- self . subject = attributes [ :'subject' ]
92
- end
93
-
94
48
if attributes . has_key? ( :'to' )
95
49
if ( value = attributes [ :'to' ] ) . is_a? ( Array )
96
50
self . to = value
97
51
end
98
52
end
99
53
100
- if attributes . has_key? ( :'contentType' )
101
- self . content_type = attributes [ :'contentType' ]
102
- else
103
- self . content_type = 'html'
104
- end
105
-
106
- if attributes . has_key? ( :'bcc' )
107
- if ( value = attributes [ :'bcc' ] ) . is_a? ( Array )
108
- self . bcc = value
109
- end
110
- end
111
-
112
- if attributes . has_key? ( :'cc' )
113
- if ( value = attributes [ :'cc' ] ) . is_a? ( Array )
114
- self . cc = value
115
- end
116
- end
117
-
118
54
if attributes . has_key? ( :'body' )
119
55
self . body = attributes [ :'body' ]
120
56
end
@@ -124,10 +60,6 @@ def initialize(attributes = {})
124
60
# @return Array for valid properties with the reasons
125
61
def list_invalid_properties
126
62
invalid_properties = Array . new
127
- if @subject . nil?
128
- invalid_properties . push ( 'invalid value for "subject", subject cannot be nil.' )
129
- end
130
-
131
63
if @to . nil?
132
64
invalid_properties . push ( 'invalid value for "to", to cannot be nil.' )
133
65
end
@@ -142,34 +74,17 @@ def list_invalid_properties
142
74
# Check to see if the all the properties in the model are valid
143
75
# @return true if the model is valid
144
76
def valid?
145
- return false if @subject . nil?
146
77
return false if @to . nil?
147
- content_type_validator = EnumAttributeValidator . new ( 'String' , [ 'text' , 'html' ] )
148
- return false unless content_type_validator . valid? ( @content_type )
149
78
return false if @body . nil?
150
79
true
151
80
end
152
81
153
- # Custom attribute writer method checking allowed values (enum).
154
- # @param [Object] content_type Object to be assigned
155
- def content_type = ( content_type )
156
- validator = EnumAttributeValidator . new ( 'String' , [ 'text' , 'html' ] )
157
- unless validator . valid? ( content_type )
158
- fail ArgumentError , 'invalid value for "content_type", must be one of #{validator.allowable_values}.'
159
- end
160
- @content_type = content_type
161
- end
162
-
163
82
# Checks equality by comparing each attribute.
164
83
# @param [Object] Object to be compared
165
84
def ==( o )
166
85
return true if self . equal? ( o )
167
86
self . class == o . class &&
168
- subject == o . subject &&
169
87
to == o . to &&
170
- content_type == o . content_type &&
171
- bcc == o . bcc &&
172
- cc == o . cc &&
173
88
body == o . body
174
89
end
175
90
@@ -182,7 +97,7 @@ def eql?(o)
182
97
# Calculates hash code according to all attributes.
183
98
# @return [Fixnum] Hash code
184
99
def hash
185
- [ subject , to , content_type , bcc , cc , body ] . hash
100
+ [ to , body ] . hash
186
101
end
187
102
188
103
# Builds the object from hash
0 commit comments