1313require 'date'
1414
1515module SibApiV3Sdk
16- # Email sending credentials including subject, body, to, cc etc .
16+ # Custom attributes for the report email .
1717 class SendReportEmail
18- # Subject of the email message
19- attr_accessor :subject
20-
2118 # Email addresses of the recipients
2219 attr_accessor :to
2320
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.
3422 attr_accessor :body
3523
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-
5824 # Attribute mapping from ruby-style variable name to JSON key.
5925 def self . attribute_map
6026 {
61- :'subject' => :'subject' ,
6227 :'to' => :'to' ,
63- :'content_type' => :'contentType' ,
64- :'bcc' => :'bcc' ,
65- :'cc' => :'cc' ,
6628 :'body' => :'body'
6729 }
6830 end
6931
7032 # Attribute type mapping.
7133 def self . swagger_types
7234 {
73- :'subject' => :'String' ,
7435 :'to' => :'Array<String>' ,
75- :'content_type' => :'String' ,
76- :'bcc' => :'Array<String>' ,
77- :'cc' => :'Array<String>' ,
7836 :'body' => :'String'
7937 }
8038 end
@@ -87,34 +45,12 @@ def initialize(attributes = {})
8745 # convert string to symbol for hash key
8846 attributes = attributes . each_with_object ( { } ) { |( k , v ) , h | h [ k . to_sym ] = v }
8947
90- if attributes . has_key? ( :'subject' )
91- self . subject = attributes [ :'subject' ]
92- end
93-
9448 if attributes . has_key? ( :'to' )
9549 if ( value = attributes [ :'to' ] ) . is_a? ( Array )
9650 self . to = value
9751 end
9852 end
9953
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-
11854 if attributes . has_key? ( :'body' )
11955 self . body = attributes [ :'body' ]
12056 end
@@ -124,10 +60,6 @@ def initialize(attributes = {})
12460 # @return Array for valid properties with the reasons
12561 def list_invalid_properties
12662 invalid_properties = Array . new
127- if @subject . nil?
128- invalid_properties . push ( 'invalid value for "subject", subject cannot be nil.' )
129- end
130-
13163 if @to . nil?
13264 invalid_properties . push ( 'invalid value for "to", to cannot be nil.' )
13365 end
@@ -142,34 +74,17 @@ def list_invalid_properties
14274 # Check to see if the all the properties in the model are valid
14375 # @return true if the model is valid
14476 def valid?
145- return false if @subject . nil?
14677 return false if @to . nil?
147- content_type_validator = EnumAttributeValidator . new ( 'String' , [ 'text' , 'html' ] )
148- return false unless content_type_validator . valid? ( @content_type )
14978 return false if @body . nil?
15079 true
15180 end
15281
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-
16382 # Checks equality by comparing each attribute.
16483 # @param [Object] Object to be compared
16584 def ==( o )
16685 return true if self . equal? ( o )
16786 self . class == o . class &&
168- subject == o . subject &&
16987 to == o . to &&
170- content_type == o . content_type &&
171- bcc == o . bcc &&
172- cc == o . cc &&
17388 body == o . body
17489 end
17590
@@ -182,7 +97,7 @@ def eql?(o)
18297 # Calculates hash code according to all attributes.
18398 # @return [Fixnum] Hash code
18499 def hash
185- [ subject , to , content_type , bcc , cc , body ] . hash
100+ [ to , body ] . hash
186101 end
187102
188103 # Builds the object from hash
0 commit comments