Skip to content
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

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

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:06.139859",
"spec_repo_commit": "d83fe206"
"regenerated": "2024-07-16 10:52:41.887335",
"spec_repo_commit": "06d5775d"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-07-11 16:35:06.158034",
"spec_repo_commit": "d83fe206"
"regenerated": "2024-07-16 10:52:41.904999",
"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
2 changes: 2 additions & 0 deletions features/scenarios_model_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
},
"v1.GetUsageBillableSummary" => {
"month" => "Time",
"include_connected_accounts" => "Boolean",
},
"v1.GetUsageCIApp" => {
"start_hr" => "Time",
Expand Down Expand Up @@ -1096,6 +1097,7 @@
"end_month" => "Time",
"start_date" => "Time",
"end_date" => "Time",
"include_connected_accounts" => "Boolean",
},
"v2.GetHistoricalCostByOrg" => {
"view" => "String",
Expand Down
2 changes: 2 additions & 0 deletions lib/datadog_api_client/v1/api/usage_metering_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -839,6 +839,7 @@ def get_usage_billable_summary(opts = {})
#
# @param opts [Hash] the optional parameters
# @option opts [Time] :month Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]` for usage starting this month.
# @option opts [Boolean] :include_connected_accounts Boolean to specify whether to include accounts connected to the current account as partner customers in the Datadog partner network program. Defaults to `false`.
# @return [Array<(UsageBillableSummaryResponse, Integer, Hash)>] UsageBillableSummaryResponse data, response status code and response headers
def get_usage_billable_summary_with_http_info(opts = {})

Expand All @@ -851,6 +852,7 @@ def get_usage_billable_summary_with_http_info(opts = {})
# query parameters
query_params = opts[:query_params] || {}
query_params[:'month'] = opts[:'month'] if !opts[:'month'].nil?
query_params[:'include_connected_accounts'] = opts[:'include_connected_accounts'] if !opts[:'include_connected_accounts'].nil?

# header parameters
header_params = opts[:header_params] || {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ module DatadogAPIClient::V1
class UsageBillableSummaryHour
include BaseGenericModel

# The account name.
attr_accessor :account_name

# The account public ID.
attr_accessor :account_public_id

# The billing plan.
attr_accessor :billing_plan

Expand Down Expand Up @@ -52,6 +58,8 @@ class UsageBillableSummaryHour
# @!visibility private
def self.attribute_map
{
:'account_name' => :'account_name',
:'account_public_id' => :'account_public_id',
:'billing_plan' => :'billing_plan',
:'end_date' => :'end_date',
:'num_orgs' => :'num_orgs',
Expand All @@ -68,6 +76,8 @@ def self.attribute_map
# @!visibility private
def self.openapi_types
{
:'account_name' => :'String',
:'account_public_id' => :'String',
:'billing_plan' => :'String',
:'end_date' => :'Time',
:'num_orgs' => :'Integer',
Expand Down Expand Up @@ -96,6 +106,14 @@ def initialize(attributes = {})
h[k.to_sym] = v
}

if attributes.key?(:'account_name')
self.account_name = attributes[:'account_name']
end

if attributes.key?(:'account_public_id')
self.account_public_id = attributes[:'account_public_id']
end

if attributes.key?(:'billing_plan')
self.billing_plan = attributes[:'billing_plan']
end
Expand Down Expand Up @@ -139,6 +157,8 @@ def initialize(attributes = {})
def ==(o)
return true if self.equal?(o)
self.class == o.class &&
account_name == o.account_name &&
account_public_id == o.account_public_id &&
billing_plan == o.billing_plan &&
end_date == o.end_date &&
num_orgs == o.num_orgs &&
Expand All @@ -154,7 +174,7 @@ def ==(o)
# @return [Integer] Hash code
# @!visibility private
def hash
[billing_plan, end_date, num_orgs, org_name, public_id, ratio_in_month, region, start_date, usage].hash
[account_name, account_public_id, billing_plan, end_date, num_orgs, org_name, public_id, ratio_in_month, region, start_date, usage].hash
end
end
end
2 changes: 2 additions & 0 deletions lib/datadog_api_client/v2/api/usage_metering_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ def get_estimated_cost_by_org(opts = {})
# @option opts [Time] :end_month Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]` for cost ending this month.
# @option opts [Time] :start_date Datetime in ISO-8601 format, UTC, precise to day: `[YYYY-MM-DD]` for cost beginning this day. Either start_month or start_date should be specified, but not both. (start_date cannot go beyond two months in the past). Provide an `end_date` to view day-over-day cumulative cost.
# @option opts [Time] :end_date Datetime in ISO-8601 format, UTC, precise to day: `[YYYY-MM-DD]` for cost ending this day.
# @option opts [Boolean] :include_connected_accounts Boolean to specify whether to include accounts connected to the current account as partner customers in the Datadog partner network program. Defaults to `false`.
# @return [Array<(CostByOrgResponse, Integer, Hash)>] CostByOrgResponse data, response status code and response headers
def get_estimated_cost_by_org_with_http_info(opts = {})

Expand All @@ -205,6 +206,7 @@ def get_estimated_cost_by_org_with_http_info(opts = {})
query_params[:'end_month'] = opts[:'end_month'] if !opts[:'end_month'].nil?
query_params[:'start_date'] = opts[:'start_date'] if !opts[:'start_date'].nil?
query_params[:'end_date'] = opts[:'end_date'] if !opts[:'end_date'].nil?
query_params[:'include_connected_accounts'] = opts[:'include_connected_accounts'] if !opts[:'include_connected_accounts'].nil?

# header parameters
header_params = opts[:header_params] || {}
Expand Down
22 changes: 21 additions & 1 deletion lib/datadog_api_client/v2/models/cost_by_org_attributes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ module DatadogAPIClient::V2
class CostByOrgAttributes
include BaseGenericModel

# The account name.
attr_accessor :account_name

# The account public ID.
attr_accessor :account_public_id

# List of charges data reported for the requested month.
attr_accessor :charges

Expand All @@ -43,6 +49,8 @@ class CostByOrgAttributes
# @!visibility private
def self.attribute_map
{
:'account_name' => :'account_name',
:'account_public_id' => :'account_public_id',
:'charges' => :'charges',
:'date' => :'date',
:'org_name' => :'org_name',
Expand All @@ -56,6 +64,8 @@ def self.attribute_map
# @!visibility private
def self.openapi_types
{
:'account_name' => :'String',
:'account_public_id' => :'String',
:'charges' => :'Array<ChargebackBreakdown>',
:'date' => :'Time',
:'org_name' => :'String',
Expand All @@ -81,6 +91,14 @@ def initialize(attributes = {})
h[k.to_sym] = v
}

if attributes.key?(:'account_name')
self.account_name = attributes[:'account_name']
end

if attributes.key?(:'account_public_id')
self.account_public_id = attributes[:'account_public_id']
end

if attributes.key?(:'charges')
if (value = attributes[:'charges']).is_a?(Array)
self.charges = value
Expand Down Expand Up @@ -114,6 +132,8 @@ def initialize(attributes = {})
def ==(o)
return true if self.equal?(o)
self.class == o.class &&
account_name == o.account_name &&
account_public_id == o.account_public_id &&
charges == o.charges &&
date == o.date &&
org_name == o.org_name &&
Expand All @@ -126,7 +146,7 @@ def ==(o)
# @return [Integer] Hash code
# @!visibility private
def hash
[charges, date, org_name, public_id, region, total_cost].hash
[account_name, account_public_id, charges, date, org_name, public_id, region, total_cost].hash
end
end
end
Loading