Skip to content

Commit 122bef8

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Added support for Google Chat Organization Handles Public API (DataDog#3667)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent afcf2f2 commit 122bef8

40 files changed

Lines changed: 3611 additions & 0 deletions

File tree

.generator/schemas/v2/openapi.yaml

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

api/datadogV2/api_google_chat_integration.go

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

api/datadogV2/doc.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,12 @@
303303
// - [GCPIntegrationApi.ListGCPSTSAccounts]
304304
// - [GCPIntegrationApi.MakeGCPSTSDelegate]
305305
// - [GCPIntegrationApi.UpdateGCPSTSAccount]
306+
// - [GoogleChatIntegrationApi.CreateOrganizationHandle]
307+
// - [GoogleChatIntegrationApi.DeleteOrganizationHandle]
308+
// - [GoogleChatIntegrationApi.GetOrganizationHandle]
309+
// - [GoogleChatIntegrationApi.GetSpaceByDisplayName]
310+
// - [GoogleChatIntegrationApi.ListOrganizationHandles]
311+
// - [GoogleChatIntegrationApi.UpdateOrganizationHandle]
306312
// - [HighAvailabilityMultiRegionApi.CreateHamrOrgConnection]
307313
// - [HighAvailabilityMultiRegionApi.GetHamrOrgConnection]
308314
// - [IPAllowlistApi.GetIPAllowlist]
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
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+
"fmt"
9+
10+
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
11+
)
12+
13+
// GoogleChatAppNamedSpaceResponse Response with Google Chat space information.
14+
type GoogleChatAppNamedSpaceResponse struct {
15+
// Google Chat space data from a response.
16+
Data GoogleChatAppNamedSpaceResponseData `json:"data"`
17+
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
18+
UnparsedObject map[string]interface{} `json:"-"`
19+
AdditionalProperties map[string]interface{} `json:"-"`
20+
}
21+
22+
// NewGoogleChatAppNamedSpaceResponse instantiates a new GoogleChatAppNamedSpaceResponse object.
23+
// This constructor will assign default values to properties that have it defined,
24+
// and makes sure properties required by API are set, but the set of arguments
25+
// will change when the set of required properties is changed.
26+
func NewGoogleChatAppNamedSpaceResponse(data GoogleChatAppNamedSpaceResponseData) *GoogleChatAppNamedSpaceResponse {
27+
this := GoogleChatAppNamedSpaceResponse{}
28+
this.Data = data
29+
return &this
30+
}
31+
32+
// NewGoogleChatAppNamedSpaceResponseWithDefaults instantiates a new GoogleChatAppNamedSpaceResponse object.
33+
// This constructor will only assign default values to properties that have it defined,
34+
// but it doesn't guarantee that properties required by API are set.
35+
func NewGoogleChatAppNamedSpaceResponseWithDefaults() *GoogleChatAppNamedSpaceResponse {
36+
this := GoogleChatAppNamedSpaceResponse{}
37+
return &this
38+
}
39+
40+
// GetData returns the Data field value.
41+
func (o *GoogleChatAppNamedSpaceResponse) GetData() GoogleChatAppNamedSpaceResponseData {
42+
if o == nil {
43+
var ret GoogleChatAppNamedSpaceResponseData
44+
return ret
45+
}
46+
return o.Data
47+
}
48+
49+
// GetDataOk returns a tuple with the Data field value
50+
// and a boolean to check if the value has been set.
51+
func (o *GoogleChatAppNamedSpaceResponse) GetDataOk() (*GoogleChatAppNamedSpaceResponseData, bool) {
52+
if o == nil {
53+
return nil, false
54+
}
55+
return &o.Data, true
56+
}
57+
58+
// SetData sets field value.
59+
func (o *GoogleChatAppNamedSpaceResponse) SetData(v GoogleChatAppNamedSpaceResponseData) {
60+
o.Data = v
61+
}
62+
63+
// MarshalJSON serializes the struct using spec logic.
64+
func (o GoogleChatAppNamedSpaceResponse) MarshalJSON() ([]byte, error) {
65+
toSerialize := map[string]interface{}{}
66+
if o.UnparsedObject != nil {
67+
return datadog.Marshal(o.UnparsedObject)
68+
}
69+
toSerialize["data"] = o.Data
70+
71+
for key, value := range o.AdditionalProperties {
72+
toSerialize[key] = value
73+
}
74+
return datadog.Marshal(toSerialize)
75+
}
76+
77+
// UnmarshalJSON deserializes the given payload.
78+
func (o *GoogleChatAppNamedSpaceResponse) UnmarshalJSON(bytes []byte) (err error) {
79+
all := struct {
80+
Data *GoogleChatAppNamedSpaceResponseData `json:"data"`
81+
}{}
82+
if err = datadog.Unmarshal(bytes, &all); err != nil {
83+
return datadog.Unmarshal(bytes, &o.UnparsedObject)
84+
}
85+
if all.Data == nil {
86+
return fmt.Errorf("required field data missing")
87+
}
88+
additionalProperties := make(map[string]interface{})
89+
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
90+
datadog.DeleteKeys(additionalProperties, &[]string{"data"})
91+
} else {
92+
return err
93+
}
94+
95+
hasInvalidField := false
96+
if all.Data.UnparsedObject != nil && o.UnparsedObject == nil {
97+
hasInvalidField = true
98+
}
99+
o.Data = *all.Data
100+
101+
if len(additionalProperties) > 0 {
102+
o.AdditionalProperties = additionalProperties
103+
}
104+
105+
if hasInvalidField {
106+
return datadog.Unmarshal(bytes, &o.UnparsedObject)
107+
}
108+
109+
return nil
110+
}
Lines changed: 207 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,207 @@
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+
// GoogleChatAppNamedSpaceResponseAttributes Google Chat space attributes.
12+
type GoogleChatAppNamedSpaceResponseAttributes struct {
13+
// Google space display name.
14+
DisplayName *string `json:"display_name,omitempty"`
15+
// Organization binding ID.
16+
OrganizationBindingId *string `json:"organization_binding_id,omitempty"`
17+
// Google space resource name.
18+
ResourceName *string `json:"resource_name,omitempty"`
19+
// Google space URI.
20+
SpaceUri *string `json:"space_uri,omitempty"`
21+
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
22+
UnparsedObject map[string]interface{} `json:"-"`
23+
AdditionalProperties map[string]interface{} `json:"-"`
24+
}
25+
26+
// NewGoogleChatAppNamedSpaceResponseAttributes instantiates a new GoogleChatAppNamedSpaceResponseAttributes object.
27+
// This constructor will assign default values to properties that have it defined,
28+
// and makes sure properties required by API are set, but the set of arguments
29+
// will change when the set of required properties is changed.
30+
func NewGoogleChatAppNamedSpaceResponseAttributes() *GoogleChatAppNamedSpaceResponseAttributes {
31+
this := GoogleChatAppNamedSpaceResponseAttributes{}
32+
return &this
33+
}
34+
35+
// NewGoogleChatAppNamedSpaceResponseAttributesWithDefaults instantiates a new GoogleChatAppNamedSpaceResponseAttributes 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 NewGoogleChatAppNamedSpaceResponseAttributesWithDefaults() *GoogleChatAppNamedSpaceResponseAttributes {
39+
this := GoogleChatAppNamedSpaceResponseAttributes{}
40+
return &this
41+
}
42+
43+
// GetDisplayName returns the DisplayName field value if set, zero value otherwise.
44+
func (o *GoogleChatAppNamedSpaceResponseAttributes) GetDisplayName() string {
45+
if o == nil || o.DisplayName == nil {
46+
var ret string
47+
return ret
48+
}
49+
return *o.DisplayName
50+
}
51+
52+
// GetDisplayNameOk returns a tuple with the DisplayName field value if set, nil otherwise
53+
// and a boolean to check if the value has been set.
54+
func (o *GoogleChatAppNamedSpaceResponseAttributes) GetDisplayNameOk() (*string, bool) {
55+
if o == nil || o.DisplayName == nil {
56+
return nil, false
57+
}
58+
return o.DisplayName, true
59+
}
60+
61+
// HasDisplayName returns a boolean if a field has been set.
62+
func (o *GoogleChatAppNamedSpaceResponseAttributes) HasDisplayName() bool {
63+
return o != nil && o.DisplayName != nil
64+
}
65+
66+
// SetDisplayName gets a reference to the given string and assigns it to the DisplayName field.
67+
func (o *GoogleChatAppNamedSpaceResponseAttributes) SetDisplayName(v string) {
68+
o.DisplayName = &v
69+
}
70+
71+
// GetOrganizationBindingId returns the OrganizationBindingId field value if set, zero value otherwise.
72+
func (o *GoogleChatAppNamedSpaceResponseAttributes) GetOrganizationBindingId() string {
73+
if o == nil || o.OrganizationBindingId == nil {
74+
var ret string
75+
return ret
76+
}
77+
return *o.OrganizationBindingId
78+
}
79+
80+
// GetOrganizationBindingIdOk returns a tuple with the OrganizationBindingId field value if set, nil otherwise
81+
// and a boolean to check if the value has been set.
82+
func (o *GoogleChatAppNamedSpaceResponseAttributes) GetOrganizationBindingIdOk() (*string, bool) {
83+
if o == nil || o.OrganizationBindingId == nil {
84+
return nil, false
85+
}
86+
return o.OrganizationBindingId, true
87+
}
88+
89+
// HasOrganizationBindingId returns a boolean if a field has been set.
90+
func (o *GoogleChatAppNamedSpaceResponseAttributes) HasOrganizationBindingId() bool {
91+
return o != nil && o.OrganizationBindingId != nil
92+
}
93+
94+
// SetOrganizationBindingId gets a reference to the given string and assigns it to the OrganizationBindingId field.
95+
func (o *GoogleChatAppNamedSpaceResponseAttributes) SetOrganizationBindingId(v string) {
96+
o.OrganizationBindingId = &v
97+
}
98+
99+
// GetResourceName returns the ResourceName field value if set, zero value otherwise.
100+
func (o *GoogleChatAppNamedSpaceResponseAttributes) GetResourceName() string {
101+
if o == nil || o.ResourceName == nil {
102+
var ret string
103+
return ret
104+
}
105+
return *o.ResourceName
106+
}
107+
108+
// GetResourceNameOk returns a tuple with the ResourceName field value if set, nil otherwise
109+
// and a boolean to check if the value has been set.
110+
func (o *GoogleChatAppNamedSpaceResponseAttributes) GetResourceNameOk() (*string, bool) {
111+
if o == nil || o.ResourceName == nil {
112+
return nil, false
113+
}
114+
return o.ResourceName, true
115+
}
116+
117+
// HasResourceName returns a boolean if a field has been set.
118+
func (o *GoogleChatAppNamedSpaceResponseAttributes) HasResourceName() bool {
119+
return o != nil && o.ResourceName != nil
120+
}
121+
122+
// SetResourceName gets a reference to the given string and assigns it to the ResourceName field.
123+
func (o *GoogleChatAppNamedSpaceResponseAttributes) SetResourceName(v string) {
124+
o.ResourceName = &v
125+
}
126+
127+
// GetSpaceUri returns the SpaceUri field value if set, zero value otherwise.
128+
func (o *GoogleChatAppNamedSpaceResponseAttributes) GetSpaceUri() string {
129+
if o == nil || o.SpaceUri == nil {
130+
var ret string
131+
return ret
132+
}
133+
return *o.SpaceUri
134+
}
135+
136+
// GetSpaceUriOk returns a tuple with the SpaceUri field value if set, nil otherwise
137+
// and a boolean to check if the value has been set.
138+
func (o *GoogleChatAppNamedSpaceResponseAttributes) GetSpaceUriOk() (*string, bool) {
139+
if o == nil || o.SpaceUri == nil {
140+
return nil, false
141+
}
142+
return o.SpaceUri, true
143+
}
144+
145+
// HasSpaceUri returns a boolean if a field has been set.
146+
func (o *GoogleChatAppNamedSpaceResponseAttributes) HasSpaceUri() bool {
147+
return o != nil && o.SpaceUri != nil
148+
}
149+
150+
// SetSpaceUri gets a reference to the given string and assigns it to the SpaceUri field.
151+
func (o *GoogleChatAppNamedSpaceResponseAttributes) SetSpaceUri(v string) {
152+
o.SpaceUri = &v
153+
}
154+
155+
// MarshalJSON serializes the struct using spec logic.
156+
func (o GoogleChatAppNamedSpaceResponseAttributes) MarshalJSON() ([]byte, error) {
157+
toSerialize := map[string]interface{}{}
158+
if o.UnparsedObject != nil {
159+
return datadog.Marshal(o.UnparsedObject)
160+
}
161+
if o.DisplayName != nil {
162+
toSerialize["display_name"] = o.DisplayName
163+
}
164+
if o.OrganizationBindingId != nil {
165+
toSerialize["organization_binding_id"] = o.OrganizationBindingId
166+
}
167+
if o.ResourceName != nil {
168+
toSerialize["resource_name"] = o.ResourceName
169+
}
170+
if o.SpaceUri != nil {
171+
toSerialize["space_uri"] = o.SpaceUri
172+
}
173+
174+
for key, value := range o.AdditionalProperties {
175+
toSerialize[key] = value
176+
}
177+
return datadog.Marshal(toSerialize)
178+
}
179+
180+
// UnmarshalJSON deserializes the given payload.
181+
func (o *GoogleChatAppNamedSpaceResponseAttributes) UnmarshalJSON(bytes []byte) (err error) {
182+
all := struct {
183+
DisplayName *string `json:"display_name,omitempty"`
184+
OrganizationBindingId *string `json:"organization_binding_id,omitempty"`
185+
ResourceName *string `json:"resource_name,omitempty"`
186+
SpaceUri *string `json:"space_uri,omitempty"`
187+
}{}
188+
if err = datadog.Unmarshal(bytes, &all); err != nil {
189+
return datadog.Unmarshal(bytes, &o.UnparsedObject)
190+
}
191+
additionalProperties := make(map[string]interface{})
192+
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
193+
datadog.DeleteKeys(additionalProperties, &[]string{"display_name", "organization_binding_id", "resource_name", "space_uri"})
194+
} else {
195+
return err
196+
}
197+
o.DisplayName = all.DisplayName
198+
o.OrganizationBindingId = all.OrganizationBindingId
199+
o.ResourceName = all.ResourceName
200+
o.SpaceUri = all.SpaceUri
201+
202+
if len(additionalProperties) > 0 {
203+
o.AdditionalProperties = additionalProperties
204+
}
205+
206+
return nil
207+
}

0 commit comments

Comments
 (0)