diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index ed984a56d0e..8fb6d884937 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -60208,6 +60208,41 @@ components: $ref: "#/components/schemas/MaxSessionDurationUpdateData" required: [data] type: object + McpCrossAppAccessIssuerUrlType: + description: Data type of an MCP Cross-App Access issuer URL update. + enum: [org_config] + example: org_config + type: string + x-enum-varnames: + - ORG_CONFIG + McpCrossAppAccessIssuerUrlUpdateAttributes: + description: Attributes for the MCP Cross-App Access issuer URL update request. + properties: + issuer_url: + description: |- + The Okta OIDC issuer URL for MCP Cross-App Access, for example + `https://your-subdomain.okta.com`. Provide an empty string to unset + the issuer URL and opt the organization out of MCP Cross-App Access. + example: https://your-subdomain.okta.com + type: string + required: [issuer_url] + type: object + McpCrossAppAccessIssuerUrlUpdateData: + description: The data object for an MCP Cross-App Access issuer URL update request. + properties: + attributes: + $ref: "#/components/schemas/McpCrossAppAccessIssuerUrlUpdateAttributes" + type: + $ref: "#/components/schemas/McpCrossAppAccessIssuerUrlType" + required: [type, attributes] + type: object + McpCrossAppAccessIssuerUrlUpdateRequest: + description: A request to update the MCP Cross-App Access issuer URL for an organization. + properties: + data: + $ref: "#/components/schemas/McpCrossAppAccessIssuerUrlUpdateData" + required: [data] + type: object McpScanRequest: description: The top-level request object for submitting an MCP SCA dependency scan. properties: @@ -154159,6 +154194,52 @@ paths: operator: OR permissions: - org_management + /api/v2/login/org_configs/mcp_cross_app_access_issuer_url: + put: + description: |- + Update the Okta OIDC issuer URL used for MCP Cross-App Access (XAA) + for the current organization. The URL must be a bare Okta issuer such + as `https://your-subdomain.okta.com` (no path, port, query, or fragment). + Provide an empty string to unset the issuer URL and opt the organization + out of MCP Cross-App Access. + operationId: UpdateLoginOrgConfigsMcpCrossAppAccessIssuerUrl + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + issuer_url: https://your-subdomain.okta.com + type: org_config + schema: + $ref: "#/components/schemas/McpCrossAppAccessIssuerUrlUpdateRequest" + 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 MCP Cross-App Access issuer URL + tags: [Organizations] + "x-permission": + operator: OR + permissions: + - org_management + x-unstable: |- + **Note**: This endpoint is in Preview and may change in the future. It is not yet recommended for production use. /api/v2/logs: post: description: |- diff --git a/examples/v2/organizations/UpdateLoginOrgConfigsMcpCrossAppAccessIssuerUrl.java b/examples/v2/organizations/UpdateLoginOrgConfigsMcpCrossAppAccessIssuerUrl.java new file mode 100644 index 00000000000..80c1989a698 --- /dev/null +++ b/examples/v2/organizations/UpdateLoginOrgConfigsMcpCrossAppAccessIssuerUrl.java @@ -0,0 +1,39 @@ +// Update the MCP Cross-App Access issuer URL returns "No Content" 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.McpCrossAppAccessIssuerUrlType; +import com.datadog.api.client.v2.model.McpCrossAppAccessIssuerUrlUpdateAttributes; +import com.datadog.api.client.v2.model.McpCrossAppAccessIssuerUrlUpdateData; +import com.datadog.api.client.v2.model.McpCrossAppAccessIssuerUrlUpdateRequest; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled( + "v2.updateLoginOrgConfigsMcpCrossAppAccessIssuerUrl", true); + OrganizationsApi apiInstance = new OrganizationsApi(defaultClient); + + McpCrossAppAccessIssuerUrlUpdateRequest body = + new McpCrossAppAccessIssuerUrlUpdateRequest() + .data( + new McpCrossAppAccessIssuerUrlUpdateData() + .attributes( + new McpCrossAppAccessIssuerUrlUpdateAttributes() + .issuerUrl("https://your-subdomain.okta.com")) + .type(McpCrossAppAccessIssuerUrlType.ORG_CONFIG)); + + try { + apiInstance.updateLoginOrgConfigsMcpCrossAppAccessIssuerUrl(body); + } catch (ApiException e) { + System.err.println( + "Exception when calling" + + " OrganizationsApi#updateLoginOrgConfigsMcpCrossAppAccessIssuerUrl"); + 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 dacb988dec6..88da720020e 100644 --- a/src/main/java/com/datadog/api/client/ApiClient.java +++ b/src/main/java/com/datadog/api/client/ApiClient.java @@ -1064,6 +1064,7 @@ public class ApiClient { put("v2.updateForm", false); put("v2.upsertAndPublishFormVersion", false); put("v2.upsertFormVersion", false); + put("v2.updateLoginOrgConfigsMcpCrossAppAccessIssuerUrl", false); put("v2.updateOrgSamlConfigurations", false); put("v2.getGovernanceControl", false); put("v2.listGovernanceControls", 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 643797a8454..34c18b3c9a2 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 @@ -9,6 +9,7 @@ import com.datadog.api.client.v2.model.GlobalOrgsResponse; import com.datadog.api.client.v2.model.ManagedOrgsResponse; import com.datadog.api.client.v2.model.MaxSessionDurationUpdateRequest; +import com.datadog.api.client.v2.model.McpCrossAppAccessIssuerUrlUpdateRequest; import com.datadog.api.client.v2.model.OrgConfigGetResponse; import com.datadog.api.client.v2.model.OrgConfigListResponse; import com.datadog.api.client.v2.model.OrgConfigWriteRequest; @@ -1137,6 +1138,164 @@ public ApiResponse updateLoginOrgConfigsMaxSessionDurationWithHttpInfo( null); } + /** + * Update the MCP Cross-App Access issuer URL. + * + *

See {@link #updateLoginOrgConfigsMcpCrossAppAccessIssuerUrlWithHttpInfo}. + * + * @param body (required) + * @throws ApiException if fails to make API call + */ + public void updateLoginOrgConfigsMcpCrossAppAccessIssuerUrl( + McpCrossAppAccessIssuerUrlUpdateRequest body) throws ApiException { + updateLoginOrgConfigsMcpCrossAppAccessIssuerUrlWithHttpInfo(body); + } + + /** + * Update the MCP Cross-App Access issuer URL. + * + *

See {@link #updateLoginOrgConfigsMcpCrossAppAccessIssuerUrlWithHttpInfoAsync}. + * + * @param body (required) + * @return CompletableFuture + */ + public CompletableFuture updateLoginOrgConfigsMcpCrossAppAccessIssuerUrlAsync( + McpCrossAppAccessIssuerUrlUpdateRequest body) { + return updateLoginOrgConfigsMcpCrossAppAccessIssuerUrlWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Update the Okta OIDC issuer URL used for MCP Cross-App Access (XAA) for the current + * organization. The URL must be a bare Okta issuer such as https://your-subdomain.okta.com + * (no path, port, query, or fragment). Provide an empty string to unset the issuer URL + * and opt the organization out of MCP Cross-App Access. + * + * @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 -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
429 Too many requests -
+ */ + public ApiResponse updateLoginOrgConfigsMcpCrossAppAccessIssuerUrlWithHttpInfo( + McpCrossAppAccessIssuerUrlUpdateRequest body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "updateLoginOrgConfigsMcpCrossAppAccessIssuerUrl"; + 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" + + " updateLoginOrgConfigsMcpCrossAppAccessIssuerUrl"); + } + // create path and map variables + String localVarPath = "/api/v2/login/org_configs/mcp_cross_app_access_issuer_url"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.OrganizationsApi.updateLoginOrgConfigsMcpCrossAppAccessIssuerUrl", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "PUT", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Update the MCP Cross-App Access issuer URL. + * + *

See {@link #updateLoginOrgConfigsMcpCrossAppAccessIssuerUrlWithHttpInfo}. + * + * @param body (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> + updateLoginOrgConfigsMcpCrossAppAccessIssuerUrlWithHttpInfoAsync( + McpCrossAppAccessIssuerUrlUpdateRequest body) { + // Check if unstable operation is enabled + String operationId = "updateLoginOrgConfigsMcpCrossAppAccessIssuerUrl"; + 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" + + " updateLoginOrgConfigsMcpCrossAppAccessIssuerUrl")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/login/org_configs/mcp_cross_app_access_issuer_url"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.OrganizationsApi.updateLoginOrgConfigsMcpCrossAppAccessIssuerUrl", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } 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. * diff --git a/src/main/java/com/datadog/api/client/v2/model/McpCrossAppAccessIssuerUrlType.java b/src/main/java/com/datadog/api/client/v2/model/McpCrossAppAccessIssuerUrlType.java new file mode 100644 index 00000000000..871f050500d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/McpCrossAppAccessIssuerUrlType.java @@ -0,0 +1,57 @@ +/* + * 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; + +/** Data type of an MCP Cross-App Access issuer URL update. */ +@JsonSerialize( + using = McpCrossAppAccessIssuerUrlType.McpCrossAppAccessIssuerUrlTypeSerializer.class) +public class McpCrossAppAccessIssuerUrlType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("org_config")); + + public static final McpCrossAppAccessIssuerUrlType ORG_CONFIG = + new McpCrossAppAccessIssuerUrlType("org_config"); + + McpCrossAppAccessIssuerUrlType(String value) { + super(value, allowedValues); + } + + public static class McpCrossAppAccessIssuerUrlTypeSerializer + extends StdSerializer { + public McpCrossAppAccessIssuerUrlTypeSerializer(Class t) { + super(t); + } + + public McpCrossAppAccessIssuerUrlTypeSerializer() { + this(null); + } + + @Override + public void serialize( + McpCrossAppAccessIssuerUrlType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static McpCrossAppAccessIssuerUrlType fromValue(String value) { + return new McpCrossAppAccessIssuerUrlType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/McpCrossAppAccessIssuerUrlUpdateAttributes.java b/src/main/java/com/datadog/api/client/v2/model/McpCrossAppAccessIssuerUrlUpdateAttributes.java new file mode 100644 index 00000000000..d43eb20fbd9 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/McpCrossAppAccessIssuerUrlUpdateAttributes.java @@ -0,0 +1,149 @@ +/* + * 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 the MCP Cross-App Access issuer URL update request. */ +@JsonPropertyOrder({McpCrossAppAccessIssuerUrlUpdateAttributes.JSON_PROPERTY_ISSUER_URL}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class McpCrossAppAccessIssuerUrlUpdateAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ISSUER_URL = "issuer_url"; + private String issuerUrl; + + public McpCrossAppAccessIssuerUrlUpdateAttributes() {} + + @JsonCreator + public McpCrossAppAccessIssuerUrlUpdateAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_ISSUER_URL) String issuerUrl) { + this.issuerUrl = issuerUrl; + } + + public McpCrossAppAccessIssuerUrlUpdateAttributes issuerUrl(String issuerUrl) { + this.issuerUrl = issuerUrl; + return this; + } + + /** + * The Okta OIDC issuer URL for MCP Cross-App Access, for example + * https://your-subdomain.okta.com. Provide an empty string to unset the issuer URL and opt + * the organization out of MCP Cross-App Access. + * + * @return issuerUrl + */ + @JsonProperty(JSON_PROPERTY_ISSUER_URL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getIssuerUrl() { + return issuerUrl; + } + + public void setIssuerUrl(String issuerUrl) { + this.issuerUrl = issuerUrl; + } + + /** + * 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 McpCrossAppAccessIssuerUrlUpdateAttributes + */ + @JsonAnySetter + public McpCrossAppAccessIssuerUrlUpdateAttributes 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 McpCrossAppAccessIssuerUrlUpdateAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + McpCrossAppAccessIssuerUrlUpdateAttributes mcpCrossAppAccessIssuerUrlUpdateAttributes = + (McpCrossAppAccessIssuerUrlUpdateAttributes) o; + return Objects.equals(this.issuerUrl, mcpCrossAppAccessIssuerUrlUpdateAttributes.issuerUrl) + && Objects.equals( + this.additionalProperties, + mcpCrossAppAccessIssuerUrlUpdateAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(issuerUrl, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class McpCrossAppAccessIssuerUrlUpdateAttributes {\n"); + sb.append(" issuerUrl: ").append(toIndentedString(issuerUrl)).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/McpCrossAppAccessIssuerUrlUpdateData.java b/src/main/java/com/datadog/api/client/v2/model/McpCrossAppAccessIssuerUrlUpdateData.java new file mode 100644 index 00000000000..4bd639b47d6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/McpCrossAppAccessIssuerUrlUpdateData.java @@ -0,0 +1,188 @@ +/* + * 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; + +/** The data object for an MCP Cross-App Access issuer URL update request. */ +@JsonPropertyOrder({ + McpCrossAppAccessIssuerUrlUpdateData.JSON_PROPERTY_ATTRIBUTES, + McpCrossAppAccessIssuerUrlUpdateData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class McpCrossAppAccessIssuerUrlUpdateData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private McpCrossAppAccessIssuerUrlUpdateAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private McpCrossAppAccessIssuerUrlType type; + + public McpCrossAppAccessIssuerUrlUpdateData() {} + + @JsonCreator + public McpCrossAppAccessIssuerUrlUpdateData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + McpCrossAppAccessIssuerUrlUpdateAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + McpCrossAppAccessIssuerUrlType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public McpCrossAppAccessIssuerUrlUpdateData attributes( + McpCrossAppAccessIssuerUrlUpdateAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes for the MCP Cross-App Access issuer URL update request. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public McpCrossAppAccessIssuerUrlUpdateAttributes getAttributes() { + return attributes; + } + + public void setAttributes(McpCrossAppAccessIssuerUrlUpdateAttributes attributes) { + this.attributes = attributes; + if (attributes != null) { + this.unparsed |= attributes.unparsed; + } + } + + public McpCrossAppAccessIssuerUrlUpdateData type(McpCrossAppAccessIssuerUrlType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Data type of an MCP Cross-App Access issuer URL update. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public McpCrossAppAccessIssuerUrlType getType() { + return type; + } + + public void setType(McpCrossAppAccessIssuerUrlType 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 McpCrossAppAccessIssuerUrlUpdateData + */ + @JsonAnySetter + public McpCrossAppAccessIssuerUrlUpdateData 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 McpCrossAppAccessIssuerUrlUpdateData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + McpCrossAppAccessIssuerUrlUpdateData mcpCrossAppAccessIssuerUrlUpdateData = + (McpCrossAppAccessIssuerUrlUpdateData) o; + return Objects.equals(this.attributes, mcpCrossAppAccessIssuerUrlUpdateData.attributes) + && Objects.equals(this.type, mcpCrossAppAccessIssuerUrlUpdateData.type) + && Objects.equals( + this.additionalProperties, mcpCrossAppAccessIssuerUrlUpdateData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class McpCrossAppAccessIssuerUrlUpdateData {\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/McpCrossAppAccessIssuerUrlUpdateRequest.java b/src/main/java/com/datadog/api/client/v2/model/McpCrossAppAccessIssuerUrlUpdateRequest.java new file mode 100644 index 00000000000..08c69caf9ac --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/McpCrossAppAccessIssuerUrlUpdateRequest.java @@ -0,0 +1,152 @@ +/* + * 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; + +/** A request to update the MCP Cross-App Access issuer URL for an organization. */ +@JsonPropertyOrder({McpCrossAppAccessIssuerUrlUpdateRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class McpCrossAppAccessIssuerUrlUpdateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private McpCrossAppAccessIssuerUrlUpdateData data; + + public McpCrossAppAccessIssuerUrlUpdateRequest() {} + + @JsonCreator + public McpCrossAppAccessIssuerUrlUpdateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + McpCrossAppAccessIssuerUrlUpdateData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public McpCrossAppAccessIssuerUrlUpdateRequest data(McpCrossAppAccessIssuerUrlUpdateData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * The data object for an MCP Cross-App Access issuer URL update request. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public McpCrossAppAccessIssuerUrlUpdateData getData() { + return data; + } + + public void setData(McpCrossAppAccessIssuerUrlUpdateData data) { + this.data = data; + if (data != null) { + this.unparsed |= data.unparsed; + } + } + + /** + * 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 McpCrossAppAccessIssuerUrlUpdateRequest + */ + @JsonAnySetter + public McpCrossAppAccessIssuerUrlUpdateRequest 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 McpCrossAppAccessIssuerUrlUpdateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + McpCrossAppAccessIssuerUrlUpdateRequest mcpCrossAppAccessIssuerUrlUpdateRequest = + (McpCrossAppAccessIssuerUrlUpdateRequest) o; + return Objects.equals(this.data, mcpCrossAppAccessIssuerUrlUpdateRequest.data) + && Objects.equals( + this.additionalProperties, + mcpCrossAppAccessIssuerUrlUpdateRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class McpCrossAppAccessIssuerUrlUpdateRequest {\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/test/resources/com/datadog/api/client/v2/api/organizations.feature b/src/test/resources/com/datadog/api/client/v2/api/organizations.feature index a8ed63ab7e6..844e415f7f4 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 @@ -168,6 +168,22 @@ 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 MCP Cross-App Access issuer URL returns "Bad Request" response + Given operation "UpdateLoginOrgConfigsMcpCrossAppAccessIssuerUrl" enabled + And new "UpdateLoginOrgConfigsMcpCrossAppAccessIssuerUrl" request + And body with value {"data": {"attributes": {"issuer_url": "https://your-subdomain.okta.com"}, "type": "org_config"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: Update the MCP Cross-App Access issuer URL returns "No Content" response + Given operation "UpdateLoginOrgConfigsMcpCrossAppAccessIssuerUrl" enabled + And new "UpdateLoginOrgConfigsMcpCrossAppAccessIssuerUrl" request + And body with value {"data": {"attributes": {"issuer_url": "https://your-subdomain.okta.com"}, "type": "org_config"}} + When the request is sent + Then the response status is 204 No Content + @generated @skip @team:DataDog/delegated-auth-login Scenario: Update the maximum session duration returns "Bad Request" response Given new "UpdateLoginOrgConfigsMaxSessionDuration" 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 f7316aecda2..ea34cd761d4 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 @@ -4768,6 +4768,12 @@ "type": "idempotent" } }, + "UpdateLoginOrgConfigsMcpCrossAppAccessIssuerUrl": { + "tag": "Organizations", + "undo": { + "type": "idempotent" + } + }, "SubmitLog": { "tag": "Logs", "undo": {