Skip to content

Commit 85e485a

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit 81b4470 of spec repo (DataDog#3476)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 8efaade commit 85e485a

11 files changed

Lines changed: 604 additions & 0 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55468,6 +55468,40 @@ components:
5546855468
type: string
5546955469
x-enum-varnames:
5547055470
- MANAGED_ORGS
55471+
MaxSessionDurationType:
55472+
description: Data type of a maximum session duration update.
55473+
enum: [max_session_duration]
55474+
example: max_session_duration
55475+
type: string
55476+
x-enum-varnames:
55477+
- MAX_SESSION_DURATION
55478+
MaxSessionDurationUpdateAttributes:
55479+
description: Attributes for the maximum session duration update request.
55480+
properties:
55481+
max_session_duration:
55482+
description: The maximum session duration, in seconds.
55483+
example: 604800
55484+
format: int64
55485+
minimum: 1
55486+
type: integer
55487+
required: [max_session_duration]
55488+
type: object
55489+
MaxSessionDurationUpdateData:
55490+
description: The data object for a maximum session duration update request.
55491+
properties:
55492+
attributes:
55493+
$ref: "#/components/schemas/MaxSessionDurationUpdateAttributes"
55494+
type:
55495+
$ref: "#/components/schemas/MaxSessionDurationType"
55496+
required: [type, attributes]
55497+
type: object
55498+
MaxSessionDurationUpdateRequest:
55499+
description: A request to update the maximum session duration for an organization.
55500+
properties:
55501+
data:
55502+
$ref: "#/components/schemas/MaxSessionDurationUpdateData"
55503+
required: [data]
55504+
type: object
5547155505
McpScanRequest:
5547255506
description: The top-level request object for submitting an MCP SCA dependency scan.
5547355507
properties:
@@ -143303,6 +143337,47 @@ paths:
143303143337
x-unstable: |-
143304143338
**Note**: This endpoint is in preview and is subject to change.
143305143339
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
143340+
/api/v2/login/org_configs/max_session_duration:
143341+
put:
143342+
description: |-
143343+
Update the maximum session duration for the current organization.
143344+
The duration is specified in seconds.
143345+
operationId: UpdateLoginOrgConfigsMaxSessionDuration
143346+
requestBody:
143347+
content:
143348+
application/json:
143349+
examples:
143350+
default:
143351+
value:
143352+
data:
143353+
attributes:
143354+
max_session_duration: 604800
143355+
type: max_session_duration
143356+
schema:
143357+
$ref: "#/components/schemas/MaxSessionDurationUpdateRequest"
143358+
required: true
143359+
responses:
143360+
"204":
143361+
description: No Content
143362+
"400":
143363+
$ref: "#/components/responses/BadRequestResponse"
143364+
"401":
143365+
$ref: "#/components/responses/UnauthorizedResponse"
143366+
"403":
143367+
$ref: "#/components/responses/ForbiddenResponse"
143368+
"429":
143369+
$ref: "#/components/responses/TooManyRequestsResponse"
143370+
security:
143371+
- apiKeyAuth: []
143372+
appKeyAuth: []
143373+
- AuthZ:
143374+
- org_management
143375+
summary: Update the maximum session duration
143376+
tags: [Organizations]
143377+
"x-permission":
143378+
operator: OR
143379+
permissions:
143380+
- org_management
143306143381
/api/v2/logs:
143307143382
post:
143308143383
description: |-
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Update the maximum session duration returns "No Content" response
2+
3+
require "datadog_api_client"
4+
api_instance = DatadogAPIClient::V2::OrganizationsAPI.new
5+
6+
body = DatadogAPIClient::V2::MaxSessionDurationUpdateRequest.new({
7+
data: DatadogAPIClient::V2::MaxSessionDurationUpdateData.new({
8+
attributes: DatadogAPIClient::V2::MaxSessionDurationUpdateAttributes.new({
9+
max_session_duration: 604800,
10+
}),
11+
type: DatadogAPIClient::V2::MaxSessionDurationType::MAX_SESSION_DURATION,
12+
}),
13+
})
14+
api_instance.update_login_org_configs_max_session_duration(body)

features/scenarios_model_mapping.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3220,6 +3220,9 @@
32203220
"page_limit" => "Integer",
32213221
"page_cursor" => "String",
32223222
},
3223+
"v2.UpdateLoginOrgConfigsMaxSessionDuration" => {
3224+
"body" => "MaxSessionDurationUpdateRequest",
3225+
},
32233226
"v2.ListOrgs" => {
32243227
"filter_name" => "String",
32253228
},

features/v2/organizations.feature

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,20 @@ Feature: Organizations
168168
When the request is sent
169169
Then the response status is 404 Not Found
170170

171+
@generated @skip @team:DataDog/delegated-auth-login
172+
Scenario: Update the maximum session duration returns "Bad Request" response
173+
Given new "UpdateLoginOrgConfigsMaxSessionDuration" request
174+
And body with value {"data": {"attributes": {"max_session_duration": 604800}, "type": "max_session_duration"}}
175+
When the request is sent
176+
Then the response status is 400 Bad Request
177+
178+
@generated @skip @team:DataDog/delegated-auth-login
179+
Scenario: Update the maximum session duration returns "No Content" response
180+
Given new "UpdateLoginOrgConfigsMaxSessionDuration" request
181+
And body with value {"data": {"attributes": {"max_session_duration": 604800}, "type": "max_session_duration"}}
182+
When the request is sent
183+
Then the response status is 204 No Content
184+
171185
@skip-go @skip-java @skip-python @skip-ruby @skip-rust @skip-terraform-config @skip-typescript @skip-validation @team:DataDog/delegated-auth-login
172186
Scenario: Upload IdP metadata returns "Bad Request - caused by either malformed XML or invalid SAML IdP metadata" response
173187
Given new "UploadIdPMetadata" request

features/v2/undo.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4560,6 +4560,12 @@
45604560
"type": "safe"
45614561
}
45624562
},
4563+
"UpdateLoginOrgConfigsMaxSessionDuration": {
4564+
"tag": "Organizations",
4565+
"undo": {
4566+
"type": "idempotent"
4567+
}
4568+
},
45634569
"SubmitLog": {
45644570
"tag": "Logs",
45654571
"undo": {

lib/datadog_api_client/inflector.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4416,6 +4416,10 @@ def overrides
44164416
"v2.managed_orgs_relationship_to_orgs" => "ManagedOrgsRelationshipToOrgs",
44174417
"v2.managed_orgs_response" => "ManagedOrgsResponse",
44184418
"v2.managed_orgs_type" => "ManagedOrgsType",
4419+
"v2.max_session_duration_type" => "MaxSessionDurationType",
4420+
"v2.max_session_duration_update_attributes" => "MaxSessionDurationUpdateAttributes",
4421+
"v2.max_session_duration_update_data" => "MaxSessionDurationUpdateData",
4422+
"v2.max_session_duration_update_request" => "MaxSessionDurationUpdateRequest",
44194423
"v2.mcp_scan_request" => "McpScanRequest",
44204424
"v2.mcp_scan_request_data" => "McpScanRequestData",
44214425
"v2.mcp_scan_request_data_attributes" => "McpScanRequestDataAttributes",

lib/datadog_api_client/v2/api/organizations_api.rb

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,74 @@ def list_saml_configurations_with_http_info(opts = {})
432432
return data, status_code, headers
433433
end
434434

435+
# Update the maximum session duration.
436+
#
437+
# @see #update_login_org_configs_max_session_duration_with_http_info
438+
def update_login_org_configs_max_session_duration(body, opts = {})
439+
update_login_org_configs_max_session_duration_with_http_info(body, opts)
440+
nil
441+
end
442+
443+
# Update the maximum session duration.
444+
#
445+
# Update the maximum session duration for the current organization.
446+
# The duration is specified in seconds.
447+
#
448+
# @param body [MaxSessionDurationUpdateRequest]
449+
# @param opts [Hash] the optional parameters
450+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
451+
def update_login_org_configs_max_session_duration_with_http_info(body, opts = {})
452+
453+
if @api_client.config.debugging
454+
@api_client.config.logger.debug 'Calling API: OrganizationsAPI.update_login_org_configs_max_session_duration ...'
455+
end
456+
# verify the required parameter 'body' is set
457+
if @api_client.config.client_side_validation && body.nil?
458+
fail ArgumentError, "Missing the required parameter 'body' when calling OrganizationsAPI.update_login_org_configs_max_session_duration"
459+
end
460+
# resource path
461+
local_var_path = '/api/v2/login/org_configs/max_session_duration'
462+
463+
# query parameters
464+
query_params = opts[:query_params] || {}
465+
466+
# header parameters
467+
header_params = opts[:header_params] || {}
468+
# HTTP header 'Accept' (if needed)
469+
header_params['Accept'] = @api_client.select_header_accept(['*/*'])
470+
# HTTP header 'Content-Type'
471+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
472+
473+
# form parameters
474+
form_params = opts[:form_params] || {}
475+
476+
# http body (model)
477+
post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
478+
479+
# return_type
480+
return_type = opts[:debug_return_type]
481+
482+
# auth_names
483+
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
484+
485+
new_options = opts.merge(
486+
:operation => :update_login_org_configs_max_session_duration,
487+
:header_params => header_params,
488+
:query_params => query_params,
489+
:form_params => form_params,
490+
:body => post_body,
491+
:auth_names => auth_names,
492+
:return_type => return_type,
493+
:api_version => "V2"
494+
)
495+
496+
data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options)
497+
if @api_client.config.debugging
498+
@api_client.config.logger.debug "API called: OrganizationsAPI#update_login_org_configs_max_session_duration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
499+
end
500+
return data, status_code, headers
501+
end
502+
435503
# Update a specific Org Config.
436504
#
437505
# @see #update_org_config_with_http_info
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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+
Contact: support@datadoghq.com
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+
# Data type of a maximum session duration update.
21+
class MaxSessionDurationType
22+
include BaseEnumModel
23+
24+
MAX_SESSION_DURATION = "max_session_duration".freeze
25+
end
26+
end
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
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+
Contact: support@datadoghq.com
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+
# Attributes for the maximum session duration update request.
21+
class MaxSessionDurationUpdateAttributes
22+
include BaseGenericModel
23+
24+
# The maximum session duration, in seconds.
25+
attr_reader :max_session_duration
26+
27+
attr_accessor :additional_properties
28+
29+
# Attribute mapping from ruby-style variable name to JSON key.
30+
# @!visibility private
31+
def self.attribute_map
32+
{
33+
:'max_session_duration' => :'max_session_duration'
34+
}
35+
end
36+
37+
# Attribute type mapping.
38+
# @!visibility private
39+
def self.openapi_types
40+
{
41+
:'max_session_duration' => :'Integer'
42+
}
43+
end
44+
45+
# Initializes the object
46+
# @param attributes [Hash] Model attributes in the form of hash
47+
# @!visibility private
48+
def initialize(attributes = {})
49+
if (!attributes.is_a?(Hash))
50+
fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::MaxSessionDurationUpdateAttributes` initialize method"
51+
end
52+
53+
self.additional_properties = {}
54+
# check to see if the attribute exists and convert string to symbol for hash key
55+
attributes = attributes.each_with_object({}) { |(k, v), h|
56+
if (!self.class.attribute_map.key?(k.to_sym))
57+
self.additional_properties[k.to_sym] = v
58+
else
59+
h[k.to_sym] = v
60+
end
61+
}
62+
63+
if attributes.key?(:'max_session_duration')
64+
self.max_session_duration = attributes[:'max_session_duration']
65+
end
66+
end
67+
68+
# Check to see if the all the properties in the model are valid
69+
# @return true if the model is valid
70+
# @!visibility private
71+
def valid?
72+
return false if @max_session_duration.nil?
73+
return false if @max_session_duration < 1
74+
true
75+
end
76+
77+
# Custom attribute writer method with validation
78+
# @param max_session_duration [Object] Object to be assigned
79+
# @!visibility private
80+
def max_session_duration=(max_session_duration)
81+
if max_session_duration.nil?
82+
fail ArgumentError, 'invalid value for "max_session_duration", max_session_duration cannot be nil.'
83+
end
84+
if max_session_duration < 1
85+
fail ArgumentError, 'invalid value for "max_session_duration", must be greater than or equal to 1.'
86+
end
87+
@max_session_duration = max_session_duration
88+
end
89+
90+
# Returns the object in the form of hash, with additionalProperties support.
91+
# @return [Hash] Returns the object in the form of hash
92+
# @!visibility private
93+
def to_hash
94+
hash = {}
95+
self.class.attribute_map.each_pair do |attr, param|
96+
value = self.send(attr)
97+
if value.nil?
98+
is_nullable = self.class.openapi_nullable.include?(attr)
99+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
100+
end
101+
102+
hash[param] = _to_hash(value)
103+
end
104+
self.additional_properties.each_pair do |attr, value|
105+
hash[attr] = value
106+
end
107+
hash
108+
end
109+
110+
# Checks equality by comparing each attribute.
111+
# @param o [Object] Object to be compared
112+
# @!visibility private
113+
def ==(o)
114+
return true if self.equal?(o)
115+
self.class == o.class &&
116+
max_session_duration == o.max_session_duration &&
117+
additional_properties == o.additional_properties
118+
end
119+
120+
# Calculates hash code according to all attributes.
121+
# @return [Integer] Hash code
122+
# @!visibility private
123+
def hash
124+
[max_session_duration, additional_properties].hash
125+
end
126+
end
127+
end

0 commit comments

Comments
 (0)