Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43428,7 +43428,7 @@ paths:
operator: OR
permissions:
- user_access_invite
"/api/v1/user/{user_handle}":
/api/v1/user/{user_handle}:
delete:
description: |-
Delete a user from an organization.
Expand Down
200 changes: 157 additions & 43 deletions .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/main/java/com/datadog/api/client/ApiClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -1102,6 +1102,7 @@ public class ApiClient {
put("v2.validateExistingMonitorUserTemplate", false);
put("v2.validateMonitorUserTemplate", false);
put("v2.deleteScopesRestriction", false);
put("v2.getOAuth2WellKnownSites", false);
put("v2.getScopesRestriction", false);
put("v2.registerOAuthClient", false);
put("v2.upsertScopesRestriction", false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
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.OAuth2WellKnownSitesResponse;
import com.datadog.api.client.v2.model.OAuthClientRegistrationRequest;
import com.datadog.api.client.v2.model.OAuthClientRegistrationResponse;
import com.datadog.api.client.v2.model.OAuthScopesRestrictionResponse;
Expand Down Expand Up @@ -201,6 +202,136 @@ public CompletableFuture<ApiResponse<Void>> deleteScopesRestrictionWithHttpInfoA
null);
}

/**
* Get OAuth2 well-known sites.
*
* <p>See {@link #getOAuth2WellKnownSitesWithHttpInfo}.
*
* @return OAuth2WellKnownSitesResponse
* @throws ApiException if fails to make API call
*/
public OAuth2WellKnownSitesResponse getOAuth2WellKnownSites() throws ApiException {
return getOAuth2WellKnownSitesWithHttpInfo().getData();
}

/**
* Get OAuth2 well-known sites.
*
* <p>See {@link #getOAuth2WellKnownSitesWithHttpInfoAsync}.
*
* @return CompletableFuture&lt;OAuth2WellKnownSitesResponse&gt;
*/
public CompletableFuture<OAuth2WellKnownSitesResponse> getOAuth2WellKnownSitesAsync() {
return getOAuth2WellKnownSitesWithHttpInfoAsync()
.thenApply(
response -> {
return response.getData();
});
}

/**
* Retrieve the list of public OAuth2 sites available for the current environment. This endpoint
* is used for OAuth2 discovery and returns sites where users can authenticate.
*
* @return ApiResponse&lt;OAuth2WellKnownSitesResponse&gt;
* @throws ApiException if fails to make API call
* @http.response.details
* <table border="1">
* <caption>Response details</caption>
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
* <tr><td> 200 </td><td> OK </td><td> - </td></tr>
* <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr>
* </table>
*/
public ApiResponse<OAuth2WellKnownSitesResponse> getOAuth2WellKnownSitesWithHttpInfo()
throws ApiException {
// Check if unstable operation is enabled
String operationId = "getOAuth2WellKnownSites";
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 = null;
// create path and map variables
String localVarPath = "/api/v2/oauth2/.well-known/sites";

Map<String, String> localVarHeaderParams = new HashMap<String, String>();

Invocation.Builder builder =
apiClient.createBuilder(
"v2.OAuth2ClientPublicApi.getOAuth2WellKnownSites",
localVarPath,
new ArrayList<Pair>(),
localVarHeaderParams,
new HashMap<String, String>(),
new String[] {"application/json"},
new String[] {});
return apiClient.invokeAPI(
"GET",
builder,
localVarHeaderParams,
new String[] {},
localVarPostBody,
new HashMap<String, Object>(),
false,
new GenericType<OAuth2WellKnownSitesResponse>() {});
}

/**
* Get OAuth2 well-known sites.
*
* <p>See {@link #getOAuth2WellKnownSitesWithHttpInfo}.
*
* @return CompletableFuture&lt;ApiResponse&lt;OAuth2WellKnownSitesResponse&gt;&gt;
*/
public CompletableFuture<ApiResponse<OAuth2WellKnownSitesResponse>>
getOAuth2WellKnownSitesWithHttpInfoAsync() {
// Check if unstable operation is enabled
String operationId = "getOAuth2WellKnownSites";
if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
} else {
CompletableFuture<ApiResponse<OAuth2WellKnownSitesResponse>> result =
new CompletableFuture<>();
result.completeExceptionally(
new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)));
return result;
}
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/api/v2/oauth2/.well-known/sites";

Map<String, String> localVarHeaderParams = new HashMap<String, String>();

Invocation.Builder builder;
try {
builder =
apiClient.createBuilder(
"v2.OAuth2ClientPublicApi.getOAuth2WellKnownSites",
localVarPath,
new ArrayList<Pair>(),
localVarHeaderParams,
new HashMap<String, String>(),
new String[] {"application/json"},
new String[] {});
} catch (ApiException ex) {
CompletableFuture<ApiResponse<OAuth2WellKnownSitesResponse>> result =
new CompletableFuture<>();
result.completeExceptionally(ex);
return result;
}
return apiClient.invokeAPIAsync(
"GET",
builder,
localVarHeaderParams,
new String[] {},
localVarPostBody,
new HashMap<String, Object>(),
false,
new GenericType<OAuth2WellKnownSitesResponse>() {});
}

/**
* Get an OAuth2 client scopes restriction.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -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.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;

/** Attributes containing the list of public OAuth2 sites. */
@JsonPropertyOrder({OAuth2WellKnownSitesAttributes.JSON_PROPERTY_SITES})
@jakarta.annotation.Generated(
value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
public class OAuth2WellKnownSitesAttributes {
@JsonIgnore public boolean unparsed = false;
public static final String JSON_PROPERTY_SITES = "sites";
private List<String> sites = new ArrayList<>();

public OAuth2WellKnownSitesAttributes() {}

@JsonCreator
public OAuth2WellKnownSitesAttributes(
@JsonProperty(required = true, value = JSON_PROPERTY_SITES) List<String> sites) {
this.sites = sites;
}

public OAuth2WellKnownSitesAttributes sites(List<String> sites) {
this.sites = sites;
return this;
}

public OAuth2WellKnownSitesAttributes addSitesItem(String sitesItem) {
this.sites.add(sitesItem);
return this;
}

/**
* Array of public OAuth2 site URLs for the environment.
*
* @return sites
*/
@JsonProperty(JSON_PROPERTY_SITES)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public List<String> getSites() {
return sites;
}

public void setSites(List<String> sites) {
this.sites = sites;
}

/**
* 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<String, Object> 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 OAuth2WellKnownSitesAttributes
*/
@JsonAnySetter
public OAuth2WellKnownSitesAttributes putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
this.additionalProperties = new HashMap<String, Object>();
}
this.additionalProperties.put(key, value);
return this;
}

/**
* Return the additional (undeclared) property.
*
* @return The additional properties
*/
@JsonAnyGetter
public Map<String, Object> 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 OAuth2WellKnownSitesAttributes object is equal to o. */
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
OAuth2WellKnownSitesAttributes oAuth2WellKnownSitesAttributes =
(OAuth2WellKnownSitesAttributes) o;
return Objects.equals(this.sites, oAuth2WellKnownSitesAttributes.sites)
&& Objects.equals(
this.additionalProperties, oAuth2WellKnownSitesAttributes.additionalProperties);
}

@Override
public int hashCode() {
return Objects.hash(sites, additionalProperties);
}

@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class OAuth2WellKnownSitesAttributes {\n");
sb.append(" sites: ").append(toIndentedString(sites)).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 ");
}
}
Loading
Loading