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
2,325 changes: 2,325 additions & 0 deletions .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

1,611 changes: 1,611 additions & 0 deletions api/datadogV2/api_status_pages.go

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions api/datadogV2/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,21 @@
// - [SpansMetricsApi.UpdateSpansMetric]
// - [StaticAnalysisApi.CreateSCAResolveVulnerableSymbols]
// - [StaticAnalysisApi.CreateSCAResult]
// - [StatusPagesApi.CreateComponent]
// - [StatusPagesApi.CreateDegradation]
// - [StatusPagesApi.CreateStatusPage]
// - [StatusPagesApi.DeleteComponent]
// - [StatusPagesApi.DeleteDegradation]
// - [StatusPagesApi.DeleteStatusPage]
// - [StatusPagesApi.GetComponent]
// - [StatusPagesApi.GetDegradation]
// - [StatusPagesApi.GetStatusPage]
// - [StatusPagesApi.ListComponents]
// - [StatusPagesApi.ListDegradations]
// - [StatusPagesApi.ListStatusPages]
// - [StatusPagesApi.UpdateComponent]
// - [StatusPagesApi.UpdateDegradation]
// - [StatusPagesApi.UpdateStatusPage]
// - [SyntheticsApi.CreateSyntheticsSuite]
// - [SyntheticsApi.DeleteSyntheticsSuites]
// - [SyntheticsApi.EditSyntheticsSuite]
Expand Down
111 changes: 111 additions & 0 deletions api/datadogV2/model_create_component_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"
)

// CreateComponentRequest
type CreateComponentRequest struct {
//
Data *CreateComponentRequestData `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:"-"`
}

// NewCreateComponentRequest instantiates a new CreateComponentRequest 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 NewCreateComponentRequest() *CreateComponentRequest {
this := CreateComponentRequest{}
return &this
}

// NewCreateComponentRequestWithDefaults instantiates a new CreateComponentRequest 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 NewCreateComponentRequestWithDefaults() *CreateComponentRequest {
this := CreateComponentRequest{}
return &this
}

// GetData returns the Data field value if set, zero value otherwise.
func (o *CreateComponentRequest) GetData() CreateComponentRequestData {
if o == nil || o.Data == nil {
var ret CreateComponentRequestData
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 *CreateComponentRequest) GetDataOk() (*CreateComponentRequestData, 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 *CreateComponentRequest) HasData() bool {
return o != nil && o.Data != nil
}

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

// MarshalJSON serializes the struct using spec logic.
func (o CreateComponentRequest) 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 *CreateComponentRequest) UnmarshalJSON(bytes []byte) (err error) {
all := struct {
Data *CreateComponentRequestData `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
}
189 changes: 189 additions & 0 deletions api/datadogV2/model_create_component_request_data.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
// 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"
)

// CreateComponentRequestData
type CreateComponentRequestData struct {
// The supported attributes for creating a component.
Attributes *CreateComponentRequestDataAttributes `json:"attributes,omitempty"`
// The supported relationships for creating a component.
Relationships *CreateComponentRequestDataRelationships `json:"relationships,omitempty"`
// Components resource type.
Type StatusPagesComponentGroupType `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:"-"`
}

// NewCreateComponentRequestData instantiates a new CreateComponentRequestData 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 NewCreateComponentRequestData(typeVar StatusPagesComponentGroupType) *CreateComponentRequestData {
this := CreateComponentRequestData{}
this.Type = typeVar
return &this
}

// NewCreateComponentRequestDataWithDefaults instantiates a new CreateComponentRequestData 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 NewCreateComponentRequestDataWithDefaults() *CreateComponentRequestData {
this := CreateComponentRequestData{}
var typeVar StatusPagesComponentGroupType = STATUSPAGESCOMPONENTGROUPTYPE_COMPONENTS
this.Type = typeVar
return &this
}

// GetAttributes returns the Attributes field value if set, zero value otherwise.
func (o *CreateComponentRequestData) GetAttributes() CreateComponentRequestDataAttributes {
if o == nil || o.Attributes == nil {
var ret CreateComponentRequestDataAttributes
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 *CreateComponentRequestData) GetAttributesOk() (*CreateComponentRequestDataAttributes, 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 *CreateComponentRequestData) HasAttributes() bool {
return o != nil && o.Attributes != nil
}

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

// GetRelationships returns the Relationships field value if set, zero value otherwise.
func (o *CreateComponentRequestData) GetRelationships() CreateComponentRequestDataRelationships {
if o == nil || o.Relationships == nil {
var ret CreateComponentRequestDataRelationships
return ret
}
return *o.Relationships
}

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

// HasRelationships returns a boolean if a field has been set.
func (o *CreateComponentRequestData) HasRelationships() bool {
return o != nil && o.Relationships != nil
}

// SetRelationships gets a reference to the given CreateComponentRequestDataRelationships and assigns it to the Relationships field.
func (o *CreateComponentRequestData) SetRelationships(v CreateComponentRequestDataRelationships) {
o.Relationships = &v
}

// GetType returns the Type field value.
func (o *CreateComponentRequestData) GetType() StatusPagesComponentGroupType {
if o == nil {
var ret StatusPagesComponentGroupType
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 *CreateComponentRequestData) GetTypeOk() (*StatusPagesComponentGroupType, bool) {
if o == nil {
return nil, false
}
return &o.Type, true
}

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

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

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

// UnmarshalJSON deserializes the given payload.
func (o *CreateComponentRequestData) UnmarshalJSON(bytes []byte) (err error) {
all := struct {
Attributes *CreateComponentRequestDataAttributes `json:"attributes,omitempty"`
Relationships *CreateComponentRequestDataRelationships `json:"relationships,omitempty"`
Type *StatusPagesComponentGroupType `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", "relationships", "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.Relationships != nil && all.Relationships.UnparsedObject != nil && o.UnparsedObject == nil {
hasInvalidField = true
}
o.Relationships = all.Relationships
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
Loading