Skip to content

Commit 7c62bdb

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 5615e9c of spec repo
1 parent 0d6926d commit 7c62bdb

12 files changed

+1058
-0
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6806,6 +6806,72 @@ components:
68066806
required:
68076807
- data
68086808
type: object
6809+
BatchDeleteRowsRequestArray:
6810+
description: The request body for deleting multiple rows from a reference table.
6811+
properties:
6812+
data:
6813+
items:
6814+
$ref: '#/components/schemas/BatchDeleteRowsRequestData'
6815+
maxItems: 200
6816+
type: array
6817+
required:
6818+
- data
6819+
type: object
6820+
BatchDeleteRowsRequestData:
6821+
description: Row resource containing a single row identifier for deletion.
6822+
properties:
6823+
id:
6824+
example: primary_key_value
6825+
type: string
6826+
type:
6827+
$ref: '#/components/schemas/TableRowResourceDataType'
6828+
required:
6829+
- type
6830+
- id
6831+
type: object
6832+
BatchUpsertRowsRequestArray:
6833+
description: The request body for creating or updating multiple rows into a
6834+
reference table.
6835+
properties:
6836+
data:
6837+
items:
6838+
$ref: '#/components/schemas/BatchUpsertRowsRequestData'
6839+
maxItems: 200
6840+
type: array
6841+
required:
6842+
- data
6843+
type: object
6844+
BatchUpsertRowsRequestData:
6845+
description: Row resource containing a single row identifier and its column
6846+
values.
6847+
properties:
6848+
attributes:
6849+
$ref: '#/components/schemas/BatchUpsertRowsRequestDataAttributes'
6850+
id:
6851+
example: primary_key_value
6852+
type: string
6853+
type:
6854+
$ref: '#/components/schemas/TableRowResourceDataType'
6855+
required:
6856+
- type
6857+
- id
6858+
type: object
6859+
BatchUpsertRowsRequestDataAttributes:
6860+
description: Attributes containing row data values for row creation or update
6861+
operations.
6862+
properties:
6863+
values:
6864+
additionalProperties:
6865+
x-required-field: true
6866+
description: Key-value pairs representing row data, where keys are field
6867+
names from the schema.
6868+
example:
6869+
example_key_value: primary_key_value
6870+
name: row_name
6871+
type: object
6872+
required:
6873+
- values
6874+
type: object
68096875
BillConfig:
68106876
description: Bill config.
68116877
properties:
@@ -74549,6 +74615,47 @@ paths:
7454974615
tags:
7455074616
- Reference Tables
7455174617
/api/v2/reference-tables/tables/{id}/rows:
74618+
delete:
74619+
description: Delete multiple rows from a Reference Table by their primary key
74620+
values.
74621+
operationId: DeleteRows
74622+
parameters:
74623+
- description: Unique identifier of the reference table to delete rows from
74624+
in: path
74625+
name: id
74626+
required: true
74627+
schema:
74628+
type: string
74629+
requestBody:
74630+
content:
74631+
application/json:
74632+
schema:
74633+
$ref: '#/components/schemas/BatchDeleteRowsRequestArray'
74634+
required: true
74635+
responses:
74636+
'200':
74637+
description: Rows deleted successfully
74638+
'400':
74639+
$ref: '#/components/responses/BadRequestResponse'
74640+
'403':
74641+
$ref: '#/components/responses/ForbiddenResponse'
74642+
'404':
74643+
$ref: '#/components/responses/NotFoundResponse'
74644+
'429':
74645+
$ref: '#/components/responses/TooManyRequestsResponse'
74646+
'500':
74647+
content:
74648+
application/json:
74649+
schema:
74650+
$ref: '#/components/schemas/APIErrorResponse'
74651+
description: Internal Server Error
74652+
security:
74653+
- apiKeyAuth: []
74654+
appKeyAuth: []
74655+
- AuthZ: []
74656+
summary: Delete rows
74657+
tags:
74658+
- Reference Tables
7455274659
get:
7455374660
description: Get reference table rows by their primary key values.
7455474661
operationId: GetRowsByID
@@ -74593,6 +74700,48 @@ paths:
7459374700
summary: Get rows by id
7459474701
tags:
7459574702
- Reference Tables
74703+
post:
74704+
description: Create or update rows in a Reference Table by their primary key
74705+
values. If a row with the specified primary key exists, it is updated; otherwise,
74706+
a new row is created.
74707+
operationId: UpsertRows
74708+
parameters:
74709+
- description: Unique identifier of the reference table to upsert rows into
74710+
in: path
74711+
name: id
74712+
required: true
74713+
schema:
74714+
type: string
74715+
requestBody:
74716+
content:
74717+
application/json:
74718+
schema:
74719+
$ref: '#/components/schemas/BatchUpsertRowsRequestArray'
74720+
required: true
74721+
responses:
74722+
'200':
74723+
description: Rows created or updated successfully
74724+
'400':
74725+
$ref: '#/components/responses/BadRequestResponse'
74726+
'403':
74727+
$ref: '#/components/responses/ForbiddenResponse'
74728+
'404':
74729+
$ref: '#/components/responses/NotFoundResponse'
74730+
'429':
74731+
$ref: '#/components/responses/TooManyRequestsResponse'
74732+
'500':
74733+
content:
74734+
application/json:
74735+
schema:
74736+
$ref: '#/components/schemas/APIErrorResponse'
74737+
description: Internal Server Error
74738+
security:
74739+
- apiKeyAuth: []
74740+
appKeyAuth: []
74741+
- AuthZ: []
74742+
summary: Upsert rows
74743+
tags:
74744+
- Reference Tables
7459674745
/api/v2/reference-tables/uploads:
7459774746
post:
7459874747
description: Create a reference table upload for bulk data ingestion

api/datadogV2/api_reference_tables.go

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,77 @@ func (a *ReferenceTablesApi) CreateReferenceTableUpload(ctx _context.Context, bo
180180
return localVarReturnValue, localVarHTTPResponse, nil
181181
}
182182

183+
// DeleteRows Delete rows.
184+
// Delete multiple rows from a Reference Table by their primary key values.
185+
func (a *ReferenceTablesApi) DeleteRows(ctx _context.Context, id string, body BatchDeleteRowsRequestArray) (*_nethttp.Response, error) {
186+
var (
187+
localVarHTTPMethod = _nethttp.MethodDelete
188+
localVarPostBody interface{}
189+
)
190+
191+
localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.ReferenceTablesApi.DeleteRows")
192+
if err != nil {
193+
return nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()}
194+
}
195+
196+
localVarPath := localBasePath + "/api/v2/reference-tables/tables/{id}/rows"
197+
localVarPath = datadog.ReplacePathParameter(localVarPath, "{id}", _neturl.PathEscape(datadog.ParameterToString(id, "")))
198+
199+
localVarHeaderParams := make(map[string]string)
200+
localVarQueryParams := _neturl.Values{}
201+
localVarFormParams := _neturl.Values{}
202+
localVarHeaderParams["Content-Type"] = "application/json"
203+
localVarHeaderParams["Accept"] = "*/*"
204+
205+
// body params
206+
localVarPostBody = &body
207+
if a.Client.Cfg.DelegatedTokenConfig != nil {
208+
err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig)
209+
if err != nil {
210+
return nil, err
211+
}
212+
} else {
213+
datadog.SetAuthKeys(
214+
ctx,
215+
&localVarHeaderParams,
216+
[2]string{"apiKeyAuth", "DD-API-KEY"},
217+
[2]string{"appKeyAuth", "DD-APPLICATION-KEY"},
218+
)
219+
}
220+
req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil)
221+
if err != nil {
222+
return nil, err
223+
}
224+
225+
localVarHTTPResponse, err := a.Client.CallAPI(req)
226+
if err != nil || localVarHTTPResponse == nil {
227+
return localVarHTTPResponse, err
228+
}
229+
230+
localVarBody, err := datadog.ReadBody(localVarHTTPResponse)
231+
if err != nil {
232+
return localVarHTTPResponse, err
233+
}
234+
235+
if localVarHTTPResponse.StatusCode >= 300 {
236+
newErr := datadog.GenericOpenAPIError{
237+
ErrorBody: localVarBody,
238+
ErrorMessage: localVarHTTPResponse.Status,
239+
}
240+
if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 || localVarHTTPResponse.StatusCode == 500 {
241+
var v APIErrorResponse
242+
err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
243+
if err != nil {
244+
return localVarHTTPResponse, newErr
245+
}
246+
newErr.ErrorModel = v
247+
}
248+
return localVarHTTPResponse, newErr
249+
}
250+
251+
return localVarHTTPResponse, nil
252+
}
253+
183254
// DeleteTable Delete table.
184255
// Delete a reference table by ID
185256
func (a *ReferenceTablesApi) DeleteTable(ctx _context.Context, id string) (*_nethttp.Response, error) {
@@ -639,6 +710,77 @@ func (a *ReferenceTablesApi) UpdateReferenceTable(ctx _context.Context, id strin
639710
return localVarHTTPResponse, nil
640711
}
641712

713+
// UpsertRows Upsert rows.
714+
// Create or update rows in a Reference Table by their primary key values. If a row with the specified primary key exists, it is updated; otherwise, a new row is created.
715+
func (a *ReferenceTablesApi) UpsertRows(ctx _context.Context, id string, body BatchUpsertRowsRequestArray) (*_nethttp.Response, error) {
716+
var (
717+
localVarHTTPMethod = _nethttp.MethodPost
718+
localVarPostBody interface{}
719+
)
720+
721+
localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.ReferenceTablesApi.UpsertRows")
722+
if err != nil {
723+
return nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()}
724+
}
725+
726+
localVarPath := localBasePath + "/api/v2/reference-tables/tables/{id}/rows"
727+
localVarPath = datadog.ReplacePathParameter(localVarPath, "{id}", _neturl.PathEscape(datadog.ParameterToString(id, "")))
728+
729+
localVarHeaderParams := make(map[string]string)
730+
localVarQueryParams := _neturl.Values{}
731+
localVarFormParams := _neturl.Values{}
732+
localVarHeaderParams["Content-Type"] = "application/json"
733+
localVarHeaderParams["Accept"] = "*/*"
734+
735+
// body params
736+
localVarPostBody = &body
737+
if a.Client.Cfg.DelegatedTokenConfig != nil {
738+
err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig)
739+
if err != nil {
740+
return nil, err
741+
}
742+
} else {
743+
datadog.SetAuthKeys(
744+
ctx,
745+
&localVarHeaderParams,
746+
[2]string{"apiKeyAuth", "DD-API-KEY"},
747+
[2]string{"appKeyAuth", "DD-APPLICATION-KEY"},
748+
)
749+
}
750+
req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil)
751+
if err != nil {
752+
return nil, err
753+
}
754+
755+
localVarHTTPResponse, err := a.Client.CallAPI(req)
756+
if err != nil || localVarHTTPResponse == nil {
757+
return localVarHTTPResponse, err
758+
}
759+
760+
localVarBody, err := datadog.ReadBody(localVarHTTPResponse)
761+
if err != nil {
762+
return localVarHTTPResponse, err
763+
}
764+
765+
if localVarHTTPResponse.StatusCode >= 300 {
766+
newErr := datadog.GenericOpenAPIError{
767+
ErrorBody: localVarBody,
768+
ErrorMessage: localVarHTTPResponse.Status,
769+
}
770+
if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 || localVarHTTPResponse.StatusCode == 500 {
771+
var v APIErrorResponse
772+
err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
773+
if err != nil {
774+
return localVarHTTPResponse, newErr
775+
}
776+
newErr.ErrorModel = v
777+
}
778+
return localVarHTTPResponse, newErr
779+
}
780+
781+
return localVarHTTPResponse, nil
782+
}
783+
642784
// NewReferenceTablesApi Returns NewReferenceTablesApi.
643785
func NewReferenceTablesApi(client *datadog.APIClient) *ReferenceTablesApi {
644786
return &ReferenceTablesApi{

api/datadogV2/doc.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,11 +465,13 @@
465465
// - [RUMApi.UpdateRUMApplication]
466466
// - [ReferenceTablesApi.CreateReferenceTable]
467467
// - [ReferenceTablesApi.CreateReferenceTableUpload]
468+
// - [ReferenceTablesApi.DeleteRows]
468469
// - [ReferenceTablesApi.DeleteTable]
469470
// - [ReferenceTablesApi.GetRowsByID]
470471
// - [ReferenceTablesApi.GetTable]
471472
// - [ReferenceTablesApi.ListTables]
472473
// - [ReferenceTablesApi.UpdateReferenceTable]
474+
// - [ReferenceTablesApi.UpsertRows]
473475
// - [RestrictionPoliciesApi.DeleteRestrictionPolicy]
474476
// - [RestrictionPoliciesApi.GetRestrictionPolicy]
475477
// - [RestrictionPoliciesApi.UpdateRestrictionPolicy]

0 commit comments

Comments
 (0)