Skip to content

Commit

Permalink
Enable automerging for Fastly routes. (#2632)
Browse files Browse the repository at this point in the history
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
  • Loading branch information
api-clients-generation-pipeline[bot] and ci.datadog-api-spec committed Aug 14, 2024
1 parent 09f0286 commit f6dee7f
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 6 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-08-14 20:10:54.859237",
"spec_repo_commit": "fafdefa8"
"regenerated": "2024-08-14 20:56:46.342591",
"spec_repo_commit": "dcc3176b"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-08-14 20:10:54.878915",
"spec_repo_commit": "fafdefa8"
"regenerated": "2024-08-14 20:56:46.360356",
"spec_repo_commit": "dcc3176b"
}
}
}
7 changes: 7 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8061,6 +8061,10 @@ components:
FastlyAccounResponseAttributes:
description: Attributes object of a Fastly account.
properties:
api_key:
description: The FastlyAccounResponseAttributes api_key.
type: string
writeOnly: true
name:
description: The name of the Fastly account.
example: test-name
Expand Down Expand Up @@ -8158,6 +8162,9 @@ components:
description: The API key of the Fastly account.
example: ABCDEFG123
type: string
name:
description: The FastlyAccountUpdateRequestAttributes name.
type: string
type: object
FastlyAccountUpdateRequestData:
description: Data object for updating a Fastly account.
Expand Down
37 changes: 36 additions & 1 deletion api/datadogV2/model_fastly_accoun_response_attributes.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import (

// FastlyAccounResponseAttributes Attributes object of a Fastly account.
type FastlyAccounResponseAttributes struct {
// The FastlyAccounResponseAttributes api_key.
ApiKey *string `json:"api_key,omitempty"`
// The name of the Fastly account.
Name string `json:"name"`
// A list of services belonging to the parent account.
Expand Down Expand Up @@ -39,6 +41,34 @@ func NewFastlyAccounResponseAttributesWithDefaults() *FastlyAccounResponseAttrib
return &this
}

// GetApiKey returns the ApiKey field value if set, zero value otherwise.
func (o *FastlyAccounResponseAttributes) GetApiKey() string {
if o == nil || o.ApiKey == nil {
var ret string
return ret
}
return *o.ApiKey
}

// GetApiKeyOk returns a tuple with the ApiKey field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FastlyAccounResponseAttributes) GetApiKeyOk() (*string, bool) {
if o == nil || o.ApiKey == nil {
return nil, false
}
return o.ApiKey, true
}

// HasApiKey returns a boolean if a field has been set.
func (o *FastlyAccounResponseAttributes) HasApiKey() bool {
return o != nil && o.ApiKey != nil
}

// SetApiKey gets a reference to the given string and assigns it to the ApiKey field.
func (o *FastlyAccounResponseAttributes) SetApiKey(v string) {
o.ApiKey = &v
}

// GetName returns the Name field value.
func (o *FastlyAccounResponseAttributes) GetName() string {
if o == nil {
Expand Down Expand Up @@ -96,6 +126,9 @@ func (o FastlyAccounResponseAttributes) MarshalJSON() ([]byte, error) {
if o.UnparsedObject != nil {
return datadog.Marshal(o.UnparsedObject)
}
if o.ApiKey != nil {
toSerialize["api_key"] = o.ApiKey
}
toSerialize["name"] = o.Name
if o.Services != nil {
toSerialize["services"] = o.Services
Expand All @@ -110,6 +143,7 @@ func (o FastlyAccounResponseAttributes) MarshalJSON() ([]byte, error) {
// UnmarshalJSON deserializes the given payload.
func (o *FastlyAccounResponseAttributes) UnmarshalJSON(bytes []byte) (err error) {
all := struct {
ApiKey *string `json:"api_key,omitempty"`
Name *string `json:"name"`
Services []FastlyService `json:"services,omitempty"`
}{}
Expand All @@ -121,10 +155,11 @@ func (o *FastlyAccounResponseAttributes) UnmarshalJSON(bytes []byte) (err error)
}
additionalProperties := make(map[string]interface{})
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
datadog.DeleteKeys(additionalProperties, &[]string{"name", "services"})
datadog.DeleteKeys(additionalProperties, &[]string{"api_key", "name", "services"})
} else {
return err
}
o.ApiKey = all.ApiKey
o.Name = *all.Name
o.Services = all.Services

Expand Down
37 changes: 36 additions & 1 deletion api/datadogV2/model_fastly_account_update_request_attributes.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import (
type FastlyAccountUpdateRequestAttributes struct {
// The API key of the Fastly account.
ApiKey *string `json:"api_key,omitempty"`
// The FastlyAccountUpdateRequestAttributes name.
Name *string `json:"name,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:"-"`
Expand Down Expand Up @@ -62,6 +64,34 @@ func (o *FastlyAccountUpdateRequestAttributes) SetApiKey(v string) {
o.ApiKey = &v
}

// GetName returns the Name field value if set, zero value otherwise.
func (o *FastlyAccountUpdateRequestAttributes) GetName() string {
if o == nil || o.Name == nil {
var ret string
return ret
}
return *o.Name
}

// GetNameOk returns a tuple with the Name field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FastlyAccountUpdateRequestAttributes) GetNameOk() (*string, bool) {
if o == nil || o.Name == nil {
return nil, false
}
return o.Name, true
}

// HasName returns a boolean if a field has been set.
func (o *FastlyAccountUpdateRequestAttributes) HasName() bool {
return o != nil && o.Name != nil
}

// SetName gets a reference to the given string and assigns it to the Name field.
func (o *FastlyAccountUpdateRequestAttributes) SetName(v string) {
o.Name = &v
}

// MarshalJSON serializes the struct using spec logic.
func (o FastlyAccountUpdateRequestAttributes) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
Expand All @@ -71,6 +101,9 @@ func (o FastlyAccountUpdateRequestAttributes) MarshalJSON() ([]byte, error) {
if o.ApiKey != nil {
toSerialize["api_key"] = o.ApiKey
}
if o.Name != nil {
toSerialize["name"] = o.Name
}

for key, value := range o.AdditionalProperties {
toSerialize[key] = value
Expand All @@ -82,17 +115,19 @@ func (o FastlyAccountUpdateRequestAttributes) MarshalJSON() ([]byte, error) {
func (o *FastlyAccountUpdateRequestAttributes) UnmarshalJSON(bytes []byte) (err error) {
all := struct {
ApiKey *string `json:"api_key,omitempty"`
Name *string `json:"name,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{"api_key"})
datadog.DeleteKeys(additionalProperties, &[]string{"api_key", "name"})
} else {
return err
}
o.ApiKey = all.ApiKey
o.Name = all.Name

if len(additionalProperties) > 0 {
o.AdditionalProperties = additionalProperties
Expand Down

0 comments on commit f6dee7f

Please sign in to comment.