Skip to content
Open
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
73 changes: 73 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55072,6 +55072,40 @@ components:
type: string
x-enum-varnames:
- MANAGED_ORGS
MaxSessionDurationType:
description: Data type of a maximum session duration update.
enum: [max_session_duration]
example: max_session_duration
type: string
x-enum-varnames:
- MAX_SESSION_DURATION
MaxSessionDurationUpdateAttributes:
description: Writable attributes for the maximum session duration.
properties:
max_session_duration:
description: The maximum session duration, in seconds.
example: 604800
format: int64
minimum: 1
type: integer
required: [max_session_duration]
type: object
MaxSessionDurationUpdateData:
description: A maximum session duration update operation.
properties:
attributes:
$ref: "#/components/schemas/MaxSessionDurationUpdateAttributes"
type:
$ref: "#/components/schemas/MaxSessionDurationType"
required: [type, attributes]
type: object
MaxSessionDurationUpdateRequest:
description: A request to update the maximum session duration for an organization.
properties:
data:
$ref: "#/components/schemas/MaxSessionDurationUpdateData"
required: [data]
type: object
McpScanRequest:
description: The top-level request object for submitting an MCP SCA dependency scan.
properties:
Expand Down Expand Up @@ -140664,6 +140698,45 @@ paths:
x-unstable: |-
**Note**: This endpoint is in preview and is subject to change.
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
/api/v2/login/org_configs/max_session_duration:
put:
description: Update the maximum session duration for the current organization. The duration is specified in seconds.
operationId: UpdateLoginOrgConfigsMaxSessionDuration
requestBody:
content:
application/json:
examples:
default:
value:
data:
attributes:
max_session_duration: 604800
type: max_session_duration
schema:
$ref: "#/components/schemas/MaxSessionDurationUpdateRequest"
required: true
responses:
"204":
description: No Content
"400":
$ref: "#/components/responses/BadRequestResponse"
"401":
$ref: "#/components/responses/UnauthorizedResponse"
"403":
$ref: "#/components/responses/ForbiddenResponse"
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ:
- org_management
summary: Update the maximum session duration
tags: [Organizations]
"x-permission":
operator: OR
permissions:
- org_management
/api/v2/logs:
post:
description: |-
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Update the maximum session duration returns "No Content" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::OrganizationsAPI.new

body = DatadogAPIClient::V2::MaxSessionDurationUpdateRequest.new({
data: DatadogAPIClient::V2::MaxSessionDurationUpdateData.new({
attributes: DatadogAPIClient::V2::MaxSessionDurationUpdateAttributes.new({
max_session_duration: 604800,
}),
type: DatadogAPIClient::V2::MaxSessionDurationType::MAX_SESSION_DURATION,
}),
})
api_instance.update_login_org_configs_max_session_duration(body)
49 changes: 26 additions & 23 deletions features/scenarios_model_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3740,6 +3740,32 @@
"v2.UpdateIPAllowlist" => {
"body" => "IPAllowlistUpdateRequest",
},
"v2.UpdateLoginOrgConfigsMaxSessionDuration" => {
"body" => "MaxSessionDurationUpdateRequest",
},
"v2.ListOrgs" => {
"filter_name" => "String",
},
"v2.UpdateOrgSamlConfigurations" => {
"body" => "OrgSAMLPreferencesUpdateRequest",
},
"v2.GetOrgConfig" => {
"org_config_name" => "String",
},
"v2.UpdateOrgConfig" => {
"org_config_name" => "String",
"body" => "OrgConfigWriteRequest",
},
"v2.UploadIdPMetadata" => {
"idp_file" => "File",
},
"v2.GetSAMLConfiguration" => {
"saml_config_uuid" => "String",
},
"v2.UpdateSAMLConfiguration" => {
"saml_config_uuid" => "String",
"body" => "SAMLConfigurationUpdateRequest",
},
"v2.SubmitLog" => {
"content_encoding" => "ContentEncoding",
"ddtags" => "String",
Expand Down Expand Up @@ -4261,29 +4287,6 @@
"v2.ResolveOnCallPage" => {
"page_id" => "UUID",
},
"v2.ListOrgs" => {
"filter_name" => "String",
},
"v2.UpdateOrgSamlConfigurations" => {
"body" => "OrgSAMLPreferencesUpdateRequest",
},
"v2.GetOrgConfig" => {
"org_config_name" => "String",
},
"v2.UpdateOrgConfig" => {
"org_config_name" => "String",
"body" => "OrgConfigWriteRequest",
},
"v2.UploadIdPMetadata" => {
"idp_file" => "File",
},
"v2.GetSAMLConfiguration" => {
"saml_config_uuid" => "String",
},
"v2.UpdateSAMLConfiguration" => {
"saml_config_uuid" => "String",
"body" => "SAMLConfigurationUpdateRequest",
},
"v2.DisableCustomerOrg" => {
"body" => "CustomerOrgDisableRequest",
},
Expand Down
14 changes: 14 additions & 0 deletions features/v2/organizations.feature
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,20 @@ Feature: Organizations
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/delegated-auth-login
Scenario: Update the maximum session duration returns "Bad Request" response
Given new "UpdateLoginOrgConfigsMaxSessionDuration" request
And body with value {"data": {"attributes": {"max_session_duration": 604800}, "type": "max_session_duration"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/delegated-auth-login
Scenario: Update the maximum session duration returns "No Content" response
Given new "UpdateLoginOrgConfigsMaxSessionDuration" request
And body with value {"data": {"attributes": {"max_session_duration": 604800}, "type": "max_session_duration"}}
When the request is sent
Then the response status is 204 No Content

@skip-go @skip-java @skip-python @skip-ruby @skip-rust @skip-terraform-config @skip-typescript @skip-validation @team:DataDog/delegated-auth-login
Scenario: Upload IdP metadata returns "Bad Request - caused by either malformed XML or invalid SAML IdP metadata" response
Given new "UploadIdPMetadata" request
Expand Down
6 changes: 6 additions & 0 deletions features/v2/undo.json
Original file line number Diff line number Diff line change
Expand Up @@ -4427,6 +4427,12 @@
"type": "safe"
}
},
"UpdateLoginOrgConfigsMaxSessionDuration": {
"tag": "Organizations",
"undo": {
"type": "idempotent"
}
},
"SubmitLog": {
"tag": "Logs",
"undo": {
Expand Down
2 changes: 1 addition & 1 deletion lib/datadog_api_client/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,7 @@ def initialize
"v2.update_jira_issue_template": false,
"v2.create_tenancy_config": false,
"v2.get_tenancy_configs": false,
"v2.update_org_saml_configurations": false,
"v2.add_role_to_restriction_query": false,
"v2.create_restriction_query": false,
"v2.delete_restriction_query": false,
Expand Down Expand Up @@ -558,7 +559,6 @@ def initialize
"v2.get_scopes_restriction": false,
"v2.register_o_auth_client": false,
"v2.upsert_scopes_restriction": false,
"v2.update_org_saml_configurations": false,
"v2.disable_customer_org": false,
"v2.bulk_update_org_group_memberships": false,
"v2.create_org_group": false,
Expand Down
4 changes: 4 additions & 0 deletions lib/datadog_api_client/inflector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4384,6 +4384,10 @@ def overrides
"v2.managed_orgs_relationship_to_orgs" => "ManagedOrgsRelationshipToOrgs",
"v2.managed_orgs_response" => "ManagedOrgsResponse",
"v2.managed_orgs_type" => "ManagedOrgsType",
"v2.max_session_duration_type" => "MaxSessionDurationType",
"v2.max_session_duration_update_attributes" => "MaxSessionDurationUpdateAttributes",
"v2.max_session_duration_update_data" => "MaxSessionDurationUpdateData",
"v2.max_session_duration_update_request" => "MaxSessionDurationUpdateRequest",
"v2.mcp_scan_request" => "McpScanRequest",
"v2.mcp_scan_request_data" => "McpScanRequestData",
"v2.mcp_scan_request_data_attributes" => "McpScanRequestDataAttributes",
Expand Down
67 changes: 67 additions & 0 deletions lib/datadog_api_client/v2/api/organizations_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,73 @@ def list_saml_configurations_with_http_info(opts = {})
return data, status_code, headers
end

# Update the maximum session duration.
#
# @see #update_login_org_configs_max_session_duration_with_http_info
def update_login_org_configs_max_session_duration(body, opts = {})
update_login_org_configs_max_session_duration_with_http_info(body, opts)
nil
end

# Update the maximum session duration.
#
# Update the maximum session duration for the current organization. The duration is specified in seconds.
#
# @param body [MaxSessionDurationUpdateRequest]
# @param opts [Hash] the optional parameters
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
def update_login_org_configs_max_session_duration_with_http_info(body, opts = {})

if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: OrganizationsAPI.update_login_org_configs_max_session_duration ...'
end
# verify the required parameter 'body' is set
if @api_client.config.client_side_validation && body.nil?
fail ArgumentError, "Missing the required parameter 'body' when calling OrganizationsAPI.update_login_org_configs_max_session_duration"
end
# resource path
local_var_path = '/api/v2/login/org_configs/max_session_duration'

# query parameters
query_params = opts[:query_params] || {}

# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['*/*'])
# HTTP header 'Content-Type'
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

# form parameters
form_params = opts[:form_params] || {}

# http body (model)
post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

# return_type
return_type = opts[:debug_return_type]

# auth_names
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

new_options = opts.merge(
:operation => :update_login_org_configs_max_session_duration,
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type,
:api_version => "V2"
)

data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: OrganizationsAPI#update_login_org_configs_max_session_duration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end

# Update a specific Org Config.
#
# @see #update_org_config_with_http_info
Expand Down
26 changes: 26 additions & 0 deletions lib/datadog_api_client/v2/models/max_session_duration_type.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
=begin
#Datadog API V2 Collection

#Collection of all Datadog Public endpoints.

The version of the OpenAPI document: 1.0
Contact: support@datadoghq.com
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
# Data type of a maximum session duration update.
class MaxSessionDurationType
include BaseEnumModel

MAX_SESSION_DURATION = "max_session_duration".freeze
end
end
Loading
Loading