Class UploadAttachmentOptions
Options for uploading files for attachments. When sending emails with the API that require attachments first upload each attachment. Then use the returned attachment ID in your SendEmailOptions
when sending an email. This way you can use attachments multiple times once they have been uploaded.
Implements
Inherited Members
Namespace: mailslurp.Model
Assembly: mailslurp.dll
Syntax
[DataContract(Name = "UploadAttachmentOptions")]
public class UploadAttachmentOptions : IEquatable<UploadAttachmentOptions>, IValidatableObject
Constructors
View SourceUploadAttachmentOptions()
Initializes a new instance of the UploadAttachmentOptions class.
Declaration
[JsonConstructor]
protected UploadAttachmentOptions()
UploadAttachmentOptions(string, string, string, string)
Initializes a new instance of the UploadAttachmentOptions class.
Declaration
public UploadAttachmentOptions(string contentId = null, string contentType = null, string filename = null, string base64Contents = null)
Parameters
Type | Name | Description |
---|---|---|
string | contentId | Optional contentId for file.. |
string | contentType | Optional contentType for file. For instance |
string | filename | Optional filename to save upload with. Will be the name that is shown in email clients. |
string | base64Contents | Base64 encoded string of file contents. Typically this means reading the bytes or string content of a file and then converting that to a base64 encoded string. For examples of how to do this see https://www.mailslurp.com/guides/base64-file-uploads/ (required). |
Properties
View SourceBase64Contents
Base64 encoded string of file contents. Typically this means reading the bytes or string content of a file and then converting that to a base64 encoded string. For examples of how to do this see https://www.mailslurp.com/guides/base64-file-uploads/
Declaration
[DataMember(Name = "base64Contents", IsRequired = true, EmitDefaultValue = true)]
public string Base64Contents { get; set; }
Property Value
Type | Description |
---|---|
string | Base64 encoded string of file contents. Typically this means reading the bytes or string content of a file and then converting that to a base64 encoded string. For examples of how to do this see https://www.mailslurp.com/guides/base64-file-uploads/ |
ContentId
Optional contentId for file.
Declaration
[DataMember(Name = "contentId", EmitDefaultValue = true)]
public string ContentId { get; set; }
Property Value
Type | Description |
---|---|
string | Optional contentId for file. |
ContentType
Optional contentType for file. For instance application/pdf
Declaration
[DataMember(Name = "contentType", EmitDefaultValue = true)]
public string ContentType { get; set; }
Property Value
Type | Description |
---|---|
string | Optional contentType for file. For instance |
Filename
Optional filename to save upload with. Will be the name that is shown in email clients
Declaration
[DataMember(Name = "filename", EmitDefaultValue = true)]
public string Filename { get; set; }
Property Value
Type | Description |
---|---|
string | Optional filename to save upload with. Will be the name that is shown in email clients |
Methods
View SourceEquals(UploadAttachmentOptions)
Returns true if UploadAttachmentOptions instances are equal
Declaration
public bool Equals(UploadAttachmentOptions input)
Parameters
Type | Name | Description |
---|---|---|
UploadAttachmentOptions | input | Instance of UploadAttachmentOptions to be compared |
Returns
Type | Description |
---|---|
bool | Boolean |
Equals(object)
Returns true if objects are equal
Declaration
public override bool Equals(object input)
Parameters
Type | Name | Description |
---|---|---|
object | input | Object to be compared |
Returns
Type | Description |
---|---|
bool | Boolean |
Overrides
View SourceGetHashCode()
Gets the hash code
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | Hash code |
Overrides
View SourceToJson()
Returns the JSON string presentation of the object
Declaration
public virtual string ToJson()
Returns
Type | Description |
---|---|
string | JSON string presentation of the object |
ToString()
Returns the string presentation of the object
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | String presentation of the object |
Overrides
Validate(ValidationContext)
To validate all properties of the instance
Declaration
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
Parameters
Type | Name | Description |
---|---|---|
ValidationContext | validationContext | Validation context |
Returns
Type | Description |
---|---|
IEnumerable<ValidationResult> | Validation Result |