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

Large diffs are not rendered by default.

645 changes: 644 additions & 1 deletion api/datadogV2/api_synthetics.go

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions api/datadogV2/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -918,16 +918,20 @@
// - [StatusPagesApi.UpdateMaintenance]
// - [StatusPagesApi.UpdateStatusPage]
// - [SyntheticsApi.AbortTestFileMultipartUpload]
// - [SyntheticsApi.AddTestToSyntheticsDowntime]
// - [SyntheticsApi.CompleteTestFileMultipartUpload]
// - [SyntheticsApi.CreateSyntheticsDowntime]
// - [SyntheticsApi.CreateSyntheticsNetworkTest]
// - [SyntheticsApi.CreateSyntheticsSuite]
// - [SyntheticsApi.DeleteSyntheticsDowntime]
// - [SyntheticsApi.DeleteSyntheticsSuites]
// - [SyntheticsApi.DeleteSyntheticsTests]
// - [SyntheticsApi.EditSyntheticsSuite]
// - [SyntheticsApi.GetApiMultistepSubtestParents]
// - [SyntheticsApi.GetApiMultistepSubtests]
// - [SyntheticsApi.GetOnDemandConcurrencyCap]
// - [SyntheticsApi.GetSyntheticsBrowserTestResult]
// - [SyntheticsApi.GetSyntheticsDowntime]
// - [SyntheticsApi.GetSyntheticsFastTestResult]
// - [SyntheticsApi.GetSyntheticsNetworkTest]
// - [SyntheticsApi.GetSyntheticsSuite]
Expand All @@ -937,13 +941,16 @@
// - [SyntheticsApi.GetTestFileMultipartPresignedUrls]
// - [SyntheticsApi.GetTestParentSuites]
// - [SyntheticsApi.ListSyntheticsBrowserTestLatestResults]
// - [SyntheticsApi.ListSyntheticsDowntimes]
// - [SyntheticsApi.ListSyntheticsTestLatestResults]
// - [SyntheticsApi.ListSyntheticsTestVersions]
// - [SyntheticsApi.PatchGlobalVariable]
// - [SyntheticsApi.PatchTestSuite]
// - [SyntheticsApi.PollSyntheticsTestResults]
// - [SyntheticsApi.RemoveTestFromSyntheticsDowntime]
// - [SyntheticsApi.SearchSuites]
// - [SyntheticsApi.SetOnDemandConcurrencyCap]
// - [SyntheticsApi.UpdateSyntheticsDowntime]
// - [SyntheticsApi.UpdateSyntheticsNetworkTest]
// - [TeamsApi.AddMemberTeam]
// - [TeamsApi.AddTeamHierarchyLink]
Expand Down
178 changes: 178 additions & 0 deletions api/datadogV2/model_synthetics_downtime_data.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
// 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"
)

// SyntheticsDowntimeData A Synthetics downtime object.
type SyntheticsDowntimeData struct {
// Attributes of a Synthetics downtime response object.
Attributes SyntheticsDowntimeDataAttributesResponse `json:"attributes"`
// The unique identifier of the downtime.
Id string `json:"id"`
// The resource type for a Synthetics downtime.
Type SyntheticsDowntimeResourceType `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:"-"`
}

// NewSyntheticsDowntimeData instantiates a new SyntheticsDowntimeData 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 NewSyntheticsDowntimeData(attributes SyntheticsDowntimeDataAttributesResponse, id string, typeVar SyntheticsDowntimeResourceType) *SyntheticsDowntimeData {
this := SyntheticsDowntimeData{}
this.Attributes = attributes
this.Id = id
this.Type = typeVar
return &this
}

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

// GetAttributes returns the Attributes field value.
func (o *SyntheticsDowntimeData) GetAttributes() SyntheticsDowntimeDataAttributesResponse {
if o == nil {
var ret SyntheticsDowntimeDataAttributesResponse
return ret
}
return o.Attributes
}

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

// SetAttributes sets field value.
func (o *SyntheticsDowntimeData) SetAttributes(v SyntheticsDowntimeDataAttributesResponse) {
o.Attributes = v
}

// GetId returns the Id field value.
func (o *SyntheticsDowntimeData) GetId() string {
if o == nil {
var ret string
return ret
}
return o.Id
}

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

// SetId sets field value.
func (o *SyntheticsDowntimeData) SetId(v string) {
o.Id = v
}

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

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

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

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

// UnmarshalJSON deserializes the given payload.
func (o *SyntheticsDowntimeData) UnmarshalJSON(bytes []byte) (err error) {
all := struct {
Attributes *SyntheticsDowntimeDataAttributesResponse `json:"attributes"`
Id *string `json:"id"`
Type *SyntheticsDowntimeResourceType `json:"type"`
}{}
if err = datadog.Unmarshal(bytes, &all); err != nil {
return datadog.Unmarshal(bytes, &o.UnparsedObject)
}
if all.Attributes == nil {
return fmt.Errorf("required field attributes missing")
}
if all.Id == nil {
return fmt.Errorf("required field id missing")
}
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", "id", "type"})
} else {
return err
}

hasInvalidField := false
if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil {
hasInvalidField = true
}
o.Attributes = *all.Attributes
o.Id = *all.Id
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