Skip to content

Commit

Permalink
Fix Powerpack schema (#2262)
Browse files Browse the repository at this point in the history
Co-authored-by: ci.datadog-api-spec <[email protected]>
  • Loading branch information
api-clients-generation-pipeline[bot] and ci.datadog-api-spec authored Nov 17, 2023
1 parent 598d79a commit a87af85
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 32 deletions.
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2023-11-17 18:38:51.988816",
"spec_repo_commit": "ea610108"
"regenerated": "2023-11-17 19:36:44.377368",
"spec_repo_commit": "506ed2d8"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2023-11-17 18:38:52.010141",
"spec_repo_commit": "ea610108"
"regenerated": "2023-11-17 19:36:44.393021",
"spec_repo_commit": "506ed2d8"
}
}
}
3 changes: 2 additions & 1 deletion .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12084,7 +12084,7 @@ components:
description: Powerpack relationship object.
properties:
author:
$ref: '#/components/schemas/Creator'
$ref: '#/components/schemas/RelationshipToUser'
type: object
PowerpackResponse:
description: Response object which includes a single powerpack configuration.
Expand Down Expand Up @@ -12156,6 +12156,7 @@ components:
last_offset:
description: The last offset.
format: int64
nullable: true
type: integer
limit:
description: Pagination limit.
Expand Down
16 changes: 8 additions & 8 deletions api/datadogV2/model_powerpack_relationships.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (

// PowerpackRelationships Powerpack relationship object.
type PowerpackRelationships struct {
// Creator of the object.
Author *Creator `json:"author,omitempty"`
// Relationship to user.
Author *RelationshipToUser `json:"author,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{}
Expand All @@ -35,17 +35,17 @@ func NewPowerpackRelationshipsWithDefaults() *PowerpackRelationships {
}

// GetAuthor returns the Author field value if set, zero value otherwise.
func (o *PowerpackRelationships) GetAuthor() Creator {
func (o *PowerpackRelationships) GetAuthor() RelationshipToUser {
if o == nil || o.Author == nil {
var ret Creator
var ret RelationshipToUser
return ret
}
return *o.Author
}

// GetAuthorOk returns a tuple with the Author field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PowerpackRelationships) GetAuthorOk() (*Creator, bool) {
func (o *PowerpackRelationships) GetAuthorOk() (*RelationshipToUser, bool) {
if o == nil || o.Author == nil {
return nil, false
}
Expand All @@ -57,8 +57,8 @@ func (o *PowerpackRelationships) HasAuthor() bool {
return o != nil && o.Author != nil
}

// SetAuthor gets a reference to the given Creator and assigns it to the Author field.
func (o *PowerpackRelationships) SetAuthor(v Creator) {
// SetAuthor gets a reference to the given RelationshipToUser and assigns it to the Author field.
func (o *PowerpackRelationships) SetAuthor(v RelationshipToUser) {
o.Author = &v
}

Expand All @@ -81,7 +81,7 @@ func (o PowerpackRelationships) MarshalJSON() ([]byte, error) {
// UnmarshalJSON deserializes the given payload.
func (o *PowerpackRelationships) UnmarshalJSON(bytes []byte) (err error) {
all := struct {
Author *Creator `json:"author,omitempty"`
Author *RelationshipToUser `json:"author,omitempty"`
}{}
if err = datadog.Unmarshal(bytes, &all); err != nil {
return datadog.Unmarshal(bytes, &o.UnparsedObject)
Expand Down
49 changes: 30 additions & 19 deletions api/datadogV2/model_powerpacks_response_meta_pagination.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type PowerpacksResponseMetaPagination struct {
// The first offset.
FirstOffset *int64 `json:"first_offset,omitempty"`
// The last offset.
LastOffset *int64 `json:"last_offset,omitempty"`
LastOffset datadog.NullableInt64 `json:"last_offset,omitempty"`
// Pagination limit.
Limit *int64 `json:"limit,omitempty"`
// The next offset.
Expand Down Expand Up @@ -76,32 +76,43 @@ func (o *PowerpacksResponseMetaPagination) SetFirstOffset(v int64) {
o.FirstOffset = &v
}

// GetLastOffset returns the LastOffset field value if set, zero value otherwise.
// GetLastOffset returns the LastOffset field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *PowerpacksResponseMetaPagination) GetLastOffset() int64 {
if o == nil || o.LastOffset == nil {
if o == nil || o.LastOffset.Get() == nil {
var ret int64
return ret
}
return *o.LastOffset
return *o.LastOffset.Get()
}

// GetLastOffsetOk returns a tuple with the LastOffset 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 *PowerpacksResponseMetaPagination) GetLastOffsetOk() (*int64, bool) {
if o == nil || o.LastOffset == nil {
if o == nil {
return nil, false
}
return o.LastOffset, true
return o.LastOffset.Get(), o.LastOffset.IsSet()
}

// HasLastOffset returns a boolean if a field has been set.
func (o *PowerpacksResponseMetaPagination) HasLastOffset() bool {
return o != nil && o.LastOffset != nil
return o != nil && o.LastOffset.IsSet()
}

// SetLastOffset gets a reference to the given int64 and assigns it to the LastOffset field.
// SetLastOffset gets a reference to the given datadog.NullableInt64 and assigns it to the LastOffset field.
func (o *PowerpacksResponseMetaPagination) SetLastOffset(v int64) {
o.LastOffset = &v
o.LastOffset.Set(&v)
}

// SetLastOffsetNil sets the value for LastOffset to be an explicit nil.
func (o *PowerpacksResponseMetaPagination) SetLastOffsetNil() {
o.LastOffset.Set(nil)
}

// UnsetLastOffset ensures that no value is present for LastOffset, not even an explicit nil.
func (o *PowerpacksResponseMetaPagination) UnsetLastOffset() {
o.LastOffset.Unset()
}

// GetLimit returns the Limit field value if set, zero value otherwise.
Expand Down Expand Up @@ -281,8 +292,8 @@ func (o PowerpacksResponseMetaPagination) MarshalJSON() ([]byte, error) {
if o.FirstOffset != nil {
toSerialize["first_offset"] = o.FirstOffset
}
if o.LastOffset != nil {
toSerialize["last_offset"] = o.LastOffset
if o.LastOffset.IsSet() {
toSerialize["last_offset"] = o.LastOffset.Get()
}
if o.Limit != nil {
toSerialize["limit"] = o.Limit
Expand Down Expand Up @@ -312,14 +323,14 @@ func (o PowerpacksResponseMetaPagination) MarshalJSON() ([]byte, error) {
// UnmarshalJSON deserializes the given payload.
func (o *PowerpacksResponseMetaPagination) UnmarshalJSON(bytes []byte) (err error) {
all := struct {
FirstOffset *int64 `json:"first_offset,omitempty"`
LastOffset *int64 `json:"last_offset,omitempty"`
Limit *int64 `json:"limit,omitempty"`
NextOffset *int64 `json:"next_offset,omitempty"`
Offset *int64 `json:"offset,omitempty"`
PrevOffset *int64 `json:"prev_offset,omitempty"`
Total *int64 `json:"total,omitempty"`
Type *string `json:"type,omitempty"`
FirstOffset *int64 `json:"first_offset,omitempty"`
LastOffset datadog.NullableInt64 `json:"last_offset,omitempty"`
Limit *int64 `json:"limit,omitempty"`
NextOffset *int64 `json:"next_offset,omitempty"`
Offset *int64 `json:"offset,omitempty"`
PrevOffset *int64 `json:"prev_offset,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)
Expand Down

0 comments on commit a87af85

Please sign in to comment.