export type Action = {
	name: string;
	roles: Array<string>;
	params: Array<ActionParam>;
};



export type ActionParam = {
	name: string;
	type: string;
	dflt: string;
};



export type ActionResult = {
	message?: string | null;
	taggedLayers?: Array<TaggedLayer>;
};



export type ActionResults = {
	name?: string | null;
	message?: string | null;
	actionResults?: Array<ActionResult>;
};



export type ActionsResults = {
	message?: string | null;
	actionResults?: Array<ActionResults>;
};



export type ActionsStore = {
	store: string;
	actions: Array<Action>;
};



export type AdminBasket = {
	name: string;
	files: Array<FileImport>;
	columns: Array<string>;
	uploadFields: Array<string>;
	projects?: Array<Project>;
};



export type Attachment = {
	name: string;
	path: string;
};



export type BaseMapWithStores = {
	name: string;
	stores: Array<string>;
};



export type BaseStyle = {
	id?: number | null;
	name: string;
	style: Record<string, unknown> | null;
	mbtiles: string;
	static_tiles_url: string;
	enabled?: boolean;
};



export type BasketDefault = {
	surveyor?: string;
	equipment?: string;
	project?: string;
	status?: string;
	store?: string | null;
};



export type BasketImportResult = {
	time: string;
	message: string;
	details: string;
};



export type BasketNameOnly = {
	name: string;
};



export type Body_execute_tag_action_api_execTagActions_post = {
	stores: Array<string>;
	ids: Array<Array<string>>;
	actionNames: Array<string>;
	params: Array<ActionParam | null>;
	formFields: Array<FormFieldInput>;
};



export type Body_login_for_access_token_api_token_post = {
	grant_type?: string | null;
	username: string;
	password: string;
	scope?: string;
	client_id?: string | null;
	client_secret?: string | null;
};



export type Body_upload_basket_file_api_admin_basket_upload__name__post = {
	file: Blob | File;
};



export type BootstrapData = {
	version?: string;
	title?: string;
	windowTitle?: string;
	map?: Map;
	geo?: Geo;
	measures?: Measures;
	redirect?: string;
	user?: UserRead | null;
};



export type CategoryGroup = {
	name?: string | null;
	major: boolean;
	long_name: string;
};



export type CategoryRead = {
	name: string;
	description: string | null;
	group: string;
	minor_group_1?: string;
	minor_group_2?: string;
	status: string;
	custom: boolean | null;
	auto_import?: boolean;
	gis_type?: string;
	long_name: string | null;
	style: string | null;
	symbol: string | null;
	mapbox_type_custom: string | null;
	mapbox_paint: Record<string, (Record<string, unknown> | Array<unknown> | number | string)> | null;
	mapbox_layout: Record<string, (Record<string, unknown> | Array<unknown> | number | string)> | null;
	viewable_role: string | null;
	extra: Record<string, unknown> | null;
	/**
	 * ISO compliant layer name (see ISO 13567)
 * :return: str
	 */
	readonly layer_name: string;
	/**
	 * Table name
 * :return:
	 */
	readonly table_name: string;
	/**
	 * Table name
 * :return:
	 */
	readonly raw_survey_table_name: string;
	readonly mapbox_type: string;
};



export type Dashboard = {
	name: string;
	group: string;
	description: string;
	time?: string | null;
	html?: string | null;
	attachment?: string | null;
	dfData?: Array<unknown>;
	plotData?: Array<Record<string, unknown>> | null;
	plotLayout?: Record<string, unknown> | null;
	notebook?: string | null;
	expandedPanes?: Array<string> | null;
	sections?: Array<DashboardSection> | null;
};



export type DashboardGroup = {
	name: string;
	pages: Array<DashboardPageMetaData>;
};



export type DashboardHome = {
	title: string;
	content: string;
	footer: string;
};



export type DashboardPageMetaData = {
	name: string;
	group: string;
	description: string;
	viewable_role?: string | null;
};



export type DashboardSection = {
	name: string;
	plot: string;
};



export type DataProvider = {
	store: string;
	name: string;
	values: Array<string>;
};



export type Downloader = {
	roles?: Array<string>;
	name: string;
	icon: string | null;
};



export type Equipment = {
	id?: number | null;
	name: string;
};



export type FeatureInfo = {
	id: string;
	itemName: string;
	geoInfoItems?: Array<InfoItem>;
	surveyInfoItems?: Array<InfoItem>;
	infoItems?: Array<InfoItem>;
	categorizedInfoItems?: Array<InfoCategory> | null;
	tags?: Array<Tag>;
	graph?: string | null;
	plotParams?: PlotParams | null;
	files?: Array<Attachment>;
	images?: Array<Attachment>;
	externalRecordUrl?: string | null;
};



/**
 * Files to import or imported in the DB.
 * Give either url or path.
 */
export type FileImport = {
	id?: number | null;
	url: string;
	path: string;
	dir: string;
	name: string;
	md5: string;
	time: string;
	comment: string;
	status: string;
	store: string;
	basket: string;
	project_id: number;
	surveyor_id: number;
	equipment_id: number;
};



export type FormField = {
	name: string;
	type: string;
	dflt?: string | null;
	value?: string | null;
};



export type FormFieldInput = {
	name: string;
	value: string;
};



export type Geo = {
	raw_survey?: RawSurvey;
	simplify_geom_factor?: number;
	simplify_preserve_topology?: boolean;
	srid?: number;
	srid_for_proj?: number;
};



export type HTTPValidationError = {
	detail?: Array<ValidationError>;
};



export type InfoCategory = {
	name: string;
	infoItems: Array<InfoItem>;
};



export type InfoItem = {
	key: string;
	value: (string | number);
};



export type LegendItem = {
	key: string;
	value: string;
};



export type Map = {
	tileServer?: TileServer;
	zoom?: number;
	pitch?: number;
	lat?: number;
	lng?: number;
	bearing?: number;
	style?: string;
	opacity?: number;
	attribution?: string;
	status?: Array<string>;
	defaultStatus?: Array<string>;
	tagKeys?: Array<string>;
};



export type MapInitData = {
	baseStyles?: Array<BaseStyle>;
	baseMaps?: Array<BaseMapWithStores>;
	groups?: Array<CategoryGroup>;
	stores?: Array<Store>;
};



export type MaplibreStyle = {
	paint?: Record<string, (Record<string, unknown> | Array<unknown> | number | string)> | null;
	layout?: Record<string, (Record<string, unknown> | Array<unknown> | number | string)> | null;
	attribution?: string | null;
};



export type Measures = {
	defaultStore?: string | null;
};



export type MeasuresItem = {
	id: number;
	name: string;
};



export type ModelAction = {
	name: string;
	icon: string;
	roles?: Array<string> | null;
	formFields: Array<FormField>;
};



export type ModelInfo = {
	store: string;
	modelName: string;
	symbol?: string | null;
	values?: Array<ModelValue>;
	actions?: Array<ModelAction>;
	formName?: string | null;
	formFields?: Array<FormField>;
	tagPlugins?: Array<string>;
	tagActions?: Array<TagActions>;
	downloaders?: Array<Downloader>;
	legend?: Array<LegendItem>;
};



export type ModelValue = {
	name: string;
	title: string;
	unit: string;
	chartType?: string;
	chartColor?: string;
};



export type PlotBaseLine = {
	name: string;
	value: number;
	color: string;
};



export type PlotBgShape = {
	name: string;
	valueTop: number;
	valueBottom: number;
	color: string;
};



export type PlotParams = {
	baseLines?: Array<PlotBaseLine>;
	bgShapes?: Array<PlotBgShape>;
	barBase?: number | null;
};



export type Project = {
	id?: number | null;
	name: string;
	contact_person: string;
	site: string;
	date_approved: string;
	start_date_planned: string;
	start_date_effective: string;
	end_date_planned: string;
	end_date_effective: string;
};



export type RawSurvey = {
	spatial_sys_ref?: SpatialSysRef;
	srid?: number;
};



export type RoleRead = {
	name: string;
	id: number;
	users?: Array<UserReadNoRoles>;
};



export type RoleReadNoUsers = {
	name: string;
	id: number;
};



export type SpatialSysRef = {
	author?: string;
	ellps?: string;
	k?: number;
	lat_0?: number;
	lon_0?: number;
	no_defs?: boolean;
	proj?: string;
	towgs84?: string;
	units?: string;
	x_0?: number;
	y_0?: number;
};



export type Store = {
	name: string;
	category?: string | null;
	auto_import: boolean;
	count?: number | null;
	custom: boolean;
	description: string;
	gis_type: string;
	group: string;
	in_menu: boolean;
	is_db: boolean;
	is_line_work: boolean;
	is_live: boolean;
	long_name: string | null;
	type: string;
	minor_group_1: string | null;
	minor_group_2: string | null;
	status: string;
	style: string | null;
	symbol: string | null;
	title: string;
	viewable_role: string | null;
	z_index: number;
};



export type StoreNameOnly = {
	name: string;
};



export type SurveyMeta = {
	projects: Array<Project>;
	surveyors: Array<Surveyor>;
	equipments: Array<Equipment>;
	statuses: Array<string>;
	stores_misc: Array<StoreNameOnly>;
	stores_line_work: Array<StoreNameOnly>;
	default: BasketDefault;
};



export type Surveyor = {
	id?: number | null;
	name: string;
};



export type Tag = {
	key: string;
	value: string;
};



export type TagAction = {
	name: string;
	action: string;
	roles?: Array<string> | null;
	link?: string | null;
	save?: boolean;
};



export type TagActions = {
	domain: string;
	key: string;
	actions: Array<TagAction>;
};



export type TaggedFeature = {
	id: string;
	tags: Tags;
	lat: number;
	lon: number;
};



export type TaggedLayer = {
	store: string;
	taggedFeatures: Array<TaggedFeature>;
};



export type Tags = {
	id?: number | null;
	geom: string;
	store: string;
	ref_id: number;
	tags: Record<string, unknown>;
};



export type TileServer = {
	baseDir?: string;
	useRequestUrl?: boolean;
	spriteBaseDir?: string;
	spriteUrl?: string;
	spriteBaseUrl?: string;
	openMapTilesKey?: string | null;
};



export type Token = {
	access_token: string;
	token_type: string;
};



export type UserRead = {
	username: string;
	email: string | null;
	disabled?: boolean | null;
	id: number;
	roles?: Array<RoleReadNoUsers>;
};



export type UserReadNoRoles = {
	username: string;
	email: string | null;
	disabled?: boolean | null;
	id: number;
};



export type UserRoleLink = {
	user_id?: number | null;
	role_id?: number | null;
};



export type ValidationError = {
	loc: Array<string | number>;
	msg: string;
	type: string;
};

