Skip to content

Commit e8e3926

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 82f3d557 of spec repo
1 parent 23befb9 commit e8e3926

File tree

10 files changed

+196
-7
lines changed

10 files changed

+196
-7
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2025-02-04 14:10:05.819748",
8-
"spec_repo_commit": "4fb9047a"
7+
"regenerated": "2025-02-05 20:58:57.604084",
8+
"spec_repo_commit": "82f3d557"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-02-04 14:10:05.835266",
13-
"spec_repo_commit": "4fb9047a"
12+
"regenerated": "2025-02-05 20:58:57.624279",
13+
"spec_repo_commit": "82f3d557"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1965,6 +1965,24 @@ components:
19651965
deployment:
19661966
$ref: '#/components/schemas/DeploymentRelationship'
19671967
type: object
1968+
AppVersionSelector:
1969+
description: The version selector parameter used in endpoints such as Get App.
1970+
Version numbers start at 1 and increment with each update. 0 is a special
1971+
value that always selects the latest version.
1972+
oneOf:
1973+
- $ref: '#/components/schemas/AppVersionSelectorConstants'
1974+
- format: int64
1975+
minimum: 0
1976+
type: integer
1977+
AppVersionSelectorConstants:
1978+
description: Constants that always select a particular version of an app.
1979+
enum:
1980+
- latest
1981+
- deployed
1982+
type: string
1983+
x-enum-varnames:
1984+
- LATEST
1985+
- DEPLOYED
19681986
ApplicationKeyCreateAttributes:
19691987
description: Attributes used to create an application Key.
19701988
properties:
@@ -32494,7 +32512,7 @@ paths:
3249432512
name: version
3249532513
required: false
3249632514
schema:
32497-
type: string
32515+
$ref: '#/components/schemas/AppVersionSelector'
3249832516
responses:
3249932517
'200':
3250032518
content:
@@ -32520,6 +32538,12 @@ paths:
3252032538
schema:
3252132539
$ref: '#/components/schemas/JSONAPIErrorResponse'
3252232540
description: Not Found
32541+
'410':
32542+
content:
32543+
application/json:
32544+
schema:
32545+
$ref: '#/components/schemas/JSONAPIErrorResponse'
32546+
description: Gone
3252332547
'429':
3252432548
$ref: '#/components/responses/TooManyRequestsResponse'
3252532549
summary: Get App
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2025-02-05T20:55:28.999Z

cassettes/features/v2/app_builder/Get-App-returns-Gone-response.yml

Lines changed: 62 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

features/scenarios_model_mapping.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -980,7 +980,7 @@
980980
},
981981
"v2.GetApp" => {
982982
"app_id" => "UUID",
983-
"version" => "String",
983+
"version" => "AppVersionSelector",
984984
},
985985
"v2.UpdateApp" => {
986986
"app_id" => "UUID",

features/v2/app_builder.feature

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,16 @@ Feature: App Builder
9999
When the request is sent
100100
Then the response status is 400 Bad Request
101101

102+
@skip-typescript @team:DataDog/app-builder-backend
103+
Scenario: Get App returns "Gone" response
104+
Given operation "GetApp" enabled
105+
And new "GetApp" request
106+
And there is a valid "app" in the system
107+
And request contains "app_id" parameter from "app.data.id"
108+
And request contains "version" parameter with value 31
109+
When the request is sent
110+
Then the response status is 410 Gone
111+
102112
@skip-typescript @team:DataDog/app-builder-backend
103113
Scenario: Get App returns "Not Found" response
104114
Given operation "GetApp" enabled

lib/datadog_api_client/inflector.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -958,6 +958,8 @@ def overrides
958958
"v2.app_meta" => "AppMeta",
959959
"v2.app_relationship" => "AppRelationship",
960960
"v2.apps_sort_field" => "AppsSortField",
961+
"v2.app_version_selector" => "AppVersionSelector",
962+
"v2.app_version_selector_constants" => "AppVersionSelectorConstants",
961963
"v2.asset" => "Asset",
962964
"v2.asset_attributes" => "AssetAttributes",
963965
"v2.asset_entity_type" => "AssetEntityType",

lib/datadog_api_client/v2/api/app_builder_api.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ def get_app(app_id, opts = {})
254254
#
255255
# @param app_id [UUID] The ID of the app to retrieve.
256256
# @param opts [Hash] the optional parameters
257-
# @option opts [String] :version The version number of the app to retrieve. If not specified, the latest version is returned. Version numbers start at 1 and increment with each update. The special values `latest` and `deployed` can be used to retrieve the latest version or the published version, respectively.
257+
# @option opts [AppVersionSelector] :version The version number of the app to retrieve. If not specified, the latest version is returned. Version numbers start at 1 and increment with each update. The special values `latest` and `deployed` can be used to retrieve the latest version or the published version, respectively.
258258
# @return [Array<(GetAppResponse, Integer, Hash)>] GetAppResponse data, response status code and response headers
259259
def get_app_with_http_info(app_id, opts = {})
260260
unstable_enabled = @api_client.config.unstable_operations["v2.get_app".to_sym]
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
=begin
2+
#Datadog API V2 Collection
3+
4+
#Collection of all Datadog Public endpoints.
5+
6+
The version of the OpenAPI document: 1.0
7+
8+
Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator
9+
10+
Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
11+
This product includes software developed at Datadog (https://www.datadoghq.com/).
12+
Copyright 2020-Present Datadog, Inc.
13+
14+
=end
15+
16+
require 'date'
17+
require 'time'
18+
19+
module DatadogAPIClient::V2
20+
# The version selector parameter used in endpoints such as Get App. Version numbers start at 1 and increment with each update. 0 is a special value that always selects the latest version.
21+
module AppVersionSelector
22+
class << self
23+
include BaseOneOfModel
24+
include BaseOneOfModelNoDiscriminator
25+
26+
# List of class defined in oneOf (OpenAPI v3)
27+
def openapi_one_of
28+
[
29+
:'AppVersionSelectorConstants',
30+
:'Integer'
31+
]
32+
end
33+
# Builds the object
34+
# @param data [Mixed] Data to be matched against the list of oneOf items
35+
# @return [Object] Returns the model or the data itself
36+
def build(data)
37+
# Go through the list of oneOf items and attempt to identify the appropriate one.
38+
# Note:
39+
# - We do not attempt to check whether exactly one item matches.
40+
# - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
41+
# due to the way the deserialization is made in the base_object template (it just casts without verifying).
42+
# - TODO: scalar values are de facto behaving as if they were nullable.
43+
# - TODO: logging when debugging is set.
44+
openapi_one_of.each do |klass|
45+
begin
46+
next if klass == :AnyType # "nullable: true"
47+
typed_data = find_and_cast_into_type(klass, data)
48+
next if typed_data.respond_to?(:_unparsed) && typed_data._unparsed
49+
return typed_data if typed_data
50+
rescue # rescue all errors so we keep iterating even if the current item lookup raises
51+
end
52+
end
53+
54+
if openapi_one_of.include?(:AnyType)
55+
data
56+
else
57+
self._unparsed = true
58+
DatadogAPIClient::UnparsedObject.new(data)
59+
end
60+
end
61+
end
62+
end
63+
end
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
=begin
2+
#Datadog API V2 Collection
3+
4+
#Collection of all Datadog Public endpoints.
5+
6+
The version of the OpenAPI document: 1.0
7+
8+
Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator
9+
10+
Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
11+
This product includes software developed at Datadog (https://www.datadoghq.com/).
12+
Copyright 2020-Present Datadog, Inc.
13+
14+
=end
15+
16+
require 'date'
17+
require 'time'
18+
19+
module DatadogAPIClient::V2
20+
# Constants that always select a particular version of an app.
21+
class AppVersionSelectorConstants
22+
include BaseEnumModel
23+
24+
LATEST = "latest".freeze
25+
DEPLOYED = "deployed".freeze
26+
end
27+
end

0 commit comments

Comments
 (0)