Skip to content

Commit

Permalink
class: swich parent ref to struct from string (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdholdren authored Aug 8, 2023
1 parent 72dcdc5 commit 6d74ccd
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 18 deletions.
16 changes: 10 additions & 6 deletions class.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,16 @@ import (
)

type Class struct {
ID string `json:"Id,omitempty"`
Name string `json:",omitempty"`
SyncToken string `json:",omitempty"`
ParentRef string `json:",omitempty"`
SubClass bool `json:",omitempty"`
FullyQualifiedName string `json:",omitempty"`
ID string `json:"Id,omitempty"`
Name string `json:",omitempty"`
SyncToken string `json:",omitempty"`
ParentRef ParentRef `json:",omitempty"`
SubClass bool `json:",omitempty"`
FullyQualifiedName string `json:",omitempty"`
}

type ParentRef struct {
Value string `json:"value"`
}

// GetClasses fetches classes based on a page size
Expand Down
24 changes: 12 additions & 12 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ Package quickbooks provides access to Intuit's QuickBooks Online API.
NOTE: This library is very incomplete. I just implemented the minimum for my
use case. Pull requests welcome :)
// Do this after you go through the normal OAuth process.
var client = oauth2.NewClient(ctx, tokenSource)
// Initialize the client handle.
var qb = quickbooks.Client{
Client: client,
Endpoint: quickbooks.SandboxEndpoint,
RealmID: "some company account ID"'
}
// Make a request!
var companyInfo, err = qb.FetchCompanyInfo()
// Do this after you go through the normal OAuth process.
var client = oauth2.NewClient(ctx, tokenSource)
// Initialize the client handle.
var qb = quickbooks.Client{
Client: client,
Endpoint: quickbooks.SandboxEndpoint,
RealmID: "some company account ID"'
}
// Make a request!
var companyInfo, err = qb.FetchCompanyInfo()
*/
package quickbooks

Expand Down

0 comments on commit 6d74ccd

Please sign in to comment.