Skip to content

Commit

Permalink
Regenerate client from commit d7ddfde1 of spec repo
Browse files Browse the repository at this point in the history
  • Loading branch information
ci.datadog-api-spec committed Oct 25, 2024
1 parent 6d5518b commit 77a6e6c
Show file tree
Hide file tree
Showing 20 changed files with 1,420 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2024-10-24 20:04:20.108446",
"spec_repo_commit": "aaacb8db"
"regenerated": "2024-10-25 14:27:11.151740",
"spec_repo_commit": "d7ddfde1"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-10-24 20:04:20.126796",
"spec_repo_commit": "aaacb8db"
"regenerated": "2024-10-25 14:27:11.171377",
"spec_repo_commit": "d7ddfde1"
}
}
}
136 changes: 136 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7101,6 +7101,81 @@ components:
description: The type of the resource. The value should always be device.
type: string
type: object
DomainAllowlist:
description: The email domain allowlist for an org.
properties:
attributes:
$ref: '#/components/schemas/DomainAllowlistAttributes'
id:
description: The unique identifier of the org.
nullable: true
type: string
type:
$ref: '#/components/schemas/DomainAllowlistType'
required:
- type
type: object
DomainAllowlistAttributes:
description: The details of the email domain allowlist.
properties:
domains:
description: The list of domains in the email domain allowlist.
items:
type: string
type: array
enabled:
description: Whether the email domain allowlist is enabled for the org.
type: boolean
type: object
DomainAllowlistRequest:
description: Request containing the desired email domain allowlist configuration.
properties:
data:
$ref: '#/components/schemas/DomainAllowlist'
required:
- data
type: object
DomainAllowlistResponse:
description: Response containing information about the email domain allowlist.
properties:
data:
$ref: '#/components/schemas/DomainAllowlistResponseData'
type: object
DomainAllowlistResponseData:
description: The email domain allowlist response for an org.
properties:
attributes:
$ref: '#/components/schemas/DomainAllowlistResponseDataAttributes'
id:
description: The unique identifier of the org.
nullable: true
type: string
type:
$ref: '#/components/schemas/DomainAllowlistType'
required:
- type
type: object
DomainAllowlistResponseDataAttributes:
description: The details of the email domain allowlist
properties:
domains:
description: The list of domains in the email domain allowlist.
items:
type: string
type: array
enabled:
description: Whether the email domain allowlist is enabled for the org.
type: boolean
type: object
DomainAllowlistType:
default: domain_allowlist
description: Email Domain Allowlist allowlist type.
enum:
- domain_allowlist
example: domain_allowlist
type: string
x-enum-varnames:
- DOMAIN_ALLOWLIST
DowntimeCreateRequest:
description: Request for creating a downtime.
properties:
Expand Down Expand Up @@ -29218,6 +29293,61 @@ paths:
tags:
- Dashboard Lists
x-codegen-request-body-name: body
/api/v2/domain_allowlist:
get:
description: Get the domain allowlist for an organization.
operationId: GetDomainAllowlist
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/DomainAllowlistResponse'
description: OK
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ:
- org_management
summary: Get Domain Allowlist
tags:
- Domain Allowlist
x-permission:
operator: OR
permissions:
- org_management
patch:
description: Update the domain allowlist for an organization.
operationId: PatchDomainAllowlist
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/DomainAllowlistRequest'
required: true
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/DomainAllowlistResponse'
description: OK
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ:
- org_management
summary: Sets Domain Allowlist
tags:
- Domain Allowlist
x-permission:
operator: OR
permissions:
- org_management
/api/v2/dora/deployment:
post:
description: 'Use this API endpoint to provide data about deployments for DORA
Expand Down Expand Up @@ -41371,6 +41501,12 @@ tags:

organization.'
name: Dashboard Lists
- description: 'Configure your Datadog Email Domain Allowlist directly through the
Datadog API.

The Email Domain Allowlist controls the domains that certain datadog emails can
be sent to.'
name: Domain Allowlist
- description: '**Note**: Downtime V2 is currently in private beta. To request access,
contact [Datadog support](https://docs.datadoghq.com/help/).

Expand Down
166 changes: 166 additions & 0 deletions api/datadogV2/api_domain_allowlist.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
// 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 datadogV2

import (
_context "context"
_nethttp "net/http"
_neturl "net/url"

"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
)

// DomainAllowlistApi service type
type DomainAllowlistApi datadog.Service

// GetDomainAllowlist Get Domain Allowlist.
// Get the domain allowlist for an organization.
func (a *DomainAllowlistApi) GetDomainAllowlist(ctx _context.Context) (DomainAllowlistResponse, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet
localVarPostBody interface{}
localVarReturnValue DomainAllowlistResponse
)

localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.DomainAllowlistApi.GetDomainAllowlist")
if err != nil {
return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()}
}

localVarPath := localBasePath + "/api/v2/domain_allowlist"

localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
localVarHeaderParams["Accept"] = "application/json"

datadog.SetAuthKeys(
ctx,
&localVarHeaderParams,
[2]string{"apiKeyAuth", "DD-API-KEY"},
[2]string{"appKeyAuth", "DD-APPLICATION-KEY"},
)
req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil)
if err != nil {
return localVarReturnValue, nil, err
}

localVarHTTPResponse, err := a.Client.CallAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}

localVarBody, err := datadog.ReadBody(localVarHTTPResponse)
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}

if localVarHTTPResponse.StatusCode >= 300 {
newErr := datadog.GenericOpenAPIError{
ErrorBody: localVarBody,
ErrorMessage: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 429 {
var v APIErrorResponse
err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.ErrorModel = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}

err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := datadog.GenericOpenAPIError{
ErrorBody: localVarBody,
ErrorMessage: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}

return localVarReturnValue, localVarHTTPResponse, nil
}

// PatchDomainAllowlist Sets Domain Allowlist.
// Update the domain allowlist for an organization.
func (a *DomainAllowlistApi) PatchDomainAllowlist(ctx _context.Context, body DomainAllowlistRequest) (DomainAllowlistResponse, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPatch
localVarPostBody interface{}
localVarReturnValue DomainAllowlistResponse
)

localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.DomainAllowlistApi.PatchDomainAllowlist")
if err != nil {
return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()}
}

localVarPath := localBasePath + "/api/v2/domain_allowlist"

localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
localVarHeaderParams["Content-Type"] = "application/json"
localVarHeaderParams["Accept"] = "application/json"

// body params
localVarPostBody = &body
datadog.SetAuthKeys(
ctx,
&localVarHeaderParams,
[2]string{"apiKeyAuth", "DD-API-KEY"},
[2]string{"appKeyAuth", "DD-APPLICATION-KEY"},
)
req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil)
if err != nil {
return localVarReturnValue, nil, err
}

localVarHTTPResponse, err := a.Client.CallAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}

localVarBody, err := datadog.ReadBody(localVarHTTPResponse)
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}

if localVarHTTPResponse.StatusCode >= 300 {
newErr := datadog.GenericOpenAPIError{
ErrorBody: localVarBody,
ErrorMessage: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 429 {
var v APIErrorResponse
err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.ErrorModel = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}

err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := datadog.GenericOpenAPIError{
ErrorBody: localVarBody,
ErrorMessage: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}

return localVarReturnValue, localVarHTTPResponse, nil
}

// NewDomainAllowlistApi Returns NewDomainAllowlistApi.
func NewDomainAllowlistApi(client *datadog.APIClient) *DomainAllowlistApi {
return &DomainAllowlistApi{
Client: client,
}
}
2 changes: 2 additions & 0 deletions api/datadogV2/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@
// - [DashboardListsApi.DeleteDashboardListItems]
// - [DashboardListsApi.GetDashboardListItems]
// - [DashboardListsApi.UpdateDashboardListItems]
// - [DomainAllowlistApi.GetDomainAllowlist]
// - [DomainAllowlistApi.PatchDomainAllowlist]
// - [DowntimesApi.CancelDowntime]
// - [DowntimesApi.CreateDowntime]
// - [DowntimesApi.GetDowntime]
Expand Down
Loading

0 comments on commit 77a6e6c

Please sign in to comment.