Example #1
0
        public static Task <IEnumerable <Expense> > GetExpensesAsync(this FreeAgentClient client, ExpenseFilter filterBy = ExpenseFilter.All, DateTime?fromDate = null, DateTime?toDate = null)
        {
            var view = filterBy.GetMemberValue();

            return(client.GetOrCreateAsync(c => c.ExpenseList(client.Configuration.CurrentHeader, view, fromDate, toDate), r => r.Expenses));
        }
Example #2
0
        public static Task <Contact> GetContactAsync(this FreeAgentClient client, Contact contact)
        {
            var id = client.ExtractId(contact);

            return(client.GetContactAsync(id));
        }
Example #3
0
 public static Task <Contact> GetContactAsync(this FreeAgentClient client, int contactId)
 {
     return(client.GetOrCreateAsync(c => c.GetContact(client.Configuration.CurrentHeader, contactId), r => r.Contact));
 }
Example #4
0
 public ResourceClient(FreeAgentClient client) : base(client)
 {
 }
 public CategoryClient(FreeAgentClient client) : base(client)
 {
 }
Example #6
0
        public static Task <NoteItem> GetNoteAsync(this FreeAgentClient client, NoteItem note)
        {
            var id = client.ExtractId(note);

            return(client.GetNoteAsync(id));
        }
Example #7
0
 public static Task <NoteItem> GetNoteAsync(this FreeAgentClient client, int noteId)
 {
     return(client.GetOrCreateAsync(c => c.GetNote(client.Configuration.CurrentHeader, noteId), r => r.Note));
 }
 public BankAccountClient(FreeAgentClient client) : base(client)
 {
 }
 public BankTransactionExplanationClient(FreeAgentClient client) : base(client)
 {
 }
Example #10
0
 public static Task DeleteBankAccountAsync(this FreeAgentClient client, BankAccount account)
 {
     return(client.UpdateOrDeleteAsync(account, (c, id) => c.DeleteBankAccount(client.Configuration.CurrentHeader, id)));
 }
Example #11
0
 public CompanyClient(FreeAgentClient client)
     : base(client)
 {
 }
Example #12
0
 public static Task <BankTransactionExplanation> CreateBankTransactionExplanationAsync(this FreeAgentClient client, BankTransactionExplanation explanation)
 {
     return(client.GetOrCreateAsync(c => c.CreateBankTransactionExplanation(client.Configuration.CurrentHeader, explanation.Wrap()), r => r.BankTransactionExplanation));
 }
Example #13
0
 public static Task <BankAccount> CreateBankAccountAsync(this FreeAgentClient client, BankAccount account)
 {
     return(client.GetOrCreateAsync(c => c.CreateBankAccount(client.Configuration.CurrentHeader, account.Wrap()), r => r.BankAccount));
 }
Example #14
0
        public static Task <BankAccount> GetBankAccountAsync(this FreeAgentClient client, Uri url)
        {
            var id = url.GetId();

            return(client.GetBankAccountAsync(id));
        }
Example #15
0
 public static Task UpdateExpenseAsync(this FreeAgentClient client, Expense expense)
 {
     return(client.UpdateOrDeleteAsync(expense, (c, id) => c.UpdateExpense(client.Configuration.CurrentHeader, id, expense.Wrap())));
 }
 public static Task <IEnumerable <Invoice> > ListInvoicesForContactAsync(this FreeAgentClient client, Uri contact)
 {
     return(client.GetOrCreateAsync(c => c.ListInvoicesForContact(client.Configuration.CurrentHeader, contact), r => r.Invoices));
 }
Example #17
0
 public CategoryClient(FreeAgentClient client)
     : base(client)
 {
 }
 public static Task <Invoice> CreateInvoice(this FreeAgentClient client, Invoice invoice)
 {
     return(client.GetOrCreateAsync(c => c.CreateInvoice(client.Configuration.CurrentHeader, invoice.Wrap()), r => r.Invoice));
 }
Example #19
0
        public static Task <NoteItem> GetNoteAsync(this FreeAgentClient client, Uri url)
        {
            var id = url.GetId();

            return(client.GetNoteAsync(id));
        }
 public static Task CreateInvoiceEmail(this FreeAgentClient client, int invoiceId, InvoiceEmail email)
 {
     return(client.Execute(c => c.EmailInvoice(client.Configuration.CurrentHeader, invoiceId, email.Wrap())));
 }
Example #21
0
 public static Task DeleteNoteAsync(this FreeAgentClient client, NoteItem note)
 {
     return(client.UpdateOrDeleteAsync(note, (c, id) => c.DeleteNote(client.Configuration.CurrentHeader, id)));
 }
        public static Task <Invoice> GetInvoiceAsync(this FreeAgentClient client, Invoice invoice)
        {
            var id = client.ExtractId(invoice);

            return(client.GetInvoiceAsync(id));
        }
Example #23
0
 public UserClient(FreeAgentClient client) : base(client)
 {
 }
        public static Task <Invoice> GetInvoiceAsync(this FreeAgentClient client, Uri url)
        {
            var id = url.GetId();

            return(client.GetInvoiceAsync(id));
        }
Example #25
0
 public static Task <Contact> CreateContactAsync(this FreeAgentClient client, Contact contact)
 {
     return(client.GetOrCreateAsync(c => c.CreateContact(client.Configuration.CurrentHeader, contact.Wrap()), r => r.Contact));
 }
 public static Task <InvoicePdf> GetInvoicePdfAsync(this FreeAgentClient client, int invoiceId)
 {
     return(client.GetOrCreateAsync(c => c.GetInvoicePdf(client.Configuration.CurrentHeader, invoiceId), r => r.Pdf));
 }
Example #27
0
        public static Task <Contact> GetContactAsync(this FreeAgentClient client, Uri url)
        {
            var id = url.GetId();

            return(client.GetContactAsync(id));
        }
        public static Task ChangeInvoiceStatus(this FreeAgentClient client, Invoice invoice, InvoiceStatus newStatus)
        {
            var newValue = "mark_as_" + newStatus.GetMemberValue().ToLowerInvariant();

            return(client.UpdateOrDeleteAsync(invoice, (c, id) => c.ChangeInvoiceStatus(client.Configuration.CurrentHeader, id, newValue)));
        }
Example #29
0
 public static Task DeleteContactAsync(this FreeAgentClient client, Contact contact)
 {
     return(client.UpdateOrDeleteAsync(contact, (c, id) => c.DeleteContact(client.Configuration.CurrentHeader, id)));
 }
Example #30
0
 public StatementClient(FreeAgentClient freeAgentClient) : base(freeAgentClient)
 {
     this.freeAgentClient = freeAgentClient;
 }
Example #31
0
 public static Task <Expense> CreateExpenseAsync(this FreeAgentClient client, Expense expense)
 {
     return(client.GetOrCreateAsync(c => c.CreateExpense(client.Configuration.CurrentHeader, expense.Wrap()), r => r.Expense));
 }
Example #32
0
        public static Task <IEnumerable <NoteItem> > GetNotesAsync(this FreeAgentClient client, Project project)
        {
            var url = client.ExtractUrl(project);

            return(client.GetOrCreateAsync(c => c.NoteList(client.Configuration.CurrentHeader, null, url.OriginalString), r => r.Notes));
        }
Example #33
0
 public AccountingClient(FreeAgentClient client)
     : base(client)
 {
 }
Example #34
0
 public BaseClient(FreeAgentClient client)
 {
     Client = client;
 }