Skip to content
This repository has been archived by the owner on Apr 20, 2021. It is now read-only.

Added Oauth2 provider #33

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions accounting/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func unmarshalAccount(accountResponseBytes []byte) (*Accounts, error) {
}

//Create will create accounts given an Accounts struct
func (a *Accounts) Create(provider *xerogolang.Provider, session goth.Session) (*Accounts, error) {
func (a *Accounts) Create(provider xerogolang.IProvider, session goth.Session) (*Accounts, error) {
additionalHeaders := map[string]string{
"Accept": "application/json",
"Content-Type": "application/xml",
Expand All @@ -124,7 +124,7 @@ func (a *Accounts) Create(provider *xerogolang.Provider, session goth.Session) (

//Update will update an account given an Accounts struct
//This will only handle single account - you cannot update multiple accounts in a single call
func (a *Accounts) Update(provider *xerogolang.Provider, session goth.Session) (*Accounts, error) {
func (a *Accounts) Update(provider xerogolang.IProvider, session goth.Session) (*Accounts, error) {
additionalHeaders := map[string]string{
"Accept": "application/json",
"Content-Type": "application/xml",
Expand All @@ -145,7 +145,7 @@ func (a *Accounts) Update(provider *xerogolang.Provider, session goth.Session) (

//FindAccountsModifiedSince will get all accounts modified after a specified date.
//additional querystringParameters such as where and order can be added as a map
func FindAccountsModifiedSince(provider *xerogolang.Provider, session goth.Session, modifiedSince time.Time, querystringParameters map[string]string) (*Accounts, error) {
func FindAccountsModifiedSince(provider xerogolang.IProvider, session goth.Session, modifiedSince time.Time, querystringParameters map[string]string) (*Accounts, error) {
additionalHeaders := map[string]string{
"Accept": "application/json",
}
Expand All @@ -164,12 +164,12 @@ func FindAccountsModifiedSince(provider *xerogolang.Provider, session goth.Sessi

//FindAccounts will get all accounts. These account will not have details like line items.
//additional querystringParameters such as where and order can be added as a map
func FindAccounts(provider *xerogolang.Provider, session goth.Session, querystringParameters map[string]string) (*Accounts, error) {
func FindAccounts(provider xerogolang.IProvider, session goth.Session, querystringParameters map[string]string) (*Accounts, error) {
return FindAccountsModifiedSince(provider, session, dayZero, querystringParameters)
}

//FindAccount will get a single account - accountID must be a GUID for an account
func FindAccount(provider *xerogolang.Provider, session goth.Session, accountID string) (*Accounts, error) {
func FindAccount(provider xerogolang.IProvider, session goth.Session, accountID string) (*Accounts, error) {
additionalHeaders := map[string]string{
"Accept": "application/json",
}
Expand All @@ -183,7 +183,7 @@ func FindAccount(provider *xerogolang.Provider, session goth.Session, accountID
}

//RemoveAccount will get a single account - accountID must be a GUID for an account
func RemoveAccount(provider *xerogolang.Provider, session goth.Session, accountID string) (*Accounts, error) {
func RemoveAccount(provider xerogolang.IProvider, session goth.Session, accountID string) (*Accounts, error) {
additionalHeaders := map[string]string{
"Accept": "application/json",
}
Expand Down
10 changes: 5 additions & 5 deletions accounting/bank_transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func unmarshalBankTransaction(bankTransactionResponseBytes []byte) (*BankTransac
}

//Create will create BankTransactions given an BankTransactions struct
func (b *BankTransactions) Create(provider *xerogolang.Provider, session goth.Session) (*BankTransactions, error) {
func (b *BankTransactions) Create(provider xerogolang.IProvider, session goth.Session) (*BankTransactions, error) {
additionalHeaders := map[string]string{
"Accept": "application/json",
"Content-Type": "application/xml",
Expand All @@ -130,7 +130,7 @@ func (b *BankTransactions) Create(provider *xerogolang.Provider, session goth.Se

//Update will update a BankTransaction given a BankTransactions struct
//This will only handle single BankTransaction - you cannot update multiple BankTransactions in a single call
func (b *BankTransactions) Update(provider *xerogolang.Provider, session goth.Session) (*BankTransactions, error) {
func (b *BankTransactions) Update(provider xerogolang.IProvider, session goth.Session) (*BankTransactions, error) {
additionalHeaders := map[string]string{
"Accept": "application/json",
"Content-Type": "application/xml",
Expand All @@ -153,7 +153,7 @@ func (b *BankTransactions) Update(provider *xerogolang.Provider, session goth.Se
//These BankTransactions will not have details like default account codes and tracking categories by default.
//If you need details then then add a 'page' querystringParameter and get 100 BankTransactions at a time
//additional querystringParameters such as where, page, order can be added as a map
func FindBankTransactionsModifiedSince(provider *xerogolang.Provider, session goth.Session, modifiedSince time.Time, querystringParameters map[string]string) (*BankTransactions, error) {
func FindBankTransactionsModifiedSince(provider xerogolang.IProvider, session goth.Session, modifiedSince time.Time, querystringParameters map[string]string) (*BankTransactions, error) {
additionalHeaders := map[string]string{
"Accept": "application/json",
}
Expand All @@ -173,12 +173,12 @@ func FindBankTransactionsModifiedSince(provider *xerogolang.Provider, session go
//FindBankTransactions will get all BankTransactions. These BankTransaction will not have details like line items by default.
//If you need details then then add a 'page' querystringParameter and get 100 BankTransactions at a time
//additional querystringParameters such as where, page, order can be added as a map
func FindBankTransactions(provider *xerogolang.Provider, session goth.Session, querystringParameters map[string]string) (*BankTransactions, error) {
func FindBankTransactions(provider xerogolang.IProvider, session goth.Session, querystringParameters map[string]string) (*BankTransactions, error) {
return FindBankTransactionsModifiedSince(provider, session, dayZero, querystringParameters)
}

//FindBankTransaction will get a single BankTransaction - BankTransactionID can be a GUID for an BankTransaction or an BankTransaction number
func FindBankTransaction(provider *xerogolang.Provider, session goth.Session, bankTransactionID string) (*BankTransactions, error) {
func FindBankTransaction(provider xerogolang.IProvider, session goth.Session, bankTransactionID string) (*BankTransactions, error) {
additionalHeaders := map[string]string{
"Accept": "application/json",
}
Expand Down
8 changes: 4 additions & 4 deletions accounting/bank_transfer.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func unmarshalBankTransfer(bankTransferResponseBytes []byte) (*BankTransfers, er
}

//Create will create bankTransfers given a BankTransfers struct
func (b *BankTransfers) Create(provider *xerogolang.Provider, session goth.Session) (*BankTransfers, error) {
func (b *BankTransfers) Create(provider xerogolang.IProvider, session goth.Session) (*BankTransfers, error) {
additionalHeaders := map[string]string{
"Accept": "application/json",
"Content-Type": "application/xml",
Expand All @@ -106,7 +106,7 @@ func (b *BankTransfers) Create(provider *xerogolang.Provider, session goth.Sessi
//These BankTransfers will not have details like default line items by default.
//If you need details then add a 'page' querystringParameter and get 100 BankTransfers at a time
//additional querystringParameters such as where and order can be added as a map
func FindBankTransfersModifiedSince(provider *xerogolang.Provider, session goth.Session, modifiedSince time.Time, querystringParameters map[string]string) (*BankTransfers, error) {
func FindBankTransfersModifiedSince(provider xerogolang.IProvider, session goth.Session, modifiedSince time.Time, querystringParameters map[string]string) (*BankTransfers, error) {
additionalHeaders := map[string]string{
"Accept": "application/json",
}
Expand All @@ -126,12 +126,12 @@ func FindBankTransfersModifiedSince(provider *xerogolang.Provider, session goth.
//FindBankTransfers will get all BankTransfers. These BankTransfer will not have details like line items by default.
//If you need details then add a 'page' querystringParameter and get 100 BankTransfers at a time
//additional querystringParameters such as where and order can be added as a map
func FindBankTransfers(provider *xerogolang.Provider, session goth.Session, querystringParameters map[string]string) (*BankTransfers, error) {
func FindBankTransfers(provider xerogolang.IProvider, session goth.Session, querystringParameters map[string]string) (*BankTransfers, error) {
return FindBankTransfersModifiedSince(provider, session, dayZero, querystringParameters)
}

//FindBankTransfer will get a single bankTransfer - bankTransferID can be a GUID for an bankTransfer or an bankTransfer number
func FindBankTransfer(provider *xerogolang.Provider, session goth.Session, bankTransferID string) (*BankTransfers, error) {
func FindBankTransfer(provider xerogolang.IProvider, session goth.Session, bankTransferID string) (*BankTransfers, error) {
additionalHeaders := map[string]string{
"Accept": "application/json",
}
Expand Down
2 changes: 1 addition & 1 deletion accounting/branding_theme.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func unmarshalBrandingTheme(brandingThemeResponseBytes []byte) (*BrandingThemes,
}

//FindBrandingThemes will get all BrandingThemes.
func FindBrandingThemes(provider *xerogolang.Provider, session goth.Session) (*BrandingThemes, error) {
func FindBrandingThemes(provider xerogolang.IProvider, session goth.Session) (*BrandingThemes, error) {
additionalHeaders := map[string]string{
"Accept": "application/json",
}
Expand Down
14 changes: 7 additions & 7 deletions accounting/contact.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ func unmarshalContact(contactResponseBytes []byte) (*Contacts, error) {
}

//Create will create Contacts given an Contacts struct
func (c *Contacts) Create(provider *xerogolang.Provider, session goth.Session) (*Contacts, error) {
func (c *Contacts) Create(provider xerogolang.IProvider, session goth.Session) (*Contacts, error) {
additionalHeaders := map[string]string{
"Accept": "application/json",
"Content-Type": "application/xml",
Expand All @@ -183,7 +183,7 @@ func (c *Contacts) Create(provider *xerogolang.Provider, session goth.Session) (

//Update will update a Contact given a Contacts struct
//This will only handle single Contact - you cannot update multiple Contacts in a single call
func (c *Contacts) Update(provider *xerogolang.Provider, session goth.Session) (*Contacts, error) {
func (c *Contacts) Update(provider xerogolang.IProvider, session goth.Session) (*Contacts, error) {
additionalHeaders := map[string]string{
"Accept": "application/json",
"Content-Type": "application/xml",
Expand All @@ -206,7 +206,7 @@ func (c *Contacts) Update(provider *xerogolang.Provider, session goth.Session) (
//These Contacts will not have details like default account codes and tracking categories.
//If you need details then then add a 'page' querystringParameter and get 100 Contacts at a time
//additional querystringParameters such as where, page, order can be added as a map
func FindContactsModifiedSince(provider *xerogolang.Provider, session goth.Session, modifiedSince time.Time, querystringParameters map[string]string) (*Contacts, error) {
func FindContactsModifiedSince(provider xerogolang.IProvider, session goth.Session, modifiedSince time.Time, querystringParameters map[string]string) (*Contacts, error) {
additionalHeaders := map[string]string{
"Accept": "application/json",
}
Expand All @@ -226,12 +226,12 @@ func FindContactsModifiedSince(provider *xerogolang.Provider, session goth.Sessi
//FindContacts will get all Contacts. These Contact will not have details like default accounts.
//If you need details then then add a 'page' querystringParameter and get 100 Contacts at a time
//additional querystringParameters such as where, page, order can be added as a map
func FindContacts(provider *xerogolang.Provider, session goth.Session, querystringParameters map[string]string) (*Contacts, error) {
func FindContacts(provider xerogolang.IProvider, session goth.Session, querystringParameters map[string]string) (*Contacts, error) {
return FindContactsModifiedSince(provider, session, dayZero, querystringParameters)
}

//FindContact will get a single Contact - ContactID can be a GUID for an Contact or an Contact number
func FindContact(provider *xerogolang.Provider, session goth.Session, contactID string) (*Contacts, error) {
func FindContact(provider xerogolang.IProvider, session goth.Session, contactID string) (*Contacts, error) {
additionalHeaders := map[string]string{
"Accept": "application/json",
}
Expand All @@ -245,7 +245,7 @@ func FindContact(provider *xerogolang.Provider, session goth.Session, contactID
}

//AddToContactGroup will add a collection of Contacts to a supplied contactGroupID
func (c *Contacts) AddToContactGroup(provider *xerogolang.Provider, session goth.Session, contactGroupID string) (*Contacts, error) {
func (c *Contacts) AddToContactGroup(provider xerogolang.IProvider, session goth.Session, contactGroupID string) (*Contacts, error) {
additionalHeaders := map[string]string{
"Accept": "application/json",
"Content-Type": "application/xml",
Expand Down Expand Up @@ -274,7 +274,7 @@ func (c *Contacts) AddToContactGroup(provider *xerogolang.Provider, session goth
}

//RemoveFromContactGroup will remove a Contact from a supplied contactGroupID - must be done one at a time.
func (c *Contacts) RemoveFromContactGroup(provider *xerogolang.Provider, session goth.Session, contactGroupID string) (*Contacts, error) {
func (c *Contacts) RemoveFromContactGroup(provider xerogolang.IProvider, session goth.Session, contactGroupID string) (*Contacts, error) {
additionalHeaders := map[string]string{
"Accept": "application/json",
}
Expand Down
10 changes: 5 additions & 5 deletions accounting/contact_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func unmarshalContactGroup(contactGroupResponseBytes []byte) (*ContactGroups, er
}

//Create will create contactGroups given an ContactGroups struct
func (c *ContactGroups) Create(provider *xerogolang.Provider, session goth.Session) (*ContactGroups, error) {
func (c *ContactGroups) Create(provider xerogolang.IProvider, session goth.Session) (*ContactGroups, error) {
additionalHeaders := map[string]string{
"Accept": "application/json",
"Content-Type": "application/xml",
Expand All @@ -61,7 +61,7 @@ func (c *ContactGroups) Create(provider *xerogolang.Provider, session goth.Sessi

//Update will update an contactGroup given an ContactGroups struct
//This will only handle single contactGroup - you cannot update multiple contactGroups in a single call
func (c *ContactGroups) Update(provider *xerogolang.Provider, session goth.Session) (*ContactGroups, error) {
func (c *ContactGroups) Update(provider xerogolang.IProvider, session goth.Session) (*ContactGroups, error) {
additionalHeaders := map[string]string{
"Accept": "application/json",
"Content-Type": "application/xml",
Expand All @@ -81,7 +81,7 @@ func (c *ContactGroups) Update(provider *xerogolang.Provider, session goth.Sessi
}

//FindContactGroups will get all contactGroups
func FindContactGroups(provider *xerogolang.Provider, session goth.Session) (*ContactGroups, error) {
func FindContactGroups(provider xerogolang.IProvider, session goth.Session) (*ContactGroups, error) {
additionalHeaders := map[string]string{
"Accept": "application/json",
}
Expand All @@ -95,7 +95,7 @@ func FindContactGroups(provider *xerogolang.Provider, session goth.Session) (*Co
}

//FindContactGroup will get a single contactGroup - contactGroupID must be a GUID for an contactGroup
func FindContactGroup(provider *xerogolang.Provider, session goth.Session, contactGroupID string) (*ContactGroups, error) {
func FindContactGroup(provider xerogolang.IProvider, session goth.Session, contactGroupID string) (*ContactGroups, error) {
additionalHeaders := map[string]string{
"Accept": "application/json",
}
Expand All @@ -109,7 +109,7 @@ func FindContactGroup(provider *xerogolang.Provider, session goth.Session, conta
}

//RemoveContactGroup will get a single contactGroup - contactGroupID must be a GUID for an contactGroup
func RemoveContactGroup(provider *xerogolang.Provider, session goth.Session, contactGroupID string) (*ContactGroups, error) {
func RemoveContactGroup(provider xerogolang.IProvider, session goth.Session, contactGroupID string) (*ContactGroups, error) {
additionalHeaders := map[string]string{
"Accept": "application/json",
}
Expand Down
10 changes: 5 additions & 5 deletions accounting/credit_note.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func unmarshalCreditNote(creditNoteResponseBytes []byte) (*CreditNotes, error) {
}

//Create will create creditNotes given an CreditNotes struct
func (c *CreditNotes) Create(provider *xerogolang.Provider, session goth.Session) (*CreditNotes, error) {
func (c *CreditNotes) Create(provider xerogolang.IProvider, session goth.Session) (*CreditNotes, error) {
additionalHeaders := map[string]string{
"Accept": "application/json",
"Content-Type": "application/xml",
Expand All @@ -136,7 +136,7 @@ func (c *CreditNotes) Create(provider *xerogolang.Provider, session goth.Session

//Update will update an creditNote given an CreditNotes struct
//This will only handle single creditNote - you cannot update multiple creditNotes in a single call
func (c *CreditNotes) Update(provider *xerogolang.Provider, session goth.Session) (*CreditNotes, error) {
func (c *CreditNotes) Update(provider xerogolang.IProvider, session goth.Session) (*CreditNotes, error) {
additionalHeaders := map[string]string{
"Accept": "application/json",
"Content-Type": "application/xml",
Expand All @@ -159,7 +159,7 @@ func (c *CreditNotes) Update(provider *xerogolang.Provider, session goth.Session
//These Credit Notes will not have details like line items by default.
//If you need details then then add a 'page' querystringParameter and get 100 Credit Notes at a time
//additional querystringParameters such as where, page, order can be added as a map
func FindCreditNotesModifiedSince(provider *xerogolang.Provider, session goth.Session, modifiedSince time.Time, querystringParameters map[string]string) (*CreditNotes, error) {
func FindCreditNotesModifiedSince(provider xerogolang.IProvider, session goth.Session, modifiedSince time.Time, querystringParameters map[string]string) (*CreditNotes, error) {
additionalHeaders := map[string]string{
"Accept": "application/json",
}
Expand All @@ -179,12 +179,12 @@ func FindCreditNotesModifiedSince(provider *xerogolang.Provider, session goth.Se
//FindCreditNotes will get all CreditNotes. These Credit Notes will not have details like line items by default.
//If you need details then then add a 'page' querystringParameter and get 100 Credit Notes at a time
//additional querystringParameters such as where, page, order can be added as a map
func FindCreditNotes(provider *xerogolang.Provider, session goth.Session, querystringParameters map[string]string) (*CreditNotes, error) {
func FindCreditNotes(provider xerogolang.IProvider, session goth.Session, querystringParameters map[string]string) (*CreditNotes, error) {
return FindCreditNotesModifiedSince(provider, session, dayZero, querystringParameters)
}

//FindCreditNote will get a single creditNote - creditNoteID can be a GUID for a creditNote or a creditNote number
func FindCreditNote(provider *xerogolang.Provider, session goth.Session, creditNoteID string) (*CreditNotes, error) {
func FindCreditNote(provider xerogolang.IProvider, session goth.Session, creditNoteID string) (*CreditNotes, error) {
additionalHeaders := map[string]string{
"Accept": "application/json",
}
Expand Down
2 changes: 1 addition & 1 deletion accounting/currency.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func unmarshalCurrencies(currencyResponseBytes []byte) (*Currencies, error) {
}

//FindCurrencies will get all currencies
func FindCurrencies(provider *xerogolang.Provider, session goth.Session) (*Currencies, error) {
func FindCurrencies(provider xerogolang.IProvider, session goth.Session) (*Currencies, error) {
additionalHeaders := map[string]string{
"Accept": "application/json",
}
Expand Down
Loading