Skip to content

Commit 8a194ca

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add missing persona_mapping endpoints (#3525)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent a6b4a7c commit 8a194ca

File tree

12 files changed

+1488
-2
lines changed

12 files changed

+1488
-2
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -929,6 +929,14 @@ components:
929929
example: 10
930930
format: int64
931931
type: integer
932+
PersonaMappingID:
933+
description: The ID of the persona mapping
934+
example: c5c758c6-18c2-4484-ae3f-46b84128404a
935+
in: path
936+
name: persona_mapping_id
937+
required: true
938+
schema:
939+
type: string
932940
ProductName:
933941
description: Name of the product to be deleted, either `logs` or `rum`.
934942
in: path
@@ -1910,6 +1918,41 @@ components:
19101918
- account_identifier
19111919
- account_uuid
19121920
type: object
1921+
AWSCloudAuthPersonaMappingCreateAttributes:
1922+
description: Attributes for creating an AWS cloud authentication persona mapping
1923+
properties:
1924+
account_identifier:
1925+
description: Datadog account identifier (email or handle) mapped to the
1926+
AWS principal
1927+
example: test@test.com
1928+
type: string
1929+
arn_pattern:
1930+
description: AWS IAM ARN pattern to match for authentication
1931+
example: arn:aws:iam::123456789012:user/testuser
1932+
type: string
1933+
required:
1934+
- arn_pattern
1935+
- account_identifier
1936+
type: object
1937+
AWSCloudAuthPersonaMappingCreateData:
1938+
description: Data for creating an AWS cloud authentication persona mapping
1939+
properties:
1940+
attributes:
1941+
$ref: '#/components/schemas/AWSCloudAuthPersonaMappingCreateAttributes'
1942+
type:
1943+
$ref: '#/components/schemas/AWSCloudAuthPersonaMappingType'
1944+
required:
1945+
- type
1946+
- attributes
1947+
type: object
1948+
AWSCloudAuthPersonaMappingCreateRequest:
1949+
description: Request used to create an AWS cloud authentication persona mapping
1950+
properties:
1951+
data:
1952+
$ref: '#/components/schemas/AWSCloudAuthPersonaMappingCreateData'
1953+
required:
1954+
- data
1955+
type: object
19131956
AWSCloudAuthPersonaMappingDataResponse:
19141957
description: Data for AWS cloud authentication persona mapping response
19151958
properties:
@@ -1926,6 +1969,14 @@ components:
19261969
- type
19271970
- attributes
19281971
type: object
1972+
AWSCloudAuthPersonaMappingResponse:
1973+
description: Response containing a single AWS cloud authentication persona mapping
1974+
properties:
1975+
data:
1976+
$ref: '#/components/schemas/AWSCloudAuthPersonaMappingDataResponse'
1977+
required:
1978+
- data
1979+
type: object
19291980
AWSCloudAuthPersonaMappingType:
19301981
description: Type identifier for AWS cloud authentication persona mapping
19311982
enum:
@@ -77100,6 +77151,114 @@ paths:
7710077151
x-unstable: '**Note**: This endpoint is in public beta and is subject to change.
7710177152

7710277153
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
77154+
post:
77155+
description: Create an AWS cloud authentication persona mapping. This endpoint
77156+
associates an AWS IAM principal with a Datadog user.
77157+
operationId: CreateAWSCloudAuthPersonaMapping
77158+
requestBody:
77159+
content:
77160+
application/json:
77161+
schema:
77162+
$ref: '#/components/schemas/AWSCloudAuthPersonaMappingCreateRequest'
77163+
required: true
77164+
responses:
77165+
'201':
77166+
content:
77167+
application/json:
77168+
schema:
77169+
$ref: '#/components/schemas/AWSCloudAuthPersonaMappingResponse'
77170+
description: Created
77171+
'400':
77172+
content:
77173+
application/json:
77174+
schema:
77175+
$ref: '#/components/schemas/JSONAPIErrorResponse'
77176+
description: Bad Request
77177+
'403':
77178+
content:
77179+
application/json:
77180+
schema:
77181+
$ref: '#/components/schemas/JSONAPIErrorResponse'
77182+
description: Forbidden
77183+
'409':
77184+
content:
77185+
application/json:
77186+
schema:
77187+
$ref: '#/components/schemas/JSONAPIErrorResponse'
77188+
description: Conflict
77189+
'429':
77190+
$ref: '#/components/responses/TooManyRequestsResponse'
77191+
summary: Create an AWS cloud authentication persona mapping
77192+
tags:
77193+
- Cloud Authentication
77194+
x-codegen-request-body-name: body
77195+
x-unstable: '**Note**: This endpoint is in public beta and is subject to change.
77196+
77197+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
77198+
/api/v2/cloud_auth/aws/persona_mapping/{persona_mapping_id}:
77199+
delete:
77200+
description: Delete an AWS cloud authentication persona mapping by ID. This
77201+
removes the association between an AWS IAM principal and a Datadog user.
77202+
operationId: DeleteAWSCloudAuthPersonaMapping
77203+
parameters:
77204+
- $ref: '#/components/parameters/PersonaMappingID'
77205+
responses:
77206+
'204':
77207+
description: No Content
77208+
'403':
77209+
content:
77210+
application/json:
77211+
schema:
77212+
$ref: '#/components/schemas/JSONAPIErrorResponse'
77213+
description: Forbidden
77214+
'404':
77215+
content:
77216+
application/json:
77217+
schema:
77218+
$ref: '#/components/schemas/JSONAPIErrorResponse'
77219+
description: Not Found
77220+
'429':
77221+
$ref: '#/components/responses/TooManyRequestsResponse'
77222+
summary: Delete an AWS cloud authentication persona mapping
77223+
tags:
77224+
- Cloud Authentication
77225+
x-unstable: '**Note**: This endpoint is in public beta and is subject to change.
77226+
77227+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
77228+
get:
77229+
description: Get a specific AWS cloud authentication persona mapping by ID.
77230+
This endpoint retrieves a single configured persona mapping that associates
77231+
an AWS IAM principal with a Datadog user.
77232+
operationId: GetAWSCloudAuthPersonaMapping
77233+
parameters:
77234+
- $ref: '#/components/parameters/PersonaMappingID'
77235+
responses:
77236+
'200':
77237+
content:
77238+
application/json:
77239+
schema:
77240+
$ref: '#/components/schemas/AWSCloudAuthPersonaMappingResponse'
77241+
description: OK
77242+
'403':
77243+
content:
77244+
application/json:
77245+
schema:
77246+
$ref: '#/components/schemas/JSONAPIErrorResponse'
77247+
description: Forbidden
77248+
'404':
77249+
content:
77250+
application/json:
77251+
schema:
77252+
$ref: '#/components/schemas/JSONAPIErrorResponse'
77253+
description: Not Found
77254+
'429':
77255+
$ref: '#/components/responses/TooManyRequestsResponse'
77256+
summary: Get an AWS cloud authentication persona mapping
77257+
tags:
77258+
- Cloud Authentication
77259+
x-unstable: '**Note**: This endpoint is in public beta and is subject to change.
77260+
77261+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
7710377262
/api/v2/cloud_security_management/custom_frameworks:
7710477263
post:
7710577264
description: Create a custom framework.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// Create an AWS cloud authentication persona mapping returns "Created" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.CloudAuthenticationApi;
6+
import com.datadog.api.client.v2.model.AWSCloudAuthPersonaMappingCreateAttributes;
7+
import com.datadog.api.client.v2.model.AWSCloudAuthPersonaMappingCreateData;
8+
import com.datadog.api.client.v2.model.AWSCloudAuthPersonaMappingCreateRequest;
9+
import com.datadog.api.client.v2.model.AWSCloudAuthPersonaMappingResponse;
10+
import com.datadog.api.client.v2.model.AWSCloudAuthPersonaMappingType;
11+
12+
public class Example {
13+
public static void main(String[] args) {
14+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
15+
defaultClient.setUnstableOperationEnabled("v2.createAWSCloudAuthPersonaMapping", true);
16+
CloudAuthenticationApi apiInstance = new CloudAuthenticationApi(defaultClient);
17+
18+
AWSCloudAuthPersonaMappingCreateRequest body =
19+
new AWSCloudAuthPersonaMappingCreateRequest()
20+
.data(
21+
new AWSCloudAuthPersonaMappingCreateData()
22+
.attributes(
23+
new AWSCloudAuthPersonaMappingCreateAttributes()
24+
.accountIdentifier("test@test.com")
25+
.arnPattern("arn:aws:iam::123456789012:user/testuser"))
26+
.type(AWSCloudAuthPersonaMappingType.AWS_CLOUD_AUTH_CONFIG));
27+
28+
try {
29+
AWSCloudAuthPersonaMappingResponse result =
30+
apiInstance.createAWSCloudAuthPersonaMapping(body);
31+
System.out.println(result);
32+
} catch (ApiException e) {
33+
System.err.println(
34+
"Exception when calling CloudAuthenticationApi#createAWSCloudAuthPersonaMapping");
35+
System.err.println("Status code: " + e.getCode());
36+
System.err.println("Reason: " + e.getResponseBody());
37+
System.err.println("Response headers: " + e.getResponseHeaders());
38+
e.printStackTrace();
39+
}
40+
}
41+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Delete an AWS cloud authentication persona mapping returns "No Content" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.CloudAuthenticationApi;
6+
7+
public class Example {
8+
public static void main(String[] args) {
9+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
10+
defaultClient.setUnstableOperationEnabled("v2.deleteAWSCloudAuthPersonaMapping", true);
11+
CloudAuthenticationApi apiInstance = new CloudAuthenticationApi(defaultClient);
12+
13+
try {
14+
apiInstance.deleteAWSCloudAuthPersonaMapping("c5c758c6-18c2-4484-ae3f-46b84128404a");
15+
} catch (ApiException e) {
16+
System.err.println(
17+
"Exception when calling CloudAuthenticationApi#deleteAWSCloudAuthPersonaMapping");
18+
System.err.println("Status code: " + e.getCode());
19+
System.err.println("Reason: " + e.getResponseBody());
20+
System.err.println("Response headers: " + e.getResponseHeaders());
21+
e.printStackTrace();
22+
}
23+
}
24+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// Get an AWS cloud authentication persona mapping returns "OK" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.CloudAuthenticationApi;
6+
import com.datadog.api.client.v2.model.AWSCloudAuthPersonaMappingResponse;
7+
8+
public class Example {
9+
public static void main(String[] args) {
10+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
11+
defaultClient.setUnstableOperationEnabled("v2.getAWSCloudAuthPersonaMapping", true);
12+
CloudAuthenticationApi apiInstance = new CloudAuthenticationApi(defaultClient);
13+
14+
try {
15+
AWSCloudAuthPersonaMappingResponse result =
16+
apiInstance.getAWSCloudAuthPersonaMapping("c5c758c6-18c2-4484-ae3f-46b84128404a");
17+
System.out.println(result);
18+
} catch (ApiException e) {
19+
System.err.println(
20+
"Exception when calling CloudAuthenticationApi#getAWSCloudAuthPersonaMapping");
21+
System.err.println("Status code: " + e.getCode());
22+
System.err.println("Reason: " + e.getResponseBody());
23+
System.err.println("Response headers: " + e.getResponseHeaders());
24+
e.printStackTrace();
25+
}
26+
}
27+
}

src/main/java/com/datadog/api/client/ApiClient.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -788,6 +788,9 @@ public class ApiClient {
788788
put("v2.getChangeRequest", false);
789789
put("v2.updateChangeRequest", false);
790790
put("v2.updateChangeRequestDecision", false);
791+
put("v2.createAWSCloudAuthPersonaMapping", false);
792+
put("v2.deleteAWSCloudAuthPersonaMapping", false);
793+
put("v2.getAWSCloudAuthPersonaMapping", false);
791794
put("v2.listAWSCloudAuthPersonaMappings", false);
792795
put("v2.activateContentPack", false);
793796
put("v2.cancelThreatHuntingJob", false);

0 commit comments

Comments
 (0)