Пример #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));
        }
Пример #2
0
        public static Task <Contact> GetContactAsync(this FreeAgentClient client, Contact contact)
        {
            var id = client.ExtractId(contact);

            return(client.GetContactAsync(id));
        }
Пример #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));
 }
Пример #4
0
 public ResourceClient(FreeAgentClient client) : base(client)
 {
 }
Пример #5
0
 public CategoryClient(FreeAgentClient client) : base(client)
 {
 }
Пример #6
0
        public static Task <NoteItem> GetNoteAsync(this FreeAgentClient client, NoteItem note)
        {
            var id = client.ExtractId(note);

            return(client.GetNoteAsync(id));
        }
Пример #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));
 }
Пример #8
0
 public BankAccountClient(FreeAgentClient client) : base(client)
 {
 }
Пример #9
0
 public BankTransactionExplanationClient(FreeAgentClient client) : base(client)
 {
 }
Пример #10
0
 public static Task DeleteBankAccountAsync(this FreeAgentClient client, BankAccount account)
 {
     return(client.UpdateOrDeleteAsync(account, (c, id) => c.DeleteBankAccount(client.Configuration.CurrentHeader, id)));
 }
Пример #11
0
 public CompanyClient(FreeAgentClient client)
     : base(client)
 {
 }
Пример #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));
 }
Пример #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));
 }
Пример #14
0
        public static Task <BankAccount> GetBankAccountAsync(this FreeAgentClient client, Uri url)
        {
            var id = url.GetId();

            return(client.GetBankAccountAsync(id));
        }
Пример #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())));
 }
Пример #16
0
 public static Task <IEnumerable <Invoice> > ListInvoicesForContactAsync(this FreeAgentClient client, Uri contact)
 {
     return(client.GetOrCreateAsync(c => c.ListInvoicesForContact(client.Configuration.CurrentHeader, contact), r => r.Invoices));
 }
Пример #17
0
 public CategoryClient(FreeAgentClient client)
     : base(client)
 {
 }
Пример #18
0
 public static Task <Invoice> CreateInvoice(this FreeAgentClient client, Invoice invoice)
 {
     return(client.GetOrCreateAsync(c => c.CreateInvoice(client.Configuration.CurrentHeader, invoice.Wrap()), r => r.Invoice));
 }
Пример #19
0
        public static Task <NoteItem> GetNoteAsync(this FreeAgentClient client, Uri url)
        {
            var id = url.GetId();

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

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

            return(client.GetInvoiceAsync(id));
        }
Пример #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));
 }
Пример #26
0
 public static Task <InvoicePdf> GetInvoicePdfAsync(this FreeAgentClient client, int invoiceId)
 {
     return(client.GetOrCreateAsync(c => c.GetInvoicePdf(client.Configuration.CurrentHeader, invoiceId), r => r.Pdf));
 }
Пример #27
0
        public static Task <Contact> GetContactAsync(this FreeAgentClient client, Uri url)
        {
            var id = url.GetId();

            return(client.GetContactAsync(id));
        }
Пример #28
0
        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)));
        }
Пример #29
0
 public static Task DeleteContactAsync(this FreeAgentClient client, Contact contact)
 {
     return(client.UpdateOrDeleteAsync(contact, (c, id) => c.DeleteContact(client.Configuration.CurrentHeader, id)));
 }
Пример #30
0
 public StatementClient(FreeAgentClient freeAgentClient) : base(freeAgentClient)
 {
     this.freeAgentClient = freeAgentClient;
 }
Пример #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));
 }
Пример #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));
        }
Пример #33
0
 public AccountingClient(FreeAgentClient client)
     : base(client)
 {
 }
Пример #34
0
 public BaseClient(FreeAgentClient client)
 {
     Client = client;
 }