Skip to content

Commit

Permalink
Regenerate client from commit 4df20bbb of spec repo
Browse files Browse the repository at this point in the history
  • Loading branch information
ci.datadog-api-spec committed Jul 17, 2024
1 parent 3dd6fb7 commit d94f4cd
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 25 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": "2024-07-17 08:36:16.692613",
"spec_repo_commit": "f77e7cb2"
"regenerated": "2024-07-17 15:42:45.676572",
"spec_repo_commit": "4df20bbb"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-07-17 08:36:16.710538",
"spec_repo_commit": "f77e7cb2"
"regenerated": "2024-07-17 15:42:45.694927",
"spec_repo_commit": "4df20bbb"
}
}
}
2 changes: 1 addition & 1 deletion .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ components:
created_by:
$ref: '#/components/schemas/RelationshipToUser'
modified_by:
$ref: '#/components/schemas/RelationshipToUser'
$ref: '#/components/schemas/NullableRelationshipToUser'
type: object
APIKeyResponse:
description: Response for retrieving an API key.
Expand Down
48 changes: 28 additions & 20 deletions api/datadogV2/model_api_key_relationships.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type APIKeyRelationships struct {
// Relationship to user.
CreatedBy *RelationshipToUser `json:"created_by,omitempty"`
// Relationship to user.
ModifiedBy *RelationshipToUser `json:"modified_by,omitempty"`
ModifiedBy NullableNullableRelationshipToUser `json:"modified_by,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 Down Expand Up @@ -64,32 +64,43 @@ func (o *APIKeyRelationships) SetCreatedBy(v RelationshipToUser) {
o.CreatedBy = &v
}

// GetModifiedBy returns the ModifiedBy field value if set, zero value otherwise.
func (o *APIKeyRelationships) GetModifiedBy() RelationshipToUser {
if o == nil || o.ModifiedBy == nil {
var ret RelationshipToUser
// GetModifiedBy returns the ModifiedBy field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *APIKeyRelationships) GetModifiedBy() NullableRelationshipToUser {
if o == nil || o.ModifiedBy.Get() == nil {
var ret NullableRelationshipToUser
return ret
}
return *o.ModifiedBy
return *o.ModifiedBy.Get()
}

// GetModifiedByOk returns a tuple with the ModifiedBy field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *APIKeyRelationships) GetModifiedByOk() (*RelationshipToUser, bool) {
if o == nil || o.ModifiedBy == nil {
// NOTE: If the value is an explicit nil, `nil, true` will be returned.
func (o *APIKeyRelationships) GetModifiedByOk() (*NullableRelationshipToUser, bool) {
if o == nil {
return nil, false
}
return o.ModifiedBy, true
return o.ModifiedBy.Get(), o.ModifiedBy.IsSet()
}

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

// SetModifiedBy gets a reference to the given NullableNullableRelationshipToUser and assigns it to the ModifiedBy field.
func (o *APIKeyRelationships) SetModifiedBy(v NullableRelationshipToUser) {
o.ModifiedBy.Set(&v)
}

// SetModifiedBy gets a reference to the given RelationshipToUser and assigns it to the ModifiedBy field.
func (o *APIKeyRelationships) SetModifiedBy(v RelationshipToUser) {
o.ModifiedBy = &v
// SetModifiedByNil sets the value for ModifiedBy to be an explicit nil.
func (o *APIKeyRelationships) SetModifiedByNil() {
o.ModifiedBy.Set(nil)
}

// UnsetModifiedBy ensures that no value is present for ModifiedBy, not even an explicit nil.
func (o *APIKeyRelationships) UnsetModifiedBy() {
o.ModifiedBy.Unset()
}

// MarshalJSON serializes the struct using spec logic.
Expand All @@ -101,8 +112,8 @@ func (o APIKeyRelationships) MarshalJSON() ([]byte, error) {
if o.CreatedBy != nil {
toSerialize["created_by"] = o.CreatedBy
}
if o.ModifiedBy != nil {
toSerialize["modified_by"] = o.ModifiedBy
if o.ModifiedBy.IsSet() {
toSerialize["modified_by"] = o.ModifiedBy.Get()
}

for key, value := range o.AdditionalProperties {
Expand All @@ -114,8 +125,8 @@ func (o APIKeyRelationships) MarshalJSON() ([]byte, error) {
// UnmarshalJSON deserializes the given payload.
func (o *APIKeyRelationships) UnmarshalJSON(bytes []byte) (err error) {
all := struct {
CreatedBy *RelationshipToUser `json:"created_by,omitempty"`
ModifiedBy *RelationshipToUser `json:"modified_by,omitempty"`
CreatedBy *RelationshipToUser `json:"created_by,omitempty"`
ModifiedBy NullableNullableRelationshipToUser `json:"modified_by,omitempty"`
}{}
if err = datadog.Unmarshal(bytes, &all); err != nil {
return datadog.Unmarshal(bytes, &o.UnparsedObject)
Expand All @@ -132,9 +143,6 @@ func (o *APIKeyRelationships) UnmarshalJSON(bytes []byte) (err error) {
hasInvalidField = true
}
o.CreatedBy = all.CreatedBy
if all.ModifiedBy != nil && all.ModifiedBy.UnparsedObject != nil && o.UnparsedObject == nil {
hasInvalidField = true
}
o.ModifiedBy = all.ModifiedBy

if len(additionalProperties) > 0 {
Expand Down

0 comments on commit d94f4cd

Please sign in to comment.