From e992fa92d5ca5aad174ea3aa955239d437be1c2c Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Wed, 5 May 2021 16:37:01 +0000 Subject: [PATCH] Regenerate client from commit eaa0782 of spec repo --- .apigentools-info | 8 +- api/v1/datadog/.openapi-generator/FILES | 2 + api/v1/datadog/README.md | 1 + api/v1/datadog/api/openapi.yaml | 171 ++++- .../datadog/api_service_level_objectives.go | 34 +- api/v1/datadog/docs/SLOResponse.md | 8 +- api/v1/datadog/docs/SLOResponseData.md | 404 ++++++++++++ .../datadog/docs/ServiceLevelObjectivesApi.md | 15 +- api/v1/datadog/model_slo_response.go | 12 +- api/v1/datadog/model_slo_response_data.go | 601 ++++++++++++++++++ 10 files changed, 1234 insertions(+), 22 deletions(-) create mode 100644 api/v1/datadog/docs/SLOResponseData.md create mode 100644 api/v1/datadog/model_slo_response_data.go diff --git a/.apigentools-info b/.apigentools-info index 5640444e7a3..9b77a888491 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.4.1.dev6", - "regenerated": "2021-05-05 11:51:39.750453", - "spec_repo_commit": "45e6981" + "regenerated": "2021-05-05 16:35:55.570334", + "spec_repo_commit": "eaa0782" }, "v2": { "apigentools_version": "1.4.1.dev6", - "regenerated": "2021-05-05 11:52:51.665617", - "spec_repo_commit": "45e6981" + "regenerated": "2021-05-05 16:36:58.979772", + "spec_repo_commit": "eaa0782" } } } \ No newline at end of file diff --git a/api/v1/datadog/.openapi-generator/FILES b/api/v1/datadog/.openapi-generator/FILES index 0974161a35a..2438acbb4be 100644 --- a/api/v1/datadog/.openapi-generator/FILES +++ b/api/v1/datadog/.openapi-generator/FILES @@ -317,6 +317,7 @@ docs/SLOListResponse.md docs/SLOListResponseMetadata.md docs/SLOListResponseMetadataPage.md docs/SLOResponse.md +docs/SLOResponseData.md docs/SLOThreshold.md docs/SLOTimeframe.md docs/SLOType.md @@ -863,6 +864,7 @@ model_slo_list_response.go model_slo_list_response_metadata.go model_slo_list_response_metadata_page.go model_slo_response.go +model_slo_response_data.go model_slo_threshold.go model_slo_timeframe.go model_slo_type.go diff --git a/api/v1/datadog/README.md b/api/v1/datadog/README.md index 47f4d1d8988..d0f11d2288f 100644 --- a/api/v1/datadog/README.md +++ b/api/v1/datadog/README.md @@ -530,6 +530,7 @@ Class | Method | HTTP request | Description - [SLOListResponseMetadata](docs/SLOListResponseMetadata.md) - [SLOListResponseMetadataPage](docs/SLOListResponseMetadataPage.md) - [SLOResponse](docs/SLOResponse.md) + - [SLOResponseData](docs/SLOResponseData.md) - [SLOThreshold](docs/SLOThreshold.md) - [SLOTimeframe](docs/SLOTimeframe.md) - [SLOType](docs/SLOType.md) diff --git a/api/v1/datadog/api/openapi.yaml b/api/v1/datadog/api/openapi.yaml index 97a9586f691..6b20d123293 100644 --- a/api/v1/datadog/api/openapi.yaml +++ b/api/v1/datadog/api/openapi.yaml @@ -5793,6 +5793,15 @@ paths: schema: type: string style: simple + - description: Get the IDs of SLO monitors that reference this SLO. + example: true + explode: true + in: query + name: with_configured_alert_ids + required: false + schema: + type: boolean + style: form responses: "200": content: @@ -16216,6 +16225,10 @@ components: - 1 - 1 name: Custom Metric SLO + configured_alert_ids: + - 123 + - 456 + - 789 id: id modified_at: 6 monitor_tags: @@ -16226,7 +16239,7 @@ components: - errors properties: data: - $ref: '#/components/schemas/ServiceLevelObjective' + $ref: '#/components/schemas/SLOResponse_data' errors: description: |- An array of error messages. Each endpoint documents how/whether this field is @@ -25410,6 +25423,162 @@ components: page: $ref: '#/components/schemas/SLOListResponse_metadata_page' type: object + SLOResponse_data: + description: |- + A service level objective object includes a service level indicator, thresholds + for one or more timeframes, and metadata (`name`, `description`, `tags`, etc.). + example: + creator: + name: name + handle: handle + email: email + query: + denominator: sum:my.custom.metric{*}.as_count() + numerator: sum:my.custom.metric{type:good}.as_count() + created_at: 0 + description: description + groups: + - env:prod + - role:mysql + type: metric + tags: + - env:prod + - app:core + thresholds: + - target: 95 + timeframe: 7d + - target: 95 + timeframe: 30d + warning: 97 + monitor_ids: + - 1 + - 1 + name: Custom Metric SLO + configured_alert_ids: + - 123 + - 456 + - 789 + id: id + modified_at: 6 + monitor_tags: + - monitor_tags + - monitor_tags + properties: + configured_alert_ids: + description: A list of SLO monitors IDs that reference this SLO. This field + is returned only when `with_configured_alert_ids` parameter is true in + query. + example: + - 123 + - 456 + - 789 + items: + description: A monitor ID. + format: int64 + type: integer + type: array + created_at: + description: |- + Creation timestamp (UNIX time in seconds) + + Always included in service level objective responses. + format: int64 + readOnly: true + type: integer + creator: + $ref: '#/components/schemas/Creator' + description: + description: |- + A user-defined description of the service level objective. + + Always included in service level objective responses (but may be `null`). + Optional in create/update requests. + nullable: true + type: string + groups: + description: |- + A list of (up to 20) monitor groups that narrow the scope of a monitor service level objective. + + Included in service level objective responses if it is not empty. Optional in + create/update requests for monitor service level objectives, but may only be + used when then length of the `monitor_ids` field is one. + example: + - env:prod + - role:mysql + items: + description: A group name, for instance `env:prod`. + type: string + type: array + id: + description: |- + A unique identifier for the service level objective object. + + Always included in service level objective responses. + readOnly: true + type: string + modified_at: + description: |- + Modification timestamp (UNIX time in seconds) + + Always included in service level objective responses. + format: int64 + readOnly: true + type: integer + monitor_ids: + description: |- + A list of monitor ids that defines the scope of a monitor service level + objective. **Required if type is `monitor`**. + items: + description: A monitor ID. + format: int64 + type: integer + type: array + monitor_tags: + description: |- + The union of monitor tags for all monitors referenced by the `monitor_ids` + field. + Always included in service level objective responses for monitor service level + objectives (but may be empty). Ignored in create/update requests. Does not + affect which monitors are included in the service level objective (that is + determined entirely by the `monitor_ids` field). + items: + description: A monitor tag. + type: string + type: array + name: + description: The name of the service level objective object. + example: Custom Metric SLO + type: string + query: + $ref: '#/components/schemas/ServiceLevelObjectiveQuery' + tags: + description: |- + A list of tags associated with this service level objective. + Always included in service level objective responses (but may be empty). + Optional in create/update requests. + example: + - env:prod + - app:core + items: + description: A tag to apply to your SLO. + type: string + type: array + thresholds: + description: |- + The thresholds (timeframes and associated targets) for this service level + objective object. + example: + - target: 95 + timeframe: 7d + - target: 95 + timeframe: 30d + warning: 97 + items: + $ref: '#/components/schemas/SLOThreshold' + type: array + type: + $ref: '#/components/schemas/SLOType' + type: object ScatterPlotWidgetDefinition_requests: description: Widget definition. example: diff --git a/api/v1/datadog/api_service_level_objectives.go b/api/v1/datadog/api_service_level_objectives.go index 9d3b6e008df..c22f10507d8 100644 --- a/api/v1/datadog/api_service_level_objectives.go +++ b/api/v1/datadog/api_service_level_objectives.go @@ -697,22 +697,45 @@ func (a *ServiceLevelObjectivesApiService) deleteSLOTimeframeInBulkExecute(r api } type apiGetSLORequest struct { - ctx _context.Context - ApiService *ServiceLevelObjectivesApiService - sloId string + ctx _context.Context + ApiService *ServiceLevelObjectivesApiService + sloId string + withConfiguredAlertIds *bool +} + +type GetSLOOptionalParameters struct { + WithConfiguredAlertIds *bool +} + +func NewGetSLOOptionalParameters() *GetSLOOptionalParameters { + this := GetSLOOptionalParameters{} + return &this +} +func (r *GetSLOOptionalParameters) WithWithConfiguredAlertIds(withConfiguredAlertIds bool) *GetSLOOptionalParameters { + r.WithConfiguredAlertIds = &withConfiguredAlertIds + return r } /* * GetSLO Get an SLO's details * Get a service level objective object. */ -func (a *ServiceLevelObjectivesApiService) GetSLO(ctx _context.Context, sloId string) (SLOResponse, *_nethttp.Response, error) { +func (a *ServiceLevelObjectivesApiService) GetSLO(ctx _context.Context, sloId string, o ...GetSLOOptionalParameters) (SLOResponse, *_nethttp.Response, error) { req := apiGetSLORequest{ ApiService: a, ctx: ctx, sloId: sloId, } + if len(o) > 1 { + var localVarReturnValue SLOResponse + return localVarReturnValue, nil, reportError("only one argument of type GetSLOOptionalParameters is allowed") + } + + if o != nil { + req.withConfiguredAlertIds = o[0].WithConfiguredAlertIds + } + return req.ApiService.getSLOExecute(req) } @@ -742,6 +765,9 @@ func (a *ServiceLevelObjectivesApiService) getSLOExecute(r apiGetSLORequest) (SL localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + if r.withConfiguredAlertIds != nil { + localVarQueryParams.Add("with_configured_alert_ids", parameterToString(*r.withConfiguredAlertIds, "")) + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} diff --git a/api/v1/datadog/docs/SLOResponse.md b/api/v1/datadog/docs/SLOResponse.md index 31839eb610c..d4621973e7c 100644 --- a/api/v1/datadog/docs/SLOResponse.md +++ b/api/v1/datadog/docs/SLOResponse.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ---- | ---- | ----------- | ------ -**Data** | Pointer to [**ServiceLevelObjective**](ServiceLevelObjective.md) | | [optional] +**Data** | Pointer to [**SLOResponseData**](SLOResponseData.md) | | [optional] **Errors** | Pointer to **[]string** | An array of error messages. Each endpoint documents how/whether this field is used. | [optional] ## Methods @@ -28,20 +28,20 @@ but it doesn't guarantee that properties required by API are set ### GetData -`func (o *SLOResponse) GetData() ServiceLevelObjective` +`func (o *SLOResponse) GetData() SLOResponseData` GetData returns the Data field if non-nil, zero value otherwise. ### GetDataOk -`func (o *SLOResponse) GetDataOk() (*ServiceLevelObjective, bool)` +`func (o *SLOResponse) GetDataOk() (*SLOResponseData, bool)` GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetData -`func (o *SLOResponse) SetData(v ServiceLevelObjective)` +`func (o *SLOResponse) SetData(v SLOResponseData)` SetData sets Data field to given value. diff --git a/api/v1/datadog/docs/SLOResponseData.md b/api/v1/datadog/docs/SLOResponseData.md new file mode 100644 index 00000000000..54e797499cf --- /dev/null +++ b/api/v1/datadog/docs/SLOResponseData.md @@ -0,0 +1,404 @@ +# SLOResponseData + +## Properties + +Name | Type | Description | Notes +---- | ---- | ----------- | ------ +**ConfiguredAlertIds** | Pointer to **[]int64** | A list of SLO monitors IDs that reference this SLO. This field is returned only when `with_configured_alert_ids` parameter is true in query. | [optional] +**CreatedAt** | Pointer to **int64** | Creation timestamp (UNIX time in seconds) Always included in service level objective responses. | [optional] [readonly] +**Creator** | Pointer to [**Creator**](Creator.md) | | [optional] +**Description** | Pointer to **NullableString** | A user-defined description of the service level objective. Always included in service level objective responses (but may be `null`). Optional in create/update requests. | [optional] +**Groups** | Pointer to **[]string** | A list of (up to 20) monitor groups that narrow the scope of a monitor service level objective. Included in service level objective responses if it is not empty. Optional in create/update requests for monitor service level objectives, but may only be used when then length of the `monitor_ids` field is one. | [optional] +**Id** | Pointer to **string** | A unique identifier for the service level objective object. Always included in service level objective responses. | [optional] [readonly] +**ModifiedAt** | Pointer to **int64** | Modification timestamp (UNIX time in seconds) Always included in service level objective responses. | [optional] [readonly] +**MonitorIds** | Pointer to **[]int64** | A list of monitor ids that defines the scope of a monitor service level objective. **Required if type is `monitor`**. | [optional] +**MonitorTags** | Pointer to **[]string** | The union of monitor tags for all monitors referenced by the `monitor_ids` field. Always included in service level objective responses for monitor service level objectives (but may be empty). Ignored in create/update requests. Does not affect which monitors are included in the service level objective (that is determined entirely by the `monitor_ids` field). | [optional] +**Name** | Pointer to **string** | The name of the service level objective object. | [optional] +**Query** | Pointer to [**ServiceLevelObjectiveQuery**](ServiceLevelObjectiveQuery.md) | | [optional] +**Tags** | Pointer to **[]string** | A list of tags associated with this service level objective. Always included in service level objective responses (but may be empty). Optional in create/update requests. | [optional] +**Thresholds** | Pointer to [**[]SLOThreshold**](SLOThreshold.md) | The thresholds (timeframes and associated targets) for this service level objective object. | [optional] +**Type** | Pointer to [**SLOType**](SLOType.md) | | [optional] + +## Methods + +### NewSLOResponseData + +`func NewSLOResponseData() *SLOResponseData` + +NewSLOResponseData instantiates a new SLOResponseData object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewSLOResponseDataWithDefaults + +`func NewSLOResponseDataWithDefaults() *SLOResponseData` + +NewSLOResponseDataWithDefaults instantiates a new SLOResponseData object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetConfiguredAlertIds + +`func (o *SLOResponseData) GetConfiguredAlertIds() []int64` + +GetConfiguredAlertIds returns the ConfiguredAlertIds field if non-nil, zero value otherwise. + +### GetConfiguredAlertIdsOk + +`func (o *SLOResponseData) GetConfiguredAlertIdsOk() (*[]int64, bool)` + +GetConfiguredAlertIdsOk returns a tuple with the ConfiguredAlertIds field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetConfiguredAlertIds + +`func (o *SLOResponseData) SetConfiguredAlertIds(v []int64)` + +SetConfiguredAlertIds sets ConfiguredAlertIds field to given value. + +### HasConfiguredAlertIds + +`func (o *SLOResponseData) HasConfiguredAlertIds() bool` + +HasConfiguredAlertIds returns a boolean if a field has been set. + +### GetCreatedAt + +`func (o *SLOResponseData) GetCreatedAt() int64` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *SLOResponseData) GetCreatedAtOk() (*int64, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *SLOResponseData) SetCreatedAt(v int64)` + +SetCreatedAt sets CreatedAt field to given value. + +### HasCreatedAt + +`func (o *SLOResponseData) HasCreatedAt() bool` + +HasCreatedAt returns a boolean if a field has been set. + +### GetCreator + +`func (o *SLOResponseData) GetCreator() Creator` + +GetCreator returns the Creator field if non-nil, zero value otherwise. + +### GetCreatorOk + +`func (o *SLOResponseData) GetCreatorOk() (*Creator, bool)` + +GetCreatorOk returns a tuple with the Creator field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreator + +`func (o *SLOResponseData) SetCreator(v Creator)` + +SetCreator sets Creator field to given value. + +### HasCreator + +`func (o *SLOResponseData) HasCreator() bool` + +HasCreator returns a boolean if a field has been set. + +### GetDescription + +`func (o *SLOResponseData) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *SLOResponseData) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *SLOResponseData) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *SLOResponseData) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### SetDescriptionNil + +`func (o *SLOResponseData) SetDescriptionNil(b bool)` + + SetDescriptionNil sets the value for Description to be an explicit nil + +### UnsetDescription +`func (o *SLOResponseData) UnsetDescription()` + +UnsetDescription ensures that no value is present for Description, not even an explicit nil +### GetGroups + +`func (o *SLOResponseData) GetGroups() []string` + +GetGroups returns the Groups field if non-nil, zero value otherwise. + +### GetGroupsOk + +`func (o *SLOResponseData) GetGroupsOk() (*[]string, bool)` + +GetGroupsOk returns a tuple with the Groups field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGroups + +`func (o *SLOResponseData) SetGroups(v []string)` + +SetGroups sets Groups field to given value. + +### HasGroups + +`func (o *SLOResponseData) HasGroups() bool` + +HasGroups returns a boolean if a field has been set. + +### GetId + +`func (o *SLOResponseData) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *SLOResponseData) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *SLOResponseData) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *SLOResponseData) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetModifiedAt + +`func (o *SLOResponseData) GetModifiedAt() int64` + +GetModifiedAt returns the ModifiedAt field if non-nil, zero value otherwise. + +### GetModifiedAtOk + +`func (o *SLOResponseData) GetModifiedAtOk() (*int64, bool)` + +GetModifiedAtOk returns a tuple with the ModifiedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetModifiedAt + +`func (o *SLOResponseData) SetModifiedAt(v int64)` + +SetModifiedAt sets ModifiedAt field to given value. + +### HasModifiedAt + +`func (o *SLOResponseData) HasModifiedAt() bool` + +HasModifiedAt returns a boolean if a field has been set. + +### GetMonitorIds + +`func (o *SLOResponseData) GetMonitorIds() []int64` + +GetMonitorIds returns the MonitorIds field if non-nil, zero value otherwise. + +### GetMonitorIdsOk + +`func (o *SLOResponseData) GetMonitorIdsOk() (*[]int64, bool)` + +GetMonitorIdsOk returns a tuple with the MonitorIds field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMonitorIds + +`func (o *SLOResponseData) SetMonitorIds(v []int64)` + +SetMonitorIds sets MonitorIds field to given value. + +### HasMonitorIds + +`func (o *SLOResponseData) HasMonitorIds() bool` + +HasMonitorIds returns a boolean if a field has been set. + +### GetMonitorTags + +`func (o *SLOResponseData) GetMonitorTags() []string` + +GetMonitorTags returns the MonitorTags field if non-nil, zero value otherwise. + +### GetMonitorTagsOk + +`func (o *SLOResponseData) GetMonitorTagsOk() (*[]string, bool)` + +GetMonitorTagsOk returns a tuple with the MonitorTags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMonitorTags + +`func (o *SLOResponseData) SetMonitorTags(v []string)` + +SetMonitorTags sets MonitorTags field to given value. + +### HasMonitorTags + +`func (o *SLOResponseData) HasMonitorTags() bool` + +HasMonitorTags returns a boolean if a field has been set. + +### GetName + +`func (o *SLOResponseData) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *SLOResponseData) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *SLOResponseData) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *SLOResponseData) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetQuery + +`func (o *SLOResponseData) GetQuery() ServiceLevelObjectiveQuery` + +GetQuery returns the Query field if non-nil, zero value otherwise. + +### GetQueryOk + +`func (o *SLOResponseData) GetQueryOk() (*ServiceLevelObjectiveQuery, bool)` + +GetQueryOk returns a tuple with the Query field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetQuery + +`func (o *SLOResponseData) SetQuery(v ServiceLevelObjectiveQuery)` + +SetQuery sets Query field to given value. + +### HasQuery + +`func (o *SLOResponseData) HasQuery() bool` + +HasQuery returns a boolean if a field has been set. + +### GetTags + +`func (o *SLOResponseData) GetTags() []string` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *SLOResponseData) GetTagsOk() (*[]string, bool)` + +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTags + +`func (o *SLOResponseData) SetTags(v []string)` + +SetTags sets Tags field to given value. + +### HasTags + +`func (o *SLOResponseData) HasTags() bool` + +HasTags returns a boolean if a field has been set. + +### GetThresholds + +`func (o *SLOResponseData) GetThresholds() []SLOThreshold` + +GetThresholds returns the Thresholds field if non-nil, zero value otherwise. + +### GetThresholdsOk + +`func (o *SLOResponseData) GetThresholdsOk() (*[]SLOThreshold, bool)` + +GetThresholdsOk returns a tuple with the Thresholds field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetThresholds + +`func (o *SLOResponseData) SetThresholds(v []SLOThreshold)` + +SetThresholds sets Thresholds field to given value. + +### HasThresholds + +`func (o *SLOResponseData) HasThresholds() bool` + +HasThresholds returns a boolean if a field has been set. + +### GetType + +`func (o *SLOResponseData) GetType() SLOType` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *SLOResponseData) GetTypeOk() (*SLOType, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *SLOResponseData) SetType(v SLOType)` + +SetType sets Type field to given value. + +### HasType + +`func (o *SLOResponseData) HasType() bool` + +HasType returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/api/v1/datadog/docs/ServiceLevelObjectivesApi.md b/api/v1/datadog/docs/ServiceLevelObjectivesApi.md index b9dcf417e6a..00c2039399d 100644 --- a/api/v1/datadog/docs/ServiceLevelObjectivesApi.md +++ b/api/v1/datadog/docs/ServiceLevelObjectivesApi.md @@ -314,7 +314,7 @@ This endpoint does not have optional parameters. ## GetSLO -> SLOResponse GetSLO(ctx, sloId) +> SLOResponse GetSLO(ctx, sloId, datadog.GetSLOOptionalParameters{}) Get a service level objective object. @@ -335,11 +335,15 @@ func main() { ctx := datadog.NewDefaultContext(context.Background()) sloId := "sloId_example" // string | The ID of the service level objective object. + withConfiguredAlertIds := true // bool | Get the IDs of SLO monitors that reference this SLO. (optional) + optionalParams := datadog.GetSLOOptionalParameters{ + WithConfiguredAlertIds: &withConfiguredAlertIds, + } configuration := datadog.NewConfiguration() apiClient := datadog.NewAPIClient(configuration) - resp, r, err := apiClient.ServiceLevelObjectivesApi.GetSLO(ctx, sloId) + resp, r, err := apiClient.ServiceLevelObjectivesApi.GetSLO(ctx, sloId, optionalParams) if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `ServiceLevelObjectivesApi.GetSLO`: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -361,8 +365,13 @@ Name | Type | Description | Notes ### Optional Parameters -This endpoint does not have optional parameters. +Other parameters are passed through a pointer to a GetSLOOptionalParameters struct. + + +Name | Type | Description | Notes +---- | ---- | ------------ | ------ +**withConfiguredAlertIds** | **bool** | Get the IDs of SLO monitors that reference this SLO. | ### Return type diff --git a/api/v1/datadog/model_slo_response.go b/api/v1/datadog/model_slo_response.go index 470309d8e92..39ed34864cc 100644 --- a/api/v1/datadog/model_slo_response.go +++ b/api/v1/datadog/model_slo_response.go @@ -14,7 +14,7 @@ import ( // SLOResponse A service level objective response containing a single service level objective. type SLOResponse struct { - Data *ServiceLevelObjective `json:"data,omitempty"` + Data *SLOResponseData `json:"data,omitempty"` // An array of error messages. Each endpoint documents how/whether this field is used. Errors *[]string `json:"errors,omitempty"` } @@ -37,9 +37,9 @@ func NewSLOResponseWithDefaults() *SLOResponse { } // GetData returns the Data field value if set, zero value otherwise. -func (o *SLOResponse) GetData() ServiceLevelObjective { +func (o *SLOResponse) GetData() SLOResponseData { if o == nil || o.Data == nil { - var ret ServiceLevelObjective + var ret SLOResponseData return ret } return *o.Data @@ -47,7 +47,7 @@ func (o *SLOResponse) GetData() ServiceLevelObjective { // GetDataOk returns a tuple with the Data field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SLOResponse) GetDataOk() (*ServiceLevelObjective, bool) { +func (o *SLOResponse) GetDataOk() (*SLOResponseData, bool) { if o == nil || o.Data == nil { return nil, false } @@ -63,8 +63,8 @@ func (o *SLOResponse) HasData() bool { return false } -// SetData gets a reference to the given ServiceLevelObjective and assigns it to the Data field. -func (o *SLOResponse) SetData(v ServiceLevelObjective) { +// SetData gets a reference to the given SLOResponseData and assigns it to the Data field. +func (o *SLOResponse) SetData(v SLOResponseData) { o.Data = &v } diff --git a/api/v1/datadog/model_slo_response_data.go b/api/v1/datadog/model_slo_response_data.go new file mode 100644 index 00000000000..6e7ee854d87 --- /dev/null +++ b/api/v1/datadog/model_slo_response_data.go @@ -0,0 +1,601 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package datadog + +import ( + "encoding/json" +) + +// SLOResponseData A service level objective object includes a service level indicator, thresholds for one or more timeframes, and metadata (`name`, `description`, `tags`, etc.). +type SLOResponseData struct { + // A list of SLO monitors IDs that reference this SLO. This field is returned only when `with_configured_alert_ids` parameter is true in query. + ConfiguredAlertIds *[]int64 `json:"configured_alert_ids,omitempty"` + // Creation timestamp (UNIX time in seconds) Always included in service level objective responses. + CreatedAt *int64 `json:"created_at,omitempty"` + Creator *Creator `json:"creator,omitempty"` + // A user-defined description of the service level objective. Always included in service level objective responses (but may be `null`). Optional in create/update requests. + Description NullableString `json:"description,omitempty"` + // A list of (up to 20) monitor groups that narrow the scope of a monitor service level objective. Included in service level objective responses if it is not empty. Optional in create/update requests for monitor service level objectives, but may only be used when then length of the `monitor_ids` field is one. + Groups *[]string `json:"groups,omitempty"` + // A unique identifier for the service level objective object. Always included in service level objective responses. + Id *string `json:"id,omitempty"` + // Modification timestamp (UNIX time in seconds) Always included in service level objective responses. + ModifiedAt *int64 `json:"modified_at,omitempty"` + // A list of monitor ids that defines the scope of a monitor service level objective. **Required if type is `monitor`**. + MonitorIds *[]int64 `json:"monitor_ids,omitempty"` + // The union of monitor tags for all monitors referenced by the `monitor_ids` field. Always included in service level objective responses for monitor service level objectives (but may be empty). Ignored in create/update requests. Does not affect which monitors are included in the service level objective (that is determined entirely by the `monitor_ids` field). + MonitorTags *[]string `json:"monitor_tags,omitempty"` + // The name of the service level objective object. + Name *string `json:"name,omitempty"` + Query *ServiceLevelObjectiveQuery `json:"query,omitempty"` + // A list of tags associated with this service level objective. Always included in service level objective responses (but may be empty). Optional in create/update requests. + Tags *[]string `json:"tags,omitempty"` + // The thresholds (timeframes and associated targets) for this service level objective object. + Thresholds *[]SLOThreshold `json:"thresholds,omitempty"` + Type *SLOType `json:"type,omitempty"` +} + +// NewSLOResponseData instantiates a new SLOResponseData object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSLOResponseData() *SLOResponseData { + this := SLOResponseData{} + return &this +} + +// NewSLOResponseDataWithDefaults instantiates a new SLOResponseData object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSLOResponseDataWithDefaults() *SLOResponseData { + this := SLOResponseData{} + return &this +} + +// GetConfiguredAlertIds returns the ConfiguredAlertIds field value if set, zero value otherwise. +func (o *SLOResponseData) GetConfiguredAlertIds() []int64 { + if o == nil || o.ConfiguredAlertIds == nil { + var ret []int64 + return ret + } + return *o.ConfiguredAlertIds +} + +// GetConfiguredAlertIdsOk returns a tuple with the ConfiguredAlertIds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SLOResponseData) GetConfiguredAlertIdsOk() (*[]int64, bool) { + if o == nil || o.ConfiguredAlertIds == nil { + return nil, false + } + return o.ConfiguredAlertIds, true +} + +// HasConfiguredAlertIds returns a boolean if a field has been set. +func (o *SLOResponseData) HasConfiguredAlertIds() bool { + if o != nil && o.ConfiguredAlertIds != nil { + return true + } + + return false +} + +// SetConfiguredAlertIds gets a reference to the given []int64 and assigns it to the ConfiguredAlertIds field. +func (o *SLOResponseData) SetConfiguredAlertIds(v []int64) { + o.ConfiguredAlertIds = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *SLOResponseData) GetCreatedAt() int64 { + if o == nil || o.CreatedAt == nil { + var ret int64 + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SLOResponseData) GetCreatedAtOk() (*int64, bool) { + if o == nil || o.CreatedAt == nil { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *SLOResponseData) HasCreatedAt() bool { + if o != nil && o.CreatedAt != nil { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given int64 and assigns it to the CreatedAt field. +func (o *SLOResponseData) SetCreatedAt(v int64) { + o.CreatedAt = &v +} + +// GetCreator returns the Creator field value if set, zero value otherwise. +func (o *SLOResponseData) GetCreator() Creator { + if o == nil || o.Creator == nil { + var ret Creator + return ret + } + return *o.Creator +} + +// GetCreatorOk returns a tuple with the Creator field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SLOResponseData) GetCreatorOk() (*Creator, bool) { + if o == nil || o.Creator == nil { + return nil, false + } + return o.Creator, true +} + +// HasCreator returns a boolean if a field has been set. +func (o *SLOResponseData) HasCreator() bool { + if o != nil && o.Creator != nil { + return true + } + + return false +} + +// SetCreator gets a reference to the given Creator and assigns it to the Creator field. +func (o *SLOResponseData) SetCreator(v Creator) { + o.Creator = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *SLOResponseData) GetDescription() string { + if o == nil || o.Description.Get() == nil { + var ret string + return ret + } + return *o.Description.Get() +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SLOResponseData) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Description.Get(), o.Description.IsSet() +} + +// HasDescription returns a boolean if a field has been set. +func (o *SLOResponseData) HasDescription() bool { + if o != nil && o.Description.IsSet() { + return true + } + + return false +} + +// SetDescription gets a reference to the given NullableString and assigns it to the Description field. +func (o *SLOResponseData) SetDescription(v string) { + o.Description.Set(&v) +} + +// SetDescriptionNil sets the value for Description to be an explicit nil +func (o *SLOResponseData) SetDescriptionNil() { + o.Description.Set(nil) +} + +// UnsetDescription ensures that no value is present for Description, not even an explicit nil +func (o *SLOResponseData) UnsetDescription() { + o.Description.Unset() +} + +// GetGroups returns the Groups field value if set, zero value otherwise. +func (o *SLOResponseData) GetGroups() []string { + if o == nil || o.Groups == nil { + var ret []string + return ret + } + return *o.Groups +} + +// GetGroupsOk returns a tuple with the Groups field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SLOResponseData) GetGroupsOk() (*[]string, bool) { + if o == nil || o.Groups == nil { + return nil, false + } + return o.Groups, true +} + +// HasGroups returns a boolean if a field has been set. +func (o *SLOResponseData) HasGroups() bool { + if o != nil && o.Groups != nil { + return true + } + + return false +} + +// SetGroups gets a reference to the given []string and assigns it to the Groups field. +func (o *SLOResponseData) SetGroups(v []string) { + o.Groups = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *SLOResponseData) GetId() string { + if o == nil || o.Id == nil { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SLOResponseData) GetIdOk() (*string, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *SLOResponseData) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *SLOResponseData) SetId(v string) { + o.Id = &v +} + +// GetModifiedAt returns the ModifiedAt field value if set, zero value otherwise. +func (o *SLOResponseData) GetModifiedAt() int64 { + if o == nil || o.ModifiedAt == nil { + var ret int64 + return ret + } + return *o.ModifiedAt +} + +// GetModifiedAtOk returns a tuple with the ModifiedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SLOResponseData) GetModifiedAtOk() (*int64, bool) { + if o == nil || o.ModifiedAt == nil { + return nil, false + } + return o.ModifiedAt, true +} + +// HasModifiedAt returns a boolean if a field has been set. +func (o *SLOResponseData) HasModifiedAt() bool { + if o != nil && o.ModifiedAt != nil { + return true + } + + return false +} + +// SetModifiedAt gets a reference to the given int64 and assigns it to the ModifiedAt field. +func (o *SLOResponseData) SetModifiedAt(v int64) { + o.ModifiedAt = &v +} + +// GetMonitorIds returns the MonitorIds field value if set, zero value otherwise. +func (o *SLOResponseData) GetMonitorIds() []int64 { + if o == nil || o.MonitorIds == nil { + var ret []int64 + return ret + } + return *o.MonitorIds +} + +// GetMonitorIdsOk returns a tuple with the MonitorIds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SLOResponseData) GetMonitorIdsOk() (*[]int64, bool) { + if o == nil || o.MonitorIds == nil { + return nil, false + } + return o.MonitorIds, true +} + +// HasMonitorIds returns a boolean if a field has been set. +func (o *SLOResponseData) HasMonitorIds() bool { + if o != nil && o.MonitorIds != nil { + return true + } + + return false +} + +// SetMonitorIds gets a reference to the given []int64 and assigns it to the MonitorIds field. +func (o *SLOResponseData) SetMonitorIds(v []int64) { + o.MonitorIds = &v +} + +// GetMonitorTags returns the MonitorTags field value if set, zero value otherwise. +func (o *SLOResponseData) GetMonitorTags() []string { + if o == nil || o.MonitorTags == nil { + var ret []string + return ret + } + return *o.MonitorTags +} + +// GetMonitorTagsOk returns a tuple with the MonitorTags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SLOResponseData) GetMonitorTagsOk() (*[]string, bool) { + if o == nil || o.MonitorTags == nil { + return nil, false + } + return o.MonitorTags, true +} + +// HasMonitorTags returns a boolean if a field has been set. +func (o *SLOResponseData) HasMonitorTags() bool { + if o != nil && o.MonitorTags != nil { + return true + } + + return false +} + +// SetMonitorTags gets a reference to the given []string and assigns it to the MonitorTags field. +func (o *SLOResponseData) SetMonitorTags(v []string) { + o.MonitorTags = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *SLOResponseData) 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 *SLOResponseData) 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 *SLOResponseData) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *SLOResponseData) SetName(v string) { + o.Name = &v +} + +// GetQuery returns the Query field value if set, zero value otherwise. +func (o *SLOResponseData) GetQuery() ServiceLevelObjectiveQuery { + if o == nil || o.Query == nil { + var ret ServiceLevelObjectiveQuery + return ret + } + return *o.Query +} + +// GetQueryOk returns a tuple with the Query field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SLOResponseData) GetQueryOk() (*ServiceLevelObjectiveQuery, bool) { + if o == nil || o.Query == nil { + return nil, false + } + return o.Query, true +} + +// HasQuery returns a boolean if a field has been set. +func (o *SLOResponseData) HasQuery() bool { + if o != nil && o.Query != nil { + return true + } + + return false +} + +// SetQuery gets a reference to the given ServiceLevelObjectiveQuery and assigns it to the Query field. +func (o *SLOResponseData) SetQuery(v ServiceLevelObjectiveQuery) { + o.Query = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *SLOResponseData) GetTags() []string { + if o == nil || o.Tags == nil { + var ret []string + return ret + } + return *o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SLOResponseData) GetTagsOk() (*[]string, bool) { + if o == nil || o.Tags == nil { + return nil, false + } + return o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *SLOResponseData) HasTags() bool { + if o != nil && o.Tags != nil { + return true + } + + return false +} + +// SetTags gets a reference to the given []string and assigns it to the Tags field. +func (o *SLOResponseData) SetTags(v []string) { + o.Tags = &v +} + +// GetThresholds returns the Thresholds field value if set, zero value otherwise. +func (o *SLOResponseData) GetThresholds() []SLOThreshold { + if o == nil || o.Thresholds == nil { + var ret []SLOThreshold + return ret + } + return *o.Thresholds +} + +// GetThresholdsOk returns a tuple with the Thresholds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SLOResponseData) GetThresholdsOk() (*[]SLOThreshold, bool) { + if o == nil || o.Thresholds == nil { + return nil, false + } + return o.Thresholds, true +} + +// HasThresholds returns a boolean if a field has been set. +func (o *SLOResponseData) HasThresholds() bool { + if o != nil && o.Thresholds != nil { + return true + } + + return false +} + +// SetThresholds gets a reference to the given []SLOThreshold and assigns it to the Thresholds field. +func (o *SLOResponseData) SetThresholds(v []SLOThreshold) { + o.Thresholds = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *SLOResponseData) GetType() SLOType { + if o == nil || o.Type == nil { + var ret SLOType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SLOResponseData) GetTypeOk() (*SLOType, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *SLOResponseData) HasType() bool { + if o != nil && o.Type != nil { + return true + } + + return false +} + +// SetType gets a reference to the given SLOType and assigns it to the Type field. +func (o *SLOResponseData) SetType(v SLOType) { + o.Type = &v +} + +func (o SLOResponseData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.ConfiguredAlertIds != nil { + toSerialize["configured_alert_ids"] = o.ConfiguredAlertIds + } + if o.CreatedAt != nil { + toSerialize["created_at"] = o.CreatedAt + } + if o.Creator != nil { + toSerialize["creator"] = o.Creator + } + if o.Description.IsSet() { + toSerialize["description"] = o.Description.Get() + } + if o.Groups != nil { + toSerialize["groups"] = o.Groups + } + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.ModifiedAt != nil { + toSerialize["modified_at"] = o.ModifiedAt + } + if o.MonitorIds != nil { + toSerialize["monitor_ids"] = o.MonitorIds + } + if o.MonitorTags != nil { + toSerialize["monitor_tags"] = o.MonitorTags + } + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.Query != nil { + toSerialize["query"] = o.Query + } + if o.Tags != nil { + toSerialize["tags"] = o.Tags + } + if o.Thresholds != nil { + toSerialize["thresholds"] = o.Thresholds + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + return json.Marshal(toSerialize) +} + +type NullableSLOResponseData struct { + value *SLOResponseData + isSet bool +} + +func (v NullableSLOResponseData) Get() *SLOResponseData { + return v.value +} + +func (v *NullableSLOResponseData) Set(val *SLOResponseData) { + v.value = val + v.isSet = true +} + +func (v NullableSLOResponseData) IsSet() bool { + return v.isSet +} + +func (v *NullableSLOResponseData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSLOResponseData(val *SLOResponseData) *NullableSLOResponseData { + return &NullableSLOResponseData{value: val, isSet: true} +} + +func (v NullableSLOResponseData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSLOResponseData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +}