Skip to content
Open
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
1,358 changes: 1,358 additions & 0 deletions .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

1,382 changes: 1,197 additions & 185 deletions api/datadogV2/api_status_pages.go

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions api/datadogV2/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -1265,26 +1265,36 @@
// - [StatusPagesApi.CreateBackfilledMaintenance]
// - [StatusPagesApi.CreateComponent]
// - [StatusPagesApi.CreateDegradation]
// - [StatusPagesApi.CreateDegradationTemplate]
// - [StatusPagesApi.CreateMaintenance]
// - [StatusPagesApi.CreateMaintenanceTemplate]
// - [StatusPagesApi.CreateStatusPage]
// - [StatusPagesApi.DeleteComponent]
// - [StatusPagesApi.DeleteDegradation]
// - [StatusPagesApi.DeleteDegradationTemplate]
// - [StatusPagesApi.DeleteMaintenanceTemplate]
// - [StatusPagesApi.DeleteStatusPage]
// - [StatusPagesApi.EditDegradationUpdate]
// - [StatusPagesApi.GetComponent]
// - [StatusPagesApi.GetDegradation]
// - [StatusPagesApi.GetDegradationTemplate]
// - [StatusPagesApi.GetMaintenance]
// - [StatusPagesApi.GetMaintenanceTemplate]
// - [StatusPagesApi.GetStatusPage]
// - [StatusPagesApi.ListComponents]
// - [StatusPagesApi.ListDegradationTemplates]
// - [StatusPagesApi.ListDegradations]
// - [StatusPagesApi.ListMaintenanceTemplates]
// - [StatusPagesApi.ListMaintenances]
// - [StatusPagesApi.ListStatusPages]
// - [StatusPagesApi.PublishStatusPage]
// - [StatusPagesApi.SoftDeleteDegradationUpdate]
// - [StatusPagesApi.UnpublishStatusPage]
// - [StatusPagesApi.UpdateComponent]
// - [StatusPagesApi.UpdateDegradation]
// - [StatusPagesApi.UpdateDegradationTemplate]
// - [StatusPagesApi.UpdateMaintenance]
// - [StatusPagesApi.UpdateMaintenanceTemplate]
// - [StatusPagesApi.UpdateStatusPage]
// - [StatuspageIntegrationApi.CreateStatuspageAccount]
// - [StatuspageIntegrationApi.CreateStatuspageUrlSetting]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import (
type CreateBackfilledDegradationRequestData struct {
// The supported attributes for creating a backfilled degradation.
Attributes *CreateBackfilledDegradationRequestDataAttributes `json:"attributes,omitempty"`
// The supported relationships for creating a backfilled degradation.
Relationships *CreateBackfilledDegradationRequestDataRelationships `json:"relationships,omitempty"`
// Degradations resource type.
Type PatchDegradationRequestDataType `json:"type"`
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
Expand Down Expand Up @@ -69,6 +71,34 @@ func (o *CreateBackfilledDegradationRequestData) SetAttributes(v CreateBackfille
o.Attributes = &v
}

// GetRelationships returns the Relationships field value if set, zero value otherwise.
func (o *CreateBackfilledDegradationRequestData) GetRelationships() CreateBackfilledDegradationRequestDataRelationships {
if o == nil || o.Relationships == nil {
var ret CreateBackfilledDegradationRequestDataRelationships
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 *CreateBackfilledDegradationRequestData) GetRelationshipsOk() (*CreateBackfilledDegradationRequestDataRelationships, 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 *CreateBackfilledDegradationRequestData) HasRelationships() bool {
return o != nil && o.Relationships != nil
}

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

// GetType returns the Type field value.
func (o *CreateBackfilledDegradationRequestData) GetType() PatchDegradationRequestDataType {
if o == nil {
Expand Down Expand Up @@ -101,6 +131,9 @@ func (o CreateBackfilledDegradationRequestData) MarshalJSON() ([]byte, error) {
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 {
Expand All @@ -112,8 +145,9 @@ func (o CreateBackfilledDegradationRequestData) MarshalJSON() ([]byte, error) {
// UnmarshalJSON deserializes the given payload.
func (o *CreateBackfilledDegradationRequestData) UnmarshalJSON(bytes []byte) (err error) {
all := struct {
Attributes *CreateBackfilledDegradationRequestDataAttributes `json:"attributes,omitempty"`
Type *PatchDegradationRequestDataType `json:"type"`
Attributes *CreateBackfilledDegradationRequestDataAttributes `json:"attributes,omitempty"`
Relationships *CreateBackfilledDegradationRequestDataRelationships `json:"relationships,omitempty"`
Type *PatchDegradationRequestDataType `json:"type"`
}{}
if err = datadog.Unmarshal(bytes, &all); err != nil {
return datadog.Unmarshal(bytes, &o.UnparsedObject)
Expand All @@ -123,7 +157,7 @@ func (o *CreateBackfilledDegradationRequestData) UnmarshalJSON(bytes []byte) (er
}
additionalProperties := make(map[string]interface{})
if err = datadog.UnmarshalUseNumber(bytes, &additionalProperties); err == nil {
datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "type"})
datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "relationships", "type"})
} else {
return err
}
Expand All @@ -133,6 +167,10 @@ func (o *CreateBackfilledDegradationRequestData) UnmarshalJSON(bytes []byte) (er
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 {
Expand Down
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"
)

// CreateBackfilledDegradationRequestDataRelationships The supported relationships for creating a backfilled degradation.
type CreateBackfilledDegradationRequestDataRelationships struct {
// The template used to create the backfilled degradation.
Template *CreateBackfilledDegradationRequestDataRelationshipsTemplate `json:"template,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:"-"`
}

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

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

// GetTemplate returns the Template field value if set, zero value otherwise.
func (o *CreateBackfilledDegradationRequestDataRelationships) GetTemplate() CreateBackfilledDegradationRequestDataRelationshipsTemplate {
if o == nil || o.Template == nil {
var ret CreateBackfilledDegradationRequestDataRelationshipsTemplate
return ret
}
return *o.Template
}

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

// HasTemplate returns a boolean if a field has been set.
func (o *CreateBackfilledDegradationRequestDataRelationships) HasTemplate() bool {
return o != nil && o.Template != nil
}

// SetTemplate gets a reference to the given CreateBackfilledDegradationRequestDataRelationshipsTemplate and assigns it to the Template field.
func (o *CreateBackfilledDegradationRequestDataRelationships) SetTemplate(v CreateBackfilledDegradationRequestDataRelationshipsTemplate) {
o.Template = &v
}

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

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

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

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

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

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

return nil
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
// 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"
)

// CreateBackfilledDegradationRequestDataRelationshipsTemplate The template used to create the backfilled degradation.
type CreateBackfilledDegradationRequestDataRelationshipsTemplate struct {
// The data object identifying the template used to create the backfilled degradation.
Data CreateBackfilledDegradationRequestDataRelationshipsTemplateData `json:"data"`
// 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:"-"`
}

// NewCreateBackfilledDegradationRequestDataRelationshipsTemplate instantiates a new CreateBackfilledDegradationRequestDataRelationshipsTemplate 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 NewCreateBackfilledDegradationRequestDataRelationshipsTemplate(data CreateBackfilledDegradationRequestDataRelationshipsTemplateData) *CreateBackfilledDegradationRequestDataRelationshipsTemplate {
this := CreateBackfilledDegradationRequestDataRelationshipsTemplate{}
this.Data = data
return &this
}

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

// GetData returns the Data field value.
func (o *CreateBackfilledDegradationRequestDataRelationshipsTemplate) GetData() CreateBackfilledDegradationRequestDataRelationshipsTemplateData {
if o == nil {
var ret CreateBackfilledDegradationRequestDataRelationshipsTemplateData
return ret
}
return o.Data
}

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

// SetData sets field value.
func (o *CreateBackfilledDegradationRequestDataRelationshipsTemplate) SetData(v CreateBackfilledDegradationRequestDataRelationshipsTemplateData) {
o.Data = v
}

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

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

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

hasInvalidField := false
if 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
}
Loading
Loading