Skip to content

add changes for datadog partner program to estimated cost and billable usage APIs #1670

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2024-07-11 16:35:13.616074",
"spec_repo_commit": "d83fe206"
"regenerated": "2024-07-16 10:52:44.851668",
"spec_repo_commit": "06d5775d"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-07-11 16:35:13.635786",
"spec_repo_commit": "d83fe206"
"regenerated": "2024-07-16 10:52:44.869580",
"spec_repo_commit": "06d5775d"
}
}
}
15 changes: 15 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17269,6 +17269,12 @@ components:
UsageBillableSummaryHour:
description: Response with monthly summary of data billed by Datadog.
properties:
account_name:
description: The account name.
type: string
account_public_id:
description: The account public ID.
type: string
billing_plan:
description: The billing plan.
type: string
Expand Down Expand Up @@ -31646,6 +31652,15 @@ paths:
schema:
format: date-time
type: string
- description: 'Boolean to specify whether to include accounts connected to
the current account as partner customers in the Datadog partner network
program. Defaults to `false`. '
in: query
name: include_connected_accounts
required: false
schema:
default: false
type: boolean
responses:
'200':
content:
Expand Down
15 changes: 15 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5390,6 +5390,12 @@ components:
CostByOrgAttributes:
description: Cost attributes data.
properties:
account_name:
description: The account name.
type: string
account_public_id:
description: The account public ID.
type: string
charges:
description: List of charges data reported for the requested month.
items:
Expand Down Expand Up @@ -36185,6 +36191,15 @@ paths:
schema:
format: date-time
type: string
- description: 'Boolean to specify whether to include accounts connected to
the current account as partner customers in the Datadog partner network
program. Defaults to `false`. '
in: query
name: include_connected_accounts
required: false
schema:
default: false
type: boolean
responses:
'200':
content:
Expand Down
8 changes: 8 additions & 0 deletions features/support/scenarios_model_mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,10 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = {
"type": "Date",
"format": "date-time",
},
"includeConnectedAccounts": {
"type": "boolean",
"format": "",
},
"operationResponseType": "UsageBillableSummaryResponse",
},
"v1.GetUsageCIApp": {
Expand Down Expand Up @@ -3090,6 +3094,10 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = {
"type": "Date",
"format": "date-time",
},
"includeConnectedAccounts": {
"type": "boolean",
"format": "",
},
"operationResponseType": "CostByOrgResponse",
},
"v2.GetHistoricalCostByOrg": {
Expand Down
13 changes: 13 additions & 0 deletions packages/datadog-api-client-v1/apis/UsageMeteringApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,7 @@ export class UsageMeteringApiRequestFactory extends BaseAPIRequestFactory {

public async getUsageBillableSummary(
month?: Date,
includeConnectedAccounts?: boolean,
_options?: Configuration
): Promise<RequestContext> {
const _config = _options || this.configuration;
Expand All @@ -656,6 +657,12 @@ export class UsageMeteringApiRequestFactory extends BaseAPIRequestFactory {
ObjectSerializer.serialize(month, "Date", "date-time")
);
}
if (includeConnectedAccounts !== undefined) {
requestContext.setQueryParam(
"include_connected_accounts",
ObjectSerializer.serialize(includeConnectedAccounts, "boolean", "")
);
}

// Apply auth methods
applySecurityAuthentication(_config, requestContext, [
Expand Down Expand Up @@ -4479,6 +4486,11 @@ export interface UsageMeteringApiGetUsageBillableSummaryRequest {
* @type Date
*/
month?: Date;
/**
* Boolean to specify whether to include accounts connected to the current account as partner customers in the Datadog partner network program. Defaults to `false`.
* @type boolean
*/
includeConnectedAccounts?: boolean;
}

export interface UsageMeteringApiGetUsageCIAppRequest {
Expand Down Expand Up @@ -5175,6 +5187,7 @@ export class UsageMeteringApi {
): Promise<UsageBillableSummaryResponse> {
const requestContextPromise = this.requestFactory.getUsageBillableSummary(
param.month,
param.includeConnectedAccounts,
options
);
return requestContextPromise.then((requestContext) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ import { AttributeTypeMap } from "../../datadog-api-client-common/util";
* Response with monthly summary of data billed by Datadog.
*/
export class UsageBillableSummaryHour {
/**
* The account name.
*/
"accountName"?: string;
/**
* The account public ID.
*/
"accountPublicId"?: string;
/**
* The billing plan.
*/
Expand Down Expand Up @@ -64,6 +72,14 @@ export class UsageBillableSummaryHour {
* @ignore
*/
static readonly attributeTypeMap: AttributeTypeMap = {
accountName: {
baseName: "account_name",
type: "string",
},
accountPublicId: {
baseName: "account_public_id",
type: "string",
},
billingPlan: {
baseName: "billing_plan",
type: "string",
Expand Down
13 changes: 13 additions & 0 deletions packages/datadog-api-client-v2/apis/UsageMeteringApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ export class UsageMeteringApiRequestFactory extends BaseAPIRequestFactory {
endMonth?: Date,
startDate?: Date,
endDate?: Date,
includeConnectedAccounts?: boolean,
_options?: Configuration
): Promise<RequestContext> {
const _config = _options || this.configuration;
Expand Down Expand Up @@ -166,6 +167,12 @@ export class UsageMeteringApiRequestFactory extends BaseAPIRequestFactory {
ObjectSerializer.serialize(endDate, "Date", "date-time")
);
}
if (includeConnectedAccounts !== undefined) {
requestContext.setQueryParam(
"include_connected_accounts",
ObjectSerializer.serialize(includeConnectedAccounts, "boolean", "")
);
}

// Apply auth methods
applySecurityAuthentication(_config, requestContext, [
Expand Down Expand Up @@ -1294,6 +1301,11 @@ export interface UsageMeteringApiGetEstimatedCostByOrgRequest {
* @type Date
*/
endDate?: Date;
/**
* Boolean to specify whether to include accounts connected to the current account as partner customers in the Datadog partner network program. Defaults to `false`.
* @type boolean
*/
includeConnectedAccounts?: boolean;
}

export interface UsageMeteringApiGetHistoricalCostByOrgRequest {
Expand Down Expand Up @@ -1548,6 +1560,7 @@ export class UsageMeteringApi {
param.endMonth,
param.startDate,
param.endDate,
param.includeConnectedAccounts,
options
);
return requestContextPromise.then((requestContext) => {
Expand Down
16 changes: 16 additions & 0 deletions packages/datadog-api-client-v2/models/CostByOrgAttributes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ import { AttributeTypeMap } from "../../datadog-api-client-common/util";
* Cost attributes data.
*/
export class CostByOrgAttributes {
/**
* The account name.
*/
"accountName"?: string;
/**
* The account public ID.
*/
"accountPublicId"?: string;
/**
* List of charges data reported for the requested month.
*/
Expand Down Expand Up @@ -52,6 +60,14 @@ export class CostByOrgAttributes {
* @ignore
*/
static readonly attributeTypeMap: AttributeTypeMap = {
accountName: {
baseName: "account_name",
type: "string",
},
accountPublicId: {
baseName: "account_public_id",
type: "string",
},
charges: {
baseName: "charges",
type: "Array<ChargebackBreakdown>",
Expand Down
Loading