diff --git a/frontend/src/openapi/models/getRequestsForPeriodGrouping.ts b/frontend/src/openapi/models/getRequestsForPeriodGrouping.ts new file mode 100644 index 0000000000..3ae1861fec --- /dev/null +++ b/frontend/src/openapi/models/getRequestsForPeriodGrouping.ts @@ -0,0 +1,14 @@ +/** + * Generated by Orval + * Do not edit manually. + * See `gen:api` script in package.json + */ + +export type GetRequestsForPeriodGrouping = + (typeof GetRequestsForPeriodGrouping)[keyof typeof GetRequestsForPeriodGrouping]; + +// eslint-disable-next-line @typescript-eslint/no-redeclare +export const GetRequestsForPeriodGrouping = { + daily: 'daily', + monthly: 'monthly', +} as const; diff --git a/frontend/src/openapi/models/getRequestsForPeriodParams.ts b/frontend/src/openapi/models/getRequestsForPeriodParams.ts new file mode 100644 index 0000000000..202a0a1f6c --- /dev/null +++ b/frontend/src/openapi/models/getRequestsForPeriodParams.ts @@ -0,0 +1,21 @@ +/** + * Generated by Orval + * Do not edit manually. + * See `gen:api` script in package.json + */ +import type { GetRequestsForPeriodGrouping } from './getRequestsForPeriodGrouping'; + +export type GetRequestsForPeriodParams = { + /** + * Whether to aggregate the data by month or by day + */ + grouping: GetRequestsForPeriodGrouping; + /** + * The starting date of the traffic data usage search in IS:yyyy-MM-dd format + */ + from: string; + /** + * The starting date of the traffic data usage search in IS:yyyy-MM-dd format + */ + to: string; +}; diff --git a/frontend/src/openapi/models/index.ts b/frontend/src/openapi/models/index.ts index 0547dc3f8c..4d770a97f5 100644 --- a/frontend/src/openapi/models/index.ts +++ b/frontend/src/openapi/models/index.ts @@ -826,6 +826,8 @@ export * from './getRawFeatureMetrics401'; export * from './getRawFeatureMetrics403'; export * from './getRawFeatureMetrics404'; export * from './getReleasePlanTemplate401'; +export * from './getRequestsForPeriodGrouping'; +export * from './getRequestsForPeriodParams'; export * from './getRoleById400'; export * from './getRoleById401'; export * from './getRoleById404'; @@ -948,6 +950,11 @@ export * from './meteredConnectionsSchemaApiDataItem'; export * from './meteredConnectionsSchemaApiDataItemDataPointsItem'; export * from './meteredConnectionsSchemaDateRange'; export * from './meteredConnectionsSchemaGrouping'; +export * from './meteredRequestsSchema'; +export * from './meteredRequestsSchemaApiDataItem'; +export * from './meteredRequestsSchemaApiDataItemDataPointsItem'; +export * from './meteredRequestsSchemaDateRange'; +export * from './meteredRequestsSchemaGrouping'; export * from './nameSchema'; export * from './notificationsSchema'; export * from './notificationsSchemaItem'; diff --git a/frontend/src/openapi/models/meteredRequestsSchema.ts b/frontend/src/openapi/models/meteredRequestsSchema.ts new file mode 100644 index 0000000000..c6b5ada4fe --- /dev/null +++ b/frontend/src/openapi/models/meteredRequestsSchema.ts @@ -0,0 +1,20 @@ +/** + * Generated by Orval + * Do not edit manually. + * See `gen:api` script in package.json + */ +import type { MeteredRequestsSchemaApiDataItem } from './meteredRequestsSchemaApiDataItem'; +import type { MeteredRequestsSchemaDateRange } from './meteredRequestsSchemaDateRange'; +import type { MeteredRequestsSchemaGrouping } from './meteredRequestsSchemaGrouping'; + +/** + * Contains the recorded metered groups requests segmented by day/month + */ +export interface MeteredRequestsSchema { + /** Contains the recorded daily/monthly requests for each metered group */ + apiData: MeteredRequestsSchemaApiDataItem[]; + /** The date range there is data for. The range is inclusive and goes from the start of the `from` date to the end of the `to` date */ + dateRange: MeteredRequestsSchemaDateRange; + /** Whether the data is aggregated by month or by day. */ + grouping: MeteredRequestsSchemaGrouping; +} diff --git a/frontend/src/openapi/models/meteredRequestsSchemaApiDataItem.ts b/frontend/src/openapi/models/meteredRequestsSchemaApiDataItem.ts new file mode 100644 index 0000000000..3c974c6942 --- /dev/null +++ b/frontend/src/openapi/models/meteredRequestsSchemaApiDataItem.ts @@ -0,0 +1,13 @@ +/** + * Generated by Orval + * Do not edit manually. + * See `gen:api` script in package.json + */ +import type { MeteredRequestsSchemaApiDataItemDataPointsItem } from './meteredRequestsSchemaApiDataItemDataPointsItem'; + +export type MeteredRequestsSchemaApiDataItem = { + /** The recorded data points for the metered group */ + dataPoints: MeteredRequestsSchemaApiDataItemDataPointsItem[]; + /** The metered group representing charging unit in the organization using Unleash */ + meteredGroup: string; +}; diff --git a/frontend/src/openapi/models/meteredRequestsSchemaApiDataItemDataPointsItem.ts b/frontend/src/openapi/models/meteredRequestsSchemaApiDataItemDataPointsItem.ts new file mode 100644 index 0000000000..db6da3cc7d --- /dev/null +++ b/frontend/src/openapi/models/meteredRequestsSchemaApiDataItemDataPointsItem.ts @@ -0,0 +1,18 @@ +/** + * Generated by Orval + * Do not edit manually. + * See `gen:api` script in package.json + */ + +export type MeteredRequestsSchemaApiDataItemDataPointsItem = { + /** + * The date of the data point. Formatted as a full date (e.g. 2023-04-01) if the data is aggregated by day or as a month (e.g. 2023-04) if the data is aggregated by month. + * @pattern ^\d{4}-\d{2}(-\d{2})?$ + */ + period: string; + /** + * Number of requests + * @minimum 0 + */ + requests: number; +}; diff --git a/frontend/src/openapi/models/meteredRequestsSchemaDateRange.ts b/frontend/src/openapi/models/meteredRequestsSchemaDateRange.ts new file mode 100644 index 0000000000..3b264f016f --- /dev/null +++ b/frontend/src/openapi/models/meteredRequestsSchemaDateRange.ts @@ -0,0 +1,15 @@ +/** + * Generated by Orval + * Do not edit manually. + * See `gen:api` script in package.json + */ + +/** + * The date range there is data for. The range is inclusive and goes from the start of the `from` date to the end of the `to` date + */ +export type MeteredRequestsSchemaDateRange = { + /** The start of the dateRange */ + from: string; + /** The end of the dateRange */ + to: string; +}; diff --git a/frontend/src/openapi/models/meteredRequestsSchemaGrouping.ts b/frontend/src/openapi/models/meteredRequestsSchemaGrouping.ts new file mode 100644 index 0000000000..1bebb0be4b --- /dev/null +++ b/frontend/src/openapi/models/meteredRequestsSchemaGrouping.ts @@ -0,0 +1,17 @@ +/** + * Generated by Orval + * Do not edit manually. + * See `gen:api` script in package.json + */ + +/** + * Whether the data is aggregated by month or by day. + */ +export type MeteredRequestsSchemaGrouping = + (typeof MeteredRequestsSchemaGrouping)[keyof typeof MeteredRequestsSchemaGrouping]; + +// eslint-disable-next-line @typescript-eslint/no-redeclare +export const MeteredRequestsSchemaGrouping = { + monthly: 'monthly', + daily: 'daily', +} as const;