diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index af969a3d7f0..c9044d10db6 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -34814,6 +34814,47 @@ components: - ms_channel_name - redirect_url type: object + MaxSessionDurationUpdateAttributes: + description: Attributes for updating maximum session duration. + properties: + max_session_duration: + description: Maximum session duration in seconds. Must not exceed 24 hours + (86400 seconds). + example: 60 + format: int64 + maximum: 86400 + minimum: 1 + type: integer + required: + - max_session_duration + type: object + MaxSessionDurationUpdateRequest: + description: Request to update the maximum session duration. + properties: + data: + $ref: '#/components/schemas/MaxSessionDurationUpdateRequestData' + required: + - data + type: object + MaxSessionDurationUpdateRequestData: + description: Data wrapper for maximum session duration update. + properties: + attributes: + $ref: '#/components/schemas/MaxSessionDurationUpdateAttributes' + type: + $ref: '#/components/schemas/MaxSessionDurationUpdateRequestDataType' + required: + - type + - attributes + type: object + MaxSessionDurationUpdateRequestDataType: + description: Type of the resource. + enum: + - max_session_duration + example: max_session_duration + type: string + x-enum-varnames: + - MAX_SESSION_DURATION MemberTeam: description: A member team properties: @@ -50546,6 +50587,65 @@ components: example: report_id type: string type: object + SamlConfigurationsUpdateAttributes: + description: Attributes for updating SAML preferences. + properties: + default_role_uuids: + description: List of role UUIDs to assign to JIT-provisioned users. Exactly + 1 role is required. + example: + - 19fcc38b-b651-46a0-b463-1f8f56c6a862 + items: + format: uuid + type: string + maxItems: 1 + minItems: 1 + type: array + jit_domains: + description: 'List of domains for Just-In-Time user provisioning. Maximum + 50 domains. + + Each domain must be between 1 and 256 characters.' + example: + - example1.com + - example2.com + items: + maxLength: 256 + minLength: 1 + type: string + maxItems: 50 + type: array + required: + - jit_domains + - default_role_uuids + type: object + SamlConfigurationsUpdateRequest: + description: Request to update organization SAML preferences. + properties: + data: + $ref: '#/components/schemas/SamlConfigurationsUpdateRequestData' + required: + - data + type: object + SamlConfigurationsUpdateRequestData: + description: Data wrapper for SAML preferences update. + properties: + attributes: + $ref: '#/components/schemas/SamlConfigurationsUpdateAttributes' + type: + $ref: '#/components/schemas/SamlConfigurationsUpdateRequestDataType' + required: + - type + - attributes + type: object + SamlConfigurationsUpdateRequestDataType: + description: Type of the resource. + enum: + - saml_preferences + example: saml_preferences + type: string + x-enum-varnames: + - SAML_PREFERENCES ScaRequest: properties: data: @@ -80508,6 +80608,59 @@ paths: operator: OR permissions: - org_management + /api/v2/login/org_configs/max_session_duration: + put: + description: 'Updates the maximum session duration for an organization. This + controls how long user sessions + + can remain active before requiring re-authentication. The value must not exceed + 24 hours (86400 seconds). + + + Requires `org_management` permission and a session that has been active within + the last 12 hours.' + operationId: UpdateLoginOrgConfigMaxSessionDuration + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MaxSessionDurationUpdateRequest' + required: true + responses: + '204': + description: No Content - The maximum session duration was successfully + updated. + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Internal Server Error + summary: Update maximum session duration + tags: + - Organizations + x-unstable: This endpoint is in public beta. If you have any feedback, contact + [Datadog support](https://docs.datadoghq.com/help/). /api/v2/logs: post: description: 'Send your logs to your Datadog platform over HTTP. Limits per @@ -85421,6 +85574,64 @@ paths: operator: OR permissions: - on_call_read + /api/v2/org/saml_configurations: + patch: + description: 'Updates SAML preferences for an organization, including JIT provisioning + domains and default role assignments. + + + This endpoint allows you to configure: + + - `jit_domains`: List of domains for Just-In-Time user provisioning (up to + 50 domains, 1-256 characters each) + + - `default_role_uuids`: List of role UUIDs to assign to JIT-provisioned users + (exactly 1 role required) + + + Requires `org_management` permission. This endpoint is gated by the `org-saml-preferences-api-gate` + experiment.' + operationId: UpdateOrgSamlConfigurations + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SamlConfigurationsUpdateRequest' + required: true + responses: + '204': + description: No Content - The SAML preferences were successfully updated. + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Internal Server Error + summary: Update organization SAML preferences + tags: + - Organizations + x-unstable: This endpoint is in public beta. If you have any feedback, contact + [Datadog support](https://docs.datadoghq.com/help/). /api/v2/org_configs: get: description: Returns all Org Configs (name, description, and value). diff --git a/examples/v2/organizations/UpdateLoginOrgConfigMaxSessionDuration.java b/examples/v2/organizations/UpdateLoginOrgConfigMaxSessionDuration.java new file mode 100644 index 00000000000..2a13a5dca3f --- /dev/null +++ b/examples/v2/organizations/UpdateLoginOrgConfigMaxSessionDuration.java @@ -0,0 +1,36 @@ +// Update maximum session duration returns "No Content - The maximum session duration was +// successfully updated." response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.OrganizationsApi; +import com.datadog.api.client.v2.model.MaxSessionDurationUpdateAttributes; +import com.datadog.api.client.v2.model.MaxSessionDurationUpdateRequest; +import com.datadog.api.client.v2.model.MaxSessionDurationUpdateRequestData; +import com.datadog.api.client.v2.model.MaxSessionDurationUpdateRequestDataType; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.updateLoginOrgConfigMaxSessionDuration", true); + OrganizationsApi apiInstance = new OrganizationsApi(defaultClient); + + MaxSessionDurationUpdateRequest body = + new MaxSessionDurationUpdateRequest() + .data( + new MaxSessionDurationUpdateRequestData() + .attributes(new MaxSessionDurationUpdateAttributes().maxSessionDuration(60L)) + .type(MaxSessionDurationUpdateRequestDataType.MAX_SESSION_DURATION)); + + try { + apiInstance.updateLoginOrgConfigMaxSessionDuration(body); + } catch (ApiException e) { + System.err.println( + "Exception when calling OrganizationsApi#updateLoginOrgConfigMaxSessionDuration"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/organizations/UpdateOrgSamlConfigurations.java b/examples/v2/organizations/UpdateOrgSamlConfigurations.java new file mode 100644 index 00000000000..fedd2c6c6aa --- /dev/null +++ b/examples/v2/organizations/UpdateOrgSamlConfigurations.java @@ -0,0 +1,43 @@ +// Update organization SAML preferences returns "No Content - The SAML preferences were successfully +// updated." response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.OrganizationsApi; +import com.datadog.api.client.v2.model.SamlConfigurationsUpdateAttributes; +import com.datadog.api.client.v2.model.SamlConfigurationsUpdateRequest; +import com.datadog.api.client.v2.model.SamlConfigurationsUpdateRequestData; +import com.datadog.api.client.v2.model.SamlConfigurationsUpdateRequestDataType; +import java.util.Arrays; +import java.util.Collections; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.updateOrgSamlConfigurations", true); + OrganizationsApi apiInstance = new OrganizationsApi(defaultClient); + + SamlConfigurationsUpdateRequest body = + new SamlConfigurationsUpdateRequest() + .data( + new SamlConfigurationsUpdateRequestData() + .attributes( + new SamlConfigurationsUpdateAttributes() + .defaultRoleUuids( + Collections.singletonList( + UUID.fromString("19fcc38b-b651-46a0-b463-1f8f56c6a862"))) + .jitDomains(Arrays.asList("example1.com", "example2.com"))) + .type(SamlConfigurationsUpdateRequestDataType.SAML_PREFERENCES)); + + try { + apiInstance.updateOrgSamlConfigurations(body); + } catch (ApiException e) { + System.err.println("Exception when calling OrganizationsApi#updateOrgSamlConfigurations"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/datadog/api/client/ApiClient.java b/src/main/java/com/datadog/api/client/ApiClient.java index fcadf72e1e8..af6409b2a83 100644 --- a/src/main/java/com/datadog/api/client/ApiClient.java +++ b/src/main/java/com/datadog/api/client/ApiClient.java @@ -871,6 +871,8 @@ public class ApiClient { put("v2.listServiceNowTemplates", false); put("v2.listServiceNowUsers", false); put("v2.updateServiceNowTemplate", false); + put("v2.updateLoginOrgConfigMaxSessionDuration", false); + put("v2.updateOrgSamlConfigurations", false); put("v2.addRoleToRestrictionQuery", false); put("v2.createRestrictionQuery", false); put("v2.deleteRestrictionQuery", false); diff --git a/src/main/java/com/datadog/api/client/v2/api/OrganizationsApi.java b/src/main/java/com/datadog/api/client/v2/api/OrganizationsApi.java index 4300bee6882..b014bf8fe2f 100644 --- a/src/main/java/com/datadog/api/client/v2/api/OrganizationsApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/OrganizationsApi.java @@ -4,9 +4,11 @@ import com.datadog.api.client.ApiException; import com.datadog.api.client.ApiResponse; import com.datadog.api.client.Pair; +import com.datadog.api.client.v2.model.MaxSessionDurationUpdateRequest; import com.datadog.api.client.v2.model.OrgConfigGetResponse; import com.datadog.api.client.v2.model.OrgConfigListResponse; import com.datadog.api.client.v2.model.OrgConfigWriteRequest; +import com.datadog.api.client.v2.model.SamlConfigurationsUpdateRequest; import jakarta.ws.rs.client.Invocation; import jakarta.ws.rs.core.GenericType; import java.io.File; @@ -298,6 +300,167 @@ public CompletableFuture> listOrgConfigsWithH new GenericType() {}); } + /** + * Update maximum session duration. + * + *

See {@link #updateLoginOrgConfigMaxSessionDurationWithHttpInfo}. + * + * @param body (required) + * @throws ApiException if fails to make API call + */ + public void updateLoginOrgConfigMaxSessionDuration(MaxSessionDurationUpdateRequest body) + throws ApiException { + updateLoginOrgConfigMaxSessionDurationWithHttpInfo(body); + } + + /** + * Update maximum session duration. + * + *

See {@link #updateLoginOrgConfigMaxSessionDurationWithHttpInfoAsync}. + * + * @param body (required) + * @return CompletableFuture + */ + public CompletableFuture updateLoginOrgConfigMaxSessionDurationAsync( + MaxSessionDurationUpdateRequest body) { + return updateLoginOrgConfigMaxSessionDurationWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Updates the maximum session duration for an organization. This controls how long user sessions + * can remain active before requiring re-authentication. The value must not exceed 24 hours (86400 + * seconds). + * + *

Requires org_management permission and a session that has been active within + * the last 12 hours. + * + * @param body (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
204 No Content - The maximum session duration was successfully updated. -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
429 Too many requests -
500 Internal Server Error -
+ */ + public ApiResponse updateLoginOrgConfigMaxSessionDurationWithHttpInfo( + MaxSessionDurationUpdateRequest body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "updateLoginOrgConfigMaxSessionDuration"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, + "Missing the required parameter 'body' when calling" + + " updateLoginOrgConfigMaxSessionDuration"); + } + // create path and map variables + String localVarPath = "/api/v2/login/org_configs/max_session_duration"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.OrganizationsApi.updateLoginOrgConfigMaxSessionDuration", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "PUT", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Update maximum session duration. + * + *

See {@link #updateLoginOrgConfigMaxSessionDurationWithHttpInfo}. + * + * @param body (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> + updateLoginOrgConfigMaxSessionDurationWithHttpInfoAsync( + MaxSessionDurationUpdateRequest body) { + // Check if unstable operation is enabled + String operationId = "updateLoginOrgConfigMaxSessionDuration"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'body' when calling" + + " updateLoginOrgConfigMaxSessionDuration")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/login/org_configs/max_session_duration"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.OrganizationsApi.updateLoginOrgConfigMaxSessionDuration", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "PUT", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + null); + } + /** * Update a specific Org Config. * @@ -460,6 +623,167 @@ public CompletableFuture> updateOrgConfigWithH new GenericType() {}); } + /** + * Update organization SAML preferences. + * + *

See {@link #updateOrgSamlConfigurationsWithHttpInfo}. + * + * @param body (required) + * @throws ApiException if fails to make API call + */ + public void updateOrgSamlConfigurations(SamlConfigurationsUpdateRequest body) + throws ApiException { + updateOrgSamlConfigurationsWithHttpInfo(body); + } + + /** + * Update organization SAML preferences. + * + *

See {@link #updateOrgSamlConfigurationsWithHttpInfoAsync}. + * + * @param body (required) + * @return CompletableFuture + */ + public CompletableFuture updateOrgSamlConfigurationsAsync( + SamlConfigurationsUpdateRequest body) { + return updateOrgSamlConfigurationsWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Updates SAML preferences for an organization, including JIT provisioning domains and default + * role assignments. + * + *

This endpoint allows you to configure: - jit_domains: List of domains for + * Just-In-Time user provisioning (up to 50 domains, 1-256 characters each) - + * default_role_uuids: List of role UUIDs to assign to JIT-provisioned users (exactly 1 + * role required) + * + *

Requires org_management permission. This endpoint is gated by the + * org-saml-preferences-api-gate experiment. + * + * @param body (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
204 No Content - The SAML preferences were successfully updated. -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
429 Too many requests -
500 Internal Server Error -
+ */ + public ApiResponse updateOrgSamlConfigurationsWithHttpInfo( + SamlConfigurationsUpdateRequest body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "updateOrgSamlConfigurations"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling updateOrgSamlConfigurations"); + } + // create path and map variables + String localVarPath = "/api/v2/org/saml_configurations"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.OrganizationsApi.updateOrgSamlConfigurations", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Update organization SAML preferences. + * + *

See {@link #updateOrgSamlConfigurationsWithHttpInfo}. + * + * @param body (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> updateOrgSamlConfigurationsWithHttpInfoAsync( + SamlConfigurationsUpdateRequest body) { + // Check if unstable operation is enabled + String operationId = "updateOrgSamlConfigurations"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'body' when calling updateOrgSamlConfigurations")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/org/saml_configurations"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.OrganizationsApi.updateOrgSamlConfigurations", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + null); + } + /** Manage optional parameters to uploadIdPMetadata. */ public static class UploadIdPMetadataOptionalParameters { private File idpFile; diff --git a/src/main/java/com/datadog/api/client/v2/model/MaxSessionDurationUpdateAttributes.java b/src/main/java/com/datadog/api/client/v2/model/MaxSessionDurationUpdateAttributes.java new file mode 100644 index 00000000000..936ab75df16 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/MaxSessionDurationUpdateAttributes.java @@ -0,0 +1,148 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Attributes for updating maximum session duration. */ +@JsonPropertyOrder({MaxSessionDurationUpdateAttributes.JSON_PROPERTY_MAX_SESSION_DURATION}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class MaxSessionDurationUpdateAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_MAX_SESSION_DURATION = "max_session_duration"; + private Long maxSessionDuration; + + public MaxSessionDurationUpdateAttributes() {} + + @JsonCreator + public MaxSessionDurationUpdateAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_MAX_SESSION_DURATION) + Long maxSessionDuration) { + this.maxSessionDuration = maxSessionDuration; + } + + public MaxSessionDurationUpdateAttributes maxSessionDuration(Long maxSessionDuration) { + this.maxSessionDuration = maxSessionDuration; + return this; + } + + /** + * Maximum session duration in seconds. Must not exceed 24 hours (86400 seconds). minimum: 1 + * maximum: 86400 + * + * @return maxSessionDuration + */ + @JsonProperty(JSON_PROPERTY_MAX_SESSION_DURATION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getMaxSessionDuration() { + return maxSessionDuration; + } + + public void setMaxSessionDuration(Long maxSessionDuration) { + this.maxSessionDuration = maxSessionDuration; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return MaxSessionDurationUpdateAttributes + */ + @JsonAnySetter + public MaxSessionDurationUpdateAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this MaxSessionDurationUpdateAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MaxSessionDurationUpdateAttributes maxSessionDurationUpdateAttributes = + (MaxSessionDurationUpdateAttributes) o; + return Objects.equals( + this.maxSessionDuration, maxSessionDurationUpdateAttributes.maxSessionDuration) + && Objects.equals( + this.additionalProperties, maxSessionDurationUpdateAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(maxSessionDuration, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MaxSessionDurationUpdateAttributes {\n"); + sb.append(" maxSessionDuration: ").append(toIndentedString(maxSessionDuration)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/MaxSessionDurationUpdateRequest.java b/src/main/java/com/datadog/api/client/v2/model/MaxSessionDurationUpdateRequest.java new file mode 100644 index 00000000000..0ce19e4e107 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/MaxSessionDurationUpdateRequest.java @@ -0,0 +1,148 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Request to update the maximum session duration. */ +@JsonPropertyOrder({MaxSessionDurationUpdateRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class MaxSessionDurationUpdateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private MaxSessionDurationUpdateRequestData data; + + public MaxSessionDurationUpdateRequest() {} + + @JsonCreator + public MaxSessionDurationUpdateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + MaxSessionDurationUpdateRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public MaxSessionDurationUpdateRequest data(MaxSessionDurationUpdateRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data wrapper for maximum session duration update. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public MaxSessionDurationUpdateRequestData getData() { + return data; + } + + public void setData(MaxSessionDurationUpdateRequestData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return MaxSessionDurationUpdateRequest + */ + @JsonAnySetter + public MaxSessionDurationUpdateRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this MaxSessionDurationUpdateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MaxSessionDurationUpdateRequest maxSessionDurationUpdateRequest = + (MaxSessionDurationUpdateRequest) o; + return Objects.equals(this.data, maxSessionDurationUpdateRequest.data) + && Objects.equals( + this.additionalProperties, maxSessionDurationUpdateRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MaxSessionDurationUpdateRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/MaxSessionDurationUpdateRequestData.java b/src/main/java/com/datadog/api/client/v2/model/MaxSessionDurationUpdateRequestData.java new file mode 100644 index 00000000000..7d6ca89a803 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/MaxSessionDurationUpdateRequestData.java @@ -0,0 +1,185 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data wrapper for maximum session duration update. */ +@JsonPropertyOrder({ + MaxSessionDurationUpdateRequestData.JSON_PROPERTY_ATTRIBUTES, + MaxSessionDurationUpdateRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class MaxSessionDurationUpdateRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private MaxSessionDurationUpdateAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private MaxSessionDurationUpdateRequestDataType type; + + public MaxSessionDurationUpdateRequestData() {} + + @JsonCreator + public MaxSessionDurationUpdateRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + MaxSessionDurationUpdateAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + MaxSessionDurationUpdateRequestDataType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public MaxSessionDurationUpdateRequestData attributes( + MaxSessionDurationUpdateAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes for updating maximum session duration. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public MaxSessionDurationUpdateAttributes getAttributes() { + return attributes; + } + + public void setAttributes(MaxSessionDurationUpdateAttributes attributes) { + this.attributes = attributes; + } + + public MaxSessionDurationUpdateRequestData type(MaxSessionDurationUpdateRequestDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type of the resource. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public MaxSessionDurationUpdateRequestDataType getType() { + return type; + } + + public void setType(MaxSessionDurationUpdateRequestDataType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return MaxSessionDurationUpdateRequestData + */ + @JsonAnySetter + public MaxSessionDurationUpdateRequestData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this MaxSessionDurationUpdateRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MaxSessionDurationUpdateRequestData maxSessionDurationUpdateRequestData = + (MaxSessionDurationUpdateRequestData) o; + return Objects.equals(this.attributes, maxSessionDurationUpdateRequestData.attributes) + && Objects.equals(this.type, maxSessionDurationUpdateRequestData.type) + && Objects.equals( + this.additionalProperties, maxSessionDurationUpdateRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MaxSessionDurationUpdateRequestData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/MaxSessionDurationUpdateRequestDataType.java b/src/main/java/com/datadog/api/client/v2/model/MaxSessionDurationUpdateRequestDataType.java new file mode 100644 index 00000000000..ed0d38f9f5f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/MaxSessionDurationUpdateRequestDataType.java @@ -0,0 +1,63 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Type of the resource. */ +@JsonSerialize( + using = + MaxSessionDurationUpdateRequestDataType.MaxSessionDurationUpdateRequestDataTypeSerializer + .class) +public class MaxSessionDurationUpdateRequestDataType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("max_session_duration")); + + public static final MaxSessionDurationUpdateRequestDataType MAX_SESSION_DURATION = + new MaxSessionDurationUpdateRequestDataType("max_session_duration"); + + MaxSessionDurationUpdateRequestDataType(String value) { + super(value, allowedValues); + } + + public static class MaxSessionDurationUpdateRequestDataTypeSerializer + extends StdSerializer { + public MaxSessionDurationUpdateRequestDataTypeSerializer( + Class t) { + super(t); + } + + public MaxSessionDurationUpdateRequestDataTypeSerializer() { + this(null); + } + + @Override + public void serialize( + MaxSessionDurationUpdateRequestDataType value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static MaxSessionDurationUpdateRequestDataType fromValue(String value) { + return new MaxSessionDurationUpdateRequestDataType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SamlConfigurationsUpdateAttributes.java b/src/main/java/com/datadog/api/client/v2/model/SamlConfigurationsUpdateAttributes.java new file mode 100644 index 00000000000..477703daf3b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SamlConfigurationsUpdateAttributes.java @@ -0,0 +1,191 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.UUID; + +/** Attributes for updating SAML preferences. */ +@JsonPropertyOrder({ + SamlConfigurationsUpdateAttributes.JSON_PROPERTY_DEFAULT_ROLE_UUIDS, + SamlConfigurationsUpdateAttributes.JSON_PROPERTY_JIT_DOMAINS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SamlConfigurationsUpdateAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DEFAULT_ROLE_UUIDS = "default_role_uuids"; + private List defaultRoleUuids = new ArrayList<>(); + + public static final String JSON_PROPERTY_JIT_DOMAINS = "jit_domains"; + private List jitDomains = new ArrayList<>(); + + public SamlConfigurationsUpdateAttributes() {} + + @JsonCreator + public SamlConfigurationsUpdateAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_DEFAULT_ROLE_UUIDS) + List defaultRoleUuids, + @JsonProperty(required = true, value = JSON_PROPERTY_JIT_DOMAINS) List jitDomains) { + this.defaultRoleUuids = defaultRoleUuids; + this.jitDomains = jitDomains; + } + + public SamlConfigurationsUpdateAttributes defaultRoleUuids(List defaultRoleUuids) { + this.defaultRoleUuids = defaultRoleUuids; + return this; + } + + public SamlConfigurationsUpdateAttributes addDefaultRoleUuidsItem(UUID defaultRoleUuidsItem) { + this.defaultRoleUuids.add(defaultRoleUuidsItem); + return this; + } + + /** + * List of role UUIDs to assign to JIT-provisioned users. Exactly 1 role is required. + * + * @return defaultRoleUuids + */ + @JsonProperty(JSON_PROPERTY_DEFAULT_ROLE_UUIDS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getDefaultRoleUuids() { + return defaultRoleUuids; + } + + public void setDefaultRoleUuids(List defaultRoleUuids) { + this.defaultRoleUuids = defaultRoleUuids; + } + + public SamlConfigurationsUpdateAttributes jitDomains(List jitDomains) { + this.jitDomains = jitDomains; + return this; + } + + public SamlConfigurationsUpdateAttributes addJitDomainsItem(String jitDomainsItem) { + this.jitDomains.add(jitDomainsItem); + return this; + } + + /** + * List of domains for Just-In-Time user provisioning. Maximum 50 domains. Each domain must be + * between 1 and 256 characters. + * + * @return jitDomains + */ + @JsonProperty(JSON_PROPERTY_JIT_DOMAINS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getJitDomains() { + return jitDomains; + } + + public void setJitDomains(List jitDomains) { + this.jitDomains = jitDomains; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return SamlConfigurationsUpdateAttributes + */ + @JsonAnySetter + public SamlConfigurationsUpdateAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this SamlConfigurationsUpdateAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SamlConfigurationsUpdateAttributes samlConfigurationsUpdateAttributes = + (SamlConfigurationsUpdateAttributes) o; + return Objects.equals( + this.defaultRoleUuids, samlConfigurationsUpdateAttributes.defaultRoleUuids) + && Objects.equals(this.jitDomains, samlConfigurationsUpdateAttributes.jitDomains) + && Objects.equals( + this.additionalProperties, samlConfigurationsUpdateAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(defaultRoleUuids, jitDomains, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SamlConfigurationsUpdateAttributes {\n"); + sb.append(" defaultRoleUuids: ").append(toIndentedString(defaultRoleUuids)).append("\n"); + sb.append(" jitDomains: ").append(toIndentedString(jitDomains)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SamlConfigurationsUpdateRequest.java b/src/main/java/com/datadog/api/client/v2/model/SamlConfigurationsUpdateRequest.java new file mode 100644 index 00000000000..77e72c6907c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SamlConfigurationsUpdateRequest.java @@ -0,0 +1,148 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Request to update organization SAML preferences. */ +@JsonPropertyOrder({SamlConfigurationsUpdateRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SamlConfigurationsUpdateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private SamlConfigurationsUpdateRequestData data; + + public SamlConfigurationsUpdateRequest() {} + + @JsonCreator + public SamlConfigurationsUpdateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + SamlConfigurationsUpdateRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public SamlConfigurationsUpdateRequest data(SamlConfigurationsUpdateRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data wrapper for SAML preferences update. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SamlConfigurationsUpdateRequestData getData() { + return data; + } + + public void setData(SamlConfigurationsUpdateRequestData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return SamlConfigurationsUpdateRequest + */ + @JsonAnySetter + public SamlConfigurationsUpdateRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this SamlConfigurationsUpdateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SamlConfigurationsUpdateRequest samlConfigurationsUpdateRequest = + (SamlConfigurationsUpdateRequest) o; + return Objects.equals(this.data, samlConfigurationsUpdateRequest.data) + && Objects.equals( + this.additionalProperties, samlConfigurationsUpdateRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SamlConfigurationsUpdateRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SamlConfigurationsUpdateRequestData.java b/src/main/java/com/datadog/api/client/v2/model/SamlConfigurationsUpdateRequestData.java new file mode 100644 index 00000000000..00bb7191ac8 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SamlConfigurationsUpdateRequestData.java @@ -0,0 +1,185 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data wrapper for SAML preferences update. */ +@JsonPropertyOrder({ + SamlConfigurationsUpdateRequestData.JSON_PROPERTY_ATTRIBUTES, + SamlConfigurationsUpdateRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SamlConfigurationsUpdateRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private SamlConfigurationsUpdateAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private SamlConfigurationsUpdateRequestDataType type; + + public SamlConfigurationsUpdateRequestData() {} + + @JsonCreator + public SamlConfigurationsUpdateRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + SamlConfigurationsUpdateAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + SamlConfigurationsUpdateRequestDataType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public SamlConfigurationsUpdateRequestData attributes( + SamlConfigurationsUpdateAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes for updating SAML preferences. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SamlConfigurationsUpdateAttributes getAttributes() { + return attributes; + } + + public void setAttributes(SamlConfigurationsUpdateAttributes attributes) { + this.attributes = attributes; + } + + public SamlConfigurationsUpdateRequestData type(SamlConfigurationsUpdateRequestDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type of the resource. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SamlConfigurationsUpdateRequestDataType getType() { + return type; + } + + public void setType(SamlConfigurationsUpdateRequestDataType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return SamlConfigurationsUpdateRequestData + */ + @JsonAnySetter + public SamlConfigurationsUpdateRequestData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this SamlConfigurationsUpdateRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SamlConfigurationsUpdateRequestData samlConfigurationsUpdateRequestData = + (SamlConfigurationsUpdateRequestData) o; + return Objects.equals(this.attributes, samlConfigurationsUpdateRequestData.attributes) + && Objects.equals(this.type, samlConfigurationsUpdateRequestData.type) + && Objects.equals( + this.additionalProperties, samlConfigurationsUpdateRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SamlConfigurationsUpdateRequestData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SamlConfigurationsUpdateRequestDataType.java b/src/main/java/com/datadog/api/client/v2/model/SamlConfigurationsUpdateRequestDataType.java new file mode 100644 index 00000000000..d592dc96b0d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SamlConfigurationsUpdateRequestDataType.java @@ -0,0 +1,63 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Type of the resource. */ +@JsonSerialize( + using = + SamlConfigurationsUpdateRequestDataType.SamlConfigurationsUpdateRequestDataTypeSerializer + .class) +public class SamlConfigurationsUpdateRequestDataType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("saml_preferences")); + + public static final SamlConfigurationsUpdateRequestDataType SAML_PREFERENCES = + new SamlConfigurationsUpdateRequestDataType("saml_preferences"); + + SamlConfigurationsUpdateRequestDataType(String value) { + super(value, allowedValues); + } + + public static class SamlConfigurationsUpdateRequestDataTypeSerializer + extends StdSerializer { + public SamlConfigurationsUpdateRequestDataTypeSerializer( + Class t) { + super(t); + } + + public SamlConfigurationsUpdateRequestDataTypeSerializer() { + this(null); + } + + @Override + public void serialize( + SamlConfigurationsUpdateRequestDataType value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static SamlConfigurationsUpdateRequestDataType fromValue(String value) { + return new SamlConfigurationsUpdateRequestDataType(value); + } +} diff --git a/src/test/resources/com/datadog/api/client/v2/api/organizations.feature b/src/test/resources/com/datadog/api/client/v2/api/organizations.feature index ddec7484e76..3c8445d660d 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/organizations.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/organizations.feature @@ -65,6 +65,38 @@ Feature: Organizations When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/team-aaa-identity + Scenario: Update maximum session duration returns "Bad Request" response + Given operation "UpdateLoginOrgConfigMaxSessionDuration" enabled + And new "UpdateLoginOrgConfigMaxSessionDuration" request + And body with value {"data": {"attributes": {"max_session_duration": 60}, "type": "max_session_duration"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/team-aaa-identity + Scenario: Update maximum session duration returns "No Content - The maximum session duration was successfully updated." response + Given operation "UpdateLoginOrgConfigMaxSessionDuration" enabled + And new "UpdateLoginOrgConfigMaxSessionDuration" request + And body with value {"data": {"attributes": {"max_session_duration": 60}, "type": "max_session_duration"}} + When the request is sent + Then the response status is 204 No Content - The maximum session duration was successfully updated. + + @generated @skip @team:DataDog/team-aaa-identity + Scenario: Update organization SAML preferences returns "Bad Request" response + Given operation "UpdateOrgSamlConfigurations" enabled + And new "UpdateOrgSamlConfigurations" request + And body with value {"data": {"attributes": {"default_role_uuids": ["19fcc38b-b651-46a0-b463-1f8f56c6a862"], "jit_domains": ["example1.com", "example2.com"]}, "type": "saml_preferences"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/team-aaa-identity + Scenario: Update organization SAML preferences returns "No Content - The SAML preferences were successfully updated." response + Given operation "UpdateOrgSamlConfigurations" enabled + And new "UpdateOrgSamlConfigurations" request + And body with value {"data": {"attributes": {"default_role_uuids": ["19fcc38b-b651-46a0-b463-1f8f56c6a862"], "jit_domains": ["example1.com", "example2.com"]}, "type": "saml_preferences"}} + When the request is sent + Then the response status is 204 No Content - The SAML preferences were successfully updated. + @skip-go @skip-java @skip-python @skip-ruby @skip-rust @skip-terraform-config @skip-typescript @skip-validation @team:DataDog/team-aaa-identity Scenario: Upload IdP metadata returns "Bad Request - caused by either malformed XML or invalid SAML IdP metadata" response Given new "UploadIdPMetadata" request diff --git a/src/test/resources/com/datadog/api/client/v2/api/undo.json b/src/test/resources/com/datadog/api/client/v2/api/undo.json index c0ec7dbe41a..68b7ccfcb38 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/undo.json +++ b/src/test/resources/com/datadog/api/client/v2/api/undo.json @@ -2566,6 +2566,12 @@ "type": "idempotent" } }, + "UpdateLoginOrgConfigMaxSessionDuration": { + "tag": "Organizations", + "undo": { + "type": "idempotent" + } + }, "SubmitLog": { "tag": "Logs", "undo": { @@ -3289,6 +3295,12 @@ "type": "safe" } }, + "UpdateOrgSamlConfigurations": { + "tag": "Organizations", + "undo": { + "type": "idempotent" + } + }, "ListOrgConfigs": { "tag": "Organizations", "undo": {