From 423dfaa94371b6f174faefc68b2f742b979aa963 Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Wed, 14 Aug 2024 22:28:45 +0000 Subject: [PATCH] Enable automerging for opsgenie routes. (#2633) Co-authored-by: ci.datadog-api-spec --- .apigentools-info | 8 ++-- .generator/schemas/v2/openapi.yaml | 14 ++++++ ...el_opsgenie_service_response_attributes.go | 43 +++++++++++++++++-- 3 files changed, 57 insertions(+), 8 deletions(-) diff --git a/.apigentools-info b/.apigentools-info index e11fd0970a3..11ca3dd4a4c 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -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" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 143d6c69cda..e77e0163368 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -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. @@ -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 @@ -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' @@ -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. @@ -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' diff --git a/api/datadogV2/model_opsgenie_service_response_attributes.go b/api/datadogV2/model_opsgenie_service_response_attributes.go index 8393f00d1e7..fe43b6c8142 100644 --- a/api/datadogV2/model_opsgenie_service_response_attributes.go +++ b/api/datadogV2/model_opsgenie_service_response_attributes.go @@ -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 @@ -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 { @@ -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 } @@ -158,16 +191,17 @@ 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 } @@ -175,6 +209,7 @@ func (o *OpsgenieServiceResponseAttributes) UnmarshalJSON(bytes []byte) (err 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 {