Class AttachmentMetaData
Meta data associated with an attachment. Attachments are stored as byte blobs so the meta data is stored separately.
Inherited Members
Namespace: mailslurp.Model
Assembly: mailslurp.dll
Syntax
[DataContract(Name = "AttachmentMetaData")]
public class AttachmentMetaData : IEquatable<AttachmentMetaData>, IValidatableObject
Constructors
View SourceAttachmentMetaData()
Initializes a new instance of the AttachmentMetaData class.
Declaration
[JsonConstructor]
protected AttachmentMetaData()
AttachmentMetaData(string, string, long, string, string)
Initializes a new instance of the AttachmentMetaData class.
Declaration
public AttachmentMetaData(string name = null, string contentType = null, long contentLength = 0, string id = null, string contentId = null)
Parameters
Type | Name | Description |
---|---|---|
string | name | Name of attachment if given (required). |
string | contentType | Content type of attachment such as |
long | contentLength | Size of attachment in bytes (required). |
string | id | ID of attachment. Can be used to with attachment controller endpoints to download attachment or with sending methods to attach to an email. (required). |
string | contentId | CID of attachment. |
Properties
View SourceContentId
CID of attachment
Declaration
[DataMember(Name = "contentId", EmitDefaultValue = true)]
public string ContentId { get; set; }
Property Value
Type | Description |
---|---|
string | CID of attachment |
ContentLength
Size of attachment in bytes
Declaration
[DataMember(Name = "contentLength", IsRequired = true, EmitDefaultValue = true)]
public long ContentLength { get; set; }
Property Value
Type | Description |
---|---|
long | Size of attachment in bytes |
ContentType
Content type of attachment such as image/png
Declaration
[DataMember(Name = "contentType", IsRequired = true, EmitDefaultValue = true)]
public string ContentType { get; set; }
Property Value
Type | Description |
---|---|
string | Content type of attachment such as |
Id
ID of attachment. Can be used to with attachment controller endpoints to download attachment or with sending methods to attach to an email.
Declaration
[DataMember(Name = "id", IsRequired = true, EmitDefaultValue = true)]
public string Id { get; set; }
Property Value
Type | Description |
---|---|
string | ID of attachment. Can be used to with attachment controller endpoints to download attachment or with sending methods to attach to an email. |
Name
Name of attachment if given
Declaration
[DataMember(Name = "name", IsRequired = true, EmitDefaultValue = true)]
public string Name { get; set; }
Property Value
Type | Description |
---|---|
string | Name of attachment if given |
Methods
View SourceEquals(AttachmentMetaData)
Returns true if AttachmentMetaData instances are equal
Declaration
public bool Equals(AttachmentMetaData input)
Parameters
Type | Name | Description |
---|---|---|
AttachmentMetaData | input | Instance of AttachmentMetaData 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 |