Skip to content

Commit f64c156

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit d733453 of spec repo (DataDog#4214)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 7f07b07 commit f64c156

39 files changed

Lines changed: 4881 additions & 43 deletions

File tree

.generator/schemas/v2/openapi.yaml

Lines changed: 589 additions & 0 deletions
Large diffs are not rendered by default.

api/datadogV2/api_google_chat_integration.go

Lines changed: 801 additions & 43 deletions
Large diffs are not rendered by default.

api/datadogV2/doc.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,11 +462,21 @@
462462
// - [GCPIntegrationApi.ListGCPSTSAccounts]
463463
// - [GCPIntegrationApi.MakeGCPSTSDelegate]
464464
// - [GCPIntegrationApi.UpdateGCPSTSAccount]
465+
// - [GoogleChatIntegrationApi.CreateGoogleChatTargetAudience]
465466
// - [GoogleChatIntegrationApi.CreateOrganizationHandle]
467+
// - [GoogleChatIntegrationApi.DeleteGoogleChatDelegatedUser]
468+
// - [GoogleChatIntegrationApi.DeleteGoogleChatOrganization]
469+
// - [GoogleChatIntegrationApi.DeleteGoogleChatTargetAudience]
466470
// - [GoogleChatIntegrationApi.DeleteOrganizationHandle]
471+
// - [GoogleChatIntegrationApi.GetGoogleChatDelegatedUser]
472+
// - [GoogleChatIntegrationApi.GetGoogleChatOrganization]
473+
// - [GoogleChatIntegrationApi.GetGoogleChatTargetAudience]
467474
// - [GoogleChatIntegrationApi.GetOrganizationHandle]
468475
// - [GoogleChatIntegrationApi.GetSpaceByDisplayName]
476+
// - [GoogleChatIntegrationApi.ListGoogleChatOrganizations]
477+
// - [GoogleChatIntegrationApi.ListGoogleChatTargetAudiences]
469478
// - [GoogleChatIntegrationApi.ListOrganizationHandles]
479+
// - [GoogleChatIntegrationApi.UpdateGoogleChatTargetAudience]
470480
// - [GoogleChatIntegrationApi.UpdateOrganizationHandle]
471481
// - [HighAvailabilityMultiRegionApi.CreateHamrOrgConnection]
472482
// - [HighAvailabilityMultiRegionApi.GetHamrOrgConnection]
Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
// This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
// Copyright 2019-Present Datadog, Inc.
4+
5+
package datadogV2
6+
7+
import (
8+
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
9+
)
10+
11+
// GoogleChatDelegatedUserAttributes Google Chat delegated user attributes.
12+
type GoogleChatDelegatedUserAttributes struct {
13+
// The delegated user's display name.
14+
DisplayName *string `json:"display_name,omitempty"`
15+
// The delegated user's email address.
16+
Email *string `json:"email,omitempty"`
17+
// The list of features enabled for the delegated user.
18+
Features []string `json:"features,omitempty"`
19+
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
20+
UnparsedObject map[string]interface{} `json:"-"`
21+
AdditionalProperties map[string]interface{} `json:"-"`
22+
}
23+
24+
// NewGoogleChatDelegatedUserAttributes instantiates a new GoogleChatDelegatedUserAttributes object.
25+
// This constructor will assign default values to properties that have it defined,
26+
// and makes sure properties required by API are set, but the set of arguments
27+
// will change when the set of required properties is changed.
28+
func NewGoogleChatDelegatedUserAttributes() *GoogleChatDelegatedUserAttributes {
29+
this := GoogleChatDelegatedUserAttributes{}
30+
return &this
31+
}
32+
33+
// NewGoogleChatDelegatedUserAttributesWithDefaults instantiates a new GoogleChatDelegatedUserAttributes object.
34+
// This constructor will only assign default values to properties that have it defined,
35+
// but it doesn't guarantee that properties required by API are set.
36+
func NewGoogleChatDelegatedUserAttributesWithDefaults() *GoogleChatDelegatedUserAttributes {
37+
this := GoogleChatDelegatedUserAttributes{}
38+
return &this
39+
}
40+
41+
// GetDisplayName returns the DisplayName field value if set, zero value otherwise.
42+
func (o *GoogleChatDelegatedUserAttributes) GetDisplayName() string {
43+
if o == nil || o.DisplayName == nil {
44+
var ret string
45+
return ret
46+
}
47+
return *o.DisplayName
48+
}
49+
50+
// GetDisplayNameOk returns a tuple with the DisplayName field value if set, nil otherwise
51+
// and a boolean to check if the value has been set.
52+
func (o *GoogleChatDelegatedUserAttributes) GetDisplayNameOk() (*string, bool) {
53+
if o == nil || o.DisplayName == nil {
54+
return nil, false
55+
}
56+
return o.DisplayName, true
57+
}
58+
59+
// HasDisplayName returns a boolean if a field has been set.
60+
func (o *GoogleChatDelegatedUserAttributes) HasDisplayName() bool {
61+
return o != nil && o.DisplayName != nil
62+
}
63+
64+
// SetDisplayName gets a reference to the given string and assigns it to the DisplayName field.
65+
func (o *GoogleChatDelegatedUserAttributes) SetDisplayName(v string) {
66+
o.DisplayName = &v
67+
}
68+
69+
// GetEmail returns the Email field value if set, zero value otherwise.
70+
func (o *GoogleChatDelegatedUserAttributes) GetEmail() string {
71+
if o == nil || o.Email == nil {
72+
var ret string
73+
return ret
74+
}
75+
return *o.Email
76+
}
77+
78+
// GetEmailOk returns a tuple with the Email field value if set, nil otherwise
79+
// and a boolean to check if the value has been set.
80+
func (o *GoogleChatDelegatedUserAttributes) GetEmailOk() (*string, bool) {
81+
if o == nil || o.Email == nil {
82+
return nil, false
83+
}
84+
return o.Email, true
85+
}
86+
87+
// HasEmail returns a boolean if a field has been set.
88+
func (o *GoogleChatDelegatedUserAttributes) HasEmail() bool {
89+
return o != nil && o.Email != nil
90+
}
91+
92+
// SetEmail gets a reference to the given string and assigns it to the Email field.
93+
func (o *GoogleChatDelegatedUserAttributes) SetEmail(v string) {
94+
o.Email = &v
95+
}
96+
97+
// GetFeatures returns the Features field value if set, zero value otherwise.
98+
func (o *GoogleChatDelegatedUserAttributes) GetFeatures() []string {
99+
if o == nil || o.Features == nil {
100+
var ret []string
101+
return ret
102+
}
103+
return o.Features
104+
}
105+
106+
// GetFeaturesOk returns a tuple with the Features field value if set, nil otherwise
107+
// and a boolean to check if the value has been set.
108+
func (o *GoogleChatDelegatedUserAttributes) GetFeaturesOk() (*[]string, bool) {
109+
if o == nil || o.Features == nil {
110+
return nil, false
111+
}
112+
return &o.Features, true
113+
}
114+
115+
// HasFeatures returns a boolean if a field has been set.
116+
func (o *GoogleChatDelegatedUserAttributes) HasFeatures() bool {
117+
return o != nil && o.Features != nil
118+
}
119+
120+
// SetFeatures gets a reference to the given []string and assigns it to the Features field.
121+
func (o *GoogleChatDelegatedUserAttributes) SetFeatures(v []string) {
122+
o.Features = v
123+
}
124+
125+
// MarshalJSON serializes the struct using spec logic.
126+
func (o GoogleChatDelegatedUserAttributes) MarshalJSON() ([]byte, error) {
127+
toSerialize := map[string]interface{}{}
128+
if o.UnparsedObject != nil {
129+
return datadog.Marshal(o.UnparsedObject)
130+
}
131+
if o.DisplayName != nil {
132+
toSerialize["display_name"] = o.DisplayName
133+
}
134+
if o.Email != nil {
135+
toSerialize["email"] = o.Email
136+
}
137+
if o.Features != nil {
138+
toSerialize["features"] = o.Features
139+
}
140+
141+
for key, value := range o.AdditionalProperties {
142+
toSerialize[key] = value
143+
}
144+
return datadog.Marshal(toSerialize)
145+
}
146+
147+
// UnmarshalJSON deserializes the given payload.
148+
func (o *GoogleChatDelegatedUserAttributes) UnmarshalJSON(bytes []byte) (err error) {
149+
all := struct {
150+
DisplayName *string `json:"display_name,omitempty"`
151+
Email *string `json:"email,omitempty"`
152+
Features []string `json:"features,omitempty"`
153+
}{}
154+
if err = datadog.Unmarshal(bytes, &all); err != nil {
155+
return datadog.Unmarshal(bytes, &o.UnparsedObject)
156+
}
157+
additionalProperties := make(map[string]interface{})
158+
if err = datadog.UnmarshalUseNumber(bytes, &additionalProperties); err == nil {
159+
datadog.DeleteKeys(additionalProperties, &[]string{"display_name", "email", "features"})
160+
} else {
161+
return err
162+
}
163+
o.DisplayName = all.DisplayName
164+
o.Email = all.Email
165+
o.Features = all.Features
166+
167+
if len(additionalProperties) > 0 {
168+
o.AdditionalProperties = additionalProperties
169+
}
170+
171+
return nil
172+
}
Lines changed: 189 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,189 @@
1+
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
// This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
// Copyright 2019-Present Datadog, Inc.
4+
5+
package datadogV2
6+
7+
import (
8+
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
9+
)
10+
11+
// GoogleChatDelegatedUserData Google Chat delegated user data from a response.
12+
type GoogleChatDelegatedUserData struct {
13+
// Google Chat delegated user attributes.
14+
Attributes *GoogleChatDelegatedUserAttributes `json:"attributes,omitempty"`
15+
// The ID of the delegated user.
16+
Id *string `json:"id,omitempty"`
17+
// Google Chat delegated user resource type.
18+
Type *GoogleChatDelegatedUserType `json:"type,omitempty"`
19+
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
20+
UnparsedObject map[string]interface{} `json:"-"`
21+
AdditionalProperties map[string]interface{} `json:"-"`
22+
}
23+
24+
// NewGoogleChatDelegatedUserData instantiates a new GoogleChatDelegatedUserData object.
25+
// This constructor will assign default values to properties that have it defined,
26+
// and makes sure properties required by API are set, but the set of arguments
27+
// will change when the set of required properties is changed.
28+
func NewGoogleChatDelegatedUserData() *GoogleChatDelegatedUserData {
29+
this := GoogleChatDelegatedUserData{}
30+
var typeVar GoogleChatDelegatedUserType = GOOGLECHATDELEGATEDUSERTYPE_GOOGLE_CHAT_DELEGATED_USER_TYPE
31+
this.Type = &typeVar
32+
return &this
33+
}
34+
35+
// NewGoogleChatDelegatedUserDataWithDefaults instantiates a new GoogleChatDelegatedUserData object.
36+
// This constructor will only assign default values to properties that have it defined,
37+
// but it doesn't guarantee that properties required by API are set.
38+
func NewGoogleChatDelegatedUserDataWithDefaults() *GoogleChatDelegatedUserData {
39+
this := GoogleChatDelegatedUserData{}
40+
var typeVar GoogleChatDelegatedUserType = GOOGLECHATDELEGATEDUSERTYPE_GOOGLE_CHAT_DELEGATED_USER_TYPE
41+
this.Type = &typeVar
42+
return &this
43+
}
44+
45+
// GetAttributes returns the Attributes field value if set, zero value otherwise.
46+
func (o *GoogleChatDelegatedUserData) GetAttributes() GoogleChatDelegatedUserAttributes {
47+
if o == nil || o.Attributes == nil {
48+
var ret GoogleChatDelegatedUserAttributes
49+
return ret
50+
}
51+
return *o.Attributes
52+
}
53+
54+
// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise
55+
// and a boolean to check if the value has been set.
56+
func (o *GoogleChatDelegatedUserData) GetAttributesOk() (*GoogleChatDelegatedUserAttributes, bool) {
57+
if o == nil || o.Attributes == nil {
58+
return nil, false
59+
}
60+
return o.Attributes, true
61+
}
62+
63+
// HasAttributes returns a boolean if a field has been set.
64+
func (o *GoogleChatDelegatedUserData) HasAttributes() bool {
65+
return o != nil && o.Attributes != nil
66+
}
67+
68+
// SetAttributes gets a reference to the given GoogleChatDelegatedUserAttributes and assigns it to the Attributes field.
69+
func (o *GoogleChatDelegatedUserData) SetAttributes(v GoogleChatDelegatedUserAttributes) {
70+
o.Attributes = &v
71+
}
72+
73+
// GetId returns the Id field value if set, zero value otherwise.
74+
func (o *GoogleChatDelegatedUserData) GetId() string {
75+
if o == nil || o.Id == nil {
76+
var ret string
77+
return ret
78+
}
79+
return *o.Id
80+
}
81+
82+
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
83+
// and a boolean to check if the value has been set.
84+
func (o *GoogleChatDelegatedUserData) GetIdOk() (*string, bool) {
85+
if o == nil || o.Id == nil {
86+
return nil, false
87+
}
88+
return o.Id, true
89+
}
90+
91+
// HasId returns a boolean if a field has been set.
92+
func (o *GoogleChatDelegatedUserData) HasId() bool {
93+
return o != nil && o.Id != nil
94+
}
95+
96+
// SetId gets a reference to the given string and assigns it to the Id field.
97+
func (o *GoogleChatDelegatedUserData) SetId(v string) {
98+
o.Id = &v
99+
}
100+
101+
// GetType returns the Type field value if set, zero value otherwise.
102+
func (o *GoogleChatDelegatedUserData) GetType() GoogleChatDelegatedUserType {
103+
if o == nil || o.Type == nil {
104+
var ret GoogleChatDelegatedUserType
105+
return ret
106+
}
107+
return *o.Type
108+
}
109+
110+
// GetTypeOk returns a tuple with the Type field value if set, nil otherwise
111+
// and a boolean to check if the value has been set.
112+
func (o *GoogleChatDelegatedUserData) GetTypeOk() (*GoogleChatDelegatedUserType, bool) {
113+
if o == nil || o.Type == nil {
114+
return nil, false
115+
}
116+
return o.Type, true
117+
}
118+
119+
// HasType returns a boolean if a field has been set.
120+
func (o *GoogleChatDelegatedUserData) HasType() bool {
121+
return o != nil && o.Type != nil
122+
}
123+
124+
// SetType gets a reference to the given GoogleChatDelegatedUserType and assigns it to the Type field.
125+
func (o *GoogleChatDelegatedUserData) SetType(v GoogleChatDelegatedUserType) {
126+
o.Type = &v
127+
}
128+
129+
// MarshalJSON serializes the struct using spec logic.
130+
func (o GoogleChatDelegatedUserData) MarshalJSON() ([]byte, error) {
131+
toSerialize := map[string]interface{}{}
132+
if o.UnparsedObject != nil {
133+
return datadog.Marshal(o.UnparsedObject)
134+
}
135+
if o.Attributes != nil {
136+
toSerialize["attributes"] = o.Attributes
137+
}
138+
if o.Id != nil {
139+
toSerialize["id"] = o.Id
140+
}
141+
if o.Type != nil {
142+
toSerialize["type"] = o.Type
143+
}
144+
145+
for key, value := range o.AdditionalProperties {
146+
toSerialize[key] = value
147+
}
148+
return datadog.Marshal(toSerialize)
149+
}
150+
151+
// UnmarshalJSON deserializes the given payload.
152+
func (o *GoogleChatDelegatedUserData) UnmarshalJSON(bytes []byte) (err error) {
153+
all := struct {
154+
Attributes *GoogleChatDelegatedUserAttributes `json:"attributes,omitempty"`
155+
Id *string `json:"id,omitempty"`
156+
Type *GoogleChatDelegatedUserType `json:"type,omitempty"`
157+
}{}
158+
if err = datadog.Unmarshal(bytes, &all); err != nil {
159+
return datadog.Unmarshal(bytes, &o.UnparsedObject)
160+
}
161+
additionalProperties := make(map[string]interface{})
162+
if err = datadog.UnmarshalUseNumber(bytes, &additionalProperties); err == nil {
163+
datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "type"})
164+
} else {
165+
return err
166+
}
167+
168+
hasInvalidField := false
169+
if all.Attributes != nil && all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil {
170+
hasInvalidField = true
171+
}
172+
o.Attributes = all.Attributes
173+
o.Id = all.Id
174+
if all.Type != nil && !all.Type.IsValid() {
175+
hasInvalidField = true
176+
} else {
177+
o.Type = all.Type
178+
}
179+
180+
if len(additionalProperties) > 0 {
181+
o.AdditionalProperties = additionalProperties
182+
}
183+
184+
if hasInvalidField {
185+
return datadog.Unmarshal(bytes, &o.UnparsedObject)
186+
}
187+
188+
return nil
189+
}

0 commit comments

Comments
 (0)