Documentation
¶
Index ¶
- type AccountService
- type Contact
- type ContactNotFoundError
- type ContactType
- type CreateInvoiceQueryRequest
- type Credit
- type Details
- type GetContactResponseBody
- type GetContactSliceResponseBody
- type GetCreditResponseBody
- type GetCreditSliceResponseBody
- type GetDetailsResponseBody
- type GetDetailsSliceResponseBody
- type GetInvoiceQueryResponseBody
- type GetInvoiceQuerySliceResponseBody
- type GetInvoiceResponseBody
- type GetInvoiceSliceResponseBody
- type Invoice
- type InvoiceNotFoundError
- type InvoiceQuery
- type InvoiceQueryNotFoundError
- type PaginatedContact
- type PaginatedCredit
- type PaginatedInvoice
- type PaginatedInvoiceQuery
- type Service
- func (s *Service) CreateInvoiceQuery(req CreateInvoiceQueryRequest) (int, error)
- func (s *Service) GetContact(contactID int) (Contact, error)
- func (s *Service) GetContacts(parameters connection.APIRequestParameters) ([]Contact, error)
- func (s *Service) GetContactsPaginated(parameters connection.APIRequestParameters) (*PaginatedContact, error)
- func (s *Service) GetCredits(parameters connection.APIRequestParameters) ([]Credit, error)
- func (s *Service) GetDetails() (Details, error)
- func (s *Service) GetInvoice(invoiceID int) (Invoice, error)
- func (s *Service) GetInvoiceQueries(parameters connection.APIRequestParameters) ([]InvoiceQuery, error)
- func (s *Service) GetInvoiceQueriesPaginated(parameters connection.APIRequestParameters) (*PaginatedInvoiceQuery, error)
- func (s *Service) GetInvoiceQuery(queryID int) (InvoiceQuery, error)
- func (s *Service) GetInvoices(parameters connection.APIRequestParameters) ([]Invoice, error)
- func (s *Service) GetInvoicesPaginated(parameters connection.APIRequestParameters) (*PaginatedInvoice, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountService ¶
type AccountService interface { GetContacts(parameters connection.APIRequestParameters) ([]Contact, error) GetContactsPaginated(parameters connection.APIRequestParameters) (*PaginatedContact, error) GetContact(contactID int) (Contact, error) GetDetails() (Details, error) GetCredits(parameters connection.APIRequestParameters) ([]Credit, error) GetInvoices(parameters connection.APIRequestParameters) ([]Invoice, error) GetInvoicesPaginated(parameters connection.APIRequestParameters) (*PaginatedInvoice, error) GetInvoice(invoiceID int) (Invoice, error) GetInvoiceQueries(parameters connection.APIRequestParameters) ([]InvoiceQuery, error) GetInvoiceQueriesPaginated(parameters connection.APIRequestParameters) (*PaginatedInvoiceQuery, error) GetInvoiceQuery(invoiceQueryID int) (InvoiceQuery, error) CreateInvoiceQuery(req CreateInvoiceQueryRequest) (int, error) }
AccountService is an interface for managing account
type Contact ¶
type Contact struct { ID int `json:"id"` Type ContactType `json:"type"` FirstName string `json:"first_name"` LastName string `json:"last_name"` }
Contact represents a UKFast account contact +genie:model_response +genie:model_paginated
type ContactNotFoundError ¶
type ContactNotFoundError struct {
ID int
}
ContactNotFoundError indicates a contact was not found
func (*ContactNotFoundError) Error ¶
func (e *ContactNotFoundError) Error() string
type ContactType ¶
type ContactType string
const ( ContactTypePrimaryContact ContactType = "Primary Contact" ContactTypeAccounts ContactType = "Accounts" ContactTypeTechnical ContactType = "Technical" ContactTypeThirdParty ContactType = "Third Party" ContactTypeOther ContactType = "Other" )
func (ContactType) String ¶
func (t ContactType) String() string
type CreateInvoiceQueryRequest ¶ added in v1.2.0
type CreateInvoiceQueryRequest struct { ContactID int `json:"contact_id"` ContactMethod string `json:"contact_method"` Amount float32 `json:"amount"` WhatWasExpected string `json:"what_was_expected"` WhatWasReceived string `json:"what_was_received"` ProposedSolution string `json:"proposed_solution"` InvoiceIDs []int `json:"invoice_ids"` }
CreateInvoiceQueryRequest represents a request to create an invoice query
type Credit ¶ added in v1.0.35
type Credit struct { Type string `json:"type"` Total int `json:"total"` Remaining int `json:"remaining"` }
Credit represents a UKFast account credit +genie:model_response +genie:model_paginated
type Details ¶
type Details struct { CompanyRegistrationNumber string `json:"company_registration_number"` VATIdentificationNumber string `json:"vat_identification_number"` PrimaryContactID int `json:"primary_contact_id"` }
Details represents a UKFast account details +genie:model_response
type GetContactResponseBody ¶
type GetContactResponseBody struct { connection.APIResponseBody Data Contact `json:"data"` }
GetContactResponseBody represents an API response body containing Contact data
type GetContactSliceResponseBody ¶ added in v1.3.17
type GetContactSliceResponseBody struct { connection.APIResponseBody Data []Contact `json:"data"` }
GetContactSliceResponseBody represents an API response body containing []Contact data
type GetCreditResponseBody ¶ added in v1.3.16
type GetCreditResponseBody struct { connection.APIResponseBody Data Credit `json:"data"` }
GetCreditResponseBody represents an API response body containing Credit data
type GetCreditSliceResponseBody ¶ added in v1.3.17
type GetCreditSliceResponseBody struct { connection.APIResponseBody Data []Credit `json:"data"` }
GetCreditSliceResponseBody represents an API response body containing []Credit data
type GetDetailsResponseBody ¶
type GetDetailsResponseBody struct { connection.APIResponseBody Data Details `json:"data"` }
GetDetailsResponseBody represents an API response body containing Details data
type GetDetailsSliceResponseBody ¶ added in v1.3.17
type GetDetailsSliceResponseBody struct { connection.APIResponseBody Data []Details `json:"data"` }
GetDetailsSliceResponseBody represents an API response body containing []Details data
type GetInvoiceQueryResponseBody ¶ added in v1.2.0
type GetInvoiceQueryResponseBody struct { connection.APIResponseBody Data InvoiceQuery `json:"data"` }
GetInvoiceQueryResponseBody represents an API response body containing InvoiceQuery data
type GetInvoiceQuerySliceResponseBody ¶ added in v1.3.17
type GetInvoiceQuerySliceResponseBody struct { connection.APIResponseBody Data []InvoiceQuery `json:"data"` }
GetInvoiceQuerySliceResponseBody represents an API response body containing []InvoiceQuery data
type GetInvoiceResponseBody ¶ added in v1.2.0
type GetInvoiceResponseBody struct { connection.APIResponseBody Data Invoice `json:"data"` }
GetInvoiceResponseBody represents an API response body containing Invoice data
type GetInvoiceSliceResponseBody ¶ added in v1.3.17
type GetInvoiceSliceResponseBody struct { connection.APIResponseBody Data []Invoice `json:"data"` }
GetInvoiceSliceResponseBody represents an API response body containing []Invoice data
type Invoice ¶ added in v1.2.0
type Invoice struct { ID int `json:"id"` Date connection.Date `json:"date"` Paid bool `json:"paid"` Net float32 `json:"net"` VAT float32 `json:"vat"` Gross float32 `json:"gross"` }
Invoice represents a UKFast account invoice +genie:model_response +genie:model_paginated
type InvoiceNotFoundError ¶ added in v1.2.0
type InvoiceNotFoundError struct {
ID int
}
InvoiceNotFoundError indicates an invoice was not found
func (*InvoiceNotFoundError) Error ¶ added in v1.2.0
func (e *InvoiceNotFoundError) Error() string
type InvoiceQuery ¶ added in v1.2.0
type InvoiceQuery struct { ID int `json:"id"` ContactID int `json:"contact_id"` Amount float32 `json:"amount"` WhatWasExpected string `json:"what_was_expected"` WhatWasReceived string `json:"what_was_received"` ProposedSolution string `json:"proposed_solution"` InvoiceIDs []int `json:"invoice_ids"` }
InvoiceQuery represents a UKFast account invoice query +genie:model_response +genie:model_paginated
type InvoiceQueryNotFoundError ¶ added in v1.2.0
type InvoiceQueryNotFoundError struct {
ID int
}
InvoiceQueryNotFoundError indicates an invoice query was not found
func (*InvoiceQueryNotFoundError) Error ¶ added in v1.2.0
func (e *InvoiceQueryNotFoundError) Error() string
type PaginatedContact ¶ added in v1.1.0
type PaginatedContact struct { *connection.PaginatedBase Items []Contact }
PaginatedContact represents a paginated collection of Contact
func NewPaginatedContact ¶ added in v1.1.0
func NewPaginatedContact(getFunc connection.PaginatedGetFunc, parameters connection.APIRequestParameters, pagination connection.APIResponseMetadataPagination, items []Contact) *PaginatedContact
NewPaginatedContact returns a pointer to an initialized PaginatedContact struct
type PaginatedCredit ¶ added in v1.3.25
type PaginatedCredit struct { *connection.PaginatedBase Items []Credit }
PaginatedCredit represents a paginated collection of Credit
func NewPaginatedCredit ¶ added in v1.3.25
func NewPaginatedCredit(getFunc connection.PaginatedGetFunc, parameters connection.APIRequestParameters, pagination connection.APIResponseMetadataPagination, items []Credit) *PaginatedCredit
NewPaginatedCredit returns a pointer to an initialized PaginatedCredit struct
type PaginatedInvoice ¶ added in v1.2.0
type PaginatedInvoice struct { *connection.PaginatedBase Items []Invoice }
PaginatedInvoice represents a paginated collection of Invoice
func NewPaginatedInvoice ¶ added in v1.2.0
func NewPaginatedInvoice(getFunc connection.PaginatedGetFunc, parameters connection.APIRequestParameters, pagination connection.APIResponseMetadataPagination, items []Invoice) *PaginatedInvoice
NewPaginatedInvoice returns a pointer to an initialized PaginatedInvoice struct
type PaginatedInvoiceQuery ¶ added in v1.2.0
type PaginatedInvoiceQuery struct { *connection.PaginatedBase Items []InvoiceQuery }
PaginatedInvoiceQuery represents a paginated collection of InvoiceQuery
func NewPaginatedInvoiceQuery ¶ added in v1.2.0
func NewPaginatedInvoiceQuery(getFunc connection.PaginatedGetFunc, parameters connection.APIRequestParameters, pagination connection.APIResponseMetadataPagination, items []InvoiceQuery) *PaginatedInvoiceQuery
NewPaginatedInvoiceQuery returns a pointer to an initialized PaginatedInvoiceQuery struct
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service implements AccountService for managing Account certificates via the UKFast API
func NewService ¶
func NewService(connection connection.Connection) *Service
NewService returns a new instance of AccountService
func (*Service) CreateInvoiceQuery ¶ added in v1.2.0
func (s *Service) CreateInvoiceQuery(req CreateInvoiceQueryRequest) (int, error)
CreateInvoiceQuery retrieves creates an InvoiceQuery
func (*Service) GetContact ¶
GetContact retrieves a single contact by id
func (*Service) GetContacts ¶
func (s *Service) GetContacts(parameters connection.APIRequestParameters) ([]Contact, error)
GetContacts retrieves a list of contacts
func (*Service) GetContactsPaginated ¶
func (s *Service) GetContactsPaginated(parameters connection.APIRequestParameters) (*PaginatedContact, error)
GetContactsPaginated retrieves a paginated list of contacts
func (*Service) GetCredits ¶ added in v1.0.35
func (s *Service) GetCredits(parameters connection.APIRequestParameters) ([]Credit, error)
GetCredits retrieves a list of credits
func (*Service) GetDetails ¶
GetDetails retrieves account details
func (*Service) GetInvoice ¶ added in v1.2.0
GetInvoice retrieves a single invoice by id
func (*Service) GetInvoiceQueries ¶ added in v1.2.0
func (s *Service) GetInvoiceQueries(parameters connection.APIRequestParameters) ([]InvoiceQuery, error)
GetInvoiceQueries retrieves a list of invoice queries
func (*Service) GetInvoiceQueriesPaginated ¶ added in v1.2.0
func (s *Service) GetInvoiceQueriesPaginated(parameters connection.APIRequestParameters) (*PaginatedInvoiceQuery, error)
GetInvoiceQueriesPaginated retrieves a paginated list of invoice queries
func (*Service) GetInvoiceQuery ¶ added in v1.2.0
func (s *Service) GetInvoiceQuery(queryID int) (InvoiceQuery, error)
GetInvoiceQuery retrieves a single invoice query by id
func (*Service) GetInvoices ¶ added in v1.2.0
func (s *Service) GetInvoices(parameters connection.APIRequestParameters) ([]Invoice, error)
GetInvoices retrieves a list of invoices
func (*Service) GetInvoicesPaginated ¶ added in v1.2.0
func (s *Service) GetInvoicesPaginated(parameters connection.APIRequestParameters) (*PaginatedInvoice, error)
GetInvoicesPaginated retrieves a paginated list of invoices