Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable automerging for cloudflare routes. #2631

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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-12 20:42:10.824965",
"spec_repo_commit": "7a16d6c5"
"regenerated": "2024-08-14 20:10:54.859237",
"spec_repo_commit": "fafdefa8"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-08-12 20:42:10.842550",
"spec_repo_commit": "7a16d6c5"
"regenerated": "2024-08-14 20:10:54.878915",
"spec_repo_commit": "fafdefa8"
}
}
}
7 changes: 7 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4412,6 +4412,10 @@ components:
CloudflareAccountResponseAttributes:
description: Attributes object of a Cloudflare account.
properties:
api_key:
description: The CloudflareAccountResponseAttributes api_key.
type: string
writeOnly: true
email:
description: The email associated with the Cloudflare account.
example: test-email@example.com
Expand Down Expand Up @@ -4484,6 +4488,9 @@ components:
key is provided (and not a token), this field is also required.
example: test-email@example.com
type: string
name:
description: The CloudflareAccountUpdateRequestAttributes name.
type: string
resources:
description: An allowlist of resources to restrict pulling metrics for.
example:
Expand Down
37 changes: 36 additions & 1 deletion api/datadogV2/model_cloudflare_account_response_attributes.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import (

// CloudflareAccountResponseAttributes Attributes object of a Cloudflare account.
type CloudflareAccountResponseAttributes struct {
// The CloudflareAccountResponseAttributes api_key.
ApiKey *string `json:"api_key,omitempty"`
// The email associated with the Cloudflare account.
Email *string `json:"email,omitempty"`
// The name of the Cloudflare account.
Expand Down Expand Up @@ -43,6 +45,34 @@ func NewCloudflareAccountResponseAttributesWithDefaults() *CloudflareAccountResp
return &this
}

// GetApiKey returns the ApiKey field value if set, zero value otherwise.
func (o *CloudflareAccountResponseAttributes) 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 *CloudflareAccountResponseAttributes) 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 *CloudflareAccountResponseAttributes) 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 *CloudflareAccountResponseAttributes) SetApiKey(v string) {
o.ApiKey = &v
}

// GetEmail returns the Email field value if set, zero value otherwise.
func (o *CloudflareAccountResponseAttributes) GetEmail() string {
if o == nil || o.Email == nil {
Expand Down Expand Up @@ -156,6 +186,9 @@ func (o CloudflareAccountResponseAttributes) MarshalJSON() ([]byte, error) {
if o.UnparsedObject != nil {
return datadog.Marshal(o.UnparsedObject)
}
if o.ApiKey != nil {
toSerialize["api_key"] = o.ApiKey
}
if o.Email != nil {
toSerialize["email"] = o.Email
}
Expand All @@ -176,6 +209,7 @@ func (o CloudflareAccountResponseAttributes) MarshalJSON() ([]byte, error) {
// UnmarshalJSON deserializes the given payload.
func (o *CloudflareAccountResponseAttributes) UnmarshalJSON(bytes []byte) (err error) {
all := struct {
ApiKey *string `json:"api_key,omitempty"`
Email *string `json:"email,omitempty"`
Name *string `json:"name"`
Resources []string `json:"resources,omitempty"`
Expand All @@ -189,10 +223,11 @@ func (o *CloudflareAccountResponseAttributes) UnmarshalJSON(bytes []byte) (err e
}
additionalProperties := make(map[string]interface{})
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
datadog.DeleteKeys(additionalProperties, &[]string{"email", "name", "resources", "zones"})
datadog.DeleteKeys(additionalProperties, &[]string{"api_key", "email", "name", "resources", "zones"})
} else {
return err
}
o.ApiKey = all.ApiKey
o.Email = all.Email
o.Name = *all.Name
o.Resources = all.Resources
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ type CloudflareAccountUpdateRequestAttributes struct {
ApiKey string `json:"api_key"`
// The email associated with the Cloudflare account. If an API key is provided (and not a token), this field is also required.
Email *string `json:"email,omitempty"`
// The CloudflareAccountUpdateRequestAttributes name.
Name *string `json:"name,omitempty"`
// An allowlist of resources to restrict pulling metrics for.
Resources []string `json:"resources,omitempty"`
// An allowlist of zones to restrict pulling metrics for.
Expand Down Expand Up @@ -94,6 +96,34 @@ func (o *CloudflareAccountUpdateRequestAttributes) SetEmail(v string) {
o.Email = &v
}

// GetName returns the Name field value if set, zero value otherwise.
func (o *CloudflareAccountUpdateRequestAttributes) 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 *CloudflareAccountUpdateRequestAttributes) 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 *CloudflareAccountUpdateRequestAttributes) 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 *CloudflareAccountUpdateRequestAttributes) SetName(v string) {
o.Name = &v
}

// GetResources returns the Resources field value if set, zero value otherwise.
func (o *CloudflareAccountUpdateRequestAttributes) GetResources() []string {
if o == nil || o.Resources == nil {
Expand Down Expand Up @@ -160,6 +190,9 @@ func (o CloudflareAccountUpdateRequestAttributes) MarshalJSON() ([]byte, error)
if o.Email != nil {
toSerialize["email"] = o.Email
}
if o.Name != nil {
toSerialize["name"] = o.Name
}
if o.Resources != nil {
toSerialize["resources"] = o.Resources
}
Expand All @@ -178,6 +211,7 @@ func (o *CloudflareAccountUpdateRequestAttributes) UnmarshalJSON(bytes []byte) (
all := struct {
ApiKey *string `json:"api_key"`
Email *string `json:"email,omitempty"`
Name *string `json:"name,omitempty"`
Resources []string `json:"resources,omitempty"`
Zones []string `json:"zones,omitempty"`
}{}
Expand All @@ -189,12 +223,13 @@ func (o *CloudflareAccountUpdateRequestAttributes) UnmarshalJSON(bytes []byte) (
}
additionalProperties := make(map[string]interface{})
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
datadog.DeleteKeys(additionalProperties, &[]string{"api_key", "email", "resources", "zones"})
datadog.DeleteKeys(additionalProperties, &[]string{"api_key", "email", "name", "resources", "zones"})
} else {
return err
}
o.ApiKey = *all.ApiKey
o.Email = all.Email
o.Name = all.Name
o.Resources = all.Resources
o.Zones = all.Zones

Expand Down
Loading