Make lastBillingDate a param for product insights
This commit is contained in:
@@ -112,12 +112,14 @@ export type CostInsightsApi = {
|
||||
* @param group
|
||||
* @param duration A time duration, such as P1M. See the Duration type for a detailed explanation
|
||||
* of how the durations are interpreted in Cost Insights.
|
||||
* @param lastBillingDate The most current date for which billing data is complete, in YYYY-MM-DD format.
|
||||
* @param project (optional) The project id from getGroupProjects or query parameters
|
||||
*/
|
||||
getProductInsights(
|
||||
product: string,
|
||||
group: string,
|
||||
duration: Duration,
|
||||
lastBillingDate: string,
|
||||
project: Maybe<string>,
|
||||
): Promise<ProductCost>;
|
||||
|
||||
|
||||
@@ -197,10 +197,11 @@ export class ExampleCostInsightsClient implements CostInsightsApi {
|
||||
product: string,
|
||||
group: string,
|
||||
duration: Duration,
|
||||
lastBillingDate: string,
|
||||
project: Maybe<string>,
|
||||
): Promise<ProductCost> {
|
||||
const projectProductInsights = await this.request(
|
||||
{ product, group, duration, project },
|
||||
{ product, group, duration, lastBillingDate, project },
|
||||
{
|
||||
aggregation: [80_000, 110_000],
|
||||
change: {
|
||||
|
||||
@@ -86,6 +86,7 @@ export const ProductInsightsCard = ({ product }: ProductInsightsCardProps) => {
|
||||
product.kind,
|
||||
group!,
|
||||
productFilter!.duration,
|
||||
lastCompleteBillingDate,
|
||||
project,
|
||||
);
|
||||
setResource(p);
|
||||
@@ -107,6 +108,7 @@ export const ProductInsightsCard = ({ product }: ProductInsightsCardProps) => {
|
||||
group,
|
||||
product.kind,
|
||||
project,
|
||||
lastCompleteBillingDate,
|
||||
]);
|
||||
|
||||
const onPeriodSelect = (duration: Duration) => {
|
||||
|
||||
Reference in New Issue
Block a user