parasut

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 28, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAuthHTTPClient

func GetAuthHTTPClient(clientID, clientSecret, username, password string) (*http.Client, error)

GetAuthHTTPClient ...

func GetHTTPClientWithToken

func GetHTTPClientWithToken(token string) *http.Client

GetHTTPClientWithToken ...

Types

type BaseResponseError

type BaseResponseError struct {
	Base []string `json:"base"`
}

BaseResponseError ...

func (*BaseResponseError) Error

func (r *BaseResponseError) Error() string

type Category

type Category struct {
	Name         string `json:"name,omitempty"`
	CategoryType string `json:"category_type,omitempty"` // "Product" "Contact" "Employee" "SalesInvoice" "Expenditure"
	BgColor      string `json:"bg_color,omitempty"`
	TextColor    string `json:"text_color,omitempty"`
}

Category ...

type CategoryData

type CategoryData struct {
	ID            string         `json:"id,omitempty"`
	Type          string         `json:"type,omitempty"`
	Attributes    *Category      `json:"attributes,omitempty"`
	Relationships *Relationships `json:"relationships,omitempty"`
}

CategoryData ...

type Client

type Client struct {
	Contacts      *ContactsService
	SalesInvoices *SalesInvoicesService
	// contains filtered or unexported fields
}

Client ...

func NewClient

func NewClient(httpClient *http.Client, companyID string) (*Client, error)

NewClient ...

func (*Client) Do

func (c *Client) Do(req *http.Request, v interface{}) (*http.Response, error)

Do ...

func (*Client) NewRequest

func (c *Client) NewRequest(method, urlStr string, body interface{}) (*http.Request, error)

NewRequest ...

type CommonResponseError

type CommonResponseError struct {
	Errors []Error `json:"errors"`
}

CommonResponseError ...

func (*CommonResponseError) Error

func (r *CommonResponseError) Error() string

type Contact

type Contact struct {
	CreatedAt                 string   `json:"created_at,omitempty"`
	UpdatedAt                 string   `json:"updated_at,omitempty"`
	ContactType               string   `json:"contact_type,omitempty"` // "person", "company"
	Name                      string   `json:"name,omitempty"`         // required
	Email                     string   `json:"email,omitempty"`
	ShortName                 string   `json:"short_name,omitempty"`
	Balance                   string   `json:"balance,omitempty"`
	TRLBalance                string   `json:"trl_balance,omitempty"`
	USDBalance                string   `json:"usd_balance,omitempty"`
	EURBalance                string   `json:"eur_balance,omitempty"`
	GBPBalance                string   `json:"gbp_balance,omitempty"`
	TaxNumber                 string   `json:"tax_number,omitempty"`
	TaxOffice                 string   `json:"tax_office,omitempty"`
	Archived                  bool     `json:"archived,omitempty"`
	AccountType               string   `json:"account_type,omitempty"` // required, "customer", "supplier"
	City                      string   `json:"city,omitempty"`
	District                  string   `json:"district,omitempty"`
	Address                   string   `json:"address,omitempty"`
	Phone                     string   `json:"phone,omitempty"`
	Fax                       string   `json:"fax,omitempty"`
	IsAbroad                  bool     `json:"is_abroad,omitempty"`
	TermDays                  int      `json:"term_days,omitempty"`
	SharingsCount             int      `json:"sharings_count,omitempty"`
	IBANS                     []string `json:"ibans,omitempty"`
	ExchangeRateType          string   `json:"exchange_rate_type,omitempty"`
	IBAN                      string   `json:"iban,omitempty"`
	SharingPreviewURL         string   `json:"sharing_preview_url,omitempty"`
	PaymentReminderPreviewURL string   `json:"payment_reminder_preview_url,omitempty"`
}

Contact ...

type ContactData

type ContactData struct {
	ID            string         `json:"id,omitempty"`
	Type          string         `json:"type,omitempty"` // contacts
	Attributes    *Contact       `json:"attributes,omitempty"`
	Relationships *Relationships `json:"relationships,omitempty"`
}

ContactData ...

type ContactGetOptions

type ContactGetOptions struct {
	Include string `url:"include,omitempty"`
}

ContactGetOptions ...

type ContactListFilter

type ContactListFilter struct {
	Name      string `url:"name,omitempty"`
	Email     string `url:"email,omitempty"`
	TaxNumber string `url:"tax_number,omitempty"`
	TaxOffice string `url:"tax_office,omitempty"`
	City      string `url:"city,omitempty"`
}

ContactListFilter ...

type ContactListOptions

type ContactListOptions struct {
	Filter  *ContactListFilter `url:"filter,omitempty"`
	Sort    string             `url:"sort,omitempty"`
	Page    *PageOptions       `url:"page,omitempty"`
	Include string             `url:"include,omitempty"`
}

ContactListOptions ...

type ContactPerson

type ContactPerson struct {
	Name  string `json:"name,osmitempty"`
	Email string `json:"email,omitempty"`
	Phone string `json:"phone,omitempty"`
	Notes string `json:"notes,omitempty"`
}

ContactPerson ...

type ContactPersonData

type ContactPersonData struct {
	ID         string         `json:"id,omitempty"`
	Type       string         `json:"type,omitempty"`
	Attributes *ContactPerson `json:"attributes,omitempty"`
}

ContactPersonData ...

type ContactRequest

type ContactRequest struct {
	Data *ContactData `json:"data,omitempty"`
}

ContactRequest ... private kullanılacak complex create modeli

type ContactResponse

type ContactResponse struct {
	Data     *ContactData `json:"data,omitempty"`
	Included []*Included  `json:"included,omitempty"`
}

ContactResponse ...

type ContactsResponse

type ContactsResponse struct {
	Data     []*ContactData `json:"data,omitempty"`
	Included []*Included    `json:"included,omitempty"`
	Meta     Meta           `json:"meta,omitempty"`
}

ContactsResponse ...

type ContactsService

type ContactsService service

ContactsService ...

func (*ContactsService) Create

Create ...

func (*ContactsService) Delete

func (s *ContactsService) Delete(id string) (*http.Response, error)

Delete ...

func (*ContactsService) Get

Get ...

func (*ContactsService) List

List ...

func (*ContactsService) Update

Update ...

type EDocumentStatusResponseError

type EDocumentStatusResponseError struct {
	SalesInvoiceID string  `json:"sales_invoice_id"`
	Type           string  `json:"type"`
	Status         string  `json:"status"`
	Errors         []Error `json:"errors"`
	PDF            string  `json:"pdf"`
}

EDocumentStatusResponseError ...

func (*EDocumentStatusResponseError) Error

type Error

type Error struct {
	Title  string `json:"title,omitempty"`
	Detail string `json:"detail,omitempty"`
}

Error ...

type Included

type Included struct {
	ID            string        `json:"id"`
	Type          string        `json:"type"`
	Attributes    interface{}   `json:"attributes"`
	Relationships Relationships `json:"Relationships"`
}

Included ...

type Meta

type Meta struct {
	CurrentPage      int    `json:"current_page"`
	TotalPages       int    `json:"total_pages"`
	TotalCount       int    `json:"total_count"`
	PerPage          int    `json:"per_page"`
	PayableTotal     string `json:"payable_total"`
	CollectibleTotal string `json:"collectible_total"`
	ExportURL        string `json:"export_url"`
}

Meta ...

type PageOptions

type PageOptions struct {
	Number int `url:"number,omitempty"`
	Size   int `url:"size,omitempty"`
}

PageOptions ...

type Product

type Product struct {
	Name string `json:"name"`
	Code string `json:"code"`
}

Product ...

type ProductData

type ProductData struct {
	ID            string         `json:"id,omitempty"`
	Type          string         `json:"type,omitempty"`
	Attributes    *Product       `json:"attributes,omitempty"`
	Relationships *Relationships `json:"relationships,omitempty"`
}

ProductData ...

type Relationship

type Relationship struct {
	Data interface{} `json:"data"`
}

Relationship interface{} çünkü, struct veya slice olabiliyor

type RelationshipData

type RelationshipData struct {
	ID   string `json:"id"`
	Type string `json:"type"`
}

RelationshipData 1:1 ilişki tipi için

type RelationshipDataList

type RelationshipDataList []*RelationshipData

RelationshipDataList 1:m ilişki tipi için

type Relationships

type Relationships map[string]*Relationship

Relationships ...

type ResponseError

type ResponseError struct {
	Response       *http.Response
	Errors         []Error  `json:"errors"`
	Base           []string `json:"base"`
	SalesInvoiceID string   `json:"sales_invoice_id"`
	Type           string   `json:"type"`
	Status         string   `json:"status"`
	PDF            string   `json:"pdf"`
}

ResponseError wrapper

func (*ResponseError) Error

func (r *ResponseError) Error() string

type SalesInvoice

type SalesInvoice struct {
	Archived               bool   `json:"archived,omitempty"`
	InvoiceNo              string `json:"invoice_no,omitempty"`
	NetTotal               string `json:"net_total,omitempty"`
	GrossTotal             string `json:"gross_total,omitempty"`
	Withholding            string `json:"withholding,omitempty"`
	TotalExciseDuty        string `json:"total_excise_duty,omitempty"`
	TotalCommunicationsTax string `json:"total_communications_tax,omitempty"`
	TotalVat               string `json:"total_vat,omitempty"`
	VatWithholding         string `json:"vat_withholding,omitempty"`
	TotalDiscount          string `json:"total_discount,omitempty"`
	TotalInvoiceDiscount   string `json:"total_invoice_discount,omitempty"`
	BeforeTaxesTotal       string `json:"before_taxes_total,omitempty"`
	Remaining              string `json:"remaining,omitempty"`
	RemainingInTRL         string `json:"remaining_in_trl,omitempty"`
	PaymentStatus          string `json:"payment_status,omitempty"` // "paid" "overdue" "unpaid" "partially_paid"
	CreatedAt              string `json:"created_at,omitempty"`
	UpdatedAt              string `json:"updated_at,omitempty"`
	ItemType               string `json:"item_type,omitempty"` // required, "invoice" "estimate" "cancelled" "recurring_invoice" "recurring_estimate" "refund"
	Description            string `json:"description,omitempty"`
	IssueDate              string `json:"issue_date,omitempty"` // required
	DueDate                string `json:"due_date,omitempty"`
	InvoiceSeries          string `json:"invoice_series,omitempty"`
	InvoiceID              int    `json:"invoice_id,omitempty"`
	Currency               string `json:"currency,omitempty"` // "TRL" "USD" "EUR" "GBP"
	ExchangeRate           string `json:"exchange_rate,omitempty"`
	WithholdingRate        string `json:"withholding_rate,omitempty"`
	VatWithholdingRate     string `json:"vat_withholding_rate,omitempty"`
	InvoiceDiscountType    string `json:"invoice_discount_type,omitempty"` // "percentage" "amount"
	InvoiceDiscount        string `json:"invoice_discount,omitempty"`
	BillingAddress         string `json:"billing_address,omitempty"`
	BillingPhone           string `json:"billing_phone,omitempty"`
	BillingFax             string `json:"billing_fax,omitempty"`
	TaxOffice              string `json:"tax_office,omitempty"`
	TaxNumber              string `json:"tax_number,omitempty"`
	City                   string `json:"city,omitempty"`
	District               string `json:"district,omitempty"`
	IsAbroad               bool   `json:"is_abroad,omitempty"`
	OrderNo                string `json:"order_no,omitempty"`
	OrderDate              string `json:"order_date,omitempty"`
	ShipmentAddress        string `json:"shipment_address,omitempty"`
}

SalesInvoice ...

type SalesInvoiceData

type SalesInvoiceData struct {
	ID            string         `json:"id"`
	Type          string         `json:"type"`
	Attributes    *SalesInvoice  `json:"attributes"`
	Relationships *Relationships `json:"relationships"`
}

SalesInvoiceData ...

type SalesInvoiceDetails

type SalesInvoiceDetails struct {
	Quantity             float64 `json:"quantity,omitempty"`      // required
	UnitPrice            float64 `json:"unit_price,omitempty"`    // required
	VatRate              float64 `json:"vat_rate,omitempty"`      // required
	DiscountType         string  `json:"discount_type,omitempty"` // "percentage", "amount"
	DiscountValue        float64 `json:"discount_value,omitempty"`
	ExciseDutyType       string  `json:"excise_duty_type,omitempty"` // "percentage", "amount"
	ExciseDutyValue      float64 `json:"excise_duty_value,omitempty"`
	CommunicationTaxRate float64 `json:"communication_tax_rate,omitempty"`
	Description          string  `json:"description,omitempty"`
}

SalesInvoiceDetails ...

type SalesInvoiceDetailsData

type SalesInvoiceDetailsData struct {
	ID            string               `json:"id"`
	Type          string               `json:"type"`
	Attributes    *SalesInvoiceDetails `json:"attributes"`
	Relationships *Relationships       `json:"relationships"`
}

SalesInvoiceDetailsData ...

type SalesInvoiceGetOptions

type SalesInvoiceGetOptions struct {
	Include string `url:"include,omitempty"` // category, contact, details, details.product, payments, payments.transaction, tags, sharings, recurrence_plan, active_e_document
}

SalesInvoiceGetOptions ...

type SalesInvoiceListFilter

type SalesInvoiceListFilter struct {
	IssueDate     string `url:"issue_date,omitempty"`
	DueDate       string `url:"due_date,omitempty"`
	ContactID     int    `url:"contact_id,omitempty"`
	InvoiceID     int    `url:"invoice_id,omitempty"`
	InvoiceSeries string `url:"invoice_series,omitempty"`
}

SalesInvoiceListFilter ...

type SalesInvoiceListOptions

type SalesInvoiceListOptions struct {
	Filter  *SalesInvoiceListFilter `url:"filter,omitempty"`
	Sort    string                  `url:"sort,omitempty"` // id, issue_date, due_date, remaining, remaining_in_trl, description, net_total
	Page    *PageOptions            `url:"page,omitempty"`
	Include string                  `url:"include,omitempty"` // category, contact, details, details.product, payments, payments.transaction, tags, sharings, recurrence_plan, active_e_document
}

SalesInvoiceListOptions ...

type SalesInvoiceRequest

type SalesInvoiceRequest struct {
	Data *SalesInvoiceData `json:"data"`
}

SalesInvoiceRequest ...

type SalesInvoiceResponse

type SalesInvoiceResponse struct {
	Data     *SalesInvoiceData `json:"data"`
	Included []*Included       `json:"included"`
}

SalesInvoiceResponse ...

type SalesInvoicesResponse

type SalesInvoicesResponse struct {
	Data     []*SalesInvoiceData `json:"data"`
	Included []*Included         `json:"included"`
	Meta     Meta                `json:"meta"`
}

SalesInvoicesResponse ...

type SalesInvoicesService

type SalesInvoicesService service

SalesInvoicesService ...

func (*SalesInvoicesService) Create

Create ...

func (*SalesInvoicesService) Delete

func (s *SalesInvoicesService) Delete(id string) (*http.Response, error)

Delete ...

func (*SalesInvoicesService) Get

Get ...

func (*SalesInvoicesService) List

List ...

func (*SalesInvoicesService) Update

Update ...

type Tag

type Tag struct {
	Name string `json:"name,omitempty"`
}

Tag ...

type TagData

type TagData struct {
	ID            string         `json:"id,omitempty"`
	Type          string         `json:"type,omitempty"`
	Attributes    *Tag           `json:"attributes,omitempty"`
	Relationships *Relationships `json:"relationships,omitempty"`
}

TagData ...

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL