account

package
v1.0.16 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

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) ([]Contact, error)
	GetContact(contactID int) (Contact, 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 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 GetDetailsResponseBody

type GetDetailsResponseBody struct {
	connection.APIResponseBody

	Data Details `json:"data"`
}

GetDetailsResponseBody represents the API response body from the GetDetails resource

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) ([]Contact, error)

GetContactsPaginated retrieves a paginated list of contacts

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