-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add MSTeams integration metadata info (#2723)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
- Loading branch information
1 parent
ff3a909
commit ffd2e91
Showing
5 changed files
with
374 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
// 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" | ||
) | ||
|
||
// MSTeamsIntegrationMetadata Incident integration metadata for the Microsoft Teams integration. | ||
type MSTeamsIntegrationMetadata struct { | ||
// Array of Microsoft Teams in this integration metadata. | ||
Teams []MSTeamsIntegrationMetadataTeamsItem `json:"teams"` | ||
// 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:"-"` | ||
} | ||
|
||
// NewMSTeamsIntegrationMetadata instantiates a new MSTeamsIntegrationMetadata 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 NewMSTeamsIntegrationMetadata(teams []MSTeamsIntegrationMetadataTeamsItem) *MSTeamsIntegrationMetadata { | ||
this := MSTeamsIntegrationMetadata{} | ||
this.Teams = teams | ||
return &this | ||
} | ||
|
||
// NewMSTeamsIntegrationMetadataWithDefaults instantiates a new MSTeamsIntegrationMetadata 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 NewMSTeamsIntegrationMetadataWithDefaults() *MSTeamsIntegrationMetadata { | ||
this := MSTeamsIntegrationMetadata{} | ||
return &this | ||
} | ||
|
||
// GetTeams returns the Teams field value. | ||
func (o *MSTeamsIntegrationMetadata) GetTeams() []MSTeamsIntegrationMetadataTeamsItem { | ||
if o == nil { | ||
var ret []MSTeamsIntegrationMetadataTeamsItem | ||
return ret | ||
} | ||
return o.Teams | ||
} | ||
|
||
// GetTeamsOk returns a tuple with the Teams field value | ||
// and a boolean to check if the value has been set. | ||
func (o *MSTeamsIntegrationMetadata) GetTeamsOk() (*[]MSTeamsIntegrationMetadataTeamsItem, bool) { | ||
if o == nil { | ||
return nil, false | ||
} | ||
return &o.Teams, true | ||
} | ||
|
||
// SetTeams sets field value. | ||
func (o *MSTeamsIntegrationMetadata) SetTeams(v []MSTeamsIntegrationMetadataTeamsItem) { | ||
o.Teams = v | ||
} | ||
|
||
// MarshalJSON serializes the struct using spec logic. | ||
func (o MSTeamsIntegrationMetadata) MarshalJSON() ([]byte, error) { | ||
toSerialize := map[string]interface{}{} | ||
if o.UnparsedObject != nil { | ||
return datadog.Marshal(o.UnparsedObject) | ||
} | ||
toSerialize["teams"] = o.Teams | ||
|
||
for key, value := range o.AdditionalProperties { | ||
toSerialize[key] = value | ||
} | ||
return datadog.Marshal(toSerialize) | ||
} | ||
|
||
// UnmarshalJSON deserializes the given payload. | ||
func (o *MSTeamsIntegrationMetadata) UnmarshalJSON(bytes []byte) (err error) { | ||
all := struct { | ||
Teams *[]MSTeamsIntegrationMetadataTeamsItem `json:"teams"` | ||
}{} | ||
if err = datadog.Unmarshal(bytes, &all); err != nil { | ||
return datadog.Unmarshal(bytes, &o.UnparsedObject) | ||
} | ||
if all.Teams == nil { | ||
return fmt.Errorf("required field teams missing") | ||
} | ||
additionalProperties := make(map[string]interface{}) | ||
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { | ||
datadog.DeleteKeys(additionalProperties, &[]string{"teams"}) | ||
} else { | ||
return err | ||
} | ||
o.Teams = *all.Teams | ||
|
||
if len(additionalProperties) > 0 { | ||
o.AdditionalProperties = additionalProperties | ||
} | ||
|
||
return nil | ||
} |
Oops, something went wrong.