population

package
v2.239.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: MIT Imports: 16 Imported by: 14

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Area

type Area struct {
	ID       string `json:"id"`
	Label    string `json:"label"`
	AreaType string `json:"area_type"`
}

Area is an area model with ID and Label

type AreaType

type AreaType struct {
	ID              string `json:"id"`
	Label           string `json:"label"`
	Description     string `json:"description"`
	TotalCount      int    `json:"total_count"`
	Hierarchy_Order int    `json:"hierarchy_order"`
}

AreaType is an area type model with ID and Label

type AuthTokens added in v2.182.0

type AuthTokens struct {
	UserAuthToken    string
	ServiceAuthToken string
}

type Category added in v2.206.3

type Category struct {
	ID                   string `json:"id"`
	Label                string `json:"label"`
	QualityStatementText string `json:"quality_statement_text"`
}

type Client

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

Client is a Cantabular Population Types API client

func NewClient

func NewClient(apiURL string) (*Client, error)

NewClient creates a new instance of Client with a given Population Type API URL

func NewWithHealthClient

func NewWithHealthClient(hcCli *health.Client) (*Client, error)

NewWithHealthClient creates a new instance of Client, reusing the URL and Clienter from the provided health check client

func (*Client) Checker

func (c *Client) Checker(ctx context.Context, check *healthcheck.CheckState) error

Checker calls recipe api health endpoint and returns a check object to the caller

func (*Client) GetArea added in v2.162.0

func (c *Client) GetArea(ctx context.Context, input GetAreaInput) (GetAreaResponse, error)

func (*Client) GetAreaTypeParents added in v2.155.0

func (c *Client) GetAreaTypeParents(ctx context.Context, input GetAreaTypeParentsInput) (GetAreaTypeParentsResponse, error)

func (*Client) GetAreaTypes added in v2.182.0

func (c *Client) GetAreaTypes(ctx context.Context, input GetAreaTypesInput) (GetAreaTypesResponse, error)

GetPopulationAreaTypes retrieves the Cantabular area-types associated with a dataset

func (*Client) GetAreas added in v2.147.0

func (c *Client) GetAreas(ctx context.Context, input GetAreasInput) (GetAreasResponse, error)

func (*Client) GetBaseVariable added in v2.185.0

func (c *Client) GetBaseVariable(ctx context.Context, input GetBaseVariableInput) (GetBaseVariableResponse, error)

func (*Client) GetBlockedAreaCount added in v2.206.3

func (*Client) GetCategorisations added in v2.182.0

func (c *Client) GetCategorisations(ctx context.Context, input GetCategorisationsInput) (GetCategorisationsResponse, error)

func (*Client) GetDimensionCategories added in v2.206.3

func (c *Client) GetDimensionCategories(ctx context.Context, input GetDimensionCategoryInput) (GetDimensionCategoriesResponse, error)

func (*Client) GetDimensions added in v2.166.0

func (c *Client) GetDimensions(ctx context.Context, input GetDimensionsInput) (GetDimensionsResponse, error)

func (*Client) GetDimensionsDescription added in v2.206.3

func (c *Client) GetDimensionsDescription(ctx context.Context, input GetDimensionsDescriptionInput) (GetDimensionsResponse, error)

func (*Client) GetParentAreaCount added in v2.179.0

func (c *Client) GetParentAreaCount(ctx context.Context, input GetParentAreaCountInput) (int, error)

func (*Client) GetPopulationTypeMetadata added in v2.206.3

func (*Client) GetPopulationTypes

func (c *Client) GetPopulationTypes(ctx context.Context, input GetPopulationTypesInput) (GetPopulationTypesResponse, error)

type Dimension added in v2.166.0

type Dimension struct {
	ID                   string     `json:"id"`
	Label                string     `json:"label"`
	Description          string     `json:"description"`
	Categories           []Category `json:"categories"`
	TotalCount           int        `json:"total_count"`
	QualityStatementText string     `json:"quality_statement_text"`
}

Dimension is an area-type model with ID and Label

type DimensionCategory added in v2.206.3

type DimensionCategory struct {
	Id         string                  `json:"id"`
	Label      string                  `json:"label"`
	Categories []DimensionCategoryItem `json:"categories"`
}

type DimensionCategoryItem added in v2.206.3

type DimensionCategoryItem struct {
	ID    string `json:"id"`
	Label string `json:"label"`
}

type ErrorResp

type ErrorResp struct {
	Errors []string `json:"errors"`
}

ErrorResp represents an error response containing a list of errors

func (ErrorResp) Error

func (e ErrorResp) Error() string

type Filter added in v2.206.3

type Filter struct {
	Codes    []string
	Variable string
}

type GetAreaInput added in v2.162.0

type GetAreaInput struct {
	AuthTokens
	PopulationType string
	AreaType       string
	Area           string
}

type GetAreaResponse added in v2.162.0

type GetAreaResponse struct {
	Area Area `json:"area"`
}

GetAreasResponse is the response object for GET /areas

type GetAreaTypeParentsInput added in v2.155.0

type GetAreaTypeParentsInput struct {
	AuthTokens
	PaginationParams
	PopulationType string
	AreaTypeID     string
}

type GetAreaTypeParentsResponse added in v2.155.0

type GetAreaTypeParentsResponse struct {
	PaginationResponse
	AreaTypes []AreaType `json:"items"`
}

GetAreaTypeParentsResponse is the response object for GET /areas

type GetAreaTypesInput added in v2.182.0

type GetAreaTypesInput struct {
	AuthTokens
	PaginationParams
	PopulationType string
}

type GetAreaTypesResponse

type GetAreaTypesResponse struct {
	PaginationResponse
	AreaTypes []AreaType `json:"items"`
}

GetAreaTypesResponse is the response object for GET /area-types

type GetAreasInput

type GetAreasInput struct {
	AuthTokens
	PaginationParams
	PopulationType string
	AreaTypeID     string
	Text           string
}

type GetAreasResponse

type GetAreasResponse struct {
	PaginationResponse
	Areas []Area `json:"items"`
}

GetAreasResponse is the response object for GET /areas

type GetBaseVariableInput added in v2.185.0

type GetBaseVariableInput struct {
	AuthTokens
	PopulationType string
	Variable       string
}

type GetBaseVariableResponse added in v2.185.0

type GetBaseVariableResponse struct {
	ID    string `json:"id"`
	Label string `json:"label"`
}

type GetBlockedAreaCountInput added in v2.206.3

type GetBlockedAreaCountInput struct {
	AuthTokens
	PopulationType string
	Variables      []string
	Filter         Filter
}

type GetCategorisationsInput added in v2.182.0

type GetCategorisationsInput struct {
	AuthTokens
	PaginationParams
	PopulationType string
	Dimension      string
}

type GetCategorisationsResponse added in v2.182.0

type GetCategorisationsResponse struct {
	PaginationResponse
	Items []Dimension `json:"items"`
}

type GetDimensionCategoriesResponse added in v2.206.3

type GetDimensionCategoriesResponse struct {
	PaginationResponse
	Categories []DimensionCategory `json:"items"`
}

type GetDimensionCategoryInput added in v2.206.3

type GetDimensionCategoryInput struct {
	AuthTokens
	PaginationParams
	PopulationType string
	Dimensions     []string
}

type GetDimensionsDescriptionInput added in v2.206.3

type GetDimensionsDescriptionInput struct {
	AuthTokens
	PopulationType string
	DimensionIDs   []string
}

type GetDimensionsInput added in v2.166.0

type GetDimensionsInput struct {
	AuthTokens
	PaginationParams
	PopulationType string
	SearchString   string
}

type GetDimensionsResponse added in v2.166.0

type GetDimensionsResponse struct {
	PaginationResponse
	Dimensions []Dimension `json:"items"`
}

GetDimensionsResponse is the response object for GetDimensions

type GetParentAreaCountInput added in v2.179.0

type GetParentAreaCountInput struct {
	AuthTokens
	PopulationType   string
	AreaTypeID       string
	ParentAreaTypeID string
	SVarID           string
	Areas            []string
}

GetParentAreaCountInput holds the required fields for GetParentAreaCount. SVarID stands for Supplentary Variable ID and is required when querying pre-build tables.

type GetPopulationTypeMetadataInput added in v2.206.3

type GetPopulationTypeMetadataInput struct {
	AuthTokens
	PopulationType string
}

GetPopulationTypeMetadataInput is a model with auth token and population type

type GetPopulationTypeMetadataResponse added in v2.206.3

type GetPopulationTypeMetadataResponse struct {
	PopulationType   string `json:"population_type"`
	DefaultDatasetID string `json:"default_dataset_id"`
	Edition          string `json:"edition"`
	Version          int    `json:"version"`
}

GetPopulationTypeMetadataResponse model with contain the metadata for poulation type

type GetPopulationTypesInput added in v2.182.0

type GetPopulationTypesInput struct {
	DefaultDatasets bool
	AuthTokens
}

type GetPopulationTypesResponse added in v2.182.0

type GetPopulationTypesResponse struct {
	Items []PopulationType `json:"items"`
}

type PaginationParams added in v2.182.0

type PaginationParams struct {
	Limit  int `json:"limit"`
	Offset int `json:"offset"`
}

type PaginationResponse added in v2.182.0

type PaginationResponse struct {
	PaginationParams
	Count      int `json:"count"`
	TotalCount int `json:"total_count"`
}

type PopulationType added in v2.182.0

type PopulationType struct {
	Name        string `json:"name"`
	Label       string `json:"label"`
	Description string `json:"description"`
}

Jump to

Keyboard shortcuts

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