Skip to content

Commit

Permalink
Enable automerging for opsgenie routes. (#2633)
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 authored Aug 14, 2024
1 parent f6dee7f commit 423dfaa
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 8 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:56:46.342591",
"spec_repo_commit": "dcc3176b"
"regenerated": "2024-08-14 22:02:33.356148",
"spec_repo_commit": "5e33062a"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-08-14 20:56:46.360356",
"spec_repo_commit": "dcc3176b"
"regenerated": "2024-08-14 22:02:33.380397",
"spec_repo_commit": "5e33062a"
}
}
}
14 changes: 14 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14304,10 +14304,12 @@ components:
custom_url:
description: The custom URL for a custom region.
example: https://example.com
format: url
type: string
name:
description: The name for the Opsgenie service.
example: fake-opsgenie-service-name
maxLength: 100
type: string
opsgenie_api_key:
description: The Opsgenie API key for your Opsgenie service.
Expand Down Expand Up @@ -14365,12 +14367,18 @@ components:
custom_url:
description: The custom URL for a custom region.
example: null
format: url
nullable: true
type: string
name:
description: The name for the Opsgenie service.
example: fake-opsgenie-service-name
maxLength: 100
type: string
opsgenie_api_key:
description: The OpsgenieServiceResponseAttributes opsgenie_api_key.
type: string
writeOnly: true
region:
$ref: '#/components/schemas/OpsgenieServiceRegionType'
type: object
Expand All @@ -14382,6 +14390,8 @@ components:
id:
description: The ID of the Opsgenie service.
example: 596da4af-0563-4097-90ff-07230c3f9db3
maxLength: 100
minLength: 1
type: string
type:
$ref: '#/components/schemas/OpsgenieServiceType'
Expand All @@ -14405,11 +14415,13 @@ components:
custom_url:
description: The custom URL for a custom region.
example: https://example.com
format: url
nullable: true
type: string
name:
description: The name for the Opsgenie service.
example: fake-opsgenie-service-name
maxLength: 100
type: string
opsgenie_api_key:
description: The Opsgenie API key for your Opsgenie service.
Expand All @@ -14426,6 +14438,8 @@ components:
id:
description: The ID of the Opsgenie service.
example: 596da4af-0563-4097-90ff-07230c3f9db3
maxLength: 100
minLength: 1
type: string
type:
$ref: '#/components/schemas/OpsgenieServiceType'
Expand Down
43 changes: 39 additions & 4 deletions api/datadogV2/model_opsgenie_service_response_attributes.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ type OpsgenieServiceResponseAttributes struct {
CustomUrl datadog.NullableString `json:"custom_url,omitempty"`
// The name for the Opsgenie service.
Name *string `json:"name,omitempty"`
// The OpsgenieServiceResponseAttributes opsgenie_api_key.
OpsgenieApiKey *string `json:"opsgenie_api_key,omitempty"`
// The region for the Opsgenie service.
Region *OpsgenieServiceRegionType `json:"region,omitempty"`
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
Expand Down Expand Up @@ -105,6 +107,34 @@ func (o *OpsgenieServiceResponseAttributes) SetName(v string) {
o.Name = &v
}

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

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

// HasOpsgenieApiKey returns a boolean if a field has been set.
func (o *OpsgenieServiceResponseAttributes) HasOpsgenieApiKey() bool {
return o != nil && o.OpsgenieApiKey != nil
}

// SetOpsgenieApiKey gets a reference to the given string and assigns it to the OpsgenieApiKey field.
func (o *OpsgenieServiceResponseAttributes) SetOpsgenieApiKey(v string) {
o.OpsgenieApiKey = &v
}

// GetRegion returns the Region field value if set, zero value otherwise.
func (o *OpsgenieServiceResponseAttributes) GetRegion() OpsgenieServiceRegionType {
if o == nil || o.Region == nil {
Expand Down Expand Up @@ -145,6 +175,9 @@ func (o OpsgenieServiceResponseAttributes) MarshalJSON() ([]byte, error) {
if o.Name != nil {
toSerialize["name"] = o.Name
}
if o.OpsgenieApiKey != nil {
toSerialize["opsgenie_api_key"] = o.OpsgenieApiKey
}
if o.Region != nil {
toSerialize["region"] = o.Region
}
Expand All @@ -158,23 +191,25 @@ func (o OpsgenieServiceResponseAttributes) MarshalJSON() ([]byte, error) {
// UnmarshalJSON deserializes the given payload.
func (o *OpsgenieServiceResponseAttributes) UnmarshalJSON(bytes []byte) (err error) {
all := struct {
CustomUrl datadog.NullableString `json:"custom_url,omitempty"`
Name *string `json:"name,omitempty"`
Region *OpsgenieServiceRegionType `json:"region,omitempty"`
CustomUrl datadog.NullableString `json:"custom_url,omitempty"`
Name *string `json:"name,omitempty"`
OpsgenieApiKey *string `json:"opsgenie_api_key,omitempty"`
Region *OpsgenieServiceRegionType `json:"region,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{"custom_url", "name", "region"})
datadog.DeleteKeys(additionalProperties, &[]string{"custom_url", "name", "opsgenie_api_key", "region"})
} else {
return err
}

hasInvalidField := false
o.CustomUrl = all.CustomUrl
o.Name = all.Name
o.OpsgenieApiKey = all.OpsgenieApiKey
if all.Region != nil && !all.Region.IsValid() {
hasInvalidField = true
} else {
Expand Down

0 comments on commit 423dfaa

Please sign in to comment.