account

package
v1.1.6 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Code generated by model_paginated_gen. DO NOT EDIT.

Index

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)
}

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

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 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

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

type GetContactResponseBody

type GetContactResponseBody struct {
	connection.APIResponseBody

	Data Contact `json:"data"`
}

GetContactResponseBody represents the API response body from the GetContact resource

type GetContactsResponseBody

type GetContactsResponseBody struct {
	connection.APIResponseBody

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

GetContactsResponseBody represents the API response body from the GetContacts resource

type GetCreditsResponseBody added in v1.0.35

type GetCreditsResponseBody struct {
	connection.APIResponseBody

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

GetCreditsResponseBody represents the API response body from the GetCredits resource

type GetDetailsResponseBody

type GetDetailsResponseBody struct {
	connection.APIResponseBody

	Data Details `json:"data"`
}

GetDetailsResponseBody represents the API response body from the GetDetails resource

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

NewPaginatedContact returns a pointer to an initialized PaginatedContact 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) GetContact

func (s *Service) GetContact(contactID int) (Contact, error)

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

func (s *Service) GetDetails() (Details, error)

GetDetails retrieves account details

Jump to

Keyboard shortcuts

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