billing

package
v1.3.20 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Code generated by github.com/ukfast/sdk-go/pkg/gen/model_paginated. DO NOT EDIT.

Code generated by github.com/ukfast/sdk-go/pkg/gen/response. DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BillingService

type BillingService interface {
	GetCards(parameters connection.APIRequestParameters) ([]Card, error)
	GetCardsPaginated(parameters connection.APIRequestParameters) (*PaginatedCard, error)
	GetCard(cardID int) (Card, error)
	CreateCard(req CreateCardRequest) (int, error)
	PatchCard(cardID int, patch PatchCardRequest) error
	DeleteCard(cardID int) error

	GetCloudCosts(parameters connection.APIRequestParameters) ([]CloudCost, error)
	GetCloudCostsPaginated(parameters connection.APIRequestParameters) (*PaginatedCloudCost, error)
	GetCloudCost(costID int) (CloudCost, error)

	GetDirectDebit() (DirectDebit, 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(queryID int) (InvoiceQuery, error)
	CreateInvoiceQuery(req CreateInvoiceQueryRequest) (int, error)

	GetPayments(parameters connection.APIRequestParameters) ([]Payment, error)
	GetPaymentsPaginated(parameters connection.APIRequestParameters) (*PaginatedPayment, error)
	GetPayment(paymentID int) (Payment, error)

	GetRecurringCosts(parameters connection.APIRequestParameters) ([]RecurringCost, error)
	GetRecurringCostsPaginated(parameters connection.APIRequestParameters) (*PaginatedRecurringCost, error)
	GetRecurringCost(costID int) (RecurringCost, error)
}

BillingService is an interface for managing billing

type Card

type Card struct {
	ID           int    `json:"id"`
	FriendlyName string `json:"friendly_name"`
	Name         string `json:"name"`
	Address      string `json:"address"`
	Postcode     string `json:"postcode"`
	CardNumber   string `json:"card_number"`
	CardType     string `json:"card_type"`
	ValidFrom    string `json:"valid_from"`
	Expiry       string `json:"expiry"`
	IssueNumber  int    `json:"issue_number"`
	PrimaryCard  bool   `json:"primary_card"`
}

Card represents a credit/debit card

type CardNotFoundError

type CardNotFoundError struct {
	ID int
}

CardNotFoundError indicates a card was not found

func (*CardNotFoundError) Error

func (e *CardNotFoundError) Error() string

type CloudCost

type CloudCost struct {
	ID       int `json:"id"`
	ServerID int `json:"server_id"`
	Resource struct {
		Type                   string              `json:"type"`
		Quantity               int                 `json:"quantity"`
		Price                  float32             `json:"price"`
		Period                 string              `json:"period"`
		UsageSinceLastInvoice  int                 `json:"usage_since_last_invoice"`
		CostSinceLastInvoice   float32             `json:"cost_since_last_invoice"`
		UsageForPeriodEstimate int                 `json:"usage_for_period_estimate"`
		CostForPeriodEstimate  float32             `json:"cost_for_period_estimate"`
		BillingStart           connection.DateTime `json:"billing_start"`
		BillingEnd             connection.DateTime `json:"billing_end"`
		BillingDueDate         connection.DateTime `json:"billing_due_date"`
	} `json:"resource"`
}

CloudCost represents a cloud cost item

type CloudCostNotFoundError

type CloudCostNotFoundError struct {
	ID int
}

CloudCostNotFoundError indicates a cloud cost was not found

func (*CloudCostNotFoundError) Error

func (e *CloudCostNotFoundError) Error() string

type CreateCardRequest

type CreateCardRequest struct {
	FriendlyName string `json:"friendly_name"`
	Name         string `json:"name"`
	Address      string `json:"address"`
	Postcode     string `json:"postcode"`
	CardNumber   string `json:"card_number"`
	CardType     string `json:"card_type"`
	ValidFrom    string `json:"valid_from"`
	Expiry       string `json:"expiry"`
	IssueNumber  int    `json:"issue_number"`
	PrimaryCard  bool   `json:"primary_card"`
}

CreateCardRequest represents a request to create a card

type CreateInvoiceQueryRequest

type CreateInvoiceQueryRequest struct {
	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"`
	ContactMethod    string              `json:"contact_method"`
	InvoiceIDs       []int               `json:"invoice_ids"`
	Resolution       string              `json:"resolution"`
	ResolutionDate   connection.DateTime `json:"resolution_date"`
	Status           string              `json:"status"`
	Date             connection.DateTime `json:"date"`
}

CreateInvoiceQueryRequest represents a request to create an invoice query

type DirectDebit

type DirectDebit struct {
	Name           string              `json:"name"`
	Number         string              `json:"number"`
	SortCode       string              `json:"sortcode"`
	IsActivated    bool                `json:"is_activated"`
	Status         string              `json:"status"`
	DaysCredit     int                 `json:"days_credit"`
	SignupDateTime connection.DateTime `json:"signup_datetime"`
	SignupSource   string              `json:"signup_source"`
}

DirectDebit represents a direct debit

type DirectDebitNotFoundError

type DirectDebitNotFoundError struct {
}

DirectDebitNotFoundError indicates direct debit details were not found

func (*DirectDebitNotFoundError) Error

func (e *DirectDebitNotFoundError) Error() string

type GetCardResponseBody

type GetCardResponseBody struct {
	connection.APIResponseBody

	Data Card `json:"data"`
}

GetCardResponseBody represents an API response body containing Card data

type GetCardSliceResponseBody

type GetCardSliceResponseBody struct {
	connection.APIResponseBody

	Data []Card `json:"data"`
}

GetCardSliceResponseBody represents an API response body containing []Card data

type GetCloudCostResponseBody

type GetCloudCostResponseBody struct {
	connection.APIResponseBody

	Data CloudCost `json:"data"`
}

GetCloudCostResponseBody represents an API response body containing CloudCost data

type GetCloudCostSliceResponseBody

type GetCloudCostSliceResponseBody struct {
	connection.APIResponseBody

	Data []CloudCost `json:"data"`
}

GetCloudCostSliceResponseBody represents an API response body containing []CloudCost data

type GetDirectDebitResponseBody

type GetDirectDebitResponseBody struct {
	connection.APIResponseBody

	Data DirectDebit `json:"data"`
}

GetDirectDebitResponseBody represents an API response body containing DirectDebit data

type GetDirectDebitSliceResponseBody

type GetDirectDebitSliceResponseBody struct {
	connection.APIResponseBody

	Data []DirectDebit `json:"data"`
}

GetDirectDebitSliceResponseBody represents an API response body containing []DirectDebit data

type GetInvoiceQueryResponseBody

type GetInvoiceQueryResponseBody struct {
	connection.APIResponseBody

	Data InvoiceQuery `json:"data"`
}

GetInvoiceQueryResponseBody represents an API response body containing InvoiceQuery data

type GetInvoiceQuerySliceResponseBody

type GetInvoiceQuerySliceResponseBody struct {
	connection.APIResponseBody

	Data []InvoiceQuery `json:"data"`
}

GetInvoiceQuerySliceResponseBody represents an API response body containing []InvoiceQuery data

type GetInvoiceResponseBody

type GetInvoiceResponseBody struct {
	connection.APIResponseBody

	Data Invoice `json:"data"`
}

GetInvoiceResponseBody represents an API response body containing Invoice data

type GetInvoiceSliceResponseBody

type GetInvoiceSliceResponseBody struct {
	connection.APIResponseBody

	Data []Invoice `json:"data"`
}

GetInvoiceSliceResponseBody represents an API response body containing []Invoice data

type GetPaymentResponseBody

type GetPaymentResponseBody struct {
	connection.APIResponseBody

	Data Payment `json:"data"`
}

GetPaymentResponseBody represents an API response body containing Payment data

type GetPaymentSliceResponseBody

type GetPaymentSliceResponseBody struct {
	connection.APIResponseBody

	Data []Payment `json:"data"`
}

GetPaymentSliceResponseBody represents an API response body containing []Payment data

type GetRecurringCostResponseBody

type GetRecurringCostResponseBody struct {
	connection.APIResponseBody

	Data RecurringCost `json:"data"`
}

GetRecurringCostResponseBody represents an API response body containing RecurringCost data

type GetRecurringCostSliceResponseBody

type GetRecurringCostSliceResponseBody struct {
	connection.APIResponseBody

	Data []RecurringCost `json:"data"`
}

GetRecurringCostSliceResponseBody represents an API response body containing []RecurringCost data

type Invoice

type Invoice struct {
	ID             int                 `json:"id"`
	Date           connection.DateTime `json:"date"`
	Paid           bool                `json:"paid"`
	Gross          string              `json:"gross"`
	VAT            string              `json:"vat"`
	Net            string              `json:"net"`
	Outstanding    string              `json:"outstanding"`
	ViaDirectDebit bool                `json:"via_direct_debit"`
}

Invoice represents an invoice

type InvoiceNotFoundError

type InvoiceNotFoundError struct {
	ID int
}

InvoiceNotFoundError indicates an invoice was not found

func (*InvoiceNotFoundError) Error

func (e *InvoiceNotFoundError) Error() string

type InvoiceQuery

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"`
	Resolution       bool                `json:"resolution"`
	ResolutionDate   connection.DateTime `json:"resolution_date"`
	Status           string              `json:"status"`
	Date             connection.DateTime `json:"date"`
}

InvoiceQuery represents an invoice query

type InvoiceQueryNotFoundError

type InvoiceQueryNotFoundError struct {
	ID int
}

InvoiceQueryNotFoundError indicates an invoice query was not found

func (*InvoiceQueryNotFoundError) Error

func (e *InvoiceQueryNotFoundError) Error() string

type PaginatedCard

type PaginatedCard struct {
	*connection.PaginatedBase

	Items []Card
}

PaginatedCard represents a paginated collection of Card

func NewPaginatedCard

NewPaginatedCard returns a pointer to an initialized PaginatedCard struct

type PaginatedCloudCost

type PaginatedCloudCost struct {
	*connection.PaginatedBase

	Items []CloudCost
}

PaginatedCloudCost represents a paginated collection of CloudCost

func NewPaginatedCloudCost

NewPaginatedCloudCost returns a pointer to an initialized PaginatedCloudCost struct

type PaginatedInvoice

type PaginatedInvoice struct {
	*connection.PaginatedBase

	Items []Invoice
}

PaginatedInvoice represents a paginated collection of Invoice

func NewPaginatedInvoice

NewPaginatedInvoice returns a pointer to an initialized PaginatedInvoice struct

type PaginatedInvoiceQuery

type PaginatedInvoiceQuery struct {
	*connection.PaginatedBase

	Items []InvoiceQuery
}

PaginatedInvoiceQuery represents a paginated collection of InvoiceQuery

func NewPaginatedInvoiceQuery

NewPaginatedInvoiceQuery returns a pointer to an initialized PaginatedInvoiceQuery struct

type PaginatedPayment

type PaginatedPayment struct {
	*connection.PaginatedBase

	Items []Payment
}

PaginatedPayment represents a paginated collection of Payment

func NewPaginatedPayment

NewPaginatedPayment returns a pointer to an initialized PaginatedPayment struct

type PaginatedRecurringCost

type PaginatedRecurringCost struct {
	*connection.PaginatedBase

	Items []RecurringCost
}

PaginatedRecurringCost represents a paginated collection of RecurringCost

func NewPaginatedRecurringCost

NewPaginatedRecurringCost returns a pointer to an initialized PaginatedRecurringCost struct

type PatchCardRequest

type PatchCardRequest struct {
	FriendlyName string `json:"friendly_name,omitempty"`
	Name         string `json:"name,omitempty"`
	Address      string `json:"address,omitempty"`
	Postcode     string `json:"postcode,omitempty"`
	CardNumber   string `json:"card_number,omitempty"`
	CardType     string `json:"card_type,omitempty"`
	ValidFrom    string `json:"valid_from,omitempty"`
	Expiry       string `json:"expiry,omitempty"`
	IssueNumber  int    `json:"issue_number,omitempty"`
	PrimaryCard  *bool  `json:"primary_card,omitempty"`
}

PatchCardRequest represents a request to create a card

type Payment

type Payment struct {
	ID          int                 `json:"id"`
	Category    string              `json:"category"`
	Quantity    int                 `json:"quantity"`
	Description string              `json:"description"`
	Date        connection.DateTime `json:"date"`
	DateFrom    connection.DateTime `json:"date_from"`
	DateTo      connection.DateTime `json:"date_to"`
	Cost        float32             `json:"cost"`
	VAT         float32             `json:"vat"`
	Gross       float32             `json:"gross"`
	Discount    float32             `json:"discount"`
}

Payment represents a payment

type PaymentNotFoundError

type PaymentNotFoundError struct {
	ID int
}

PaymentNotFoundError indicates a payment was not found

func (*PaymentNotFoundError) Error

func (e *PaymentNotFoundError) Error() string

type RecurringCost

type RecurringCost struct {
	ID   int `json:"id"`
	Type struct {
		ID   int    `json:"id"`
		Name string `json:"name"`
	} `json:"type"`
	Description     string `json:"description"`
	Status          string `json:"status"`
	OrderID         string `json:"order_id"`
	PurchaseOrderID string `json:"purchase_order_id"`
	CostCentreID    int    `json:"cost_centre_id"`
	Product         struct {
		ID   int    `json:"id"`
		Name string `json:"name"`
	} `json:"product"`
	Cost                     float32             `json:"cost"`
	Period                   string              `json:"period"`
	Interval                 int                 `json:"interval"`
	ByCard                   bool                `json:"by_card"`
	NextPaymentAt            connection.Date     `json:"next_payment_at"`
	EndDate                  connection.Date     `json:"end_date"`
	ContractEndDate          connection.Date     `json:"contract_end_date"`
	FrozenEndDate            connection.Date     `json:"frozen_end_date"`
	MigrationEndDate         connection.Date     `json:"migration_end_date"`
	ExtendedMigrationEndDate connection.Date     `json:"extended_migration_end_date"`
	CreatedAt                connection.DateTime `json:"created_at"`
	Partner                  struct {
		ID   int    `json:"id"`
		Cost string `json:"cost"`
	} `json:"partner"`
	ProjectID int `json:"project_id"`
}

RecurringCost represents a recurring cost

type RecurringCostNotFoundError

type RecurringCostNotFoundError struct {
	ID int
}

RecurringCostNotFoundError indicates a recurring cost was not found

func (*RecurringCostNotFoundError) Error

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service implements BillingService for managing Billing certificates via the UKFast API

func NewService

func NewService(connection connection.Connection) *Service

NewService returns a new instance of BillingService

func (*Service) CreateCard

func (s *Service) CreateCard(req CreateCardRequest) (int, error)

CreateCard creates a new card

func (*Service) CreateInvoiceQuery

func (s *Service) CreateInvoiceQuery(req CreateInvoiceQueryRequest) (int, error)

CreateInvoiceQuery retrieves creates an InvoiceQuery

func (*Service) DeleteCard

func (s *Service) DeleteCard(cardID int) error

DeleteCard removes a card

func (*Service) GetCard

func (s *Service) GetCard(cardID int) (Card, error)

GetCard retrieves a single card by id

func (*Service) GetCards

func (s *Service) GetCards(parameters connection.APIRequestParameters) ([]Card, error)

GetCards retrieves a list of cards

func (*Service) GetCardsPaginated

func (s *Service) GetCardsPaginated(parameters connection.APIRequestParameters) (*PaginatedCard, error)

GetCardsPaginated retrieves a paginated list of cards

func (*Service) GetCloudCost

func (s *Service) GetCloudCost(costID int) (CloudCost, error)

GetCloudCost retrieves a single cost by id

func (*Service) GetCloudCosts

func (s *Service) GetCloudCosts(parameters connection.APIRequestParameters) ([]CloudCost, error)

GetCloudCosts retrieves a list of costs

func (*Service) GetCloudCostsPaginated

func (s *Service) GetCloudCostsPaginated(parameters connection.APIRequestParameters) (*PaginatedCloudCost, error)

GetCloudCostsPaginated retrieves a paginated list of costs

func (*Service) GetDirectDebit

func (s *Service) GetDirectDebit() (DirectDebit, error)

GetDirectDebit retrieves direct debit details

func (*Service) GetInvoice

func (s *Service) GetInvoice(invoiceID int) (Invoice, error)

GetInvoice retrieves a single invoice by id

func (*Service) GetInvoiceQueries

func (s *Service) GetInvoiceQueries(parameters connection.APIRequestParameters) ([]InvoiceQuery, error)

GetInvoiceQueries retrieves a list of invoice queries

func (*Service) GetInvoiceQueriesPaginated

func (s *Service) GetInvoiceQueriesPaginated(parameters connection.APIRequestParameters) (*PaginatedInvoiceQuery, error)

GetInvoiceQueriesPaginated retrieves a paginated list of invoice queries

func (*Service) GetInvoiceQuery

func (s *Service) GetInvoiceQuery(queryID int) (InvoiceQuery, error)

GetInvoiceQuery retrieves a single invoice query by id

func (*Service) GetInvoices

func (s *Service) GetInvoices(parameters connection.APIRequestParameters) ([]Invoice, error)

GetInvoices retrieves a list of invoices

func (*Service) GetInvoicesPaginated

func (s *Service) GetInvoicesPaginated(parameters connection.APIRequestParameters) (*PaginatedInvoice, error)

GetInvoicesPaginated retrieves a paginated list of invoices

func (*Service) GetPayment

func (s *Service) GetPayment(paymentID int) (Payment, error)

GetPayment retrieves a single payment by id

func (*Service) GetPayments

func (s *Service) GetPayments(parameters connection.APIRequestParameters) ([]Payment, error)

GetPayments retrieves a list of payments

func (*Service) GetPaymentsPaginated

func (s *Service) GetPaymentsPaginated(parameters connection.APIRequestParameters) (*PaginatedPayment, error)

GetPaymentsPaginated retrieves a paginated list of payments

func (*Service) GetRecurringCost

func (s *Service) GetRecurringCost(costID int) (RecurringCost, error)

GetRecurringCost retrieves a single cost by id

func (*Service) GetRecurringCosts

func (s *Service) GetRecurringCosts(parameters connection.APIRequestParameters) ([]RecurringCost, error)

GetRecurringCosts retrieves a list of costs

func (*Service) GetRecurringCostsPaginated

func (s *Service) GetRecurringCostsPaginated(parameters connection.APIRequestParameters) (*PaginatedRecurringCost, error)

GetRecurringCostsPaginated retrieves a paginated list of costs

func (*Service) PatchCard

func (s *Service) PatchCard(cardID int, patch PatchCardRequest) error

PatchCard patches a card

Jump to

Keyboard shortcuts

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