Skip to content
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
4 changes: 3 additions & 1 deletion .generator/src/generator/templates/api.j2
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ func (a *{{ classname }}) build{{ operation.operationId }}Request(ctx _context.C
}

// {{ operation.operationId }} {{ operation.summary }}.
{{ operation.description|block_comment(prefix="//") }}
{{ operation.description|block_comment(prefix="//") }}{% if operation.deprecated %}
//
// Deprecated: This API is deprecated.{% endif %}
func (a *{{ classname }}) {{ operation.operationId }}(ctx _context.Context{% for name, parameter in operation|parameters if parameter.required or parameter.in == "path" %}, {{ name|variable_name}} {{ get_type_for_parameter(parameter) }}{% endfor %}{%- for name, parameter in operation|parameters if not parameter.required and parameter.in != "path" %}{%- if loop.first %}, o ...{{ operation.operationId }}OptionalParameters{% endif %}{% endfor %}) ({% if returnType %}{{ returnType }}, {% endif %}*_nethttp.Response, error) {
req, err := a.build{{ operation.operationId }}Request(ctx{% for name, parameter in operation|parameters if parameter.required or parameter.in == "path" %}, {{ name|variable_name}}{% endfor %}{%- for name, parameter in operation|parameters if not parameter.required and parameter.in != "path" %}{%- if loop.first %}, o...{% endif %}{% endfor %})
if err != nil {
Expand Down
4 changes: 3 additions & 1 deletion .generator/src/generator/templates/model_simple.j2
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// {{ name }} {{ model.description|block_comment(prefix="//", first_line=False) }}
// {{ name }} {{ model.description|block_comment(prefix="//", first_line=False) }}{% if model.deprecated %}
//
// Deprecated: This model is deprecated.{% endif %}
type {{ name }} struct {
{#-
{{^isMap}}
Expand Down
2 changes: 2 additions & 0 deletions api/datadogV1/api_logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,8 @@ func (a *LogsApi) buildSubmitLogRequest(ctx _context.Context, body []HTTPLogItem
// - 403: Permission issue (likely using an invalid API Key)
// - 413: Payload too large (batch is above 5MB uncompressed)
// - 5xx: Internal error, request should be retried after some time
//
// Deprecated: This API is deprecated.
func (a *LogsApi) SubmitLog(ctx _context.Context, body []HTTPLogItem, o ...SubmitLogOptionalParameters) (interface{}, *_nethttp.Response, error) {
req, err := a.buildSubmitLogRequest(ctx, body, o...)
if err != nil {
Expand Down
12 changes: 12 additions & 0 deletions api/datadogV1/api_usage_metering.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ func (a *UsageMeteringApi) buildGetDailyCustomReportsRequest(ctx _context.Contex
// Get daily custom reports.
// **Note:** This endpoint will be fully deprecated on December 1, 2022.
// Refer to [Migrating from v1 to v2 of the Usage Attribution API](https://docs.datadoghq.com/account_management/guide/usage-attribution-migration/) for the associated migration guide.
//
// Deprecated: This API is deprecated.
func (a *UsageMeteringApi) GetDailyCustomReports(ctx _context.Context, o ...GetDailyCustomReportsOptionalParameters) (UsageCustomReportsResponse, *_nethttp.Response, error) {
req, err := a.buildGetDailyCustomReportsRequest(ctx, o...)
if err != nil {
Expand Down Expand Up @@ -782,6 +784,8 @@ func (a *UsageMeteringApi) buildGetMonthlyCustomReportsRequest(ctx _context.Cont
// Get monthly custom reports.
// **Note:** This endpoint will be fully deprecated on December 1, 2022.
// Refer to [Migrating from v1 to v2 of the Usage Attribution API](https://docs.datadoghq.com/account_management/guide/usage-attribution-migration/) for the associated migration guide.
//
// Deprecated: This API is deprecated.
func (a *UsageMeteringApi) GetMonthlyCustomReports(ctx _context.Context, o ...GetMonthlyCustomReportsOptionalParameters) (UsageCustomReportsResponse, *_nethttp.Response, error) {
req, err := a.buildGetMonthlyCustomReportsRequest(ctx, o...)
if err != nil {
Expand Down Expand Up @@ -1145,6 +1149,8 @@ func (a *UsageMeteringApi) buildGetSpecifiedDailyCustomReportsRequest(ctx _conte
// Get specified daily custom reports.
// **Note:** This endpoint will be fully deprecated on December 1, 2022.
// Refer to [Migrating from v1 to v2 of the Usage Attribution API](https://docs.datadoghq.com/account_management/guide/usage-attribution-migration/) for the associated migration guide.
//
// Deprecated: This API is deprecated.
func (a *UsageMeteringApi) GetSpecifiedDailyCustomReports(ctx _context.Context, reportId string) (UsageSpecifiedCustomReportsResponse, *_nethttp.Response, error) {
req, err := a.buildGetSpecifiedDailyCustomReportsRequest(ctx, reportId)
if err != nil {
Expand Down Expand Up @@ -1266,6 +1272,8 @@ func (a *UsageMeteringApi) buildGetSpecifiedMonthlyCustomReportsRequest(ctx _con
// Get specified monthly custom reports.
// **Note:** This endpoint will be fully deprecated on December 1, 2022.
// Refer to [Migrating from v1 to v2 of the Usage Attribution API](https://docs.datadoghq.com/account_management/guide/usage-attribution-migration/) for the associated migration guide.
//
// Deprecated: This API is deprecated.
func (a *UsageMeteringApi) GetSpecifiedMonthlyCustomReports(ctx _context.Context, reportId string) (UsageSpecifiedCustomReportsResponse, *_nethttp.Response, error) {
req, err := a.buildGetSpecifiedMonthlyCustomReportsRequest(ctx, reportId)
if err != nil {
Expand Down Expand Up @@ -1612,6 +1620,8 @@ func (a *UsageMeteringApi) buildGetUsageAttributionRequest(ctx _context.Context,
// Get usage attribution.
// **Note:** This endpoint will be fully deprecated on December 1, 2022.
// Refer to [Migrating from v1 to v2 of the Usage Attribution API](https://docs.datadoghq.com/account_management/guide/usage-attribution-migration/) for the associated migration guide.
//
// Deprecated: This API is deprecated.
func (a *UsageMeteringApi) GetUsageAttribution(ctx _context.Context, startMonth time.Time, fields UsageAttributionSupportedMetrics, o ...GetUsageAttributionOptionalParameters) (UsageAttributionResponse, *_nethttp.Response, error) {
req, err := a.buildGetUsageAttributionRequest(ctx, startMonth, fields, o...)
if err != nil {
Expand Down Expand Up @@ -5314,6 +5324,8 @@ func (a *UsageMeteringApi) buildGetUsageSyntheticsRequest(ctx _context.Context,
// GetUsageSynthetics Get hourly usage for synthetics checks.
// Get hourly usage for [synthetics checks](https://docs.datadoghq.com/synthetics/).
// **Note:** hourly usage data for all products is now available in the [Get hourly usage by product family API](https://docs.datadoghq.com/api/latest/usage-metering/#get-hourly-usage-by-product-family). Refer to [Migrating from the V1 Hourly Usage APIs to V2](https://docs.datadoghq.com/account_management/guide/hourly-usage-migration/) for the associated migration guide.
//
// Deprecated: This API is deprecated.
func (a *UsageMeteringApi) GetUsageSynthetics(ctx _context.Context, startHr time.Time, o ...GetUsageSyntheticsOptionalParameters) (UsageSyntheticsResponse, *_nethttp.Response, error) {
req, err := a.buildGetUsageSyntheticsRequest(ctx, startHr, o...)
if err != nil {
Expand Down
2 changes: 2 additions & 0 deletions api/datadogV1/model_organization_billing.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import (
)

// OrganizationBilling A JSON array of billing type.
//
// Deprecated: This model is deprecated.
type OrganizationBilling struct {
// The type of billing. Only `parent_billing` is supported.
Type *string `json:"type,omitempty"`
Expand Down
2 changes: 2 additions & 0 deletions api/datadogV1/model_organization_subscription.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import (
)

// OrganizationSubscription Subscription definition.
//
// Deprecated: This model is deprecated.
type OrganizationSubscription struct {
// The subscription type. Types available are `trial`, `free`, and `pro`.
Type *string `json:"type,omitempty"`
Expand Down
2 changes: 2 additions & 0 deletions api/datadogV2/api_usage_metering.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ func (a *UsageMeteringApi) buildGetCostByOrgRequest(ctx _context.Context, startM
// **Note:** This endpoint has been deprecated. Please use the new endpoint
// [`/historical_cost`](https://docs.datadoghq.com/api/latest/usage-metering/#get-historical-cost-across-your-account)
// instead.
//
// Deprecated: This API is deprecated.
func (a *UsageMeteringApi) GetCostByOrg(ctx _context.Context, startMonth time.Time, o ...GetCostByOrgOptionalParameters) (CostByOrgResponse, *_nethttp.Response, error) {
req, err := a.buildGetCostByOrgRequest(ctx, startMonth, o...)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ go clean -testcache

# Run the same in tests submodule
cd tests
staticcheck ./...
staticcheck -checks inherit,-SA1019 ./...
go mod tidy
go clean -testcache
gotestsum --format short-verbose ./...
Expand Down