44from .disposition import Disposition
55from .content_id import ContentId
66
7+
78class Attachment (object ):
89 """An attachment to be included with an email."""
910
10- def __init__ (self , file_content = None , file_name = None , file_type = None , disposition = None , content_id = None ):
11+ def __init__ (
12+ self ,
13+ file_content = None ,
14+ file_name = None ,
15+ file_type = None ,
16+ disposition = None ,
17+ content_id = None ):
1118 """Create an Attachment
1219
1320 :param file_content: The Base64 encoded content of the attachment
@@ -16,17 +23,21 @@ def __init__(self, file_content=None, file_name=None, file_type=None, dispositi
1623 :type file_name: FileName, string
1724 :param file_type: The MIME type of the content you are attaching
1825 :type file_type FileType, string, optional
19- :param disposition: The content-disposition of the attachment, specifying display style.
20- Specifies how you would like the attachment to be displayed.
21- - "inline" results in the attached file being displayed automatically
22- within the message.
23- - "attachment" results in the attached file requiring some action to
24- display (e.g. opening or downloading the file).
25- If unspecified, "attachment" is used. Must be one of the two choices.
26+ :param disposition: The content-disposition of the attachment,
27+ specifying display style. Specifies how you
28+ would like the attachment to be displayed.
29+ - "inline" results in the attached file being
30+ displayed automatically within the message.
31+ - "attachment" results in the attached file
32+ requiring some action to display (e.g. opening
33+ or downloading the file).
34+ If unspecified, "attachment" is used. Must be one
35+ of the two choices.
2636 :type disposition: Disposition, string, optional
2737 :param content_id: The content id for the attachment.
28- This is used when the Disposition is set to "inline" and the attachment
29- is an image, allowing the file to be displayed within the email body.
38+ This is used when the Disposition is set to
39+ "inline" and the attachment is an image, allowing
40+ the file to be displayed within the email body.
3041 :type content_id: ContentId, string, optional
3142 """
3243 self ._file_content = None
@@ -37,16 +48,16 @@ def __init__(self, file_content=None, file_name=None, file_type=None, dispositi
3748
3849 if file_content is not None :
3950 self .file_content = file_content
40-
51+
4152 if file_type is not None :
4253 self .file_type = file_type
43-
54+
4455 if file_name is not None :
4556 self .file_name = file_name
46-
57+
4758 if disposition is not None :
4859 self .disposition = disposition
49-
60+
5061 if content_id is not None :
5162 self .content_id = content_id
5263
@@ -136,13 +147,16 @@ def disposition(self, value):
136147 display (e.g. opening or downloading the file).
137148 If unspecified, "attachment" is used. Must be one of the two choices.
138149
139- :param disposition: The content-disposition of the attachment, specifying display style.
140- Specifies how you would like the attachment to be displayed.
141- - "inline" results in the attached file being displayed automatically
142- within the message.
143- - "attachment" results in the attached file requiring some action to
144- display (e.g. opening or downloading the file).
145- If unspecified, "attachment" is used. Must be one of the two choices.
150+ :param disposition: The content-disposition of the attachment,
151+ specifying display style. Specifies how you would
152+ like the attachment to be displayed.
153+ - "inline" results in the attached file being
154+ displayed automatically within the message.
155+ - "attachment" results in the attached file
156+ requiring some action to display (e.g. opening
157+ or downloading the file).
158+ If unspecified, "attachment" is used. Must be one
159+ of the two choices.
146160 :type disposition: Disposition, string, optional
147161 """
148162 if isinstance (value , Disposition ):
@@ -169,8 +183,9 @@ def content_id(self, value):
169183 is an image, allowing the file to be displayed within the email body.
170184
171185 :param content_id: The content id for the attachment.
172- This is used when the Disposition is set to "inline" and the attachment
173- is an image, allowing the file to be displayed within the email body.
186+ This is used when the Disposition is set to "inline"
187+ and the attachment is an image, allowing the file to
188+ be displayed within the email body.
174189 :type content_id: ContentId, string, optional
175190 """
176191 if isinstance (value , ContentId ):
0 commit comments