Smartsheet.Api.Internal.AssociatedAttachmentResourcesImpl.AttachFile C# (CSharp) Method

AttachFile() private method

private AttachFile ( long objectId, string file, string contentType ) : Attachment
objectId long
file string
contentType string
return Smartsheet.Api.Models.Attachment
        public virtual Attachment AttachFile(long objectId, string file, string contentType)
        {
            throw new System.NotImplementedException();
        }

Same methods

AssociatedAttachmentResourcesImpl::AttachFile ( long objectId, string file, string contentType, long contentLength ) : Attachment

Usage Example

Example #1
0
        public virtual void TestAttachFile()
        {
            server.setResponseBody(@"..\..\..\TestSDK\resources\attachFile.json");
            string     file       = @"..\..\..\TestSDK\resources\large_sheet.pdf";
            Attachment attachment = associatedAttachment.AttachFile(1234L, file, "application/pdf");

            Assert.True(attachment.ID == 7265404226692996L);
            Assert.AreEqual("Testing.PDF", attachment.Name);
            Assert.AreEqual(AttachmentType.FILE, attachment.AttachmentType);
            Assert.AreEqual("application/pdf", attachment.MimeType);
            Assert.True(1831L == attachment.SizeInKb);
            Assert.AreEqual(AttachmentParentType.SHEET, attachment.ParentType);
        }