Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
890 changes: 890 additions & 0 deletions .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

868 changes: 868 additions & 0 deletions api/datadogV2/api_actions_datastores.go

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions api/datadogV2/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@
// - [ActionConnectionApi.RegisterAppKey]
// - [ActionConnectionApi.UnregisterAppKey]
// - [ActionConnectionApi.UpdateActionConnection]
// - [ActionsDatastoresApi.BulkWriteDatastoreItems]
// - [ActionsDatastoresApi.CreateDatastore]
// - [ActionsDatastoresApi.DeleteDatastore]
// - [ActionsDatastoresApi.DeleteDatastoreItem]
// - [ActionsDatastoresApi.GetDatastore]
// - [ActionsDatastoresApi.ListDatastoreItems]
// - [ActionsDatastoresApi.ListDatastores]
// - [ActionsDatastoresApi.UpdateDatastore]
// - [ActionsDatastoresApi.UpdateDatastoreItem]
// - [AgentlessScanningApi.CreateAwsOnDemandTask]
// - [AgentlessScanningApi.CreateAwsScanOptions]
// - [AgentlessScanningApi.DeleteAwsScanOptions]
Expand Down
111 changes: 111 additions & 0 deletions api/datadogV2/model_bulk_put_apps_datastore_items_request.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
// 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 (
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
)

// BulkPutAppsDatastoreItemsRequest Request to insert multiple items into a datastore in a single operation.
type BulkPutAppsDatastoreItemsRequest struct {
// Data wrapper containing the items to insert and their configuration for the bulk insert operation.
Data *BulkPutAppsDatastoreItemsRequestData `json:"data,omitempty"`
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
UnparsedObject map[string]interface{} `json:"-"`
AdditionalProperties map[string]interface{} `json:"-"`
}

// NewBulkPutAppsDatastoreItemsRequest instantiates a new BulkPutAppsDatastoreItemsRequest object.
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed.
func NewBulkPutAppsDatastoreItemsRequest() *BulkPutAppsDatastoreItemsRequest {
this := BulkPutAppsDatastoreItemsRequest{}
return &this
}

// NewBulkPutAppsDatastoreItemsRequestWithDefaults instantiates a new BulkPutAppsDatastoreItemsRequest object.
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set.
func NewBulkPutAppsDatastoreItemsRequestWithDefaults() *BulkPutAppsDatastoreItemsRequest {
this := BulkPutAppsDatastoreItemsRequest{}
return &this
}

// GetData returns the Data field value if set, zero value otherwise.
func (o *BulkPutAppsDatastoreItemsRequest) GetData() BulkPutAppsDatastoreItemsRequestData {
if o == nil || o.Data == nil {
var ret BulkPutAppsDatastoreItemsRequestData
return ret
}
return *o.Data
}

// GetDataOk returns a tuple with the Data field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BulkPutAppsDatastoreItemsRequest) GetDataOk() (*BulkPutAppsDatastoreItemsRequestData, bool) {
if o == nil || o.Data == nil {
return nil, false
}
return o.Data, true
}

// HasData returns a boolean if a field has been set.
func (o *BulkPutAppsDatastoreItemsRequest) HasData() bool {
return o != nil && o.Data != nil
}

// SetData gets a reference to the given BulkPutAppsDatastoreItemsRequestData and assigns it to the Data field.
func (o *BulkPutAppsDatastoreItemsRequest) SetData(v BulkPutAppsDatastoreItemsRequestData) {
o.Data = &v
}

// MarshalJSON serializes the struct using spec logic.
func (o BulkPutAppsDatastoreItemsRequest) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.UnparsedObject != nil {
return datadog.Marshal(o.UnparsedObject)
}
if o.Data != nil {
toSerialize["data"] = o.Data
}

for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return datadog.Marshal(toSerialize)
}

// UnmarshalJSON deserializes the given payload.
func (o *BulkPutAppsDatastoreItemsRequest) UnmarshalJSON(bytes []byte) (err error) {
all := struct {
Data *BulkPutAppsDatastoreItemsRequestData `json:"data,omitempty"`
}{}
if err = datadog.Unmarshal(bytes, &all); err != nil {
return datadog.Unmarshal(bytes, &o.UnparsedObject)
}
additionalProperties := make(map[string]interface{})
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
datadog.DeleteKeys(additionalProperties, &[]string{"data"})
} else {
return err
}

hasInvalidField := false
if all.Data != nil && all.Data.UnparsedObject != nil && o.UnparsedObject == nil {
hasInvalidField = true
}
o.Data = all.Data

if len(additionalProperties) > 0 {
o.AdditionalProperties = additionalProperties
}

if hasInvalidField {
return datadog.Unmarshal(bytes, &o.UnparsedObject)
}

return nil
}
151 changes: 151 additions & 0 deletions api/datadogV2/model_bulk_put_apps_datastore_items_request_data.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
// 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 (
"fmt"

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

// BulkPutAppsDatastoreItemsRequestData Data wrapper containing the items to insert and their configuration for the bulk insert operation.
type BulkPutAppsDatastoreItemsRequestData struct {
// Configuration for bulk inserting multiple items into a datastore.
Attributes *BulkPutAppsDatastoreItemsRequestDataAttributes `json:"attributes,omitempty"`
// The resource type for datastore items.
Type DatastoreItemsDataType `json:"type"`
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
UnparsedObject map[string]interface{} `json:"-"`
AdditionalProperties map[string]interface{} `json:"-"`
}

// NewBulkPutAppsDatastoreItemsRequestData instantiates a new BulkPutAppsDatastoreItemsRequestData object.
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed.
func NewBulkPutAppsDatastoreItemsRequestData(typeVar DatastoreItemsDataType) *BulkPutAppsDatastoreItemsRequestData {
this := BulkPutAppsDatastoreItemsRequestData{}
this.Type = typeVar
return &this
}

// NewBulkPutAppsDatastoreItemsRequestDataWithDefaults instantiates a new BulkPutAppsDatastoreItemsRequestData object.
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set.
func NewBulkPutAppsDatastoreItemsRequestDataWithDefaults() *BulkPutAppsDatastoreItemsRequestData {
this := BulkPutAppsDatastoreItemsRequestData{}
var typeVar DatastoreItemsDataType = DATASTOREITEMSDATATYPE_ITEMS
this.Type = typeVar
return &this
}

// GetAttributes returns the Attributes field value if set, zero value otherwise.
func (o *BulkPutAppsDatastoreItemsRequestData) GetAttributes() BulkPutAppsDatastoreItemsRequestDataAttributes {
if o == nil || o.Attributes == nil {
var ret BulkPutAppsDatastoreItemsRequestDataAttributes
return ret
}
return *o.Attributes
}

// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BulkPutAppsDatastoreItemsRequestData) GetAttributesOk() (*BulkPutAppsDatastoreItemsRequestDataAttributes, bool) {
if o == nil || o.Attributes == nil {
return nil, false
}
return o.Attributes, true
}

// HasAttributes returns a boolean if a field has been set.
func (o *BulkPutAppsDatastoreItemsRequestData) HasAttributes() bool {
return o != nil && o.Attributes != nil
}

// SetAttributes gets a reference to the given BulkPutAppsDatastoreItemsRequestDataAttributes and assigns it to the Attributes field.
func (o *BulkPutAppsDatastoreItemsRequestData) SetAttributes(v BulkPutAppsDatastoreItemsRequestDataAttributes) {
o.Attributes = &v
}

// GetType returns the Type field value.
func (o *BulkPutAppsDatastoreItemsRequestData) GetType() DatastoreItemsDataType {
if o == nil {
var ret DatastoreItemsDataType
return ret
}
return o.Type
}

// GetTypeOk returns a tuple with the Type field value
// and a boolean to check if the value has been set.
func (o *BulkPutAppsDatastoreItemsRequestData) GetTypeOk() (*DatastoreItemsDataType, bool) {
if o == nil {
return nil, false
}
return &o.Type, true
}

// SetType sets field value.
func (o *BulkPutAppsDatastoreItemsRequestData) SetType(v DatastoreItemsDataType) {
o.Type = v
}

// MarshalJSON serializes the struct using spec logic.
func (o BulkPutAppsDatastoreItemsRequestData) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.UnparsedObject != nil {
return datadog.Marshal(o.UnparsedObject)
}
if o.Attributes != nil {
toSerialize["attributes"] = o.Attributes
}
toSerialize["type"] = o.Type

for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return datadog.Marshal(toSerialize)
}

// UnmarshalJSON deserializes the given payload.
func (o *BulkPutAppsDatastoreItemsRequestData) UnmarshalJSON(bytes []byte) (err error) {
all := struct {
Attributes *BulkPutAppsDatastoreItemsRequestDataAttributes `json:"attributes,omitempty"`
Type *DatastoreItemsDataType `json:"type"`
}{}
if err = datadog.Unmarshal(bytes, &all); err != nil {
return datadog.Unmarshal(bytes, &o.UnparsedObject)
}
if all.Type == nil {
return fmt.Errorf("required field type missing")
}
additionalProperties := make(map[string]interface{})
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "type"})
} else {
return err
}

hasInvalidField := false
if all.Attributes != nil && all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil {
hasInvalidField = true
}
o.Attributes = all.Attributes
if !all.Type.IsValid() {
hasInvalidField = true
} else {
o.Type = *all.Type
}

if len(additionalProperties) > 0 {
o.AdditionalProperties = additionalProperties
}

if hasInvalidField {
return datadog.Unmarshal(bytes, &o.UnparsedObject)
}

return nil
}
Loading