Skip to content

Commit

Permalink
[TM-1269] Regenerate API
Browse files Browse the repository at this point in the history
  • Loading branch information
roguenet committed Oct 22, 2024
1 parent 1e8d5ef commit d84bf6e
Show file tree
Hide file tree
Showing 4 changed files with 392 additions and 0 deletions.
150 changes: 150 additions & 0 deletions src/generated/apiComponents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34403,6 +34403,151 @@ export const useGetV2DashboardTopTreesPlanted = <TData = GetV2DashboardTopTreesP
);
};

export type GetV2DashboardIndicatorHectaresRestorationQueryParams = {
/**
* search term to use on the collection
*/
search?: string;
/**
* multiple filters can be applied. syntax is ?filter[foo]=value1,value2$filter[bar]=value3
*/
filter?: string;
};

export type GetV2DashboardIndicatorHectaresRestorationError = Fetcher.ErrorWrapper<undefined>;

export type GetV2DashboardIndicatorHectaresRestorationResponse = {
data?: {
restoration_strategies_represented?: {
/**
* Total amount for tree planting projects.
*/
["tree-planting"]?: number;
/**
* Total amount for projects involving both tree planting and direct seeding.
*/
["tree-planting,direct-seeding"]?: number;
/**
* Total amount for assisted natural regeneration projects.
*/
["assisted-natural-regeneration"]?: number;
/**
* Total amount for projects involving both tree planting and assisted natural regeneration.
*/
["tree-planting,assisted-natural-regeneration"]?: number;
/**
* Total amount for direct seeding projects.
*/
["direct-seeding"]?: number;
/**
* Total amount for control projects.
*/
control?: number;
/**
* Total amount for projects with no specific restoration category.
*/
["null"]?: number;
};
target_land_use_types_represented?: {
/**
* Total amount for projects without a defined land use type.
*/
["null"]?: number;
/**
* Total amount for projects involving natural forest.
*/
["natural-forest"]?: number;
/**
* Total amount for agroforest projects.
*/
agroforest?: number;
/**
* Total amount for silvopasture projects.
*/
silvopasture?: number;
/**
* Total amount for woodlot or plantation projects.
*/
["woodlot-or-plantation"]?: number;
/**
* Total amount for riparian area or wetland projects.
*/
["riparian-area-or-wetland"]?: number;
/**
* Total amount for projects involving both agroforest and riparian area or wetland.
*/
["agroforest,riparian-area-or-wetland"]?: number;
/**
* Total amount for projects involving both riparian area or wetland and woodlot or plantation.
*/
["riparian-area-or-wetland,woodlot-or-plantation"]?: number;
/**
* Total amount for projects involving open natural ecosystem or grasslands.
*/
["Open natural ecosystem or Grasslands"]?: number;
/**
* Total amount for urban forest projects.
*/
["urban-forest"]?: number;
};
};
};

export type GetV2DashboardIndicatorHectaresRestorationVariables = {
queryParams?: GetV2DashboardIndicatorHectaresRestorationQueryParams;
} & ApiContext["fetcherOptions"];

/**
* This endpoint returns hectares restored using data from indicators 5 (restoration strategies) and 6 (target land use types).
*/
export const fetchGetV2DashboardIndicatorHectaresRestoration = (
variables: GetV2DashboardIndicatorHectaresRestorationVariables,
signal?: AbortSignal
) =>
apiFetch<
GetV2DashboardIndicatorHectaresRestorationResponse,
GetV2DashboardIndicatorHectaresRestorationError,
undefined,
{},
GetV2DashboardIndicatorHectaresRestorationQueryParams,
{}
>({ url: "/v2/dashboard/indicator/hectares-restoration", method: "get", ...variables, signal });

/**
* This endpoint returns hectares restored using data from indicators 5 (restoration strategies) and 6 (target land use types).
*/
export const useGetV2DashboardIndicatorHectaresRestoration = <
TData = GetV2DashboardIndicatorHectaresRestorationResponse
>(
variables: GetV2DashboardIndicatorHectaresRestorationVariables,
options?: Omit<
reactQuery.UseQueryOptions<
GetV2DashboardIndicatorHectaresRestorationResponse,
GetV2DashboardIndicatorHectaresRestorationError,
TData
>,
"queryKey" | "queryFn"
>
) => {
const { fetcherOptions, queryOptions, queryKeyFn } = useApiContext(options);
return reactQuery.useQuery<
GetV2DashboardIndicatorHectaresRestorationResponse,
GetV2DashboardIndicatorHectaresRestorationError,
TData
>(
queryKeyFn({
path: "/v2/dashboard/indicator/hectares-restoration",
operationId: "getV2DashboardIndicatorHectaresRestoration",
variables
}),
({ signal }) => fetchGetV2DashboardIndicatorHectaresRestoration({ ...fetcherOptions, ...variables }, signal),
{
...options,
...queryOptions
}
);
};

export type GetV2ProjectPipelineQueryParams = {
/**
* Optional. Filter counts and metrics by country.
Expand Down Expand Up @@ -36534,6 +36679,11 @@ export type QueryOperation =
operationId: "getV2DashboardTopTreesPlanted";
variables: GetV2DashboardTopTreesPlantedVariables;
}
| {
path: "/v2/dashboard/indicator/hectares-restoration";
operationId: "getV2DashboardIndicatorHectaresRestoration";
variables: GetV2DashboardIndicatorHectaresRestorationVariables;
}
| {
path: "/v2/project-pipeline";
operationId: "getV2ProjectPipeline";
Expand Down
152 changes: 152 additions & 0 deletions src/generated/apiSchemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23417,3 +23417,155 @@ export type FileResource = {
is_public?: boolean;
is_cover?: boolean;
};

export type DashboardIndicatorHectaresRestorationResponse = {
data?: {
restoration_strategies_represented?: {
/**
* Total amount for tree planting projects.
*/
["tree-planting"]?: number;
/**
* Total amount for projects involving both tree planting and direct seeding.
*/
["tree-planting,direct-seeding"]?: number;
/**
* Total amount for assisted natural regeneration projects.
*/
["assisted-natural-regeneration"]?: number;
/**
* Total amount for projects involving both tree planting and assisted natural regeneration.
*/
["tree-planting,assisted-natural-regeneration"]?: number;
/**
* Total amount for direct seeding projects.
*/
["direct-seeding"]?: number;
/**
* Total amount for control projects.
*/
control?: number;
/**
* Total amount for projects with no specific restoration category.
*/
["null"]?: number;
};
target_land_use_types_represented?: {
/**
* Total amount for projects without a defined land use type.
*/
["null"]?: number;
/**
* Total amount for projects involving natural forest.
*/
["natural-forest"]?: number;
/**
* Total amount for agroforest projects.
*/
agroforest?: number;
/**
* Total amount for silvopasture projects.
*/
silvopasture?: number;
/**
* Total amount for woodlot or plantation projects.
*/
["woodlot-or-plantation"]?: number;
/**
* Total amount for riparian area or wetland projects.
*/
["riparian-area-or-wetland"]?: number;
/**
* Total amount for projects involving both agroforest and riparian area or wetland.
*/
["agroforest,riparian-area-or-wetland"]?: number;
/**
* Total amount for projects involving both riparian area or wetland and woodlot or plantation.
*/
["riparian-area-or-wetland,woodlot-or-plantation"]?: number;
/**
* Total amount for projects involving open natural ecosystem or grasslands.
*/
["Open natural ecosystem or Grasslands"]?: number;
/**
* Total amount for urban forest projects.
*/
["urban-forest"]?: number;
};
};
};

export type DashboardIndicatorHectaresRestorationData = {
restoration_strategies_represented?: {
/**
* Total amount for tree planting projects.
*/
["tree-planting"]?: number;
/**
* Total amount for projects involving both tree planting and direct seeding.
*/
["tree-planting,direct-seeding"]?: number;
/**
* Total amount for assisted natural regeneration projects.
*/
["assisted-natural-regeneration"]?: number;
/**
* Total amount for projects involving both tree planting and assisted natural regeneration.
*/
["tree-planting,assisted-natural-regeneration"]?: number;
/**
* Total amount for direct seeding projects.
*/
["direct-seeding"]?: number;
/**
* Total amount for control projects.
*/
control?: number;
/**
* Total amount for projects with no specific restoration category.
*/
["null"]?: number;
};
target_land_use_types_represented?: {
/**
* Total amount for projects without a defined land use type.
*/
["null"]?: number;
/**
* Total amount for projects involving natural forest.
*/
["natural-forest"]?: number;
/**
* Total amount for agroforest projects.
*/
agroforest?: number;
/**
* Total amount for silvopasture projects.
*/
silvopasture?: number;
/**
* Total amount for woodlot or plantation projects.
*/
["woodlot-or-plantation"]?: number;
/**
* Total amount for riparian area or wetland projects.
*/
["riparian-area-or-wetland"]?: number;
/**
* Total amount for projects involving both agroforest and riparian area or wetland.
*/
["agroforest,riparian-area-or-wetland"]?: number;
/**
* Total amount for projects involving both riparian area or wetland and woodlot or plantation.
*/
["riparian-area-or-wetland,woodlot-or-plantation"]?: number;
/**
* Total amount for projects involving open natural ecosystem or grasslands.
*/
["Open natural ecosystem or Grasslands"]?: number;
/**
* Total amount for urban forest projects.
*/
["urban-forest"]?: number;
};
};
Loading

0 comments on commit d84bf6e

Please sign in to comment.