Skip to content

Commit

Permalink
Regenerate client from commit 57f11a78 of spec repo
Browse files Browse the repository at this point in the history
  • Loading branch information
ci.datadog-api-spec committed Feb 4, 2025
1 parent 71b3269 commit 1b75fc2
Show file tree
Hide file tree
Showing 7 changed files with 115 additions and 7 deletions.
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": "2025-02-04 14:10:05.819748",
"spec_repo_commit": "4fb9047a"
"regenerated": "2025-02-04 21:15:18.411206",
"spec_repo_commit": "57f11a78"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2025-02-04 14:10:05.835266",
"spec_repo_commit": "4fb9047a"
"regenerated": "2025-02-04 21:15:18.426774",
"spec_repo_commit": "57f11a78"
}
}
}
18 changes: 17 additions & 1 deletion .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1965,6 +1965,22 @@ components:
deployment:
$ref: '#/components/schemas/DeploymentRelationship'
type: object
AppVersionSelector:
description: The version selector parameter used in endpoints such as Get App
oneOf:
- $ref: '#/components/schemas/AppVersionSelectorConstants'
- format: int64
minimum: 0
type: integer
AppVersionSelectorConstants:
description: Constants that always selects a particular version of an app
enum:
- latest
- deployed
type: string
x-enum-varnames:
- LATEST
- DEPLOYED
ApplicationKeyCreateAttributes:
description: Attributes used to create an application Key.
properties:
Expand Down Expand Up @@ -32494,7 +32510,7 @@ paths:
name: version
required: false
schema:
type: string
$ref: '#/components/schemas/AppVersionSelector'
responses:
'200':
content:
Expand Down
2 changes: 1 addition & 1 deletion features/scenarios_model_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -980,7 +980,7 @@
},
"v2.GetApp" => {
"app_id" => "UUID",
"version" => "String",
"version" => "AppVersionSelector",
},
"v2.UpdateApp" => {
"app_id" => "UUID",
Expand Down
2 changes: 2 additions & 0 deletions lib/datadog_api_client/inflector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -958,6 +958,8 @@ def overrides
"v2.app_meta" => "AppMeta",
"v2.app_relationship" => "AppRelationship",
"v2.apps_sort_field" => "AppsSortField",
"v2.app_version_selector" => "AppVersionSelector",
"v2.app_version_selector_constants" => "AppVersionSelectorConstants",
"v2.asset" => "Asset",
"v2.asset_attributes" => "AssetAttributes",
"v2.asset_entity_type" => "AssetEntityType",
Expand Down
2 changes: 1 addition & 1 deletion lib/datadog_api_client/v2/api/app_builder_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ def get_app(app_id, opts = {})
#
# @param app_id [UUID] The ID of the app to retrieve.
# @param opts [Hash] the optional parameters
# @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.
# @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.
# @return [Array<(GetAppResponse, Integer, Hash)>] GetAppResponse data, response status code and response headers
def get_app_with_http_info(app_id, opts = {})
unstable_enabled = @api_client.config.unstable_operations["v2.get_app".to_sym]
Expand Down
63 changes: 63 additions & 0 deletions lib/datadog_api_client/v2/models/app_version_selector.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
=begin
#Datadog API V2 Collection
#Collection of all Datadog Public endpoints.
The version of the OpenAPI document: 1.0
Contact: [email protected]
Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator
Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
This product includes software developed at Datadog (https://www.datadoghq.com/).
Copyright 2020-Present Datadog, Inc.
=end

require 'date'
require 'time'

module DatadogAPIClient::V2
# The version selector parameter used in endpoints such as Get App
module AppVersionSelector
class << self
include BaseOneOfModel
include BaseOneOfModelNoDiscriminator

# List of class defined in oneOf (OpenAPI v3)
def openapi_one_of
[
:'AppVersionSelectorConstants',
:'Integer'
]
end
# Builds the object
# @param data [Mixed] Data to be matched against the list of oneOf items
# @return [Object] Returns the model or the data itself
def build(data)
# Go through the list of oneOf items and attempt to identify the appropriate one.
# Note:
# - We do not attempt to check whether exactly one item matches.
# - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
# due to the way the deserialization is made in the base_object template (it just casts without verifying).
# - TODO: scalar values are de facto behaving as if they were nullable.
# - TODO: logging when debugging is set.
openapi_one_of.each do |klass|
begin
next if klass == :AnyType # "nullable: true"
typed_data = find_and_cast_into_type(klass, data)
next if typed_data.respond_to?(:_unparsed) && typed_data._unparsed
return typed_data if typed_data
rescue # rescue all errors so we keep iterating even if the current item lookup raises
end
end

if openapi_one_of.include?(:AnyType)
data
else
self._unparsed = true
DatadogAPIClient::UnparsedObject.new(data)
end
end
end
end
end
27 changes: 27 additions & 0 deletions lib/datadog_api_client/v2/models/app_version_selector_constants.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
=begin
#Datadog API V2 Collection
#Collection of all Datadog Public endpoints.
The version of the OpenAPI document: 1.0
Contact: [email protected]
Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator
Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
This product includes software developed at Datadog (https://www.datadoghq.com/).
Copyright 2020-Present Datadog, Inc.
=end

require 'date'
require 'time'

module DatadogAPIClient::V2
# Constants that always selects a particular version of an app
class AppVersionSelectorConstants
include BaseEnumModel

LATEST = "latest".freeze
DEPLOYED = "deployed".freeze
end
end

0 comments on commit 1b75fc2

Please sign in to comment.