Documentation
¶
Index ¶
- type AccountService
- type Contact
- type ContactNotFoundError
- type ContactType
- type Details
- type GetContactResponseBody
- type GetContactsResponseBody
- type GetDetailsResponseBody
- type Service
- func (s *Service) GetContact(contactID int) (Contact, error)
- func (s *Service) GetContacts(parameters connection.APIRequestParameters) ([]Contact, error)
- func (s *Service) GetContactsPaginated(parameters connection.APIRequestParameters) ([]Contact, error)
- func (s *Service) GetDetails() (Details, 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) ([]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 ¶
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 ¶
GetDetails retrieves account details