Skip to content

Commit d87687d

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit b75df79 of spec repo
1 parent 81ae8dd commit d87687d

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
@@ -6788,6 +6788,72 @@ components:
67886788
required:
67896789
- data
67906790
type: object
6791+
BatchDeleteRowsRequestArray:
6792+
description: The request body for deleting multiple rows from a reference table.
6793+
properties:
6794+
data:
6795+
items:
6796+
$ref: '#/components/schemas/BatchDeleteRowsRequestData'
6797+
maxItems: 200
6798+
type: array
6799+
required:
6800+
- data
6801+
type: object
6802+
BatchDeleteRowsRequestData:
6803+
description: Row resource containing a single row identifier for deletion.
6804+
properties:
6805+
id:
6806+
example: primary_key_value
6807+
type: string
6808+
type:
6809+
$ref: '#/components/schemas/TableRowResourceDataType'
6810+
required:
6811+
- type
6812+
- id
6813+
type: object
6814+
BatchUpsertRowsRequestArray:
6815+
description: The request body for creating or updating multiple rows into a
6816+
reference table.
6817+
properties:
6818+
data:
6819+
items:
6820+
$ref: '#/components/schemas/BatchUpsertRowsRequestData'
6821+
maxItems: 200
6822+
type: array
6823+
required:
6824+
- data
6825+
type: object
6826+
BatchUpsertRowsRequestData:
6827+
description: Row resource containing a single row identifier and its column
6828+
values.
6829+
properties:
6830+
attributes:
6831+
$ref: '#/components/schemas/BatchUpsertRowsRequestDataAttributes'
6832+
id:
6833+
example: primary_key_value
6834+
type: string
6835+
type:
6836+
$ref: '#/components/schemas/TableRowResourceDataType'
6837+
required:
6838+
- type
6839+
- id
6840+
type: object
6841+
BatchUpsertRowsRequestDataAttributes:
6842+
description: Attributes containing row data values for row creation or update
6843+
operations.
6844+
properties:
6845+
values:
6846+
additionalProperties:
6847+
x-required-field: true
6848+
description: Key-value pairs representing row data, where keys are field
6849+
names from the schema.
6850+
example:
6851+
example_key_value: primary_key_value
6852+
name: row_name
6853+
type: object
6854+
required:
6855+
- values
6856+
type: object
67916857
BillConfig:
67926858
description: Bill config.
67936859
properties:
@@ -73670,6 +73736,47 @@ paths:
7367073736
tags:
7367173737
- Reference Tables
7367273738
/api/v2/reference-tables/tables/{id}/rows:
73739+
delete:
73740+
description: Delete multiple rows from a Reference Table by their primary key
73741+
values.
73742+
operationId: DeleteRows
73743+
parameters:
73744+
- description: Unique identifier of the reference table to delete rows from
73745+
in: path
73746+
name: id
73747+
required: true
73748+
schema:
73749+
type: string
73750+
requestBody:
73751+
content:
73752+
application/json:
73753+
schema:
73754+
$ref: '#/components/schemas/BatchDeleteRowsRequestArray'
73755+
required: true
73756+
responses:
73757+
'200':
73758+
description: Rows deleted successfully
73759+
'400':
73760+
$ref: '#/components/responses/BadRequestResponse'
73761+
'403':
73762+
$ref: '#/components/responses/ForbiddenResponse'
73763+
'404':
73764+
$ref: '#/components/responses/NotFoundResponse'
73765+
'429':
73766+
$ref: '#/components/responses/TooManyRequestsResponse'
73767+
'500':
73768+
content:
73769+
application/json:
73770+
schema:
73771+
$ref: '#/components/schemas/APIErrorResponse'
73772+
description: Internal Server Error
73773+
security:
73774+
- apiKeyAuth: []
73775+
appKeyAuth: []
73776+
- AuthZ: []
73777+
summary: Delete rows
73778+
tags:
73779+
- Reference Tables
7367373780
get:
7367473781
description: Get reference table rows by their primary key values.
7367573782
operationId: GetRowsByID
@@ -73714,6 +73821,48 @@ paths:
7371473821
summary: Get rows by id
7371573822
tags:
7371673823
- Reference Tables
73824+
post:
73825+
description: Create or update rows in a Reference Table by their primary key
73826+
values. If a row with the specified primary key exists, it is updated; otherwise,
73827+
a new row is created.
73828+
operationId: UpsertRows
73829+
parameters:
73830+
- description: Unique identifier of the reference table to upsert rows into
73831+
in: path
73832+
name: id
73833+
required: true
73834+
schema:
73835+
type: string
73836+
requestBody:
73837+
content:
73838+
application/json:
73839+
schema:
73840+
$ref: '#/components/schemas/BatchUpsertRowsRequestArray'
73841+
required: true
73842+
responses:
73843+
'200':
73844+
description: Rows created or updated successfully
73845+
'400':
73846+
$ref: '#/components/responses/BadRequestResponse'
73847+
'403':
73848+
$ref: '#/components/responses/ForbiddenResponse'
73849+
'404':
73850+
$ref: '#/components/responses/NotFoundResponse'
73851+
'429':
73852+
$ref: '#/components/responses/TooManyRequestsResponse'
73853+
'500':
73854+
content:
73855+
application/json:
73856+
schema:
73857+
$ref: '#/components/schemas/APIErrorResponse'
73858+
description: Internal Server Error
73859+
security:
73860+
- apiKeyAuth: []
73861+
appKeyAuth: []
73862+
- AuthZ: []
73863+
summary: Upsert rows
73864+
tags:
73865+
- Reference Tables
7371773866
/api/v2/reference-tables/uploads:
7371873867
post:
7371973868
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
@@ -457,11 +457,13 @@
457457
// - [RUMApi.UpdateRUMApplication]
458458
// - [ReferenceTablesApi.CreateReferenceTable]
459459
// - [ReferenceTablesApi.CreateReferenceTableUpload]
460+
// - [ReferenceTablesApi.DeleteRows]
460461
// - [ReferenceTablesApi.DeleteTable]
461462
// - [ReferenceTablesApi.GetRowsByID]
462463
// - [ReferenceTablesApi.GetTable]
463464
// - [ReferenceTablesApi.ListTables]
464465
// - [ReferenceTablesApi.UpdateReferenceTable]
466+
// - [ReferenceTablesApi.UpsertRows]
465467
// - [RestrictionPoliciesApi.DeleteRestrictionPolicy]
466468
// - [RestrictionPoliciesApi.GetRestrictionPolicy]
467469
// - [RestrictionPoliciesApi.UpdateRestrictionPolicy]

0 commit comments

Comments
 (0)