Skip to content

Commit 9c8d16e

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit defc5f5 of spec repo
1 parent a40f0d3 commit 9c8d16e

12 files changed

+783
-0
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1834,6 +1834,65 @@ components:
18341834
required:
18351835
- role_name
18361836
type: object
1837+
AWSCloudAuthPersonaMappingAttributesResponse:
1838+
description: Attributes for AWS cloud authentication persona mapping response
1839+
properties:
1840+
account_identifier:
1841+
description: Datadog account identifier (email or handle) mapped to the
1842+
AWS principal
1843+
1844+
type: string
1845+
account_uuid:
1846+
description: Datadog account UUID
1847+
example: 12bbdc5c-5966-47e0-8733-285f9e44bcf4
1848+
type: string
1849+
arn_pattern:
1850+
description: AWS IAM ARN pattern to match for authentication
1851+
example: arn:aws:iam::123456789012:user/testuser
1852+
type: string
1853+
required:
1854+
- arn_pattern
1855+
- account_identifier
1856+
- account_uuid
1857+
type: object
1858+
AWSCloudAuthPersonaMappingDataResponse:
1859+
description: Data for AWS cloud authentication persona mapping response
1860+
properties:
1861+
attributes:
1862+
$ref: '#/components/schemas/AWSCloudAuthPersonaMappingAttributesResponse'
1863+
id:
1864+
description: Unique identifier for the persona mapping
1865+
example: c5c758c6-18c2-4484-ae3f-46b84128404a
1866+
type: string
1867+
type:
1868+
$ref: '#/components/schemas/AWSCloudAuthPersonaMappingType'
1869+
required:
1870+
- id
1871+
- type
1872+
- attributes
1873+
type: object
1874+
AWSCloudAuthPersonaMappingType:
1875+
description: Type identifier for AWS cloud authentication persona mapping
1876+
enum:
1877+
- aws_cloud_auth_config
1878+
example: aws_cloud_auth_config
1879+
type: string
1880+
x-enum-varnames:
1881+
- AWS_CLOUD_AUTH_CONFIG
1882+
AWSCloudAuthPersonaMappingsData:
1883+
description: List of AWS cloud authentication persona mappings
1884+
items:
1885+
$ref: '#/components/schemas/AWSCloudAuthPersonaMappingDataResponse'
1886+
type: array
1887+
AWSCloudAuthPersonaMappingsResponse:
1888+
description: Response containing a list of AWS cloud authentication persona
1889+
mappings
1890+
properties:
1891+
data:
1892+
$ref: '#/components/schemas/AWSCloudAuthPersonaMappingsData'
1893+
required:
1894+
- data
1895+
type: object
18371896
AWSCredentials:
18381897
description: The definition of `AWSCredentials` object.
18391898
oneOf:
@@ -74551,6 +74610,39 @@ paths:
7455174610
permissions:
7455274611
- ci_visibility_read
7455374612
- test_optimization_read
74613+
/api/v2/cloud_auth/aws/persona_mapping:
74614+
get:
74615+
description: List all AWS cloud authentication persona mappings. This endpoint
74616+
retrieves all configured persona mappings that associate AWS IAM principals
74617+
with Datadog users.
74618+
operationId: ListAWSCloudAuthPersonaMappings
74619+
responses:
74620+
'200':
74621+
content:
74622+
application/json:
74623+
schema:
74624+
$ref: '#/components/schemas/AWSCloudAuthPersonaMappingsResponse'
74625+
description: OK
74626+
'400':
74627+
content:
74628+
application/json:
74629+
schema:
74630+
$ref: '#/components/schemas/JSONAPIErrorResponse'
74631+
description: Bad Request
74632+
'403':
74633+
content:
74634+
application/json:
74635+
schema:
74636+
$ref: '#/components/schemas/JSONAPIErrorResponse'
74637+
description: Forbidden
74638+
'429':
74639+
$ref: '#/components/responses/TooManyRequestsResponse'
74640+
summary: List AWS cloud authentication persona mappings
74641+
tags:
74642+
- Cloud Authentication
74643+
x-unstable: '**Note**: This endpoint is in public beta and is subject to change.
74644+
74645+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
7455474646
/api/v2/cloud_security_management/custom_frameworks:
7455574647
post:
7455674648
description: Create a custom framework.
@@ -104331,6 +104423,9 @@ tags:
104331104423
Management page](https://docs.datadoghq.com/service_management/case_management/)
104332104424
for more information.
104333104425
name: Case Management Type
104426+
- description: Configure AWS cloud authentication mappings for persona and intake
104427+
authentication through the Datadog API.
104428+
name: Cloud Authentication
104334104429
- description: The Cloud Cost Management API allows you to set up, edit, and delete
104335104430
Cloud Cost Management accounts for AWS, Azure, and Google Cloud. You can query
104336104431
your cost data by using the [Metrics endpoint](https://docs.datadoghq.com/api/latest/metrics/#query-timeseries-data-across-multiple-products)

api/datadog/configuration.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -679,6 +679,7 @@ func NewConfiguration() *Configuration {
679679
"v2.LinkJiraIssueToCase": false,
680680
"v2.MoveCaseToProject": false,
681681
"v2.UnlinkJiraIssue": false,
682+
"v2.ListAWSCloudAuthPersonaMappings": false,
682683
"v2.ActivateContentPack": false,
683684
"v2.CancelThreatHuntingJob": false,
684685
"v2.ConvertJobResultToSignal": false,
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
// This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
// Copyright 2019-Present Datadog, Inc.
4+
5+
package datadogV2
6+
7+
import (
8+
_context "context"
9+
_fmt "fmt"
10+
_log "log"
11+
_nethttp "net/http"
12+
_neturl "net/url"
13+
14+
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
15+
)
16+
17+
// CloudAuthenticationApi service type
18+
type CloudAuthenticationApi datadog.Service
19+
20+
// ListAWSCloudAuthPersonaMappings List AWS cloud authentication persona mappings.
21+
// List all AWS cloud authentication persona mappings. This endpoint retrieves all configured persona mappings that associate AWS IAM principals with Datadog users.
22+
func (a *CloudAuthenticationApi) ListAWSCloudAuthPersonaMappings(ctx _context.Context) (AWSCloudAuthPersonaMappingsResponse, *_nethttp.Response, error) {
23+
var (
24+
localVarHTTPMethod = _nethttp.MethodGet
25+
localVarPostBody interface{}
26+
localVarReturnValue AWSCloudAuthPersonaMappingsResponse
27+
)
28+
29+
operationId := "v2.ListAWSCloudAuthPersonaMappings"
30+
isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId)
31+
if !isOperationEnabled {
32+
return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)}
33+
}
34+
if isOperationEnabled && a.Client.Cfg.Debug {
35+
_log.Printf("WARNING: Using unstable operation '%s'", operationId)
36+
}
37+
38+
localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CloudAuthenticationApi.ListAWSCloudAuthPersonaMappings")
39+
if err != nil {
40+
return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()}
41+
}
42+
43+
localVarPath := localBasePath + "/api/v2/cloud_auth/aws/persona_mapping"
44+
45+
localVarHeaderParams := make(map[string]string)
46+
localVarQueryParams := _neturl.Values{}
47+
localVarFormParams := _neturl.Values{}
48+
localVarHeaderParams["Accept"] = "application/json"
49+
50+
if a.Client.Cfg.DelegatedTokenConfig != nil {
51+
err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig)
52+
if err != nil {
53+
return localVarReturnValue, nil, err
54+
}
55+
} else {
56+
datadog.SetAuthKeys(
57+
ctx,
58+
&localVarHeaderParams,
59+
[2]string{"apiKeyAuth", "DD-API-KEY"},
60+
[2]string{"appKeyAuth", "DD-APPLICATION-KEY"},
61+
)
62+
}
63+
req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil)
64+
if err != nil {
65+
return localVarReturnValue, nil, err
66+
}
67+
68+
localVarHTTPResponse, err := a.Client.CallAPI(req)
69+
if err != nil || localVarHTTPResponse == nil {
70+
return localVarReturnValue, localVarHTTPResponse, err
71+
}
72+
73+
localVarBody, err := datadog.ReadBody(localVarHTTPResponse)
74+
if err != nil {
75+
return localVarReturnValue, localVarHTTPResponse, err
76+
}
77+
78+
if localVarHTTPResponse.StatusCode >= 300 {
79+
newErr := datadog.GenericOpenAPIError{
80+
ErrorBody: localVarBody,
81+
ErrorMessage: localVarHTTPResponse.Status,
82+
}
83+
if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 {
84+
var v JSONAPIErrorResponse
85+
err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
86+
if err != nil {
87+
return localVarReturnValue, localVarHTTPResponse, newErr
88+
}
89+
newErr.ErrorModel = v
90+
return localVarReturnValue, localVarHTTPResponse, newErr
91+
}
92+
if localVarHTTPResponse.StatusCode == 429 {
93+
var v APIErrorResponse
94+
err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
95+
if err != nil {
96+
return localVarReturnValue, localVarHTTPResponse, newErr
97+
}
98+
newErr.ErrorModel = v
99+
}
100+
return localVarReturnValue, localVarHTTPResponse, newErr
101+
}
102+
103+
err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
104+
if err != nil {
105+
newErr := datadog.GenericOpenAPIError{
106+
ErrorBody: localVarBody,
107+
ErrorMessage: err.Error(),
108+
}
109+
return localVarReturnValue, localVarHTTPResponse, newErr
110+
}
111+
112+
return localVarReturnValue, localVarHTTPResponse, nil
113+
}
114+
115+
// NewCloudAuthenticationApi Returns NewCloudAuthenticationApi.
116+
func NewCloudAuthenticationApi(client *datadog.APIClient) *CloudAuthenticationApi {
117+
return &CloudAuthenticationApi{
118+
Client: client,
119+
}
120+
}

api/datadogV2/doc.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@
158158
// - [CaseManagementTypeApi.CreateCaseType]
159159
// - [CaseManagementTypeApi.DeleteCaseType]
160160
// - [CaseManagementTypeApi.GetAllCaseTypes]
161+
// - [CloudAuthenticationApi.ListAWSCloudAuthPersonaMappings]
161162
// - [CloudCostManagementApi.CreateCostAWSCURConfig]
162163
// - [CloudCostManagementApi.CreateCostAzureUCConfigs]
163164
// - [CloudCostManagementApi.CreateCostGCPUsageCostConfig]

0 commit comments

Comments
 (0)