|
| 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