diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 382c9233aa5..d051a6ed646 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -51964,6 +51964,8 @@ components: items: $ref: "#/components/schemas/OrgGroupMembershipData" type: array + links: + $ref: "#/components/schemas/OrgGroupPaginationLinks" meta: $ref: "#/components/schemas/OrgGroupPaginationMeta" required: @@ -52081,6 +52083,8 @@ components: items: $ref: "#/components/schemas/OrgGroupMembershipData" type: array + links: + $ref: "#/components/schemas/OrgGroupPaginationLinks" meta: $ref: "#/components/schemas/OrgGroupPaginationMeta" required: @@ -52181,24 +52185,71 @@ components: required: - data type: object + OrgGroupPaginationLinks: + description: Pagination links for navigating between pages of an org group list response. + properties: + first: + description: Link to the first page. + type: string + last: + description: Link to the last page. + type: string + next: + description: Link to the next page. + nullable: true + type: string + prev: + description: Link to the previous page. + nullable: true + type: string + self: + description: Link to the current page. + type: string + type: object OrgGroupPaginationMeta: - description: Pagination metadata. + description: Pagination metadata for org group list responses. properties: page: $ref: "#/components/schemas/OrgGroupPaginationMetaPage" - required: - - page type: object OrgGroupPaginationMetaPage: - description: Page-based pagination details. + description: Page-based pagination details for org group list responses. properties: - total_count: - description: The total number of items. - example: 42 + first_number: + description: First page number. format: int64 type: integer - required: - - total_count + last_number: + description: Last page number. + format: int64 + nullable: true + type: integer + next_number: + description: Next page number. + format: int64 + nullable: true + type: integer + number: + description: Page number. + format: int64 + type: integer + prev_number: + description: Previous page number. + format: int64 + nullable: true + type: integer + size: + description: Page size. + format: int64 + type: integer + total: + description: Total number of results. + format: int64 + type: integer + type: + description: Pagination type. + example: "number_size" + type: string type: object OrgGroupPolicyAttributes: description: Attributes of an org group policy. @@ -52388,6 +52439,8 @@ components: items: $ref: "#/components/schemas/OrgGroupPolicyData" type: array + links: + $ref: "#/components/schemas/OrgGroupPaginationLinks" meta: $ref: "#/components/schemas/OrgGroupPaginationMeta" required: @@ -52501,6 +52554,8 @@ components: items: $ref: "#/components/schemas/OrgGroupPolicyOverrideData" type: array + links: + $ref: "#/components/schemas/OrgGroupPaginationLinks" meta: $ref: "#/components/schemas/OrgGroupPaginationMeta" required: @@ -111582,9 +111637,22 @@ paths: id: "a1b2c3d4-e5f6-7890-abcd-ef0123456789" type: org_groups type: org_group_memberships + links: + first: "https://api.datadoghq.com/api/v2/org_group_memberships?filter%5Borg_group_id%5D=a1b2c3d4-e5f6-7890-abcd-ef0123456789&page%5Bnumber%5D=0&page%5Bsize%5D=50" + last: "https://api.datadoghq.com/api/v2/org_group_memberships?filter%5Borg_group_id%5D=a1b2c3d4-e5f6-7890-abcd-ef0123456789&page%5Bnumber%5D=0&page%5Bsize%5D=50" + next: + prev: + self: "https://api.datadoghq.com/api/v2/org_group_memberships?filter%5Borg_group_id%5D=a1b2c3d4-e5f6-7890-abcd-ef0123456789&page%5Bnumber%5D=0&page%5Bsize%5D=50" meta: page: - total_count: 1 + first_number: 0 + last_number: 0 + next_number: + number: 0 + prev_number: + size: 50 + total: 1 + type: number_size schema: $ref: "#/components/schemas/OrgGroupMembershipListResponse" description: OK @@ -111883,9 +111951,22 @@ paths: id: "a1b2c3d4-e5f6-7890-abcd-ef0123456789" type: org_groups type: org_group_policies + links: + first: "https://api.datadoghq.com/api/v2/org_group_policies?filter%5Borg_group_id%5D=a1b2c3d4-e5f6-7890-abcd-ef0123456789&page%5Bnumber%5D=0&page%5Bsize%5D=50" + last: "https://api.datadoghq.com/api/v2/org_group_policies?filter%5Borg_group_id%5D=a1b2c3d4-e5f6-7890-abcd-ef0123456789&page%5Bnumber%5D=0&page%5Bsize%5D=50" + next: + prev: + self: "https://api.datadoghq.com/api/v2/org_group_policies?filter%5Borg_group_id%5D=a1b2c3d4-e5f6-7890-abcd-ef0123456789&page%5Bnumber%5D=0&page%5Bsize%5D=50" meta: page: - total_count: 1 + first_number: 0 + last_number: 0 + next_number: + number: 0 + prev_number: + size: 50 + total: 1 + type: number_size schema: $ref: "#/components/schemas/OrgGroupPolicyListResponse" description: OK @@ -112274,9 +112355,22 @@ paths: id: "1a2b3c4d-5e6f-7890-abcd-ef0123456789" type: org_group_policies type: org_group_policy_overrides + links: + first: "https://api.datadoghq.com/api/v2/org_group_policy_overrides?filter%5Borg_group_id%5D=a1b2c3d4-e5f6-7890-abcd-ef0123456789&page%5Bnumber%5D=0&page%5Bsize%5D=50" + last: "https://api.datadoghq.com/api/v2/org_group_policy_overrides?filter%5Borg_group_id%5D=a1b2c3d4-e5f6-7890-abcd-ef0123456789&page%5Bnumber%5D=0&page%5Bsize%5D=50" + next: + prev: + self: "https://api.datadoghq.com/api/v2/org_group_policy_overrides?filter%5Borg_group_id%5D=a1b2c3d4-e5f6-7890-abcd-ef0123456789&page%5Bnumber%5D=0&page%5Bsize%5D=50" meta: page: - total_count: 1 + first_number: 0 + last_number: 0 + next_number: + number: 0 + prev_number: + size: 50 + total: 1 + type: number_size schema: $ref: "#/components/schemas/OrgGroupPolicyOverrideListResponse" description: OK @@ -112615,9 +112709,22 @@ paths: owner_org_uuid: "b2c3d4e5-f6a7-8901-bcde-f01234567890" id: "a1b2c3d4-e5f6-7890-abcd-ef0123456789" type: org_groups + links: + first: "https://api.datadoghq.com/api/v2/org_groups?page%5Bnumber%5D=0&page%5Bsize%5D=50" + last: "https://api.datadoghq.com/api/v2/org_groups?page%5Bnumber%5D=0&page%5Bsize%5D=50" + next: + prev: + self: "https://api.datadoghq.com/api/v2/org_groups?page%5Bnumber%5D=0&page%5Bsize%5D=50" meta: page: - total_count: 1 + first_number: 0 + last_number: 0 + next_number: + number: 0 + prev_number: + size: 50 + total: 1 + type: number_size schema: $ref: "#/components/schemas/OrgGroupListResponse" description: OK diff --git a/api/datadogV2/model_org_group_list_response.go b/api/datadogV2/model_org_group_list_response.go index db936551e68..6932b7ff9a5 100644 --- a/api/datadogV2/model_org_group_list_response.go +++ b/api/datadogV2/model_org_group_list_response.go @@ -16,7 +16,9 @@ type OrgGroupListResponse struct { Data []OrgGroupData `json:"data"` // Related resources included in the response when requested with the `include` parameter. Included []OrgGroupMembershipData `json:"included,omitempty"` - // Pagination metadata. + // Pagination links for navigating between pages of an org group list response. + Links *OrgGroupPaginationLinks `json:"links,omitempty"` + // Pagination metadata for org group list responses. Meta *OrgGroupPaginationMeta `json:"meta,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` @@ -92,6 +94,34 @@ func (o *OrgGroupListResponse) SetIncluded(v []OrgGroupMembershipData) { o.Included = v } +// GetLinks returns the Links field value if set, zero value otherwise. +func (o *OrgGroupListResponse) GetLinks() OrgGroupPaginationLinks { + if o == nil || o.Links == nil { + var ret OrgGroupPaginationLinks + return ret + } + return *o.Links +} + +// GetLinksOk returns a tuple with the Links field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrgGroupListResponse) GetLinksOk() (*OrgGroupPaginationLinks, bool) { + if o == nil || o.Links == nil { + return nil, false + } + return o.Links, true +} + +// HasLinks returns a boolean if a field has been set. +func (o *OrgGroupListResponse) HasLinks() bool { + return o != nil && o.Links != nil +} + +// SetLinks gets a reference to the given OrgGroupPaginationLinks and assigns it to the Links field. +func (o *OrgGroupListResponse) SetLinks(v OrgGroupPaginationLinks) { + o.Links = &v +} + // GetMeta returns the Meta field value if set, zero value otherwise. func (o *OrgGroupListResponse) GetMeta() OrgGroupPaginationMeta { if o == nil || o.Meta == nil { @@ -130,6 +160,9 @@ func (o OrgGroupListResponse) MarshalJSON() ([]byte, error) { if o.Included != nil { toSerialize["included"] = o.Included } + if o.Links != nil { + toSerialize["links"] = o.Links + } if o.Meta != nil { toSerialize["meta"] = o.Meta } @@ -145,6 +178,7 @@ func (o *OrgGroupListResponse) UnmarshalJSON(bytes []byte) (err error) { all := struct { Data *[]OrgGroupData `json:"data"` Included []OrgGroupMembershipData `json:"included,omitempty"` + Links *OrgGroupPaginationLinks `json:"links,omitempty"` Meta *OrgGroupPaginationMeta `json:"meta,omitempty"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { @@ -155,7 +189,7 @@ func (o *OrgGroupListResponse) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"data", "included", "meta"}) + datadog.DeleteKeys(additionalProperties, &[]string{"data", "included", "links", "meta"}) } else { return err } @@ -163,6 +197,10 @@ func (o *OrgGroupListResponse) UnmarshalJSON(bytes []byte) (err error) { hasInvalidField := false o.Data = *all.Data o.Included = all.Included + if all.Links != nil && all.Links.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Links = all.Links if all.Meta != nil && all.Meta.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } diff --git a/api/datadogV2/model_org_group_membership_list_response.go b/api/datadogV2/model_org_group_membership_list_response.go index ec8db9a48cc..43de44b293e 100644 --- a/api/datadogV2/model_org_group_membership_list_response.go +++ b/api/datadogV2/model_org_group_membership_list_response.go @@ -14,7 +14,9 @@ import ( type OrgGroupMembershipListResponse struct { // An array of org group memberships. Data []OrgGroupMembershipData `json:"data"` - // Pagination metadata. + // Pagination links for navigating between pages of an org group list response. + Links *OrgGroupPaginationLinks `json:"links,omitempty"` + // Pagination metadata for org group list responses. Meta *OrgGroupPaginationMeta `json:"meta,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` @@ -62,6 +64,34 @@ func (o *OrgGroupMembershipListResponse) SetData(v []OrgGroupMembershipData) { o.Data = v } +// GetLinks returns the Links field value if set, zero value otherwise. +func (o *OrgGroupMembershipListResponse) GetLinks() OrgGroupPaginationLinks { + if o == nil || o.Links == nil { + var ret OrgGroupPaginationLinks + return ret + } + return *o.Links +} + +// GetLinksOk returns a tuple with the Links field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrgGroupMembershipListResponse) GetLinksOk() (*OrgGroupPaginationLinks, bool) { + if o == nil || o.Links == nil { + return nil, false + } + return o.Links, true +} + +// HasLinks returns a boolean if a field has been set. +func (o *OrgGroupMembershipListResponse) HasLinks() bool { + return o != nil && o.Links != nil +} + +// SetLinks gets a reference to the given OrgGroupPaginationLinks and assigns it to the Links field. +func (o *OrgGroupMembershipListResponse) SetLinks(v OrgGroupPaginationLinks) { + o.Links = &v +} + // GetMeta returns the Meta field value if set, zero value otherwise. func (o *OrgGroupMembershipListResponse) GetMeta() OrgGroupPaginationMeta { if o == nil || o.Meta == nil { @@ -97,6 +127,9 @@ func (o OrgGroupMembershipListResponse) MarshalJSON() ([]byte, error) { return datadog.Marshal(o.UnparsedObject) } toSerialize["data"] = o.Data + if o.Links != nil { + toSerialize["links"] = o.Links + } if o.Meta != nil { toSerialize["meta"] = o.Meta } @@ -110,8 +143,9 @@ func (o OrgGroupMembershipListResponse) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *OrgGroupMembershipListResponse) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Data *[]OrgGroupMembershipData `json:"data"` - Meta *OrgGroupPaginationMeta `json:"meta,omitempty"` + Data *[]OrgGroupMembershipData `json:"data"` + Links *OrgGroupPaginationLinks `json:"links,omitempty"` + Meta *OrgGroupPaginationMeta `json:"meta,omitempty"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { return datadog.Unmarshal(bytes, &o.UnparsedObject) @@ -121,13 +155,17 @@ func (o *OrgGroupMembershipListResponse) UnmarshalJSON(bytes []byte) (err error) } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"data", "meta"}) + datadog.DeleteKeys(additionalProperties, &[]string{"data", "links", "meta"}) } else { return err } hasInvalidField := false o.Data = *all.Data + if all.Links != nil && all.Links.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Links = all.Links if all.Meta != nil && all.Meta.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } diff --git a/api/datadogV2/model_org_group_pagination_links.go b/api/datadogV2/model_org_group_pagination_links.go new file mode 100644 index 00000000000..46e4882e521 --- /dev/null +++ b/api/datadogV2/model_org_group_pagination_links.go @@ -0,0 +1,264 @@ +// 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 ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// OrgGroupPaginationLinks Pagination links for navigating between pages of an org group list response. +type OrgGroupPaginationLinks struct { + // Link to the first page. + First *string `json:"first,omitempty"` + // Link to the last page. + Last *string `json:"last,omitempty"` + // Link to the next page. + Next datadog.NullableString `json:"next,omitempty"` + // Link to the previous page. + Prev datadog.NullableString `json:"prev,omitempty"` + // Link to the current page. + Self *string `json:"self,omitempty"` + // 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:"-"` +} + +// NewOrgGroupPaginationLinks instantiates a new OrgGroupPaginationLinks 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 NewOrgGroupPaginationLinks() *OrgGroupPaginationLinks { + this := OrgGroupPaginationLinks{} + return &this +} + +// NewOrgGroupPaginationLinksWithDefaults instantiates a new OrgGroupPaginationLinks 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 NewOrgGroupPaginationLinksWithDefaults() *OrgGroupPaginationLinks { + this := OrgGroupPaginationLinks{} + return &this +} + +// GetFirst returns the First field value if set, zero value otherwise. +func (o *OrgGroupPaginationLinks) GetFirst() string { + if o == nil || o.First == nil { + var ret string + return ret + } + return *o.First +} + +// GetFirstOk returns a tuple with the First field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrgGroupPaginationLinks) GetFirstOk() (*string, bool) { + if o == nil || o.First == nil { + return nil, false + } + return o.First, true +} + +// HasFirst returns a boolean if a field has been set. +func (o *OrgGroupPaginationLinks) HasFirst() bool { + return o != nil && o.First != nil +} + +// SetFirst gets a reference to the given string and assigns it to the First field. +func (o *OrgGroupPaginationLinks) SetFirst(v string) { + o.First = &v +} + +// GetLast returns the Last field value if set, zero value otherwise. +func (o *OrgGroupPaginationLinks) GetLast() string { + if o == nil || o.Last == nil { + var ret string + return ret + } + return *o.Last +} + +// GetLastOk returns a tuple with the Last field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrgGroupPaginationLinks) GetLastOk() (*string, bool) { + if o == nil || o.Last == nil { + return nil, false + } + return o.Last, true +} + +// HasLast returns a boolean if a field has been set. +func (o *OrgGroupPaginationLinks) HasLast() bool { + return o != nil && o.Last != nil +} + +// SetLast gets a reference to the given string and assigns it to the Last field. +func (o *OrgGroupPaginationLinks) SetLast(v string) { + o.Last = &v +} + +// GetNext returns the Next field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *OrgGroupPaginationLinks) GetNext() string { + if o == nil || o.Next.Get() == nil { + var ret string + return ret + } + return *o.Next.Get() +} + +// GetNextOk returns a tuple with the Next field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *OrgGroupPaginationLinks) GetNextOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Next.Get(), o.Next.IsSet() +} + +// HasNext returns a boolean if a field has been set. +func (o *OrgGroupPaginationLinks) HasNext() bool { + return o != nil && o.Next.IsSet() +} + +// SetNext gets a reference to the given datadog.NullableString and assigns it to the Next field. +func (o *OrgGroupPaginationLinks) SetNext(v string) { + o.Next.Set(&v) +} + +// SetNextNil sets the value for Next to be an explicit nil. +func (o *OrgGroupPaginationLinks) SetNextNil() { + o.Next.Set(nil) +} + +// UnsetNext ensures that no value is present for Next, not even an explicit nil. +func (o *OrgGroupPaginationLinks) UnsetNext() { + o.Next.Unset() +} + +// GetPrev returns the Prev field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *OrgGroupPaginationLinks) GetPrev() string { + if o == nil || o.Prev.Get() == nil { + var ret string + return ret + } + return *o.Prev.Get() +} + +// GetPrevOk returns a tuple with the Prev field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *OrgGroupPaginationLinks) GetPrevOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Prev.Get(), o.Prev.IsSet() +} + +// HasPrev returns a boolean if a field has been set. +func (o *OrgGroupPaginationLinks) HasPrev() bool { + return o != nil && o.Prev.IsSet() +} + +// SetPrev gets a reference to the given datadog.NullableString and assigns it to the Prev field. +func (o *OrgGroupPaginationLinks) SetPrev(v string) { + o.Prev.Set(&v) +} + +// SetPrevNil sets the value for Prev to be an explicit nil. +func (o *OrgGroupPaginationLinks) SetPrevNil() { + o.Prev.Set(nil) +} + +// UnsetPrev ensures that no value is present for Prev, not even an explicit nil. +func (o *OrgGroupPaginationLinks) UnsetPrev() { + o.Prev.Unset() +} + +// GetSelf returns the Self field value if set, zero value otherwise. +func (o *OrgGroupPaginationLinks) GetSelf() string { + if o == nil || o.Self == nil { + var ret string + return ret + } + return *o.Self +} + +// GetSelfOk returns a tuple with the Self field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrgGroupPaginationLinks) GetSelfOk() (*string, bool) { + if o == nil || o.Self == nil { + return nil, false + } + return o.Self, true +} + +// HasSelf returns a boolean if a field has been set. +func (o *OrgGroupPaginationLinks) HasSelf() bool { + return o != nil && o.Self != nil +} + +// SetSelf gets a reference to the given string and assigns it to the Self field. +func (o *OrgGroupPaginationLinks) SetSelf(v string) { + o.Self = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o OrgGroupPaginationLinks) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.First != nil { + toSerialize["first"] = o.First + } + if o.Last != nil { + toSerialize["last"] = o.Last + } + if o.Next.IsSet() { + toSerialize["next"] = o.Next.Get() + } + if o.Prev.IsSet() { + toSerialize["prev"] = o.Prev.Get() + } + if o.Self != nil { + toSerialize["self"] = o.Self + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *OrgGroupPaginationLinks) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + First *string `json:"first,omitempty"` + Last *string `json:"last,omitempty"` + Next datadog.NullableString `json:"next,omitempty"` + Prev datadog.NullableString `json:"prev,omitempty"` + Self *string `json:"self,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"first", "last", "next", "prev", "self"}) + } else { + return err + } + o.First = all.First + o.Last = all.Last + o.Next = all.Next + o.Prev = all.Prev + o.Self = all.Self + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_org_group_pagination_meta.go b/api/datadogV2/model_org_group_pagination_meta.go index 612f589494c..c7574a43276 100644 --- a/api/datadogV2/model_org_group_pagination_meta.go +++ b/api/datadogV2/model_org_group_pagination_meta.go @@ -5,15 +5,13 @@ package datadogV2 import ( - "fmt" - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// OrgGroupPaginationMeta Pagination metadata. +// OrgGroupPaginationMeta Pagination metadata for org group list responses. type OrgGroupPaginationMeta struct { - // Page-based pagination details. - Page OrgGroupPaginationMetaPage `json:"page"` + // Page-based pagination details for org group list responses. + Page *OrgGroupPaginationMetaPage `json:"page,omitempty"` // 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:"-"` @@ -23,9 +21,8 @@ type OrgGroupPaginationMeta struct { // 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 NewOrgGroupPaginationMeta(page OrgGroupPaginationMetaPage) *OrgGroupPaginationMeta { +func NewOrgGroupPaginationMeta() *OrgGroupPaginationMeta { this := OrgGroupPaginationMeta{} - this.Page = page return &this } @@ -37,27 +34,32 @@ func NewOrgGroupPaginationMetaWithDefaults() *OrgGroupPaginationMeta { return &this } -// GetPage returns the Page field value. +// GetPage returns the Page field value if set, zero value otherwise. func (o *OrgGroupPaginationMeta) GetPage() OrgGroupPaginationMetaPage { - if o == nil { + if o == nil || o.Page == nil { var ret OrgGroupPaginationMetaPage return ret } - return o.Page + return *o.Page } -// GetPageOk returns a tuple with the Page field value +// GetPageOk returns a tuple with the Page field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *OrgGroupPaginationMeta) GetPageOk() (*OrgGroupPaginationMetaPage, bool) { - if o == nil { + if o == nil || o.Page == nil { return nil, false } - return &o.Page, true + return o.Page, true +} + +// HasPage returns a boolean if a field has been set. +func (o *OrgGroupPaginationMeta) HasPage() bool { + return o != nil && o.Page != nil } -// SetPage sets field value. +// SetPage gets a reference to the given OrgGroupPaginationMetaPage and assigns it to the Page field. func (o *OrgGroupPaginationMeta) SetPage(v OrgGroupPaginationMetaPage) { - o.Page = v + o.Page = &v } // MarshalJSON serializes the struct using spec logic. @@ -66,7 +68,9 @@ func (o OrgGroupPaginationMeta) MarshalJSON() ([]byte, error) { if o.UnparsedObject != nil { return datadog.Marshal(o.UnparsedObject) } - toSerialize["page"] = o.Page + if o.Page != nil { + toSerialize["page"] = o.Page + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -77,14 +81,11 @@ func (o OrgGroupPaginationMeta) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *OrgGroupPaginationMeta) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Page *OrgGroupPaginationMetaPage `json:"page"` + Page *OrgGroupPaginationMetaPage `json:"page,omitempty"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { return datadog.Unmarshal(bytes, &o.UnparsedObject) } - if all.Page == nil { - return fmt.Errorf("required field page missing") - } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { datadog.DeleteKeys(additionalProperties, &[]string{"page"}) @@ -93,10 +94,10 @@ func (o *OrgGroupPaginationMeta) UnmarshalJSON(bytes []byte) (err error) { } hasInvalidField := false - if all.Page.UnparsedObject != nil && o.UnparsedObject == nil { + if all.Page != nil && all.Page.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } - o.Page = *all.Page + o.Page = all.Page if len(additionalProperties) > 0 { o.AdditionalProperties = additionalProperties diff --git a/api/datadogV2/model_org_group_pagination_meta_page.go b/api/datadogV2/model_org_group_pagination_meta_page.go index e7e0b67fbaa..551b03f5114 100644 --- a/api/datadogV2/model_org_group_pagination_meta_page.go +++ b/api/datadogV2/model_org_group_pagination_meta_page.go @@ -5,15 +5,27 @@ package datadogV2 import ( - "fmt" - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// OrgGroupPaginationMetaPage Page-based pagination details. +// OrgGroupPaginationMetaPage Page-based pagination details for org group list responses. type OrgGroupPaginationMetaPage struct { - // The total number of items. - TotalCount int64 `json:"total_count"` + // First page number. + FirstNumber *int64 `json:"first_number,omitempty"` + // Last page number. + LastNumber datadog.NullableInt64 `json:"last_number,omitempty"` + // Next page number. + NextNumber datadog.NullableInt64 `json:"next_number,omitempty"` + // Page number. + Number *int64 `json:"number,omitempty"` + // Previous page number. + PrevNumber datadog.NullableInt64 `json:"prev_number,omitempty"` + // Page size. + Size *int64 `json:"size,omitempty"` + // Total number of results. + Total *int64 `json:"total,omitempty"` + // Pagination type. + Type *string `json:"type,omitempty"` // 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:"-"` @@ -23,9 +35,8 @@ type OrgGroupPaginationMetaPage struct { // 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 NewOrgGroupPaginationMetaPage(totalCount int64) *OrgGroupPaginationMetaPage { +func NewOrgGroupPaginationMetaPage() *OrgGroupPaginationMetaPage { this := OrgGroupPaginationMetaPage{} - this.TotalCount = totalCount return &this } @@ -37,27 +48,261 @@ func NewOrgGroupPaginationMetaPageWithDefaults() *OrgGroupPaginationMetaPage { return &this } -// GetTotalCount returns the TotalCount field value. -func (o *OrgGroupPaginationMetaPage) GetTotalCount() int64 { +// GetFirstNumber returns the FirstNumber field value if set, zero value otherwise. +func (o *OrgGroupPaginationMetaPage) GetFirstNumber() int64 { + if o == nil || o.FirstNumber == nil { + var ret int64 + return ret + } + return *o.FirstNumber +} + +// GetFirstNumberOk returns a tuple with the FirstNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrgGroupPaginationMetaPage) GetFirstNumberOk() (*int64, bool) { + if o == nil || o.FirstNumber == nil { + return nil, false + } + return o.FirstNumber, true +} + +// HasFirstNumber returns a boolean if a field has been set. +func (o *OrgGroupPaginationMetaPage) HasFirstNumber() bool { + return o != nil && o.FirstNumber != nil +} + +// SetFirstNumber gets a reference to the given int64 and assigns it to the FirstNumber field. +func (o *OrgGroupPaginationMetaPage) SetFirstNumber(v int64) { + o.FirstNumber = &v +} + +// GetLastNumber returns the LastNumber field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *OrgGroupPaginationMetaPage) GetLastNumber() int64 { + if o == nil || o.LastNumber.Get() == nil { + var ret int64 + return ret + } + return *o.LastNumber.Get() +} + +// GetLastNumberOk returns a tuple with the LastNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *OrgGroupPaginationMetaPage) GetLastNumberOk() (*int64, bool) { if o == nil { + return nil, false + } + return o.LastNumber.Get(), o.LastNumber.IsSet() +} + +// HasLastNumber returns a boolean if a field has been set. +func (o *OrgGroupPaginationMetaPage) HasLastNumber() bool { + return o != nil && o.LastNumber.IsSet() +} + +// SetLastNumber gets a reference to the given datadog.NullableInt64 and assigns it to the LastNumber field. +func (o *OrgGroupPaginationMetaPage) SetLastNumber(v int64) { + o.LastNumber.Set(&v) +} + +// SetLastNumberNil sets the value for LastNumber to be an explicit nil. +func (o *OrgGroupPaginationMetaPage) SetLastNumberNil() { + o.LastNumber.Set(nil) +} + +// UnsetLastNumber ensures that no value is present for LastNumber, not even an explicit nil. +func (o *OrgGroupPaginationMetaPage) UnsetLastNumber() { + o.LastNumber.Unset() +} + +// GetNextNumber returns the NextNumber field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *OrgGroupPaginationMetaPage) GetNextNumber() int64 { + if o == nil || o.NextNumber.Get() == nil { + var ret int64 + return ret + } + return *o.NextNumber.Get() +} + +// GetNextNumberOk returns a tuple with the NextNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *OrgGroupPaginationMetaPage) GetNextNumberOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.NextNumber.Get(), o.NextNumber.IsSet() +} + +// HasNextNumber returns a boolean if a field has been set. +func (o *OrgGroupPaginationMetaPage) HasNextNumber() bool { + return o != nil && o.NextNumber.IsSet() +} + +// SetNextNumber gets a reference to the given datadog.NullableInt64 and assigns it to the NextNumber field. +func (o *OrgGroupPaginationMetaPage) SetNextNumber(v int64) { + o.NextNumber.Set(&v) +} + +// SetNextNumberNil sets the value for NextNumber to be an explicit nil. +func (o *OrgGroupPaginationMetaPage) SetNextNumberNil() { + o.NextNumber.Set(nil) +} + +// UnsetNextNumber ensures that no value is present for NextNumber, not even an explicit nil. +func (o *OrgGroupPaginationMetaPage) UnsetNextNumber() { + o.NextNumber.Unset() +} + +// GetNumber returns the Number field value if set, zero value otherwise. +func (o *OrgGroupPaginationMetaPage) GetNumber() int64 { + if o == nil || o.Number == nil { + var ret int64 + return ret + } + return *o.Number +} + +// GetNumberOk returns a tuple with the Number field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrgGroupPaginationMetaPage) GetNumberOk() (*int64, bool) { + if o == nil || o.Number == nil { + return nil, false + } + return o.Number, true +} + +// HasNumber returns a boolean if a field has been set. +func (o *OrgGroupPaginationMetaPage) HasNumber() bool { + return o != nil && o.Number != nil +} + +// SetNumber gets a reference to the given int64 and assigns it to the Number field. +func (o *OrgGroupPaginationMetaPage) SetNumber(v int64) { + o.Number = &v +} + +// GetPrevNumber returns the PrevNumber field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *OrgGroupPaginationMetaPage) GetPrevNumber() int64 { + if o == nil || o.PrevNumber.Get() == nil { var ret int64 return ret } - return o.TotalCount + return *o.PrevNumber.Get() } -// GetTotalCountOk returns a tuple with the TotalCount field value +// GetPrevNumberOk returns a tuple with the PrevNumber field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *OrgGroupPaginationMetaPage) GetTotalCountOk() (*int64, bool) { +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *OrgGroupPaginationMetaPage) GetPrevNumberOk() (*int64, bool) { if o == nil { return nil, false } - return &o.TotalCount, true + return o.PrevNumber.Get(), o.PrevNumber.IsSet() +} + +// HasPrevNumber returns a boolean if a field has been set. +func (o *OrgGroupPaginationMetaPage) HasPrevNumber() bool { + return o != nil && o.PrevNumber.IsSet() +} + +// SetPrevNumber gets a reference to the given datadog.NullableInt64 and assigns it to the PrevNumber field. +func (o *OrgGroupPaginationMetaPage) SetPrevNumber(v int64) { + o.PrevNumber.Set(&v) +} + +// SetPrevNumberNil sets the value for PrevNumber to be an explicit nil. +func (o *OrgGroupPaginationMetaPage) SetPrevNumberNil() { + o.PrevNumber.Set(nil) +} + +// UnsetPrevNumber ensures that no value is present for PrevNumber, not even an explicit nil. +func (o *OrgGroupPaginationMetaPage) UnsetPrevNumber() { + o.PrevNumber.Unset() } -// SetTotalCount sets field value. -func (o *OrgGroupPaginationMetaPage) SetTotalCount(v int64) { - o.TotalCount = v +// GetSize returns the Size field value if set, zero value otherwise. +func (o *OrgGroupPaginationMetaPage) GetSize() int64 { + if o == nil || o.Size == nil { + var ret int64 + return ret + } + return *o.Size +} + +// GetSizeOk returns a tuple with the Size field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrgGroupPaginationMetaPage) GetSizeOk() (*int64, bool) { + if o == nil || o.Size == nil { + return nil, false + } + return o.Size, true +} + +// HasSize returns a boolean if a field has been set. +func (o *OrgGroupPaginationMetaPage) HasSize() bool { + return o != nil && o.Size != nil +} + +// SetSize gets a reference to the given int64 and assigns it to the Size field. +func (o *OrgGroupPaginationMetaPage) SetSize(v int64) { + o.Size = &v +} + +// GetTotal returns the Total field value if set, zero value otherwise. +func (o *OrgGroupPaginationMetaPage) GetTotal() int64 { + if o == nil || o.Total == nil { + var ret int64 + return ret + } + return *o.Total +} + +// GetTotalOk returns a tuple with the Total field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrgGroupPaginationMetaPage) GetTotalOk() (*int64, bool) { + if o == nil || o.Total == nil { + return nil, false + } + return o.Total, true +} + +// HasTotal returns a boolean if a field has been set. +func (o *OrgGroupPaginationMetaPage) HasTotal() bool { + return o != nil && o.Total != nil +} + +// SetTotal gets a reference to the given int64 and assigns it to the Total field. +func (o *OrgGroupPaginationMetaPage) SetTotal(v int64) { + o.Total = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *OrgGroupPaginationMetaPage) GetType() string { + if o == nil || o.Type == nil { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrgGroupPaginationMetaPage) GetTypeOk() (*string, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *OrgGroupPaginationMetaPage) HasType() bool { + return o != nil && o.Type != nil +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *OrgGroupPaginationMetaPage) SetType(v string) { + o.Type = &v } // MarshalJSON serializes the struct using spec logic. @@ -66,7 +311,30 @@ func (o OrgGroupPaginationMetaPage) MarshalJSON() ([]byte, error) { if o.UnparsedObject != nil { return datadog.Marshal(o.UnparsedObject) } - toSerialize["total_count"] = o.TotalCount + if o.FirstNumber != nil { + toSerialize["first_number"] = o.FirstNumber + } + if o.LastNumber.IsSet() { + toSerialize["last_number"] = o.LastNumber.Get() + } + if o.NextNumber.IsSet() { + toSerialize["next_number"] = o.NextNumber.Get() + } + if o.Number != nil { + toSerialize["number"] = o.Number + } + if o.PrevNumber.IsSet() { + toSerialize["prev_number"] = o.PrevNumber.Get() + } + if o.Size != nil { + toSerialize["size"] = o.Size + } + if o.Total != nil { + toSerialize["total"] = o.Total + } + if o.Type != nil { + toSerialize["type"] = o.Type + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -77,21 +345,32 @@ func (o OrgGroupPaginationMetaPage) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *OrgGroupPaginationMetaPage) UnmarshalJSON(bytes []byte) (err error) { all := struct { - TotalCount *int64 `json:"total_count"` + FirstNumber *int64 `json:"first_number,omitempty"` + LastNumber datadog.NullableInt64 `json:"last_number,omitempty"` + NextNumber datadog.NullableInt64 `json:"next_number,omitempty"` + Number *int64 `json:"number,omitempty"` + PrevNumber datadog.NullableInt64 `json:"prev_number,omitempty"` + Size *int64 `json:"size,omitempty"` + Total *int64 `json:"total,omitempty"` + Type *string `json:"type,omitempty"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { return datadog.Unmarshal(bytes, &o.UnparsedObject) } - if all.TotalCount == nil { - return fmt.Errorf("required field total_count missing") - } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"total_count"}) + datadog.DeleteKeys(additionalProperties, &[]string{"first_number", "last_number", "next_number", "number", "prev_number", "size", "total", "type"}) } else { return err } - o.TotalCount = *all.TotalCount + o.FirstNumber = all.FirstNumber + o.LastNumber = all.LastNumber + o.NextNumber = all.NextNumber + o.Number = all.Number + o.PrevNumber = all.PrevNumber + o.Size = all.Size + o.Total = all.Total + o.Type = all.Type if len(additionalProperties) > 0 { o.AdditionalProperties = additionalProperties diff --git a/api/datadogV2/model_org_group_policy_list_response.go b/api/datadogV2/model_org_group_policy_list_response.go index daaba7c16da..6309578593c 100644 --- a/api/datadogV2/model_org_group_policy_list_response.go +++ b/api/datadogV2/model_org_group_policy_list_response.go @@ -14,7 +14,9 @@ import ( type OrgGroupPolicyListResponse struct { // An array of org group policies. Data []OrgGroupPolicyData `json:"data"` - // Pagination metadata. + // Pagination links for navigating between pages of an org group list response. + Links *OrgGroupPaginationLinks `json:"links,omitempty"` + // Pagination metadata for org group list responses. Meta *OrgGroupPaginationMeta `json:"meta,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` @@ -62,6 +64,34 @@ func (o *OrgGroupPolicyListResponse) SetData(v []OrgGroupPolicyData) { o.Data = v } +// GetLinks returns the Links field value if set, zero value otherwise. +func (o *OrgGroupPolicyListResponse) GetLinks() OrgGroupPaginationLinks { + if o == nil || o.Links == nil { + var ret OrgGroupPaginationLinks + return ret + } + return *o.Links +} + +// GetLinksOk returns a tuple with the Links field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrgGroupPolicyListResponse) GetLinksOk() (*OrgGroupPaginationLinks, bool) { + if o == nil || o.Links == nil { + return nil, false + } + return o.Links, true +} + +// HasLinks returns a boolean if a field has been set. +func (o *OrgGroupPolicyListResponse) HasLinks() bool { + return o != nil && o.Links != nil +} + +// SetLinks gets a reference to the given OrgGroupPaginationLinks and assigns it to the Links field. +func (o *OrgGroupPolicyListResponse) SetLinks(v OrgGroupPaginationLinks) { + o.Links = &v +} + // GetMeta returns the Meta field value if set, zero value otherwise. func (o *OrgGroupPolicyListResponse) GetMeta() OrgGroupPaginationMeta { if o == nil || o.Meta == nil { @@ -97,6 +127,9 @@ func (o OrgGroupPolicyListResponse) MarshalJSON() ([]byte, error) { return datadog.Marshal(o.UnparsedObject) } toSerialize["data"] = o.Data + if o.Links != nil { + toSerialize["links"] = o.Links + } if o.Meta != nil { toSerialize["meta"] = o.Meta } @@ -110,8 +143,9 @@ func (o OrgGroupPolicyListResponse) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *OrgGroupPolicyListResponse) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Data *[]OrgGroupPolicyData `json:"data"` - Meta *OrgGroupPaginationMeta `json:"meta,omitempty"` + Data *[]OrgGroupPolicyData `json:"data"` + Links *OrgGroupPaginationLinks `json:"links,omitempty"` + Meta *OrgGroupPaginationMeta `json:"meta,omitempty"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { return datadog.Unmarshal(bytes, &o.UnparsedObject) @@ -121,13 +155,17 @@ func (o *OrgGroupPolicyListResponse) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"data", "meta"}) + datadog.DeleteKeys(additionalProperties, &[]string{"data", "links", "meta"}) } else { return err } hasInvalidField := false o.Data = *all.Data + if all.Links != nil && all.Links.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Links = all.Links if all.Meta != nil && all.Meta.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true } diff --git a/api/datadogV2/model_org_group_policy_override_list_response.go b/api/datadogV2/model_org_group_policy_override_list_response.go index 6e34eed03e8..7ecec626ac3 100644 --- a/api/datadogV2/model_org_group_policy_override_list_response.go +++ b/api/datadogV2/model_org_group_policy_override_list_response.go @@ -14,7 +14,9 @@ import ( type OrgGroupPolicyOverrideListResponse struct { // An array of org group policy overrides. Data []OrgGroupPolicyOverrideData `json:"data"` - // Pagination metadata. + // Pagination links for navigating between pages of an org group list response. + Links *OrgGroupPaginationLinks `json:"links,omitempty"` + // Pagination metadata for org group list responses. Meta *OrgGroupPaginationMeta `json:"meta,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` @@ -62,6 +64,34 @@ func (o *OrgGroupPolicyOverrideListResponse) SetData(v []OrgGroupPolicyOverrideD o.Data = v } +// GetLinks returns the Links field value if set, zero value otherwise. +func (o *OrgGroupPolicyOverrideListResponse) GetLinks() OrgGroupPaginationLinks { + if o == nil || o.Links == nil { + var ret OrgGroupPaginationLinks + return ret + } + return *o.Links +} + +// GetLinksOk returns a tuple with the Links field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrgGroupPolicyOverrideListResponse) GetLinksOk() (*OrgGroupPaginationLinks, bool) { + if o == nil || o.Links == nil { + return nil, false + } + return o.Links, true +} + +// HasLinks returns a boolean if a field has been set. +func (o *OrgGroupPolicyOverrideListResponse) HasLinks() bool { + return o != nil && o.Links != nil +} + +// SetLinks gets a reference to the given OrgGroupPaginationLinks and assigns it to the Links field. +func (o *OrgGroupPolicyOverrideListResponse) SetLinks(v OrgGroupPaginationLinks) { + o.Links = &v +} + // GetMeta returns the Meta field value if set, zero value otherwise. func (o *OrgGroupPolicyOverrideListResponse) GetMeta() OrgGroupPaginationMeta { if o == nil || o.Meta == nil { @@ -97,6 +127,9 @@ func (o OrgGroupPolicyOverrideListResponse) MarshalJSON() ([]byte, error) { return datadog.Marshal(o.UnparsedObject) } toSerialize["data"] = o.Data + if o.Links != nil { + toSerialize["links"] = o.Links + } if o.Meta != nil { toSerialize["meta"] = o.Meta } @@ -110,8 +143,9 @@ func (o OrgGroupPolicyOverrideListResponse) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *OrgGroupPolicyOverrideListResponse) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Data *[]OrgGroupPolicyOverrideData `json:"data"` - Meta *OrgGroupPaginationMeta `json:"meta,omitempty"` + Data *[]OrgGroupPolicyOverrideData `json:"data"` + Links *OrgGroupPaginationLinks `json:"links,omitempty"` + Meta *OrgGroupPaginationMeta `json:"meta,omitempty"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { return datadog.Unmarshal(bytes, &o.UnparsedObject) @@ -121,13 +155,17 @@ func (o *OrgGroupPolicyOverrideListResponse) UnmarshalJSON(bytes []byte) (err er } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"data", "meta"}) + datadog.DeleteKeys(additionalProperties, &[]string{"data", "links", "meta"}) } else { return err } hasInvalidField := false o.Data = *all.Data + if all.Links != nil && all.Links.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Links = all.Links if all.Meta != nil && all.Meta.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true }