Documentation ¶
Index ¶
- type Config
- func (c *Config) AddContact(body ContactBody) (ContactReturn, error)
- func (c *Config) AddFile(file *os.File, name string) (FileReturn, error)
- func (c *Config) AddInvoice(body InvoiceBody) (InvoiceReturn, error)
- func (c *Config) Contact(id string) (ContactsReturnContent, error)
- func (c *Config) Contacts() ([]ContactsReturnContent, error)
- func (c *Config) Invoice(id string) (InvoiceBody, error)
- func (c *Config) Send(path string, body io.Reader, method, contentType string) (*http.Response, error)
- func (c *Config) SetBaseUrl(url string)
- func (c *Config) UpdateContact(body ContactBody) (ContactReturn, error)
- type ContactBody
- type ContactBodyAddresses
- type ContactBodyBilling
- type ContactBodyCompany
- type ContactBodyContactPersons
- type ContactBodyCustomer
- type ContactBodyEmailAddresses
- type ContactBodyPerson
- type ContactBodyPhoneNumbers
- type ContactBodyRoles
- type ContactBodyShipping
- type ContactBodyVendor
- type ContactReturn
- type ContactsReturn
- type ContactsReturnAddresses
- type ContactsReturnBilling
- type ContactsReturnCompany
- type ContactsReturnContactPersons
- type ContactsReturnContent
- type ContactsReturnCustomer
- type ContactsReturnEmailAddresses
- type ContactsReturnPhoneNumbers
- type ContactsReturnRoles
- type ContactsReturnShipping
- type ContactsReturnSort
- type ContactsReturnVendor
- type FileReturn
- type InvoiceBody
- type InvoiceBodyAddress
- type InvoiceBodyLineItems
- type InvoiceBodyPaymentConditions
- type InvoiceBodyPaymentDiscountConditions
- type InvoiceBodyShippingConditions
- type InvoiceBodyTaxAmounts
- type InvoiceBodyTaxConditions
- type InvoiceBodyTotalPrice
- type InvoiceBodyUnitPrice
- type InvoiceReturn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config is to define the request data
func (*Config) AddContact ¶
func (c *Config) AddContact(body ContactBody) (ContactReturn, error)
AddContact is to add a new contact
func (*Config) AddInvoice ¶
func (c *Config) AddInvoice(body InvoiceBody) (InvoiceReturn, error)
AddInvoice is to create a invoice
func (*Config) Contact ¶
func (c *Config) Contact(id string) (ContactsReturnContent, error)
Contact is to get a contact by id
func (*Config) Contacts ¶
func (c *Config) Contacts() ([]ContactsReturnContent, error)
Contacts is to get a list of all contacts
func (*Config) Invoice ¶
func (c *Config) Invoice(id string) (InvoiceBody, error)
Invoice is to get a invoice by id
func (*Config) Send ¶
func (c *Config) Send(path string, body io.Reader, method, contentType string) (*http.Response, error)
Send is to send a new request
func (*Config) SetBaseUrl ¶
func (*Config) UpdateContact ¶
func (c *Config) UpdateContact(body ContactBody) (ContactReturn, error)
UpdateContact is to add a new contact
type ContactBody ¶
type ContactBody struct { Id string `json:"id,omitempty"` Version int `json:"version,omitempty"` Roles ContactBodyRoles `json:"roles"` Company ContactBodyCompany `json:"company,omitempty"` Person ContactBodyPerson `json:"person,omitempty"` Addresses ContactBodyAddresses `json:"addresses"` EmailAddresses ContactBodyEmailAddresses `json:"emailAddresses"` PhoneNumbers ContactBodyPhoneNumbers `json:"phoneNumbers"` Note string `json:"note"` Archived bool `json:"archived,omitempty"` }
ContactBody is to create a new contact
type ContactBodyAddresses ¶
type ContactBodyAddresses struct { Billing []ContactBodyBilling `json:"billing"` Shipping []ContactBodyShipping `json:"shipping"` }
type ContactBodyBilling ¶
type ContactBodyCompany ¶
type ContactBodyCompany struct { Name string `json:"name"` TaxNumber string `json:"taxNumber"` VatRegistrationId string `json:"vatRegistrationId"` AllowTaxFreeInvoices bool `json:"allowTaxFreeInvoices"` ContactPersons []ContactBodyContactPersons `json:"contactPersons"` }
type ContactBodyCustomer ¶
type ContactBodyCustomer struct {
Number int `json:"number,omitempty"`
}
type ContactBodyPerson ¶
type ContactBodyPhoneNumbers ¶
type ContactBodyRoles ¶
type ContactBodyRoles struct { Customer ContactBodyCustomer `json:"customer"` Vendor ContactBodyVendor `json:"vendor"` }
type ContactBodyShipping ¶
type ContactBodyVendor ¶
type ContactBodyVendor struct {
Number int `json:"number,omitempty"`
}
type ContactReturn ¶
type ContactReturn struct { ID string `json:"id"` ResourceUri string `json:"resourceUri"` CreatedDate string `json:"createdDate"` UpdatedDate string `json:"updatedDate"` Version int `json:"version"` }
ContactReturn is to decode json return
type ContactsReturn ¶
type ContactsReturn struct { Content []ContactsReturnContent `json:"content"` First bool `json:"first"` Last bool `json:"last"` TotalPages int `json:"totalPages"` TotalElements int `json:"totalElements"` NumberOfElements int `json:"numberOfElements"` Size int `json:"size"` Number int `json:"number"` Sort []ContactsReturnSort `json:"sort"` }
ContactsReturn is to decode json data
type ContactsReturnAddresses ¶
type ContactsReturnAddresses struct { Billing []ContactsReturnBilling `json:"billing"` Shipping []ContactsReturnShipping `json:"shipping"` }
type ContactsReturnBilling ¶
type ContactsReturnCompany ¶
type ContactsReturnCompany struct { Name string `json:"name"` TaxNumber string `json:"taxNumber"` VatRegistrationId string `json:"vatRegistrationId"` AllowTaxFreeInvoices bool `json:"allowTaxFreeInvoices"` ContactPersons []ContactsReturnContactPersons `json:"contactPersons"` }
type ContactsReturnContent ¶
type ContactsReturnContent struct { Id string `json:"id,omitempty"` Version int `json:"version,omitempty"` Roles ContactBodyRoles `json:"roles"` Company ContactBodyCompany `json:"company,omitempty"` Person ContactBodyPerson `json:"person,omitempty"` Addresses ContactBodyAddresses `json:"addresses"` EmailAddresses ContactBodyEmailAddresses `json:"emailAddresses"` PhoneNumbers ContactBodyPhoneNumbers `json:"phoneNumbers"` Note string `json:"note"` Archived bool `json:"archived,omitempty"` }
type ContactsReturnCustomer ¶
type ContactsReturnCustomer struct {
Number int `json:"number,omitempty"`
}
type ContactsReturnRoles ¶
type ContactsReturnRoles struct { Customer ContactsReturnCustomer `json:"customer"` Vendor ContactsReturnVendor `json:"vendor"` }
type ContactsReturnShipping ¶
type ContactsReturnSort ¶
type ContactsReturnVendor ¶
type ContactsReturnVendor struct {
Number int `json:"number,omitempty"`
}
type FileReturn ¶
type FileReturn struct {
Id string `json:"id"`
}
FileReturn is to decode json data
type InvoiceBody ¶
type InvoiceBody struct { Id string `json:"id"` OrganizationId string `json:"organizationId"` CreateDate string `json:"createDate"` UpdatedDate string `json:"updatedDate"` Version int `json:"version"` Archived bool `json:"archived"` VoucherStatus string `json:"voucherStatus"` VoucherNumber string `json:"voucherNumber"` VoucherDate string `json:"voucherDate"` DueDate interface{} `json:"dueDate"` Address InvoiceBodyAddress `json:"address"` LineItems []InvoiceBodyLineItems `json:"lineItems"` TotalPrice InvoiceBodyTotalPrice `json:"totalPrice"` TaxAmounts []InvoiceBodyTaxAmounts `json:"taxAmounts"` TaxConditions InvoiceBodyTaxConditions `json:"taxConditions"` PaymentConditions InvoiceBodyPaymentConditions `json:"paymentConditions"` ShippingConditions InvoiceBodyShippingConditions `json:"shippingConditions"` Title string `json:"title"` Introduction string `json:"introduction"` Remark string `json:"remark"` }
InvoiceBody is to define body data
type InvoiceBodyAddress ¶
type InvoiceBodyLineItems ¶
type InvoiceBodyLineItems struct { Id string `json:"id,omitempty"` Type string `json:"type"` Name string `json:"name"` Description string `json:"description"` Quantity float64 `json:"quantity"` UnitName string `json:"unitName"` UnitPrice InvoiceBodyUnitPrice `json:"unitPrice"` DiscountPercentage int `json:"discountPercentage"` LineItemAmount float64 `json:"lineItemAmount"` }
type InvoiceBodyPaymentConditions ¶
type InvoiceBodyPaymentConditions struct { PaymentTermLabel string `json:"paymentTermLabel"` PaymentTermDuration int `json:"paymentTermDuration"` PaymentDiscountConditions InvoiceBodyPaymentDiscountConditions `json:"paymentDiscountConditions"` }
type InvoiceBodyTaxAmounts ¶
type InvoiceBodyTaxConditions ¶
type InvoiceBodyTaxConditions struct { TaxType string `json:"taxType"` TaxTypeNote interface{} `json:"taxTypeNote"` }
type InvoiceBodyTotalPrice ¶
type InvoiceBodyTotalPrice struct { Currency string `json:"currency"` TotalNetAmount float64 `json:"totalNetAmount"` TotalGrossAmount float64 `json:"totalGrossAmount"` TaxRatePercentage interface{} `json:"taxRatePercentage"` TotalTaxAmount float64 `json:"totalTaxAmount"` TotalDiscountAbsolute interface{} `json:"totalDiscountAbsolute"` TotalDiscountPercentage interface{} `json:"totalDiscountPercentage"` }
type InvoiceBodyUnitPrice ¶
Click to show internal directories.
Click to hide internal directories.