diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d160259c..04981b23a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ ## [Unreleased] +- Make `field` property optional in a custom metrics SLO + ## [0.11.14] - 2025-03-17 - Fix a provider crash when interacting with elasticstack_kibana_data_view resources created with 0.11.0. ([#979](https://github.com/elastic/terraform-provider-elasticstack/pull/979)) diff --git a/Makefile b/Makefile index dc345ccc0..4f78b1548 100644 --- a/Makefile +++ b/Makefile @@ -349,9 +349,8 @@ generate-connectors-client: tools ## generate Kibana connectors client .PHONY: generate-slo-client generate-slo-client: tools ## generate Kibana slo client - @ rm -rf generated/slo @ docker run --rm -v "${PWD}:/local" openapitools/openapi-generator-cli:v7.0.1 generate \ - -i /local/generated/slo-spec.yml \ + -i /local/generated/slo/bundled.yaml \ --git-repo-id terraform-provider-elasticstack \ --git-user-id elastic \ -p isGoSubmodule=true \ @@ -361,8 +360,8 @@ generate-slo-client: tools ## generate Kibana slo client -g go \ -o /local/generated/slo \ --type-mappings=float32=float64 - @ rm -rf generated/slo/go.mod generated/slo/go.sum generated/slo/test - @ go fmt ./generated/... + rm -rf generated/slo/go.mod generated/slo/go.sum generated/slo/test + go fmt ./generated/... .PHONY: generate-clients generate-clients: generate-alerting-client generate-slo-client generate-connectors-client ## generate all clients diff --git a/generated/slo/.openapi-generator/FILES b/generated/slo/.openapi-generator/FILES index 9145efdc6..a861c26b8 100644 --- a/generated/slo/.openapi-generator/FILES +++ b/generated/slo/.openapi-generator/FILES @@ -1,5 +1,4 @@ .gitignore -.openapi-generator-ignore .travis.yml README.md api/openapi.yaml @@ -13,9 +12,13 @@ docs/CreateSloResponse.md docs/DeleteSloInstancesRequest.md docs/DeleteSloInstancesRequestListInner.md docs/ErrorBudget.md +docs/Filter.md +docs/FilterMeta.md +docs/FindSloDefinitionsResponse.md +docs/FindSloDefinitionsResponseOneOf.md +docs/FindSloDefinitionsResponseOneOf1.md docs/FindSloResponse.md -docs/HistoricalSummaryRequest.md -docs/HistoricalSummaryResponseInner.md +docs/GroupBy.md docs/IndicatorPropertiesApmAvailability.md docs/IndicatorPropertiesApmAvailabilityParams.md docs/IndicatorPropertiesApmLatency.md @@ -26,8 +29,9 @@ docs/IndicatorPropertiesCustomMetric.md docs/IndicatorPropertiesCustomMetricParams.md docs/IndicatorPropertiesCustomMetricParamsGood.md docs/IndicatorPropertiesCustomMetricParamsGoodMetricsInner.md +docs/IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf.md +docs/IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1.md docs/IndicatorPropertiesCustomMetricParamsTotal.md -docs/IndicatorPropertiesCustomMetricParamsTotalMetricsInner.md docs/IndicatorPropertiesHistogram.md docs/IndicatorPropertiesHistogramParams.md docs/IndicatorPropertiesHistogramParamsGood.md @@ -36,6 +40,10 @@ docs/IndicatorPropertiesTimesliceMetric.md docs/IndicatorPropertiesTimesliceMetricParams.md docs/IndicatorPropertiesTimesliceMetricParamsMetric.md docs/IndicatorPropertiesTimesliceMetricParamsMetricMetricsInner.md +docs/KqlWithFilters.md +docs/KqlWithFiltersGood.md +docs/KqlWithFiltersOneOf.md +docs/KqlWithFiltersTotal.md docs/Model400Response.md docs/Model401Response.md docs/Model403Response.md @@ -44,9 +52,9 @@ docs/Model409Response.md docs/Objective.md docs/Settings.md docs/SloAPI.md -docs/SloResponse.md -docs/SloResponseGroupBy.md -docs/SloResponseIndicator.md +docs/SloDefinitionResponse.md +docs/SloWithSummaryResponse.md +docs/SloWithSummaryResponseIndicator.md docs/Summary.md docs/SummaryStatus.md docs/TimeWindow.md @@ -69,9 +77,13 @@ model_create_slo_response.go model_delete_slo_instances_request.go model_delete_slo_instances_request_list_inner.go model_error_budget.go +model_filter.go +model_filter_meta.go +model_find_slo_definitions_response.go +model_find_slo_definitions_response_one_of.go +model_find_slo_definitions_response_one_of_1.go model_find_slo_response.go -model_historical_summary_request.go -model_historical_summary_response_inner.go +model_group_by.go model_indicator_properties_apm_availability.go model_indicator_properties_apm_availability_params.go model_indicator_properties_apm_latency.go @@ -82,8 +94,9 @@ model_indicator_properties_custom_metric.go model_indicator_properties_custom_metric_params.go model_indicator_properties_custom_metric_params_good.go model_indicator_properties_custom_metric_params_good_metrics_inner.go +model_indicator_properties_custom_metric_params_good_metrics_inner_one_of.go +model_indicator_properties_custom_metric_params_good_metrics_inner_one_of_1.go model_indicator_properties_custom_metric_params_total.go -model_indicator_properties_custom_metric_params_total_metrics_inner.go model_indicator_properties_histogram.go model_indicator_properties_histogram_params.go model_indicator_properties_histogram_params_good.go @@ -92,11 +105,15 @@ model_indicator_properties_timeslice_metric.go model_indicator_properties_timeslice_metric_params.go model_indicator_properties_timeslice_metric_params_metric.go model_indicator_properties_timeslice_metric_params_metric_metrics_inner.go +model_kql_with_filters.go +model_kql_with_filters_good.go +model_kql_with_filters_one_of.go +model_kql_with_filters_total.go model_objective.go model_settings.go -model_slo_response.go -model_slo_response_group_by.go -model_slo_response_indicator.go +model_slo_definition_response.go +model_slo_with_summary_response.go +model_slo_with_summary_response_indicator.go model_summary.go model_summary_status.go model_time_window.go diff --git a/generated/slo/README.md b/generated/slo/README.md index 261fc2d0e..99c6edf03 100644 --- a/generated/slo/README.md +++ b/generated/slo/README.md @@ -5,7 +5,7 @@ OpenAPI schema for SLOs endpoints ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. -- API version: 1.0 +- API version: 1.1 - Package version: 1.0.0 - Build package: org.openapitools.codegen.languages.GoClientCodegen @@ -73,19 +73,20 @@ ctx = context.WithValue(context.Background(), slo.ContextOperationServerVariable ## Documentation for API Endpoints -All URIs are relative to *http://localhost:5601* +All URIs are relative to *https://localhost:5601* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*SloAPI* | [**CreateSloOp**](docs/SloAPI.md#createsloop) | **Post** /s/{spaceId}/api/observability/slos | Creates an SLO. -*SloAPI* | [**DeleteSloInstancesOp**](docs/SloAPI.md#deletesloinstancesop) | **Post** /s/{spaceId}/api/observability/slos/_delete_instances | Batch delete rollup and summary data for the matching list of sloId and instanceId -*SloAPI* | [**DeleteSloOp**](docs/SloAPI.md#deletesloop) | **Delete** /s/{spaceId}/api/observability/slos/{sloId} | Deletes an SLO -*SloAPI* | [**DisableSloOp**](docs/SloAPI.md#disablesloop) | **Post** /s/{spaceId}/api/observability/slos/{sloId}/disable | Disables an SLO -*SloAPI* | [**EnableSloOp**](docs/SloAPI.md#enablesloop) | **Post** /s/{spaceId}/api/observability/slos/{sloId}/enable | Enables an SLO -*SloAPI* | [**FindSlosOp**](docs/SloAPI.md#findslosop) | **Get** /s/{spaceId}/api/observability/slos | Retrieves a paginated list of SLOs -*SloAPI* | [**GetSloOp**](docs/SloAPI.md#getsloop) | **Get** /s/{spaceId}/api/observability/slos/{sloId} | Retrieves a SLO -*SloAPI* | [**HistoricalSummaryOp**](docs/SloAPI.md#historicalsummaryop) | **Post** /s/{spaceId}/internal/observability/slos/_historical_summary | Retrieves the historical summary for a list of SLOs -*SloAPI* | [**UpdateSloOp**](docs/SloAPI.md#updatesloop) | **Put** /s/{spaceId}/api/observability/slos/{sloId} | Updates an SLO +*SloAPI* | [**CreateSloOp**](docs/SloAPI.md#createsloop) | **Post** /s/{spaceId}/api/observability/slos | Create an SLO +*SloAPI* | [**DeleteSloInstancesOp**](docs/SloAPI.md#deletesloinstancesop) | **Post** /s/{spaceId}/api/observability/slos/_delete_instances | Batch delete rollup and summary data +*SloAPI* | [**DeleteSloOp**](docs/SloAPI.md#deletesloop) | **Delete** /s/{spaceId}/api/observability/slos/{sloId} | Delete an SLO +*SloAPI* | [**DisableSloOp**](docs/SloAPI.md#disablesloop) | **Post** /s/{spaceId}/api/observability/slos/{sloId}/disable | Disable an SLO +*SloAPI* | [**EnableSloOp**](docs/SloAPI.md#enablesloop) | **Post** /s/{spaceId}/api/observability/slos/{sloId}/enable | Enable an SLO +*SloAPI* | [**FindSlosOp**](docs/SloAPI.md#findslosop) | **Get** /s/{spaceId}/api/observability/slos | Get a paginated list of SLOs +*SloAPI* | [**GetDefinitionsOp**](docs/SloAPI.md#getdefinitionsop) | **Get** /s/{spaceId}/internal/observability/slos/_definitions | Get the SLO definitions +*SloAPI* | [**GetSloOp**](docs/SloAPI.md#getsloop) | **Get** /s/{spaceId}/api/observability/slos/{sloId} | Get an SLO +*SloAPI* | [**ResetSloOp**](docs/SloAPI.md#resetsloop) | **Post** /s/{spaceId}/api/observability/slos/{sloId}/_reset | Reset an SLO +*SloAPI* | [**UpdateSloOp**](docs/SloAPI.md#updatesloop) | **Put** /s/{spaceId}/api/observability/slos/{sloId} | Update an SLO ## Documentation For Models @@ -97,9 +98,13 @@ Class | Method | HTTP request | Description - [DeleteSloInstancesRequest](docs/DeleteSloInstancesRequest.md) - [DeleteSloInstancesRequestListInner](docs/DeleteSloInstancesRequestListInner.md) - [ErrorBudget](docs/ErrorBudget.md) + - [Filter](docs/Filter.md) + - [FilterMeta](docs/FilterMeta.md) + - [FindSloDefinitionsResponse](docs/FindSloDefinitionsResponse.md) + - [FindSloDefinitionsResponseOneOf](docs/FindSloDefinitionsResponseOneOf.md) + - [FindSloDefinitionsResponseOneOf1](docs/FindSloDefinitionsResponseOneOf1.md) - [FindSloResponse](docs/FindSloResponse.md) - - [HistoricalSummaryRequest](docs/HistoricalSummaryRequest.md) - - [HistoricalSummaryResponseInner](docs/HistoricalSummaryResponseInner.md) + - [GroupBy](docs/GroupBy.md) - [IndicatorPropertiesApmAvailability](docs/IndicatorPropertiesApmAvailability.md) - [IndicatorPropertiesApmAvailabilityParams](docs/IndicatorPropertiesApmAvailabilityParams.md) - [IndicatorPropertiesApmLatency](docs/IndicatorPropertiesApmLatency.md) @@ -110,8 +115,9 @@ Class | Method | HTTP request | Description - [IndicatorPropertiesCustomMetricParams](docs/IndicatorPropertiesCustomMetricParams.md) - [IndicatorPropertiesCustomMetricParamsGood](docs/IndicatorPropertiesCustomMetricParamsGood.md) - [IndicatorPropertiesCustomMetricParamsGoodMetricsInner](docs/IndicatorPropertiesCustomMetricParamsGoodMetricsInner.md) + - [IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf](docs/IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf.md) + - [IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1](docs/IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1.md) - [IndicatorPropertiesCustomMetricParamsTotal](docs/IndicatorPropertiesCustomMetricParamsTotal.md) - - [IndicatorPropertiesCustomMetricParamsTotalMetricsInner](docs/IndicatorPropertiesCustomMetricParamsTotalMetricsInner.md) - [IndicatorPropertiesHistogram](docs/IndicatorPropertiesHistogram.md) - [IndicatorPropertiesHistogramParams](docs/IndicatorPropertiesHistogramParams.md) - [IndicatorPropertiesHistogramParamsGood](docs/IndicatorPropertiesHistogramParamsGood.md) @@ -120,6 +126,10 @@ Class | Method | HTTP request | Description - [IndicatorPropertiesTimesliceMetricParams](docs/IndicatorPropertiesTimesliceMetricParams.md) - [IndicatorPropertiesTimesliceMetricParamsMetric](docs/IndicatorPropertiesTimesliceMetricParamsMetric.md) - [IndicatorPropertiesTimesliceMetricParamsMetricMetricsInner](docs/IndicatorPropertiesTimesliceMetricParamsMetricMetricsInner.md) + - [KqlWithFilters](docs/KqlWithFilters.md) + - [KqlWithFiltersGood](docs/KqlWithFiltersGood.md) + - [KqlWithFiltersOneOf](docs/KqlWithFiltersOneOf.md) + - [KqlWithFiltersTotal](docs/KqlWithFiltersTotal.md) - [Model400Response](docs/Model400Response.md) - [Model401Response](docs/Model401Response.md) - [Model403Response](docs/Model403Response.md) @@ -127,9 +137,9 @@ Class | Method | HTTP request | Description - [Model409Response](docs/Model409Response.md) - [Objective](docs/Objective.md) - [Settings](docs/Settings.md) - - [SloResponse](docs/SloResponse.md) - - [SloResponseGroupBy](docs/SloResponseGroupBy.md) - - [SloResponseIndicator](docs/SloResponseIndicator.md) + - [SloDefinitionResponse](docs/SloDefinitionResponse.md) + - [SloWithSummaryResponse](docs/SloWithSummaryResponse.md) + - [SloWithSummaryResponseIndicator](docs/SloWithSummaryResponseIndicator.md) - [Summary](docs/Summary.md) - [SummaryStatus](docs/SummaryStatus.md) - [TimeWindow](docs/TimeWindow.md) @@ -141,42 +151,7 @@ Class | Method | HTTP request | Description ## Documentation For Authorization - -Authentication schemes defined for the API: -### basicAuth - -- **Type**: HTTP basic authentication - -Example - -```golang -auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ - UserName: "username", - Password: "password", -}) -r, err := client.Service.Operation(auth, args) -``` - -### apiKeyAuth - -- **Type**: API key -- **API key parameter name**: Authorization -- **Location**: HTTP header - -Note, each API key must be added to a map of `map[string]APIKey` where the key is: Authorization and passed in as the auth context for each request. - -Example - -```golang -auth := context.WithValue( - context.Background(), - sw.ContextAPIKeys, - map[string]sw.APIKey{ - "Authorization": {Key: "API_KEY_STRING"}, - }, - ) -r, err := client.Service.Operation(auth, args) -``` +Endpoints do not require authorization. ## Documentation for Utility Methods diff --git a/generated/slo/api/openapi.yaml b/generated/slo/api/openapi.yaml index 6533b9907..a23a9abce 100644 --- a/generated/slo/api/openapi.yaml +++ b/generated/slo/api/openapi.yaml @@ -7,13 +7,12 @@ info: name: Elastic License 2.0 url: https://www.elastic.co/licensing/elastic-license title: SLOs - version: "1.0" + version: "1.1" servers: -- description: local - url: http://localhost:5601 -security: -- basicAuth: [] -- apiKeyAuth: [] +- url: "https://{kibana_url}" + variables: + kibana_url: + default: localhost:5601 tags: - description: "SLO APIs enable you to define, manage and track service-level objectives" name: slo @@ -51,7 +50,30 @@ paths: schema: type: string style: form - - description: The page number to return + - description: "The page size to use for cursor-based pagination, must be greater\ + \ or equal than 1" + example: 1 + explode: true + in: query + name: size + required: false + schema: + default: 1 + type: integer + style: form + - description: "The cursor to use for fetching the results from, when using\ + \ a cursor-base pagination." + explode: true + in: query + name: searchAfter + required: false + schema: + items: + type: string + type: array + style: form + - description: "The page to use for pagination, must be greater or equal than\ + \ 1" example: 1 explode: true in: query @@ -61,7 +83,7 @@ paths: default: 1 type: integer style: form - - description: The number of SLOs to return per page + - description: Number of SLOs returned by page example: 25 explode: true in: query @@ -100,6 +122,15 @@ paths: - desc type: string style: form + - description: Hide stale SLOs from the list as defined by stale SLO threshold + in SLO settings + explode: true + in: query + name: hideStale + required: false + schema: + type: boolean + style: form responses: "200": content: @@ -131,7 +162,7 @@ paths: schema: $ref: '#/components/schemas/404_response' description: Not found response - summary: Retrieves a paginated list of SLOs + summary: Get a paginated list of SLOs tags: - slo post: @@ -194,9 +225,7 @@ paths: schema: $ref: '#/components/schemas/409_response' description: Conflict - The SLO id already exists - servers: - - url: https://localhost:5601 - summary: Creates an SLO. + summary: Create an SLO tags: - slo /s/{spaceId}/api/observability/slos/{sloId}: @@ -259,7 +288,7 @@ paths: schema: $ref: '#/components/schemas/404_response' description: Not found response - summary: Deletes an SLO + summary: Delete an SLO tags: - slo get: @@ -308,7 +337,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/slo_response' + $ref: '#/components/schemas/slo_with_summary_response' description: Successful request "400": content: @@ -334,7 +363,7 @@ paths: schema: $ref: '#/components/schemas/404_response' description: Not found response - summary: Retrieves a SLO + summary: Get an SLO tags: - slo put: @@ -380,7 +409,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/slo_response' + $ref: '#/components/schemas/slo_definition_response' description: Successful request "400": content: @@ -406,7 +435,7 @@ paths: schema: $ref: '#/components/schemas/404_response' description: Not found response - summary: Updates an SLO + summary: Update an SLO tags: - slo /s/{spaceId}/api/observability/slos/{sloId}/enable: @@ -469,7 +498,7 @@ paths: schema: $ref: '#/components/schemas/404_response' description: Not found response - summary: Enables an SLO + summary: Enable an SLO tags: - slo /s/{spaceId}/api/observability/slos/{sloId}/disable: @@ -506,7 +535,7 @@ paths: type: string style: simple responses: - "200": + "204": description: Successful request "400": content: @@ -532,14 +561,14 @@ paths: schema: $ref: '#/components/schemas/404_response' description: Not found response - summary: Disables an SLO + summary: Disable an SLO tags: - slo - /s/{spaceId}/internal/observability/slos/_historical_summary: + /s/{spaceId}/api/observability/slos/{sloId}/_reset: post: description: | - You must have the `read` privileges for the **SLOs** feature in the **Observability** section of the Kibana feature privileges. - operationId: historicalSummaryOp + You must have the `write` privileges for the **SLOs** feature in the **Observability** section of the Kibana feature privileges. + operationId: resetSloOp parameters: - description: Cross-site request forgery protection explode: false @@ -559,18 +588,21 @@ paths: example: default type: string style: simple - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/historical_summary_request' + - description: An identifier for the slo. + explode: false + in: path + name: sloId required: true + schema: + example: 9c235211-6834-11ea-a78c-6feb38a34414 + type: string + style: simple responses: "200": content: application/json: schema: - $ref: '#/components/schemas/historical_summary_response' + $ref: '#/components/schemas/slo_definition_response' description: Successful request "400": content: @@ -590,13 +622,110 @@ paths: schema: $ref: '#/components/schemas/403_response' description: Unauthorized response - summary: Retrieves the historical summary for a list of SLOs + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/404_response' + description: Not found response + summary: Reset an SLO + tags: + - slo + /s/{spaceId}/internal/observability/slos/_definitions: + get: + description: | + You must have the `read` privileges for the **SLOs** feature in the **Observability** section of the Kibana feature privileges. + operationId: getDefinitionsOp + parameters: + - description: Cross-site request forgery protection + explode: false + in: header + name: kbn-xsrf + required: true + schema: + type: string + style: simple + - description: "An identifier for the space. If `/s/` and the identifier are\ + \ omitted from the path, the default space is used." + explode: false + in: path + name: spaceId + required: true + schema: + example: default + type: string + style: simple + - description: Indicates if the API returns only outdated SLO or all SLO definitions + example: true + explode: true + in: query + name: includeOutdatedOnly + required: false + schema: + type: boolean + style: form + - description: Filters the SLOs by name + example: my service availability + explode: true + in: query + name: search + required: false + schema: + type: string + style: form + - description: "The page to use for pagination, must be greater or equal than\ + \ 1" + example: 1 + explode: true + in: query + name: page + required: false + schema: + type: number + style: form + - description: Number of SLOs returned by page + example: 100 + explode: true + in: query + name: perPage + required: false + schema: + default: 100 + maximum: 1000 + type: integer + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/find_slo_definitions_response' + description: Successful request + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/400_response' + description: Bad request + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/401_response' + description: Unauthorized response + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/403_response' + description: Unauthorized response + summary: Get the SLO definitions tags: - slo /s/{spaceId}/api/observability/slos/_delete_instances: post: description: | - You must have `all` privileges for the **SLOs** feature in the **Observability** section of the Kibana feature privileges. + The deletion occurs for the specified list of `sloId` and `instanceId`. You must have `all` privileges for the **SLOs** feature in the **Observability** section of the Kibana feature privileges. operationId: deleteSloInstancesOp parameters: - description: Cross-site request forgery protection @@ -644,10 +773,7 @@ paths: schema: $ref: '#/components/schemas/403_response' description: Unauthorized response - servers: - - url: https://localhost:5601 - summary: Batch delete rollup and summary data for the matching list of sloId - and instanceId + summary: Batch delete rollup and summary data tags: - slo components: @@ -697,8 +823,71 @@ components: - type title: APM availability type: object + filter_meta: + description: Defines properties for a filter + properties: + alias: + nullable: true + type: string + disabled: + type: boolean + negate: + type: boolean + controlledBy: + type: string + group: + type: string + index: + type: string + isMultiIndex: + type: boolean + type: + type: string + key: + type: string + params: + type: object + value: + type: string + field: + type: string + title: FilterMeta + type: object + filter: + description: Defines properties for a filter + properties: + query: + type: object + meta: + $ref: '#/components/schemas/filter_meta' + title: Filter + type: object + kql_with_filters: + description: Defines properties for a filter + oneOf: + - description: the KQL query to filter the documents with. + example: "field.environment : \"production\" and service.name : \"my-service\"" + type: string + - $ref: '#/components/schemas/kql_with_filters_oneOf' + title: KQL with filters + kql_with_filters_good: + description: The KQL query used to define the good events. + oneOf: + - description: the KQL query to filter the documents with. + example: "request.latency <= 150 and request.status_code : \"2xx\"" + type: string + - $ref: '#/components/schemas/kql_with_filters_oneOf' + title: KQL query for good events + kql_with_filters_total: + description: The KQL query used to define all events. + oneOf: + - description: the KQL query to filter the documents with. + example: "field.environment : \"production\" and service.name : \"my-service\"" + type: string + - $ref: '#/components/schemas/kql_with_filters_oneOf' + title: KQL query for all events indicator_properties_custom_kql: - description: Defines properties for a custom KQL indicator type + description: Defines properties for a custom query indicator type properties: params: $ref: '#/components/schemas/indicator_properties_custom_kql_params' @@ -709,7 +898,7 @@ components: required: - params - type - title: Custom KQL + title: Custom Query type: object indicator_properties_apm_latency: description: Defines properties for the APM latency indicator type @@ -897,11 +1086,17 @@ components: target: description: the target objective between 0 and 1 excluded example: 0.99 + exclusiveMaximum: true + exclusiveMinimum: true + maximum: 100 + minimum: 0 type: number timesliceTarget: description: the target objective for each slice when using a timeslices budgeting method example: 0.995 + maximum: 100 + minimum: 0 type: number timesliceWindow: description: "the duration of each slice when using a timeslices budgeting\ @@ -915,17 +1110,40 @@ components: settings: description: Defines properties for SLO settings. example: + syncField: event.ingested + preventInitialBackfill: true syncDelay: 5m frequency: 5m properties: + syncField: + description: "The date field that is used to identify new documents in the\ + \ source. It is strongly recommended to use a field that contains the\ + \ ingest timestamp. If you use a different field, you might need to set\ + \ the delay such that it accounts for data transmission delays. When unspecified,\ + \ we use the indicator timestamp field." + example: event.ingested + type: string syncDelay: - description: The synch delay to apply to the transform. Default 1m + default: 1m + description: The time delay in minutes between the current time and the + latest source data time. Increasing the value will delay any alerting. + The default value is 1 minute. The minimum value is 1m and the maximum + is 359m. It should always be greater then source index refresh interval. example: 5m type: string frequency: - description: "Configure how often the transform runs, default 1m" + default: 1m + description: The interval between checks for changes in the source data. + The minimum value is 1m and the maximum is 59m. The default value is 1 + minute. example: 5m type: string + preventInitialBackfill: + default: false + description: "Start aggregating data from the time the SLO is created, instead\ + \ of backfilling data from the beginning of the time window." + example: true + type: boolean title: Settings type: object summary_status: @@ -994,7 +1212,21 @@ components: - status title: Summary type: object - slo_response: + group_by: + description: optional group by field or fields to use to generate an SLO per + distinct value + example: + - - service.name + - service.name + - - service.name + - service.environment + oneOf: + - type: string + - items: + type: string + type: array + title: Group by + slo_with_summary_response: example: indicator: null summary: @@ -1006,13 +1238,20 @@ components: status: HEALTHY sliValue: 0.9836 settings: + syncField: event.ingested + preventInitialBackfill: true syncDelay: 5m frequency: 5m timeWindow: duration: 30d type: rolling description: My SLO description - groupBy: some.field + groupBy: + - - service.name + - service.name + - - service.name + - service.environment + version: 2 enabled: true objective: timesliceWindow: 5m @@ -1042,7 +1281,7 @@ components: example: My SLO description type: string indicator: - $ref: '#/components/schemas/slo_response_indicator' + $ref: '#/components/schemas/slo_with_summary_response_indicator' timeWindow: $ref: '#/components/schemas/time_window' budgetingMethod: @@ -1062,7 +1301,7 @@ components: example: true type: boolean groupBy: - $ref: '#/components/schemas/slo_response_groupBy' + $ref: '#/components/schemas/group_by' instanceId: description: "the value derived from the groupBy field, if present, otherwise\ \ '*'" @@ -1081,6 +1320,10 @@ components: description: The last update date example: 2023-01-12T10:03:19.000Z type: string + version: + description: The internal SLO version + example: 2 + type: number required: - budgetingMethod - createdAt @@ -1098,6 +1341,7 @@ components: - tags - timeWindow - updatedAt + - version title: SLO response type: object find_slo_response: @@ -1106,6 +1350,8 @@ components: example: total: 34 perPage: 25 + size: 25 + searchAfter: searchAfter page: 1 results: - indicator: null @@ -1118,13 +1364,20 @@ components: status: HEALTHY sliValue: 0.9836 settings: + syncField: event.ingested + preventInitialBackfill: true syncDelay: 5m frequency: 5m timeWindow: duration: 30d type: rolling description: My SLO description - groupBy: some.field + groupBy: + - - service.name + - service.name + - - service.name + - service.environment + version: 2 enabled: true objective: timesliceWindow: 5m @@ -1150,13 +1403,20 @@ components: status: HEALTHY sliValue: 0.9836 settings: + syncField: event.ingested + preventInitialBackfill: true syncDelay: 5m frequency: 5m timeWindow: duration: 30d type: rolling description: My SLO description - groupBy: some.field + groupBy: + - - service.name + - service.name + - - service.name + - service.environment + version: 2 enabled: true objective: timesliceWindow: 5m @@ -1173,6 +1433,12 @@ components: budgetingMethod: occurrences updatedAt: 2023-01-12T10:03:19.000Z properties: + size: + description: Size provided for cursor based pagination + example: 25 + type: number + searchAfter: + type: string page: example: 1 type: number @@ -1184,7 +1450,7 @@ components: type: number results: items: - $ref: '#/components/schemas/slo_response' + $ref: '#/components/schemas/slo_with_summary_response' type: array title: Find SLO response type: object @@ -1286,7 +1552,7 @@ components: settings: $ref: '#/components/schemas/settings' groupBy: - $ref: '#/components/schemas/slo_response_groupBy' + $ref: '#/components/schemas/group_by' tags: description: List of tags items: @@ -1350,7 +1616,7 @@ components: settings: $ref: '#/components/schemas/settings' groupBy: - $ref: '#/components/schemas/slo_response_groupBy' + $ref: '#/components/schemas/group_by' tags: description: List of tags items: @@ -1358,24 +1624,113 @@ components: type: array title: Update SLO request type: object - historical_summary_request: + slo_definition_response: + example: + indicator: null + settings: + syncField: event.ingested + preventInitialBackfill: true + syncDelay: 5m + frequency: 5m + timeWindow: + duration: 30d + type: rolling + description: My SLO description + groupBy: + - - service.name + - service.name + - - service.name + - service.environment + version: 2 + enabled: true + objective: + timesliceWindow: 5m + timesliceTarget: 0.995 + target: 0.99 + revision: 2 + tags: + - tags + - tags + createdAt: 2023-01-12T10:03:19.000Z + name: My Service SLO + id: 8853df00-ae2e-11ed-90af-09bb6422b258 + budgetingMethod: occurrences + updatedAt: 2023-01-12T10:03:19.000Z properties: - list: - description: The list of SLO identifiers to get the historical summary for + id: + description: The identifier of the SLO. + example: 8853df00-ae2e-11ed-90af-09bb6422b258 + type: string + name: + description: The name of the SLO. + example: My Service SLO + type: string + description: + description: The description of the SLO. + example: My SLO description + type: string + indicator: + $ref: '#/components/schemas/slo_with_summary_response_indicator' + timeWindow: + $ref: '#/components/schemas/time_window' + budgetingMethod: + $ref: '#/components/schemas/budgeting_method' + objective: + $ref: '#/components/schemas/objective' + settings: + $ref: '#/components/schemas/settings' + revision: + description: The SLO revision + example: 2 + type: number + enabled: + description: Indicate if the SLO is enabled + example: true + type: boolean + groupBy: + $ref: '#/components/schemas/group_by' + tags: + description: List of tags items: - example: 8853df00-ae2e-11ed-90af-09bb6422b258 type: string type: array + createdAt: + description: The creation date + example: 2023-01-12T10:03:19.000Z + type: string + updatedAt: + description: The last update date + example: 2023-01-12T10:03:19.000Z + type: string + version: + description: The internal SLO version + example: 2 + type: number required: - - list - title: Historical summary request + - budgetingMethod + - createdAt + - description + - enabled + - groupBy + - id + - indicator + - name + - objective + - revision + - settings + - tags + - timeWindow + - updatedAt + - version + title: SLO definition response type: object - historical_summary_response: - additionalProperties: - items: - $ref: '#/components/schemas/Historical_summary_response_inner' - type: array - title: Historical summary response + find_slo_definitions_response: + description: | + A paginated response of SLO definitions matching the query. + oneOf: + - $ref: '#/components/schemas/find_slo_definitions_response_oneOf' + - $ref: '#/components/schemas/find_slo_definitions_response_oneOf_1' + title: Find SLO definitions response type: object delete_slo_instances_request: description: | @@ -1425,6 +1780,15 @@ components: - transactionName - transactionType type: object + kql_with_filters_oneOf: + properties: + kqlQuery: + type: string + filters: + items: + $ref: '#/components/schemas/filter' + type: array + type: object indicator_properties_custom_kql_params: description: An object containing the indicator parameters. nullable: false @@ -1433,18 +1797,19 @@ components: description: The index or index pattern to use example: my-service-* type: string - filter: - description: the KQL query to filter the documents with. - example: "field.environment : \"production\" and service.name : \"my-service\"" + dataViewId: + description: "The kibana data view id to use, primarily used to include\ + \ data view runtime mappings. Make sure to save SLO again if you add/update\ + \ run time fields to the data view and if those fields are being used\ + \ in slo queries." + example: 03b80ab3-003d-498b-881c-3beedbaf1162 type: string + filter: + $ref: '#/components/schemas/kql_with_filters' good: - description: the KQL query used to define the good events. - example: "request.latency <= 150 and request.status_code : \"2xx\"" - type: string + $ref: '#/components/schemas/kql_with_filters_good' total: - description: the KQL query used to define all events. - example: "" - type: string + $ref: '#/components/schemas/kql_with_filters_total' timestampField: description: | The timestamp field used in the source indice. @@ -1496,7 +1861,7 @@ components: - transactionName - transactionType type: object - indicator_properties_custom_metric_params_good_metrics_inner: + indicator_properties_custom_metric_params_good_metrics_inner_oneOf: properties: name: description: The name of the metric. Only valid options are A-Z @@ -1504,7 +1869,7 @@ components: pattern: "^[A-Z]$" type: string aggregation: - description: The aggregation type of the metric. Only valid option is "sum" + description: The aggregation type of the metric. enum: - sum example: sum @@ -1515,31 +1880,14 @@ components: type: string filter: description: The filter to apply to the metric. - example: "processor.outcome: \"success\"" + example: "processor.outcome: *" type: string required: - aggregation - field - name type: object - indicator_properties_custom_metric_params_good: - description: | - An object defining the "good" metrics and equation - properties: - metrics: - description: "List of metrics with their name, aggregation type, and field." - items: - $ref: '#/components/schemas/indicator_properties_custom_metric_params_good_metrics_inner' - type: array - equation: - description: The equation to calculate the "good" metric. - example: A - type: string - required: - - equation - - metrics - type: object - indicator_properties_custom_metric_params_total_metrics_inner: + indicator_properties_custom_metric_params_good_metrics_inner_oneOf_1: properties: name: description: The name of the metric. Only valid options are A-Z @@ -1547,14 +1895,10 @@ components: pattern: "^[A-Z]$" type: string aggregation: - description: The aggregation type of the metric. Only valid option is "sum" + description: The aggregation type of the metric. enum: - - sum - example: sum - type: string - field: - description: The field of the metric. - example: processor.processed + - doc_count + example: doc_count type: string filter: description: The filter to apply to the metric. @@ -1562,9 +1906,29 @@ components: type: string required: - aggregation - - field - name type: object + indicator_properties_custom_metric_params_good_metrics_inner: + oneOf: + - $ref: '#/components/schemas/indicator_properties_custom_metric_params_good_metrics_inner_oneOf' + - $ref: '#/components/schemas/indicator_properties_custom_metric_params_good_metrics_inner_oneOf_1' + indicator_properties_custom_metric_params_good: + description: | + An object defining the "good" metrics and equation + properties: + metrics: + description: "List of metrics with their name, aggregation type, and field." + items: + $ref: '#/components/schemas/indicator_properties_custom_metric_params_good_metrics_inner' + type: array + equation: + description: The equation to calculate the "good" metric. + example: A + type: string + required: + - equation + - metrics + type: object indicator_properties_custom_metric_params_total: description: | An object defining the "total" metrics and equation @@ -1572,7 +1936,7 @@ components: metrics: description: "List of metrics with their name, aggregation type, and field." items: - $ref: '#/components/schemas/indicator_properties_custom_metric_params_total_metrics_inner' + $ref: '#/components/schemas/indicator_properties_custom_metric_params_good_metrics_inner' type: array equation: description: The equation to calculate the "total" metric. @@ -1590,6 +1954,13 @@ components: description: The index or index pattern to use example: my-service-* type: string + dataViewId: + description: "The kibana data view id to use, primarily used to include\ + \ data view runtime mappings. Make sure to save SLO again if you add/update\ + \ run time fields to the data view and if those fields are being used\ + \ in slo queries." + example: 03b80ab3-003d-498b-881c-3beedbaf1162 + type: string filter: description: the KQL query to filter the documents with. example: "field.environment : \"production\" and service.name : \"my-service\"" @@ -1681,6 +2052,13 @@ components: description: The index or index pattern to use example: my-service-* type: string + dataViewId: + description: "The kibana data view id to use, primarily used to include\ + \ data view runtime mappings. Make sure to save SLO again if you add/update\ + \ run time fields to the data view and if those fields are being used\ + \ in slo queries." + example: 03b80ab3-003d-498b-881c-3beedbaf1162 + type: string filter: description: the KQL query to filter the documents with. example: "field.environment : \"production\" and service.name : \"my-service\"" @@ -1746,6 +2124,13 @@ components: description: The index or index pattern to use example: my-service-* type: string + dataViewId: + description: "The kibana data view id to use, primarily used to include\ + \ data view runtime mappings. Make sure to save SLO again if you add/update\ + \ run time fields to the data view and if those fields are being used\ + \ in slo queries." + example: 03b80ab3-003d-498b-881c-3beedbaf1162 + type: string filter: description: the KQL query to filter the documents with. example: "field.environment : \"production\" and service.name : \"my-service\"" @@ -1762,7 +2147,7 @@ components: - metric - timestampField type: object - slo_response_indicator: + slo_with_summary_response_indicator: discriminator: mapping: sli.apm.transactionErrorRate: '#/components/schemas/indicator_properties_apm_availability' @@ -1779,15 +2164,6 @@ components: - $ref: '#/components/schemas/indicator_properties_custom_metric' - $ref: '#/components/schemas/indicator_properties_histogram' - $ref: '#/components/schemas/indicator_properties_timeslice_metric' - slo_response_groupBy: - description: optional group by field to use to generate an SLO per distinct - value - example: some.field - oneOf: - - type: string - - items: - type: string - type: array create_slo_request_indicator: oneOf: - $ref: '#/components/schemas/indicator_properties_custom_kql' @@ -1796,18 +2172,50 @@ components: - $ref: '#/components/schemas/indicator_properties_custom_metric' - $ref: '#/components/schemas/indicator_properties_histogram' - $ref: '#/components/schemas/indicator_properties_timeslice_metric' - Historical_summary_response_inner: + find_slo_definitions_response_oneOf: properties: - date: - example: 2022-01-01T00:00:00.000Z - type: string - status: - $ref: '#/components/schemas/summary_status' - sliValue: - example: 0.9836 + page: + example: 1 type: number - errorBudget: - $ref: '#/components/schemas/error_budget' + perPage: + example: 25 + type: number + total: + example: 34 + type: number + results: + items: + $ref: '#/components/schemas/slo_with_summary_response' + type: array + type: object + find_slo_definitions_response_oneOf_1: + properties: + page: + default: 1 + description: for backward compability + type: number + perPage: + description: for backward compability + example: 25 + type: number + size: + example: 25 + type: number + searchAfter: + description: the cursor to provide to get the next paged results + example: + - some-slo-id + - other-cursor-id + items: + type: string + type: array + total: + example: 34 + type: number + results: + items: + $ref: '#/components/schemas/slo_with_summary_response' + type: array type: object delete_slo_instances_request_list_inner: properties: @@ -1823,12 +2231,3 @@ components: - instanceId - sloId type: object - securitySchemes: - basicAuth: - scheme: basic - type: http - apiKeyAuth: - description: "e.g. Authorization: ApiKey base64AccessApiKey" - in: header - name: Authorization - type: apiKey diff --git a/generated/slo/api_slo.go b/generated/slo/api_slo.go index d4340c8c7..0b43f906c 100644 --- a/generated/slo/api_slo.go +++ b/generated/slo/api_slo.go @@ -3,7 +3,7 @@ SLOs OpenAPI schema for SLOs endpoints -API version: 1.0 +API version: 1.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -16,13 +16,14 @@ import ( "io" "net/http" "net/url" + "reflect" "strings" ) type SloAPI interface { /* - CreateSloOp Creates an SLO. + CreateSloOp Create an SLO You must have `all` privileges for the **SLOs** feature in the **Observability** section of the Kibana feature privileges. @@ -38,9 +39,9 @@ type SloAPI interface { CreateSloOpExecute(r ApiCreateSloOpRequest) (*CreateSloResponse, *http.Response, error) /* - DeleteSloInstancesOp Batch delete rollup and summary data for the matching list of sloId and instanceId + DeleteSloInstancesOp Batch delete rollup and summary data - You must have `all` privileges for the **SLOs** feature in the **Observability** section of the Kibana feature privileges. + The deletion occurs for the specified list of `sloId` and `instanceId`. You must have `all` privileges for the **SLOs** feature in the **Observability** section of the Kibana feature privileges. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -53,7 +54,7 @@ type SloAPI interface { DeleteSloInstancesOpExecute(r ApiDeleteSloInstancesOpRequest) (*http.Response, error) /* - DeleteSloOp Deletes an SLO + DeleteSloOp Delete an SLO You must have the `write` privileges for the **SLOs** feature in the **Observability** section of the Kibana feature privileges. @@ -69,7 +70,7 @@ type SloAPI interface { DeleteSloOpExecute(r ApiDeleteSloOpRequest) (*http.Response, error) /* - DisableSloOp Disables an SLO + DisableSloOp Disable an SLO You must have the `write` privileges for the **SLOs** feature in the **Observability** section of the Kibana feature privileges. @@ -85,7 +86,7 @@ type SloAPI interface { DisableSloOpExecute(r ApiDisableSloOpRequest) (*http.Response, error) /* - EnableSloOp Enables an SLO + EnableSloOp Enable an SLO You must have the `write` privileges for the **SLOs** feature in the **Observability** section of the Kibana feature privileges. @@ -101,7 +102,7 @@ type SloAPI interface { EnableSloOpExecute(r ApiEnableSloOpRequest) (*http.Response, error) /* - FindSlosOp Retrieves a paginated list of SLOs + FindSlosOp Get a paginated list of SLOs You must have the `read` privileges for the **SLOs** feature in the **Observability** section of the Kibana feature privileges. @@ -117,7 +118,23 @@ type SloAPI interface { FindSlosOpExecute(r ApiFindSlosOpRequest) (*FindSloResponse, *http.Response, error) /* - GetSloOp Retrieves a SLO + GetDefinitionsOp Get the SLO definitions + + You must have the `read` privileges for the **SLOs** feature in the **Observability** section of the Kibana feature privileges. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param spaceId An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. + @return ApiGetDefinitionsOpRequest + */ + GetDefinitionsOp(ctx context.Context, spaceId string) ApiGetDefinitionsOpRequest + + // GetDefinitionsOpExecute executes the request + // @return FindSloDefinitionsResponse + GetDefinitionsOpExecute(r ApiGetDefinitionsOpRequest) (*FindSloDefinitionsResponse, *http.Response, error) + + /* + GetSloOp Get an SLO You must have the `read` privileges for the **SLOs** feature in the **Observability** section of the Kibana feature privileges. @@ -130,27 +147,28 @@ type SloAPI interface { GetSloOp(ctx context.Context, spaceId string, sloId string) ApiGetSloOpRequest // GetSloOpExecute executes the request - // @return SloResponse - GetSloOpExecute(r ApiGetSloOpRequest) (*SloResponse, *http.Response, error) + // @return SloWithSummaryResponse + GetSloOpExecute(r ApiGetSloOpRequest) (*SloWithSummaryResponse, *http.Response, error) /* - HistoricalSummaryOp Retrieves the historical summary for a list of SLOs + ResetSloOp Reset an SLO - You must have the `read` privileges for the **SLOs** feature in the **Observability** section of the Kibana feature privileges. + You must have the `write` privileges for the **SLOs** feature in the **Observability** section of the Kibana feature privileges. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param spaceId An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. - @return ApiHistoricalSummaryOpRequest + @param sloId An identifier for the slo. + @return ApiResetSloOpRequest */ - HistoricalSummaryOp(ctx context.Context, spaceId string) ApiHistoricalSummaryOpRequest + ResetSloOp(ctx context.Context, spaceId string, sloId string) ApiResetSloOpRequest - // HistoricalSummaryOpExecute executes the request - // @return map[string][]HistoricalSummaryResponseInner - HistoricalSummaryOpExecute(r ApiHistoricalSummaryOpRequest) (*map[string][]HistoricalSummaryResponseInner, *http.Response, error) + // ResetSloOpExecute executes the request + // @return SloDefinitionResponse + ResetSloOpExecute(r ApiResetSloOpRequest) (*SloDefinitionResponse, *http.Response, error) /* - UpdateSloOp Updates an SLO + UpdateSloOp Update an SLO You must have the `write` privileges for the **SLOs** feature in the **Observability** section of the Kibana feature privileges. @@ -163,8 +181,8 @@ type SloAPI interface { UpdateSloOp(ctx context.Context, spaceId string, sloId string) ApiUpdateSloOpRequest // UpdateSloOpExecute executes the request - // @return SloResponse - UpdateSloOpExecute(r ApiUpdateSloOpRequest) (*SloResponse, *http.Response, error) + // @return SloDefinitionResponse + UpdateSloOpExecute(r ApiUpdateSloOpRequest) (*SloDefinitionResponse, *http.Response, error) } // SloAPIService SloAPI service @@ -194,7 +212,7 @@ func (r ApiCreateSloOpRequest) Execute() (*CreateSloResponse, *http.Response, er } /* -CreateSloOp Creates an SLO. +CreateSloOp Create an SLO You must have `all` privileges for the **SLOs** feature in the **Observability** section of the Kibana feature privileges. @@ -259,20 +277,6 @@ func (a *SloAPIService) CreateSloOpExecute(r ApiCreateSloOpRequest) (*CreateSloR parameterAddToHeaderOrQuery(localVarHeaderParams, "kbn-xsrf", r.kbnXsrf, "") // body params localVarPostBody = r.createSloRequest - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKeyAuth"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarHeaderParams["Authorization"] = key - } - } - } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err @@ -377,9 +381,9 @@ func (r ApiDeleteSloInstancesOpRequest) Execute() (*http.Response, error) { } /* -DeleteSloInstancesOp Batch delete rollup and summary data for the matching list of sloId and instanceId +DeleteSloInstancesOp Batch delete rollup and summary data -You must have `all` privileges for the **SLOs** feature in the **Observability** section of the Kibana feature privileges. +The deletion occurs for the specified list of `sloId` and `instanceId`. You must have `all` privileges for the **SLOs** feature in the **Observability** section of the Kibana feature privileges. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param spaceId An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. @@ -439,20 +443,6 @@ func (a *SloAPIService) DeleteSloInstancesOpExecute(r ApiDeleteSloInstancesOpReq parameterAddToHeaderOrQuery(localVarHeaderParams, "kbn-xsrf", r.kbnXsrf, "") // body params localVarPostBody = r.deleteSloInstancesRequest - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKeyAuth"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarHeaderParams["Authorization"] = key - } - } - } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err @@ -532,7 +522,7 @@ func (r ApiDeleteSloOpRequest) Execute() (*http.Response, error) { } /* -DeleteSloOp Deletes an SLO +DeleteSloOp Delete an SLO You must have the `write` privileges for the **SLOs** feature in the **Observability** section of the Kibana feature privileges. @@ -592,20 +582,6 @@ func (a *SloAPIService) DeleteSloOpExecute(r ApiDeleteSloOpRequest) (*http.Respo localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } parameterAddToHeaderOrQuery(localVarHeaderParams, "kbn-xsrf", r.kbnXsrf, "") - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKeyAuth"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarHeaderParams["Authorization"] = key - } - } - } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err @@ -696,7 +672,7 @@ func (r ApiDisableSloOpRequest) Execute() (*http.Response, error) { } /* -DisableSloOp Disables an SLO +DisableSloOp Disable an SLO You must have the `write` privileges for the **SLOs** feature in the **Observability** section of the Kibana feature privileges. @@ -756,20 +732,6 @@ func (a *SloAPIService) DisableSloOpExecute(r ApiDisableSloOpRequest) (*http.Res localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } parameterAddToHeaderOrQuery(localVarHeaderParams, "kbn-xsrf", r.kbnXsrf, "") - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKeyAuth"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarHeaderParams["Authorization"] = key - } - } - } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err @@ -860,7 +822,7 @@ func (r ApiEnableSloOpRequest) Execute() (*http.Response, error) { } /* -EnableSloOp Enables an SLO +EnableSloOp Enable an SLO You must have the `write` privileges for the **SLOs** feature in the **Observability** section of the Kibana feature privileges. @@ -920,20 +882,6 @@ func (a *SloAPIService) EnableSloOpExecute(r ApiEnableSloOpRequest) (*http.Respo localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } parameterAddToHeaderOrQuery(localVarHeaderParams, "kbn-xsrf", r.kbnXsrf, "") - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKeyAuth"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarHeaderParams["Authorization"] = key - } - } - } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err @@ -1011,10 +959,13 @@ type ApiFindSlosOpRequest struct { kbnXsrf *string spaceId string kqlQuery *string + size *int32 + searchAfter *[]string page *int32 perPage *int32 sortBy *string sortDirection *string + hideStale *bool } // Cross-site request forgery protection @@ -1029,13 +980,25 @@ func (r ApiFindSlosOpRequest) KqlQuery(kqlQuery string) ApiFindSlosOpRequest { return r } -// The page number to return +// The page size to use for cursor-based pagination, must be greater or equal than 1 +func (r ApiFindSlosOpRequest) Size(size int32) ApiFindSlosOpRequest { + r.size = &size + return r +} + +// The cursor to use for fetching the results from, when using a cursor-base pagination. +func (r ApiFindSlosOpRequest) SearchAfter(searchAfter []string) ApiFindSlosOpRequest { + r.searchAfter = &searchAfter + return r +} + +// The page to use for pagination, must be greater or equal than 1 func (r ApiFindSlosOpRequest) Page(page int32) ApiFindSlosOpRequest { r.page = &page return r } -// The number of SLOs to return per page +// Number of SLOs returned by page func (r ApiFindSlosOpRequest) PerPage(perPage int32) ApiFindSlosOpRequest { r.perPage = &perPage return r @@ -1053,12 +1016,18 @@ func (r ApiFindSlosOpRequest) SortDirection(sortDirection string) ApiFindSlosOpR return r } +// Hide stale SLOs from the list as defined by stale SLO threshold in SLO settings +func (r ApiFindSlosOpRequest) HideStale(hideStale bool) ApiFindSlosOpRequest { + r.hideStale = &hideStale + return r +} + func (r ApiFindSlosOpRequest) Execute() (*FindSloResponse, *http.Response, error) { return r.ApiService.FindSlosOpExecute(r) } /* -FindSlosOp Retrieves a paginated list of SLOs +FindSlosOp Get a paginated list of SLOs You must have the `read` privileges for the **SLOs** feature in the **Observability** section of the Kibana feature privileges. @@ -1103,6 +1072,23 @@ func (a *SloAPIService) FindSlosOpExecute(r ApiFindSlosOpRequest) (*FindSloRespo if r.kqlQuery != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "kqlQuery", r.kqlQuery, "") } + if r.size != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "size", r.size, "") + } else { + var defaultValue int32 = 1 + r.size = &defaultValue + } + if r.searchAfter != nil { + t := *r.searchAfter + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "searchAfter", s.Index(i).Interface(), "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "searchAfter", t, "multi") + } + } if r.page != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "") } else { @@ -1127,6 +1113,9 @@ func (a *SloAPIService) FindSlosOpExecute(r ApiFindSlosOpRequest) (*FindSloRespo var defaultValue string = "asc" r.sortDirection = &defaultValue } + if r.hideStale != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "hideStale", r.hideStale, "") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1145,20 +1134,6 @@ func (a *SloAPIService) FindSlosOpExecute(r ApiFindSlosOpRequest) (*FindSloRespo localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } parameterAddToHeaderOrQuery(localVarHeaderParams, "kbn-xsrf", r.kbnXsrf, "") - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKeyAuth"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarHeaderParams["Authorization"] = key - } - } - } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err @@ -1239,6 +1214,196 @@ func (a *SloAPIService) FindSlosOpExecute(r ApiFindSlosOpRequest) (*FindSloRespo return localVarReturnValue, localVarHTTPResponse, nil } +type ApiGetDefinitionsOpRequest struct { + ctx context.Context + ApiService SloAPI + kbnXsrf *string + spaceId string + includeOutdatedOnly *bool + search *string + page *float64 + perPage *int32 +} + +// Cross-site request forgery protection +func (r ApiGetDefinitionsOpRequest) KbnXsrf(kbnXsrf string) ApiGetDefinitionsOpRequest { + r.kbnXsrf = &kbnXsrf + return r +} + +// Indicates if the API returns only outdated SLO or all SLO definitions +func (r ApiGetDefinitionsOpRequest) IncludeOutdatedOnly(includeOutdatedOnly bool) ApiGetDefinitionsOpRequest { + r.includeOutdatedOnly = &includeOutdatedOnly + return r +} + +// Filters the SLOs by name +func (r ApiGetDefinitionsOpRequest) Search(search string) ApiGetDefinitionsOpRequest { + r.search = &search + return r +} + +// The page to use for pagination, must be greater or equal than 1 +func (r ApiGetDefinitionsOpRequest) Page(page float64) ApiGetDefinitionsOpRequest { + r.page = &page + return r +} + +// Number of SLOs returned by page +func (r ApiGetDefinitionsOpRequest) PerPage(perPage int32) ApiGetDefinitionsOpRequest { + r.perPage = &perPage + return r +} + +func (r ApiGetDefinitionsOpRequest) Execute() (*FindSloDefinitionsResponse, *http.Response, error) { + return r.ApiService.GetDefinitionsOpExecute(r) +} + +/* +GetDefinitionsOp Get the SLO definitions + +You must have the `read` privileges for the **SLOs** feature in the **Observability** section of the Kibana feature privileges. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param spaceId An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. + @return ApiGetDefinitionsOpRequest +*/ +func (a *SloAPIService) GetDefinitionsOp(ctx context.Context, spaceId string) ApiGetDefinitionsOpRequest { + return ApiGetDefinitionsOpRequest{ + ApiService: a, + ctx: ctx, + spaceId: spaceId, + } +} + +// Execute executes the request +// +// @return FindSloDefinitionsResponse +func (a *SloAPIService) GetDefinitionsOpExecute(r ApiGetDefinitionsOpRequest) (*FindSloDefinitionsResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *FindSloDefinitionsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SloAPIService.GetDefinitionsOp") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/s/{spaceId}/internal/observability/slos/_definitions" + localVarPath = strings.Replace(localVarPath, "{"+"spaceId"+"}", url.PathEscape(parameterValueToString(r.spaceId, "spaceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.kbnXsrf == nil { + return localVarReturnValue, nil, reportError("kbnXsrf is required and must be specified") + } + + if r.includeOutdatedOnly != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "includeOutdatedOnly", r.includeOutdatedOnly, "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "") + } + if r.perPage != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "perPage", r.perPage, "") + } else { + var defaultValue int32 = 100 + r.perPage = &defaultValue + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + parameterAddToHeaderOrQuery(localVarHeaderParams, "kbn-xsrf", r.kbnXsrf, "") + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Model400Response + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Model401Response + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Model403Response + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + type ApiGetSloOpRequest struct { ctx context.Context ApiService SloAPI @@ -1260,12 +1425,12 @@ func (r ApiGetSloOpRequest) InstanceId(instanceId string) ApiGetSloOpRequest { return r } -func (r ApiGetSloOpRequest) Execute() (*SloResponse, *http.Response, error) { +func (r ApiGetSloOpRequest) Execute() (*SloWithSummaryResponse, *http.Response, error) { return r.ApiService.GetSloOpExecute(r) } /* -GetSloOp Retrieves a SLO +GetSloOp Get an SLO You must have the `read` privileges for the **SLOs** feature in the **Observability** section of the Kibana feature privileges. @@ -1285,13 +1450,13 @@ func (a *SloAPIService) GetSloOp(ctx context.Context, spaceId string, sloId stri // Execute executes the request // -// @return SloResponse -func (a *SloAPIService) GetSloOpExecute(r ApiGetSloOpRequest) (*SloResponse, *http.Response, error) { +// @return SloWithSummaryResponse +func (a *SloAPIService) GetSloOpExecute(r ApiGetSloOpRequest) (*SloWithSummaryResponse, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *SloResponse + localVarReturnValue *SloWithSummaryResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SloAPIService.GetSloOp") @@ -1331,20 +1496,6 @@ func (a *SloAPIService) GetSloOpExecute(r ApiGetSloOpRequest) (*SloResponse, *ht localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } parameterAddToHeaderOrQuery(localVarHeaderParams, "kbn-xsrf", r.kbnXsrf, "") - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKeyAuth"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarHeaderParams["Authorization"] = key - } - } - } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err @@ -1425,64 +1576,62 @@ func (a *SloAPIService) GetSloOpExecute(r ApiGetSloOpRequest) (*SloResponse, *ht return localVarReturnValue, localVarHTTPResponse, nil } -type ApiHistoricalSummaryOpRequest struct { - ctx context.Context - ApiService SloAPI - kbnXsrf *string - spaceId string - historicalSummaryRequest *HistoricalSummaryRequest +type ApiResetSloOpRequest struct { + ctx context.Context + ApiService SloAPI + kbnXsrf *string + spaceId string + sloId string } // Cross-site request forgery protection -func (r ApiHistoricalSummaryOpRequest) KbnXsrf(kbnXsrf string) ApiHistoricalSummaryOpRequest { +func (r ApiResetSloOpRequest) KbnXsrf(kbnXsrf string) ApiResetSloOpRequest { r.kbnXsrf = &kbnXsrf return r } -func (r ApiHistoricalSummaryOpRequest) HistoricalSummaryRequest(historicalSummaryRequest HistoricalSummaryRequest) ApiHistoricalSummaryOpRequest { - r.historicalSummaryRequest = &historicalSummaryRequest - return r -} - -func (r ApiHistoricalSummaryOpRequest) Execute() (*map[string][]HistoricalSummaryResponseInner, *http.Response, error) { - return r.ApiService.HistoricalSummaryOpExecute(r) +func (r ApiResetSloOpRequest) Execute() (*SloDefinitionResponse, *http.Response, error) { + return r.ApiService.ResetSloOpExecute(r) } /* -HistoricalSummaryOp Retrieves the historical summary for a list of SLOs +ResetSloOp Reset an SLO -You must have the `read` privileges for the **SLOs** feature in the **Observability** section of the Kibana feature privileges. +You must have the `write` privileges for the **SLOs** feature in the **Observability** section of the Kibana feature privileges. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param spaceId An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. - @return ApiHistoricalSummaryOpRequest + @param sloId An identifier for the slo. + @return ApiResetSloOpRequest */ -func (a *SloAPIService) HistoricalSummaryOp(ctx context.Context, spaceId string) ApiHistoricalSummaryOpRequest { - return ApiHistoricalSummaryOpRequest{ +func (a *SloAPIService) ResetSloOp(ctx context.Context, spaceId string, sloId string) ApiResetSloOpRequest { + return ApiResetSloOpRequest{ ApiService: a, ctx: ctx, spaceId: spaceId, + sloId: sloId, } } // Execute executes the request // -// @return map[string][]HistoricalSummaryResponseInner -func (a *SloAPIService) HistoricalSummaryOpExecute(r ApiHistoricalSummaryOpRequest) (*map[string][]HistoricalSummaryResponseInner, *http.Response, error) { +// @return SloDefinitionResponse +func (a *SloAPIService) ResetSloOpExecute(r ApiResetSloOpRequest) (*SloDefinitionResponse, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile - localVarReturnValue *map[string][]HistoricalSummaryResponseInner + localVarReturnValue *SloDefinitionResponse ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SloAPIService.HistoricalSummaryOp") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SloAPIService.ResetSloOp") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/s/{spaceId}/internal/observability/slos/_historical_summary" + localVarPath := localBasePath + "/s/{spaceId}/api/observability/slos/{sloId}/_reset" localVarPath = strings.Replace(localVarPath, "{"+"spaceId"+"}", url.PathEscape(parameterValueToString(r.spaceId, "spaceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"sloId"+"}", url.PathEscape(parameterValueToString(r.sloId, "sloId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1490,12 +1639,9 @@ func (a *SloAPIService) HistoricalSummaryOpExecute(r ApiHistoricalSummaryOpReque if r.kbnXsrf == nil { return localVarReturnValue, nil, reportError("kbnXsrf is required and must be specified") } - if r.historicalSummaryRequest == nil { - return localVarReturnValue, nil, reportError("historicalSummaryRequest is required and must be specified") - } // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -1512,22 +1658,6 @@ func (a *SloAPIService) HistoricalSummaryOpExecute(r ApiHistoricalSummaryOpReque localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } parameterAddToHeaderOrQuery(localVarHeaderParams, "kbn-xsrf", r.kbnXsrf, "") - // body params - localVarPostBody = r.historicalSummaryRequest - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKeyAuth"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarHeaderParams["Authorization"] = key - } - } - } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err @@ -1581,6 +1711,17 @@ func (a *SloAPIService) HistoricalSummaryOpExecute(r ApiHistoricalSummaryOpReque } newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Model404Response + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } @@ -1617,12 +1758,12 @@ func (r ApiUpdateSloOpRequest) UpdateSloRequest(updateSloRequest UpdateSloReques return r } -func (r ApiUpdateSloOpRequest) Execute() (*SloResponse, *http.Response, error) { +func (r ApiUpdateSloOpRequest) Execute() (*SloDefinitionResponse, *http.Response, error) { return r.ApiService.UpdateSloOpExecute(r) } /* -UpdateSloOp Updates an SLO +UpdateSloOp Update an SLO You must have the `write` privileges for the **SLOs** feature in the **Observability** section of the Kibana feature privileges. @@ -1642,13 +1783,13 @@ func (a *SloAPIService) UpdateSloOp(ctx context.Context, spaceId string, sloId s // Execute executes the request // -// @return SloResponse -func (a *SloAPIService) UpdateSloOpExecute(r ApiUpdateSloOpRequest) (*SloResponse, *http.Response, error) { +// @return SloDefinitionResponse +func (a *SloAPIService) UpdateSloOpExecute(r ApiUpdateSloOpRequest) (*SloDefinitionResponse, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} formFiles []formFile - localVarReturnValue *SloResponse + localVarReturnValue *SloDefinitionResponse ) localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SloAPIService.UpdateSloOp") @@ -1690,20 +1831,6 @@ func (a *SloAPIService) UpdateSloOpExecute(r ApiUpdateSloOpRequest) (*SloRespons parameterAddToHeaderOrQuery(localVarHeaderParams, "kbn-xsrf", r.kbnXsrf, "") // body params localVarPostBody = r.updateSloRequest - if r.ctx != nil { - // API Key Authentication - if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { - if apiKey, ok := auth["apiKeyAuth"]; ok { - var key string - if apiKey.Prefix != "" { - key = apiKey.Prefix + " " + apiKey.Key - } else { - key = apiKey.Key - } - localVarHeaderParams["Authorization"] = key - } - } - } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err diff --git a/generated/slo-spec.yml b/generated/slo/bundled.yaml similarity index 69% rename from generated/slo-spec.yml rename to generated/slo/bundled.yaml index a1922fa03..b06e3a41f 100644 --- a/generated/slo-spec.yml +++ b/generated/slo/bundled.yaml @@ -1,26 +1,26 @@ +# 9b9a12e9ae6d82523453337c5127fec3ac53c504 https://github.com/elastic/kibana/commits/main/x-pack/solutions/observability/plugins/slo/docs/openapi/slo/bundled.yaml openapi: 3.0.1 info: title: SLOs description: OpenAPI schema for SLOs endpoints - version: '1.0' + version: '1.1' contact: name: Actionable Observability Team license: name: Elastic License 2.0 url: https://www.elastic.co/licensing/elastic-license servers: - - url: http://localhost:5601 - description: local -security: - - basicAuth: [] - - apiKeyAuth: [] + - url: https://{kibana_url} + variables: + kibana_url: + default: localhost:5601 tags: - name: slo description: SLO APIs enable you to define, manage and track service-level objectives paths: /s/{spaceId}/api/observability/slos: post: - summary: Creates an SLO. + summary: Create an SLO operationId: createSloOp description: | You must have `all` privileges for the **SLOs** feature in the **Observability** section of the Kibana feature privileges. @@ -66,10 +66,8 @@ paths: application/json: schema: $ref: '#/components/schemas/409_response' - servers: - - url: https://localhost:5601 get: - summary: Retrieves a paginated list of SLOs + summary: Get a paginated list of SLOs operationId: findSlosOp description: | You must have the `read` privileges for the **SLOs** feature in the **Observability** section of the Kibana feature privileges. @@ -84,16 +82,30 @@ paths: schema: type: string example: 'slo.name:latency* and slo.tags : "prod"' + - name: size + in: query + description: The page size to use for cursor-based pagination, must be greater or equal than 1 + schema: + type: integer + default: 1 + example: 1 + - name: searchAfter + in: query + description: The cursor to use for fetching the results from, when using a cursor-base pagination. + schema: + type: array + items: + type: string - name: page in: query - description: The page number to return + description: The page to use for pagination, must be greater or equal than 1 schema: type: integer default: 1 example: 1 - name: perPage in: query - description: The number of SLOs to return per page + description: Number of SLOs returned by page schema: type: integer default: 25 @@ -121,6 +133,11 @@ paths: - desc default: asc example: asc + - name: hideStale + in: query + description: Hide stale SLOs from the list as defined by stale SLO threshold in SLO settings + schema: + type: boolean responses: '200': description: Successful request @@ -154,7 +171,7 @@ paths: $ref: '#/components/schemas/404_response' /s/{spaceId}/api/observability/slos/{sloId}: get: - summary: Retrieves a SLO + summary: Get an SLO operationId: getSloOp description: | You must have the `read` privileges for the **SLOs** feature in the **Observability** section of the Kibana feature privileges. @@ -176,7 +193,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/slo_response' + $ref: '#/components/schemas/slo_with_summary_response' '400': description: Bad request content: @@ -202,7 +219,7 @@ paths: schema: $ref: '#/components/schemas/404_response' put: - summary: Updates an SLO + summary: Update an SLO operationId: updateSloOp description: | You must have the `write` privileges for the **SLOs** feature in the **Observability** section of the Kibana feature privileges. @@ -224,7 +241,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/slo_response' + $ref: '#/components/schemas/slo_definition_response' '400': description: Bad request content: @@ -250,7 +267,7 @@ paths: schema: $ref: '#/components/schemas/404_response' delete: - summary: Deletes an SLO + summary: Delete an SLO operationId: deleteSloOp description: | You must have the `write` privileges for the **SLOs** feature in the **Observability** section of the Kibana feature privileges. @@ -289,7 +306,7 @@ paths: $ref: '#/components/schemas/404_response' /s/{spaceId}/api/observability/slos/{sloId}/enable: post: - summary: Enables an SLO + summary: Enable an SLO operationId: enableSloOp description: | You must have the `write` privileges for the **SLOs** feature in the **Observability** section of the Kibana feature privileges. @@ -328,7 +345,7 @@ paths: $ref: '#/components/schemas/404_response' /s/{spaceId}/api/observability/slos/{sloId}/disable: post: - summary: Disables an SLO + summary: Disable an SLO operationId: disableSloOp description: | You must have the `write` privileges for the **SLOs** feature in the **Observability** section of the Kibana feature privileges. @@ -339,7 +356,7 @@ paths: - $ref: '#/components/parameters/space_id' - $ref: '#/components/parameters/slo_id' responses: - '200': + '204': description: Successful request '400': description: Bad request @@ -365,10 +382,53 @@ paths: application/json: schema: $ref: '#/components/schemas/404_response' - /s/{spaceId}/internal/observability/slos/_historical_summary: + /s/{spaceId}/api/observability/slos/{sloId}/_reset: post: - summary: Retrieves the historical summary for a list of SLOs - operationId: historicalSummaryOp + summary: Reset an SLO + operationId: resetSloOp + description: | + You must have the `write` privileges for the **SLOs** feature in the **Observability** section of the Kibana feature privileges. + tags: + - slo + parameters: + - $ref: '#/components/parameters/kbn_xsrf' + - $ref: '#/components/parameters/space_id' + - $ref: '#/components/parameters/slo_id' + responses: + '200': + description: Successful request + content: + application/json: + schema: + $ref: '#/components/schemas/slo_definition_response' + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/400_response' + '401': + description: Unauthorized response + content: + application/json: + schema: + $ref: '#/components/schemas/401_response' + '403': + description: Unauthorized response + content: + application/json: + schema: + $ref: '#/components/schemas/403_response' + '404': + description: Not found response + content: + application/json: + schema: + $ref: '#/components/schemas/404_response' + /s/{spaceId}/internal/observability/slos/_definitions: + get: + summary: Get the SLO definitions + operationId: getDefinitionsOp description: | You must have the `read` privileges for the **SLOs** feature in the **Observability** section of the Kibana feature privileges. tags: @@ -376,19 +436,39 @@ paths: parameters: - $ref: '#/components/parameters/kbn_xsrf' - $ref: '#/components/parameters/space_id' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/historical_summary_request' + - name: includeOutdatedOnly + in: query + description: Indicates if the API returns only outdated SLO or all SLO definitions + schema: + type: boolean + example: true + - name: search + in: query + description: Filters the SLOs by name + schema: + type: string + example: my service availability + - name: page + in: query + description: The page to use for pagination, must be greater or equal than 1 + schema: + type: number + example: 1 + - name: perPage + in: query + description: Number of SLOs returned by page + schema: + type: integer + default: 100 + maximum: 1000 + example: 100 responses: '200': description: Successful request content: application/json: schema: - $ref: '#/components/schemas/historical_summary_response' + $ref: '#/components/schemas/find_slo_definitions_response' '400': description: Bad request content: @@ -409,10 +489,10 @@ paths: $ref: '#/components/schemas/403_response' /s/{spaceId}/api/observability/slos/_delete_instances: post: - summary: Batch delete rollup and summary data for the matching list of sloId and instanceId + summary: Batch delete rollup and summary data operationId: deleteSloInstancesOp description: | - You must have `all` privileges for the **SLOs** feature in the **Observability** section of the Kibana feature privileges. + The deletion occurs for the specified list of `sloId` and `instanceId`. You must have `all` privileges for the **SLOs** feature in the **Observability** section of the Kibana feature privileges. tags: - slo parameters: @@ -445,18 +525,7 @@ paths: application/json: schema: $ref: '#/components/schemas/403_response' - servers: - - url: https://localhost:5601 components: - securitySchemes: - basicAuth: - type: http - scheme: basic - apiKeyAuth: - type: apiKey - in: header - name: Authorization - description: 'e.g. Authorization: ApiKey base64AccessApiKey' parameters: kbn_xsrf: schema: @@ -529,12 +598,96 @@ components: description: The type of indicator. type: string example: sli.apm.transactionDuration + filter_meta: + title: FilterMeta + description: Defines properties for a filter + type: object + properties: + alias: + type: string + nullable: true + disabled: + type: boolean + negate: + type: boolean + controlledBy: + type: string + group: + type: string + index: + type: string + isMultiIndex: + type: boolean + type: + type: string + key: + type: string + params: + type: object + value: + type: string + field: + type: string + filter: + title: Filter + description: Defines properties for a filter + type: object + properties: + query: + type: object + meta: + $ref: '#/components/schemas/filter_meta' + kql_with_filters: + title: KQL with filters + description: Defines properties for a filter + oneOf: + - description: the KQL query to filter the documents with. + type: string + example: 'field.environment : "production" and service.name : "my-service"' + - type: object + properties: + kqlQuery: + type: string + filters: + type: array + items: + $ref: '#/components/schemas/filter' + kql_with_filters_good: + title: KQL query for good events + description: The KQL query used to define the good events. + oneOf: + - description: the KQL query to filter the documents with. + type: string + example: 'request.latency <= 150 and request.status_code : "2xx"' + - type: object + properties: + kqlQuery: + type: string + filters: + type: array + items: + $ref: '#/components/schemas/filter' + kql_with_filters_total: + title: KQL query for all events + description: The KQL query used to define all events. + oneOf: + - description: the KQL query to filter the documents with. + type: string + example: 'field.environment : "production" and service.name : "my-service"' + - type: object + properties: + kqlQuery: + type: string + filters: + type: array + items: + $ref: '#/components/schemas/filter' indicator_properties_custom_kql: - title: Custom KQL + title: Custom Query required: - type - params - description: Defines properties for a custom KQL indicator type + description: Defines properties for a custom query indicator type type: object properties: params: @@ -551,18 +704,16 @@ components: description: The index or index pattern to use type: string example: my-service-* - filter: - description: the KQL query to filter the documents with. + dataViewId: + description: The kibana data view id to use, primarily used to include data view runtime mappings. Make sure to save SLO again if you add/update run time fields to the data view and if those fields are being used in slo queries. type: string - example: 'field.environment : "production" and service.name : "my-service"' + example: 03b80ab3-003d-498b-881c-3beedbaf1162 + filter: + $ref: '#/components/schemas/kql_with_filters' good: - description: the KQL query used to define the good events. - type: string - example: 'request.latency <= 150 and request.status_code : "2xx"' + $ref: '#/components/schemas/kql_with_filters_good' total: - description: the KQL query used to define all events. - type: string - example: '' + $ref: '#/components/schemas/kql_with_filters_total' timestampField: description: | The timestamp field used in the source indice. @@ -646,6 +797,10 @@ components: description: The index or index pattern to use type: string example: my-service-* + dataViewId: + description: The kibana data view id to use, primarily used to include data view runtime mappings. Make sure to save SLO again if you add/update run time fields to the data view and if those fields are being used in slo queries. + type: string + example: 03b80ab3-003d-498b-881c-3beedbaf1162 filter: description: the KQL query to filter the documents with. type: string @@ -667,31 +822,52 @@ components: description: List of metrics with their name, aggregation type, and field. type: array items: - type: object - required: - - name - - aggregation - - field - properties: - name: - description: The name of the metric. Only valid options are A-Z - type: string - example: A - pattern: ^[A-Z]$ - aggregation: - description: The aggregation type of the metric. Only valid option is "sum" - type: string - example: sum - enum: - - sum - field: - description: The field of the metric. - type: string - example: processor.processed - filter: - description: The filter to apply to the metric. - type: string - example: 'processor.outcome: "success"' + oneOf: + - type: object + required: + - name + - aggregation + - field + properties: + name: + description: The name of the metric. Only valid options are A-Z + type: string + example: A + pattern: ^[A-Z]$ + aggregation: + description: The aggregation type of the metric. + type: string + example: sum + enum: + - sum + field: + description: The field of the metric. + type: string + example: processor.processed + filter: + description: The filter to apply to the metric. + type: string + example: 'processor.outcome: *' + - type: object + required: + - name + - aggregation + properties: + name: + description: The name of the metric. Only valid options are A-Z + type: string + example: A + pattern: ^[A-Z]$ + aggregation: + description: The aggregation type of the metric. + type: string + example: doc_count + enum: + - doc_count + filter: + description: The filter to apply to the metric. + type: string + example: 'processor.outcome: *' equation: description: The equation to calculate the "good" metric. type: string @@ -708,31 +884,52 @@ components: description: List of metrics with their name, aggregation type, and field. type: array items: - type: object - required: - - name - - aggregation - - field - properties: - name: - description: The name of the metric. Only valid options are A-Z - type: string - example: A - pattern: ^[A-Z]$ - aggregation: - description: The aggregation type of the metric. Only valid option is "sum" - type: string - example: sum - enum: - - sum - field: - description: The field of the metric. - type: string - example: processor.processed - filter: - description: The filter to apply to the metric. - type: string - example: 'processor.outcome: *' + oneOf: + - type: object + required: + - name + - aggregation + - field + properties: + name: + description: The name of the metric. Only valid options are A-Z + type: string + example: A + pattern: ^[A-Z]$ + aggregation: + description: The aggregation type of the metric. + type: string + example: sum + enum: + - sum + field: + description: The field of the metric. + type: string + example: processor.processed + filter: + description: The filter to apply to the metric. + type: string + example: 'processor.outcome: *' + - type: object + required: + - name + - aggregation + properties: + name: + description: The name of the metric. Only valid options are A-Z + type: string + example: A + pattern: ^[A-Z]$ + aggregation: + description: The aggregation type of the metric. + type: string + example: doc_count + enum: + - doc_count + filter: + description: The filter to apply to the metric. + type: string + example: 'processor.outcome: *' equation: description: The equation to calculate the "total" metric. type: string @@ -763,6 +960,10 @@ components: description: The index or index pattern to use type: string example: my-service-* + dataViewId: + description: The kibana data view id to use, primarily used to include data view runtime mappings. Make sure to save SLO again if you add/update run time fields to the data view and if those fields are being used in slo queries. + type: string + example: 03b80ab3-003d-498b-881c-3beedbaf1162 filter: description: the KQL query to filter the documents with. type: string @@ -946,6 +1147,10 @@ components: description: The index or index pattern to use type: string example: my-service-* + dataViewId: + description: The kibana data view id to use, primarily used to include data view runtime mappings. Make sure to save SLO again if you add/update run time fields to the data view and if those fields are being used in slo queries. + type: string + example: 03b80ab3-003d-498b-881c-3beedbaf1162 filter: description: the KQL query to filter the documents with. type: string @@ -1031,10 +1236,16 @@ components: target: description: the target objective between 0 and 1 excluded type: number + minimum: 0 + maximum: 100 + exclusiveMinimum: true + exclusiveMaximum: true example: 0.99 timesliceTarget: description: the target objective for each slice when using a timeslices budgeting method type: number + minimum: 0 + maximum: 100 example: 0.995 timesliceWindow: description: the duration of each slice when using a timeslices budgeting method, as {duraton}{unit} @@ -1045,14 +1256,25 @@ components: description: Defines properties for SLO settings. type: object properties: + syncField: + description: The date field that is used to identify new documents in the source. It is strongly recommended to use a field that contains the ingest timestamp. If you use a different field, you might need to set the delay such that it accounts for data transmission delays. When unspecified, we use the indicator timestamp field. + type: string + example: event.ingested syncDelay: - description: The synch delay to apply to the transform. Default 1m + description: The time delay in minutes between the current time and the latest source data time. Increasing the value will delay any alerting. The default value is 1 minute. The minimum value is 1m and the maximum is 359m. It should always be greater then source index refresh interval. type: string + default: 1m example: 5m frequency: - description: Configure how often the transform runs, default 1m + description: The interval between checks for changes in the source data. The minimum value is 1m and the maximum is 59m. The default value is 1 minute. type: string + default: 1m example: 5m + preventInitialBackfill: + description: Start aggregating data from the time the SLO is created, instead of backfilling data from the beginning of the time window. + type: boolean + default: false + example: true summary_status: title: summary status type: string @@ -1103,7 +1325,20 @@ components: example: 0.9836 errorBudget: $ref: '#/components/schemas/error_budget' - slo_response: + group_by: + title: Group by + description: optional group by field or fields to use to generate an SLO per distinct value + example: + - - service.name + - service.name + - - service.name + - service.environment + oneOf: + - type: string + - type: array + items: + type: string + slo_with_summary_response: title: SLO response type: object required: @@ -1123,6 +1358,7 @@ components: - tags - createdAt - updatedAt + - version properties: id: description: The identifier of the SLO. @@ -1172,13 +1408,7 @@ components: type: boolean example: true groupBy: - description: optional group by field to use to generate an SLO per distinct value - oneOf: - - type: string - - type: array - items: - type: string - example: some.field + $ref: '#/components/schemas/group_by' instanceId: description: the value derived from the groupBy field, if present, otherwise '*' type: string @@ -1196,12 +1426,22 @@ components: description: The last update date type: string example: '2023-01-12T10:03:19.000Z' + version: + description: The internal SLO version + type: number + example: 2 find_slo_response: title: Find SLO response description: | A paginated response of SLOs matching the query. type: object properties: + size: + type: number + example: 25 + description: Size provided for cursor based pagination + searchAfter: + type: string page: type: number example: 1 @@ -1214,7 +1454,7 @@ components: results: type: array items: - $ref: '#/components/schemas/slo_response' + $ref: '#/components/schemas/slo_with_summary_response' 400_response: title: Bad request type: object @@ -1323,13 +1563,7 @@ components: settings: $ref: '#/components/schemas/settings' groupBy: - description: optional group by field to use to generate an SLO per distinct value - oneOf: - - type: string - - type: array - items: - type: string - example: some.field + $ref: '#/components/schemas/group_by' tags: description: List of tags type: array @@ -1390,48 +1624,145 @@ components: settings: $ref: '#/components/schemas/settings' groupBy: - description: optional group by field to use to generate an SLO per distinct value - oneOf: - - type: string - - type: array - items: - type: string - example: some.field + $ref: '#/components/schemas/group_by' tags: description: List of tags type: array items: type: string - historical_summary_request: - title: Historical summary request + slo_definition_response: + title: SLO definition response type: object required: - - list + - id + - name + - description + - indicator + - timeWindow + - budgetingMethod + - objective + - settings + - revision + - enabled + - groupBy + - tags + - createdAt + - updatedAt + - version properties: - list: - description: The list of SLO identifiers to get the historical summary for + id: + description: The identifier of the SLO. + type: string + example: 8853df00-ae2e-11ed-90af-09bb6422b258 + name: + description: The name of the SLO. + type: string + example: My Service SLO + description: + description: The description of the SLO. + type: string + example: My SLO description + indicator: + discriminator: + propertyName: type + mapping: + sli.apm.transactionErrorRate: '#/components/schemas/indicator_properties_apm_availability' + sli.kql.custom: '#/components/schemas/indicator_properties_custom_kql' + sli.apm.transactionDuration: '#/components/schemas/indicator_properties_apm_latency' + sli.metric.custom: '#/components/schemas/indicator_properties_custom_metric' + sli.histogram.custom: '#/components/schemas/indicator_properties_histogram' + sli.metric.timeslice: '#/components/schemas/indicator_properties_timeslice_metric' + oneOf: + - $ref: '#/components/schemas/indicator_properties_custom_kql' + - $ref: '#/components/schemas/indicator_properties_apm_availability' + - $ref: '#/components/schemas/indicator_properties_apm_latency' + - $ref: '#/components/schemas/indicator_properties_custom_metric' + - $ref: '#/components/schemas/indicator_properties_histogram' + - $ref: '#/components/schemas/indicator_properties_timeslice_metric' + timeWindow: + $ref: '#/components/schemas/time_window' + budgetingMethod: + $ref: '#/components/schemas/budgeting_method' + objective: + $ref: '#/components/schemas/objective' + settings: + $ref: '#/components/schemas/settings' + revision: + description: The SLO revision + type: number + example: 2 + enabled: + description: Indicate if the SLO is enabled + type: boolean + example: true + groupBy: + $ref: '#/components/schemas/group_by' + tags: + description: List of tags type: array items: type: string - example: 8853df00-ae2e-11ed-90af-09bb6422b258 - historical_summary_response: - title: Historical summary response + createdAt: + description: The creation date + type: string + example: '2023-01-12T10:03:19.000Z' + updatedAt: + description: The last update date + type: string + example: '2023-01-12T10:03:19.000Z' + version: + description: The internal SLO version + type: number + example: 2 + find_slo_definitions_response: + title: Find SLO definitions response + description: | + A paginated response of SLO definitions matching the query. type: object - additionalProperties: - type: array - items: - type: object + oneOf: + - type: object properties: - date: - type: string - example: '2022-01-01T00:00:00.000Z' - status: - $ref: '#/components/schemas/summary_status' - sliValue: + page: + type: number + example: 1 + perPage: type: number - example: 0.9836 - errorBudget: - $ref: '#/components/schemas/error_budget' + example: 25 + total: + type: number + example: 34 + results: + type: array + items: + $ref: '#/components/schemas/slo_with_summary_response' + - type: object + properties: + page: + type: number + default: 1 + description: for backward compability + perPage: + type: number + example: 25 + description: for backward compability + size: + type: number + example: 25 + searchAfter: + type: array + items: + type: string + example: + - some-slo-id + - other-cursor-id + description: the cursor to provide to get the next paged results + total: + type: number + example: 34 + results: + type: array + items: + $ref: '#/components/schemas/slo_with_summary_response' delete_slo_instances_request: title: Delete SLO instances request description: | @@ -1456,4 +1787,4 @@ components: instanceId: description: The SLO instance identifier type: string - example: 8853df00-ae2e-11ed-90af-09bb6422b258 + example: 8853df00-ae2e-11ed-90af-09bb6422b258 \ No newline at end of file diff --git a/generated/slo/client.go b/generated/slo/client.go index 6a012a56f..5e6cccbae 100644 --- a/generated/slo/client.go +++ b/generated/slo/client.go @@ -3,7 +3,7 @@ SLOs OpenAPI schema for SLOs endpoints -API version: 1.0 +API version: 1.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -40,7 +40,7 @@ var ( queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]") ) -// APIClient manages communication with the SLOs API v1.0 +// APIClient manages communication with the SLOs API v1.1 // In most cases there should be only one, shared, APIClient. type APIClient struct { cfg *Configuration @@ -409,11 +409,6 @@ func (c *APIClient) prepareRequest( // Walk through any authentication. - // Basic HTTP Authentication - if auth, ok := ctx.Value(ContextBasicAuth).(BasicAuth); ok { - localVarRequest.SetBasicAuth(auth.UserName, auth.Password) - } - } for header, value := range c.cfg.DefaultHeader { diff --git a/generated/slo/configuration.go b/generated/slo/configuration.go index 2df8d268c..3064eeeb4 100644 --- a/generated/slo/configuration.go +++ b/generated/slo/configuration.go @@ -3,7 +3,7 @@ SLOs OpenAPI schema for SLOs endpoints -API version: 1.0 +API version: 1.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -28,12 +28,6 @@ func (c contextKey) String() string { } var ( - // ContextBasicAuth takes BasicAuth as authentication for the request. - ContextBasicAuth = contextKey("basic") - - // ContextAPIKeys takes a string apikey as authentication for the request - ContextAPIKeys = contextKey("apiKeys") - // ContextServerIndex uses a server configuration from the index. ContextServerIndex = contextKey("serverIndex") @@ -96,24 +90,17 @@ func NewConfiguration() *Configuration { Debug: false, Servers: ServerConfigurations{ { - URL: "http://localhost:5601", - Description: "local", - }, - }, - OperationServers: map[string]ServerConfigurations{ - "SloAPIService.CreateSloOp": { - { - URL: "https://localhost:5601", - Description: "No description provided", - }, - }, - "SloAPIService.DeleteSloInstancesOp": { - { - URL: "https://localhost:5601", - Description: "No description provided", + URL: "https://{kibana_url}", + Description: "No description provided", + Variables: map[string]ServerVariable{ + "kibana_url": ServerVariable{ + Description: "No description provided", + DefaultValue: "localhost:5601", + }, }, }, }, + OperationServers: map[string]ServerConfigurations{}, } return cfg } diff --git a/generated/slo/docs/CreateSloRequest.md b/generated/slo/docs/CreateSloRequest.md index e8b5ec1bc..492603b08 100644 --- a/generated/slo/docs/CreateSloRequest.md +++ b/generated/slo/docs/CreateSloRequest.md @@ -12,7 +12,7 @@ Name | Type | Description | Notes **BudgetingMethod** | [**BudgetingMethod**](BudgetingMethod.md) | | **Objective** | [**Objective**](Objective.md) | | **Settings** | Pointer to [**Settings**](Settings.md) | | [optional] -**GroupBy** | Pointer to [**SloResponseGroupBy**](SloResponseGroupBy.md) | | [optional] +**GroupBy** | Pointer to [**GroupBy**](GroupBy.md) | | [optional] **Tags** | Pointer to **[]string** | List of tags | [optional] ## Methods @@ -206,20 +206,20 @@ HasSettings returns a boolean if a field has been set. ### GetGroupBy -`func (o *CreateSloRequest) GetGroupBy() SloResponseGroupBy` +`func (o *CreateSloRequest) GetGroupBy() GroupBy` GetGroupBy returns the GroupBy field if non-nil, zero value otherwise. ### GetGroupByOk -`func (o *CreateSloRequest) GetGroupByOk() (*SloResponseGroupBy, bool)` +`func (o *CreateSloRequest) GetGroupByOk() (*GroupBy, bool)` GetGroupByOk returns a tuple with the GroupBy field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetGroupBy -`func (o *CreateSloRequest) SetGroupBy(v SloResponseGroupBy)` +`func (o *CreateSloRequest) SetGroupBy(v GroupBy)` SetGroupBy sets GroupBy field to given value. diff --git a/generated/slo/docs/Filter.md b/generated/slo/docs/Filter.md new file mode 100644 index 000000000..291be3dd6 --- /dev/null +++ b/generated/slo/docs/Filter.md @@ -0,0 +1,82 @@ +# Filter + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Query** | Pointer to **map[string]interface{}** | | [optional] +**Meta** | Pointer to [**FilterMeta**](FilterMeta.md) | | [optional] + +## Methods + +### NewFilter + +`func NewFilter() *Filter` + +NewFilter instantiates a new Filter 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 + +### NewFilterWithDefaults + +`func NewFilterWithDefaults() *Filter` + +NewFilterWithDefaults instantiates a new Filter 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 + +### GetQuery + +`func (o *Filter) GetQuery() map[string]interface{}` + +GetQuery returns the Query field if non-nil, zero value otherwise. + +### GetQueryOk + +`func (o *Filter) GetQueryOk() (*map[string]interface{}, 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 *Filter) SetQuery(v map[string]interface{})` + +SetQuery sets Query field to given value. + +### HasQuery + +`func (o *Filter) HasQuery() bool` + +HasQuery returns a boolean if a field has been set. + +### GetMeta + +`func (o *Filter) GetMeta() FilterMeta` + +GetMeta returns the Meta field if non-nil, zero value otherwise. + +### GetMetaOk + +`func (o *Filter) GetMetaOk() (*FilterMeta, bool)` + +GetMetaOk returns a tuple with the Meta field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMeta + +`func (o *Filter) SetMeta(v FilterMeta)` + +SetMeta sets Meta field to given value. + +### HasMeta + +`func (o *Filter) HasMeta() bool` + +HasMeta 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/generated/slo/docs/FilterMeta.md b/generated/slo/docs/FilterMeta.md new file mode 100644 index 000000000..eea21e171 --- /dev/null +++ b/generated/slo/docs/FilterMeta.md @@ -0,0 +1,352 @@ +# FilterMeta + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Alias** | Pointer to **NullableString** | | [optional] +**Disabled** | Pointer to **bool** | | [optional] +**Negate** | Pointer to **bool** | | [optional] +**ControlledBy** | Pointer to **string** | | [optional] +**Group** | Pointer to **string** | | [optional] +**Index** | Pointer to **string** | | [optional] +**IsMultiIndex** | Pointer to **bool** | | [optional] +**Type** | Pointer to **string** | | [optional] +**Key** | Pointer to **string** | | [optional] +**Params** | Pointer to **map[string]interface{}** | | [optional] +**Value** | Pointer to **string** | | [optional] +**Field** | Pointer to **string** | | [optional] + +## Methods + +### NewFilterMeta + +`func NewFilterMeta() *FilterMeta` + +NewFilterMeta instantiates a new FilterMeta 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 + +### NewFilterMetaWithDefaults + +`func NewFilterMetaWithDefaults() *FilterMeta` + +NewFilterMetaWithDefaults instantiates a new FilterMeta 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 + +### GetAlias + +`func (o *FilterMeta) GetAlias() string` + +GetAlias returns the Alias field if non-nil, zero value otherwise. + +### GetAliasOk + +`func (o *FilterMeta) GetAliasOk() (*string, bool)` + +GetAliasOk returns a tuple with the Alias field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAlias + +`func (o *FilterMeta) SetAlias(v string)` + +SetAlias sets Alias field to given value. + +### HasAlias + +`func (o *FilterMeta) HasAlias() bool` + +HasAlias returns a boolean if a field has been set. + +### SetAliasNil + +`func (o *FilterMeta) SetAliasNil(b bool)` + + SetAliasNil sets the value for Alias to be an explicit nil + +### UnsetAlias +`func (o *FilterMeta) UnsetAlias()` + +UnsetAlias ensures that no value is present for Alias, not even an explicit nil +### GetDisabled + +`func (o *FilterMeta) GetDisabled() bool` + +GetDisabled returns the Disabled field if non-nil, zero value otherwise. + +### GetDisabledOk + +`func (o *FilterMeta) GetDisabledOk() (*bool, bool)` + +GetDisabledOk returns a tuple with the Disabled field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDisabled + +`func (o *FilterMeta) SetDisabled(v bool)` + +SetDisabled sets Disabled field to given value. + +### HasDisabled + +`func (o *FilterMeta) HasDisabled() bool` + +HasDisabled returns a boolean if a field has been set. + +### GetNegate + +`func (o *FilterMeta) GetNegate() bool` + +GetNegate returns the Negate field if non-nil, zero value otherwise. + +### GetNegateOk + +`func (o *FilterMeta) GetNegateOk() (*bool, bool)` + +GetNegateOk returns a tuple with the Negate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNegate + +`func (o *FilterMeta) SetNegate(v bool)` + +SetNegate sets Negate field to given value. + +### HasNegate + +`func (o *FilterMeta) HasNegate() bool` + +HasNegate returns a boolean if a field has been set. + +### GetControlledBy + +`func (o *FilterMeta) GetControlledBy() string` + +GetControlledBy returns the ControlledBy field if non-nil, zero value otherwise. + +### GetControlledByOk + +`func (o *FilterMeta) GetControlledByOk() (*string, bool)` + +GetControlledByOk returns a tuple with the ControlledBy field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetControlledBy + +`func (o *FilterMeta) SetControlledBy(v string)` + +SetControlledBy sets ControlledBy field to given value. + +### HasControlledBy + +`func (o *FilterMeta) HasControlledBy() bool` + +HasControlledBy returns a boolean if a field has been set. + +### GetGroup + +`func (o *FilterMeta) GetGroup() string` + +GetGroup returns the Group field if non-nil, zero value otherwise. + +### GetGroupOk + +`func (o *FilterMeta) GetGroupOk() (*string, bool)` + +GetGroupOk returns a tuple with the Group field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGroup + +`func (o *FilterMeta) SetGroup(v string)` + +SetGroup sets Group field to given value. + +### HasGroup + +`func (o *FilterMeta) HasGroup() bool` + +HasGroup returns a boolean if a field has been set. + +### GetIndex + +`func (o *FilterMeta) GetIndex() string` + +GetIndex returns the Index field if non-nil, zero value otherwise. + +### GetIndexOk + +`func (o *FilterMeta) GetIndexOk() (*string, bool)` + +GetIndexOk returns a tuple with the Index field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIndex + +`func (o *FilterMeta) SetIndex(v string)` + +SetIndex sets Index field to given value. + +### HasIndex + +`func (o *FilterMeta) HasIndex() bool` + +HasIndex returns a boolean if a field has been set. + +### GetIsMultiIndex + +`func (o *FilterMeta) GetIsMultiIndex() bool` + +GetIsMultiIndex returns the IsMultiIndex field if non-nil, zero value otherwise. + +### GetIsMultiIndexOk + +`func (o *FilterMeta) GetIsMultiIndexOk() (*bool, bool)` + +GetIsMultiIndexOk returns a tuple with the IsMultiIndex field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsMultiIndex + +`func (o *FilterMeta) SetIsMultiIndex(v bool)` + +SetIsMultiIndex sets IsMultiIndex field to given value. + +### HasIsMultiIndex + +`func (o *FilterMeta) HasIsMultiIndex() bool` + +HasIsMultiIndex returns a boolean if a field has been set. + +### GetType + +`func (o *FilterMeta) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *FilterMeta) GetTypeOk() (*string, 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 *FilterMeta) SetType(v string)` + +SetType sets Type field to given value. + +### HasType + +`func (o *FilterMeta) HasType() bool` + +HasType returns a boolean if a field has been set. + +### GetKey + +`func (o *FilterMeta) GetKey() string` + +GetKey returns the Key field if non-nil, zero value otherwise. + +### GetKeyOk + +`func (o *FilterMeta) GetKeyOk() (*string, bool)` + +GetKeyOk returns a tuple with the Key field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetKey + +`func (o *FilterMeta) SetKey(v string)` + +SetKey sets Key field to given value. + +### HasKey + +`func (o *FilterMeta) HasKey() bool` + +HasKey returns a boolean if a field has been set. + +### GetParams + +`func (o *FilterMeta) GetParams() map[string]interface{}` + +GetParams returns the Params field if non-nil, zero value otherwise. + +### GetParamsOk + +`func (o *FilterMeta) GetParamsOk() (*map[string]interface{}, bool)` + +GetParamsOk returns a tuple with the Params field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetParams + +`func (o *FilterMeta) SetParams(v map[string]interface{})` + +SetParams sets Params field to given value. + +### HasParams + +`func (o *FilterMeta) HasParams() bool` + +HasParams returns a boolean if a field has been set. + +### GetValue + +`func (o *FilterMeta) GetValue() string` + +GetValue returns the Value field if non-nil, zero value otherwise. + +### GetValueOk + +`func (o *FilterMeta) GetValueOk() (*string, bool)` + +GetValueOk returns a tuple with the Value field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetValue + +`func (o *FilterMeta) SetValue(v string)` + +SetValue sets Value field to given value. + +### HasValue + +`func (o *FilterMeta) HasValue() bool` + +HasValue returns a boolean if a field has been set. + +### GetField + +`func (o *FilterMeta) GetField() string` + +GetField returns the Field field if non-nil, zero value otherwise. + +### GetFieldOk + +`func (o *FilterMeta) GetFieldOk() (*string, bool)` + +GetFieldOk returns a tuple with the Field field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetField + +`func (o *FilterMeta) SetField(v string)` + +SetField sets Field field to given value. + +### HasField + +`func (o *FilterMeta) HasField() bool` + +HasField 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/generated/slo/docs/FindSloDefinitionsResponse.md b/generated/slo/docs/FindSloDefinitionsResponse.md new file mode 100644 index 000000000..5774f4339 --- /dev/null +++ b/generated/slo/docs/FindSloDefinitionsResponse.md @@ -0,0 +1,186 @@ +# FindSloDefinitionsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Page** | Pointer to **float64** | for backward compability | [optional] [default to 1] +**PerPage** | Pointer to **float64** | for backward compability | [optional] +**Total** | Pointer to **float64** | | [optional] +**Results** | Pointer to [**[]SloWithSummaryResponse**](SloWithSummaryResponse.md) | | [optional] +**Size** | Pointer to **float64** | | [optional] +**SearchAfter** | Pointer to **[]string** | the cursor to provide to get the next paged results | [optional] + +## Methods + +### NewFindSloDefinitionsResponse + +`func NewFindSloDefinitionsResponse() *FindSloDefinitionsResponse` + +NewFindSloDefinitionsResponse instantiates a new FindSloDefinitionsResponse 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 + +### NewFindSloDefinitionsResponseWithDefaults + +`func NewFindSloDefinitionsResponseWithDefaults() *FindSloDefinitionsResponse` + +NewFindSloDefinitionsResponseWithDefaults instantiates a new FindSloDefinitionsResponse 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 + +### GetPage + +`func (o *FindSloDefinitionsResponse) GetPage() float64` + +GetPage returns the Page field if non-nil, zero value otherwise. + +### GetPageOk + +`func (o *FindSloDefinitionsResponse) GetPageOk() (*float64, bool)` + +GetPageOk returns a tuple with the Page field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPage + +`func (o *FindSloDefinitionsResponse) SetPage(v float64)` + +SetPage sets Page field to given value. + +### HasPage + +`func (o *FindSloDefinitionsResponse) HasPage() bool` + +HasPage returns a boolean if a field has been set. + +### GetPerPage + +`func (o *FindSloDefinitionsResponse) GetPerPage() float64` + +GetPerPage returns the PerPage field if non-nil, zero value otherwise. + +### GetPerPageOk + +`func (o *FindSloDefinitionsResponse) GetPerPageOk() (*float64, bool)` + +GetPerPageOk returns a tuple with the PerPage field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPerPage + +`func (o *FindSloDefinitionsResponse) SetPerPage(v float64)` + +SetPerPage sets PerPage field to given value. + +### HasPerPage + +`func (o *FindSloDefinitionsResponse) HasPerPage() bool` + +HasPerPage returns a boolean if a field has been set. + +### GetTotal + +`func (o *FindSloDefinitionsResponse) GetTotal() float64` + +GetTotal returns the Total field if non-nil, zero value otherwise. + +### GetTotalOk + +`func (o *FindSloDefinitionsResponse) GetTotalOk() (*float64, bool)` + +GetTotalOk returns a tuple with the Total field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTotal + +`func (o *FindSloDefinitionsResponse) SetTotal(v float64)` + +SetTotal sets Total field to given value. + +### HasTotal + +`func (o *FindSloDefinitionsResponse) HasTotal() bool` + +HasTotal returns a boolean if a field has been set. + +### GetResults + +`func (o *FindSloDefinitionsResponse) GetResults() []SloWithSummaryResponse` + +GetResults returns the Results field if non-nil, zero value otherwise. + +### GetResultsOk + +`func (o *FindSloDefinitionsResponse) GetResultsOk() (*[]SloWithSummaryResponse, bool)` + +GetResultsOk returns a tuple with the Results field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetResults + +`func (o *FindSloDefinitionsResponse) SetResults(v []SloWithSummaryResponse)` + +SetResults sets Results field to given value. + +### HasResults + +`func (o *FindSloDefinitionsResponse) HasResults() bool` + +HasResults returns a boolean if a field has been set. + +### GetSize + +`func (o *FindSloDefinitionsResponse) GetSize() float64` + +GetSize returns the Size field if non-nil, zero value otherwise. + +### GetSizeOk + +`func (o *FindSloDefinitionsResponse) GetSizeOk() (*float64, bool)` + +GetSizeOk returns a tuple with the Size field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSize + +`func (o *FindSloDefinitionsResponse) SetSize(v float64)` + +SetSize sets Size field to given value. + +### HasSize + +`func (o *FindSloDefinitionsResponse) HasSize() bool` + +HasSize returns a boolean if a field has been set. + +### GetSearchAfter + +`func (o *FindSloDefinitionsResponse) GetSearchAfter() []string` + +GetSearchAfter returns the SearchAfter field if non-nil, zero value otherwise. + +### GetSearchAfterOk + +`func (o *FindSloDefinitionsResponse) GetSearchAfterOk() (*[]string, bool)` + +GetSearchAfterOk returns a tuple with the SearchAfter field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSearchAfter + +`func (o *FindSloDefinitionsResponse) SetSearchAfter(v []string)` + +SetSearchAfter sets SearchAfter field to given value. + +### HasSearchAfter + +`func (o *FindSloDefinitionsResponse) HasSearchAfter() bool` + +HasSearchAfter 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/generated/slo/docs/FindSloDefinitionsResponseOneOf.md b/generated/slo/docs/FindSloDefinitionsResponseOneOf.md new file mode 100644 index 000000000..7c10f87c4 --- /dev/null +++ b/generated/slo/docs/FindSloDefinitionsResponseOneOf.md @@ -0,0 +1,134 @@ +# FindSloDefinitionsResponseOneOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Page** | Pointer to **float64** | | [optional] +**PerPage** | Pointer to **float64** | | [optional] +**Total** | Pointer to **float64** | | [optional] +**Results** | Pointer to [**[]SloWithSummaryResponse**](SloWithSummaryResponse.md) | | [optional] + +## Methods + +### NewFindSloDefinitionsResponseOneOf + +`func NewFindSloDefinitionsResponseOneOf() *FindSloDefinitionsResponseOneOf` + +NewFindSloDefinitionsResponseOneOf instantiates a new FindSloDefinitionsResponseOneOf 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 + +### NewFindSloDefinitionsResponseOneOfWithDefaults + +`func NewFindSloDefinitionsResponseOneOfWithDefaults() *FindSloDefinitionsResponseOneOf` + +NewFindSloDefinitionsResponseOneOfWithDefaults instantiates a new FindSloDefinitionsResponseOneOf 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 + +### GetPage + +`func (o *FindSloDefinitionsResponseOneOf) GetPage() float64` + +GetPage returns the Page field if non-nil, zero value otherwise. + +### GetPageOk + +`func (o *FindSloDefinitionsResponseOneOf) GetPageOk() (*float64, bool)` + +GetPageOk returns a tuple with the Page field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPage + +`func (o *FindSloDefinitionsResponseOneOf) SetPage(v float64)` + +SetPage sets Page field to given value. + +### HasPage + +`func (o *FindSloDefinitionsResponseOneOf) HasPage() bool` + +HasPage returns a boolean if a field has been set. + +### GetPerPage + +`func (o *FindSloDefinitionsResponseOneOf) GetPerPage() float64` + +GetPerPage returns the PerPage field if non-nil, zero value otherwise. + +### GetPerPageOk + +`func (o *FindSloDefinitionsResponseOneOf) GetPerPageOk() (*float64, bool)` + +GetPerPageOk returns a tuple with the PerPage field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPerPage + +`func (o *FindSloDefinitionsResponseOneOf) SetPerPage(v float64)` + +SetPerPage sets PerPage field to given value. + +### HasPerPage + +`func (o *FindSloDefinitionsResponseOneOf) HasPerPage() bool` + +HasPerPage returns a boolean if a field has been set. + +### GetTotal + +`func (o *FindSloDefinitionsResponseOneOf) GetTotal() float64` + +GetTotal returns the Total field if non-nil, zero value otherwise. + +### GetTotalOk + +`func (o *FindSloDefinitionsResponseOneOf) GetTotalOk() (*float64, bool)` + +GetTotalOk returns a tuple with the Total field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTotal + +`func (o *FindSloDefinitionsResponseOneOf) SetTotal(v float64)` + +SetTotal sets Total field to given value. + +### HasTotal + +`func (o *FindSloDefinitionsResponseOneOf) HasTotal() bool` + +HasTotal returns a boolean if a field has been set. + +### GetResults + +`func (o *FindSloDefinitionsResponseOneOf) GetResults() []SloWithSummaryResponse` + +GetResults returns the Results field if non-nil, zero value otherwise. + +### GetResultsOk + +`func (o *FindSloDefinitionsResponseOneOf) GetResultsOk() (*[]SloWithSummaryResponse, bool)` + +GetResultsOk returns a tuple with the Results field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetResults + +`func (o *FindSloDefinitionsResponseOneOf) SetResults(v []SloWithSummaryResponse)` + +SetResults sets Results field to given value. + +### HasResults + +`func (o *FindSloDefinitionsResponseOneOf) HasResults() bool` + +HasResults 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/generated/slo/docs/FindSloDefinitionsResponseOneOf1.md b/generated/slo/docs/FindSloDefinitionsResponseOneOf1.md new file mode 100644 index 000000000..ee6e5ae94 --- /dev/null +++ b/generated/slo/docs/FindSloDefinitionsResponseOneOf1.md @@ -0,0 +1,186 @@ +# FindSloDefinitionsResponseOneOf1 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Page** | Pointer to **float64** | for backward compability | [optional] [default to 1] +**PerPage** | Pointer to **float64** | for backward compability | [optional] +**Size** | Pointer to **float64** | | [optional] +**SearchAfter** | Pointer to **[]string** | the cursor to provide to get the next paged results | [optional] +**Total** | Pointer to **float64** | | [optional] +**Results** | Pointer to [**[]SloWithSummaryResponse**](SloWithSummaryResponse.md) | | [optional] + +## Methods + +### NewFindSloDefinitionsResponseOneOf1 + +`func NewFindSloDefinitionsResponseOneOf1() *FindSloDefinitionsResponseOneOf1` + +NewFindSloDefinitionsResponseOneOf1 instantiates a new FindSloDefinitionsResponseOneOf1 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 + +### NewFindSloDefinitionsResponseOneOf1WithDefaults + +`func NewFindSloDefinitionsResponseOneOf1WithDefaults() *FindSloDefinitionsResponseOneOf1` + +NewFindSloDefinitionsResponseOneOf1WithDefaults instantiates a new FindSloDefinitionsResponseOneOf1 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 + +### GetPage + +`func (o *FindSloDefinitionsResponseOneOf1) GetPage() float64` + +GetPage returns the Page field if non-nil, zero value otherwise. + +### GetPageOk + +`func (o *FindSloDefinitionsResponseOneOf1) GetPageOk() (*float64, bool)` + +GetPageOk returns a tuple with the Page field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPage + +`func (o *FindSloDefinitionsResponseOneOf1) SetPage(v float64)` + +SetPage sets Page field to given value. + +### HasPage + +`func (o *FindSloDefinitionsResponseOneOf1) HasPage() bool` + +HasPage returns a boolean if a field has been set. + +### GetPerPage + +`func (o *FindSloDefinitionsResponseOneOf1) GetPerPage() float64` + +GetPerPage returns the PerPage field if non-nil, zero value otherwise. + +### GetPerPageOk + +`func (o *FindSloDefinitionsResponseOneOf1) GetPerPageOk() (*float64, bool)` + +GetPerPageOk returns a tuple with the PerPage field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPerPage + +`func (o *FindSloDefinitionsResponseOneOf1) SetPerPage(v float64)` + +SetPerPage sets PerPage field to given value. + +### HasPerPage + +`func (o *FindSloDefinitionsResponseOneOf1) HasPerPage() bool` + +HasPerPage returns a boolean if a field has been set. + +### GetSize + +`func (o *FindSloDefinitionsResponseOneOf1) GetSize() float64` + +GetSize returns the Size field if non-nil, zero value otherwise. + +### GetSizeOk + +`func (o *FindSloDefinitionsResponseOneOf1) GetSizeOk() (*float64, bool)` + +GetSizeOk returns a tuple with the Size field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSize + +`func (o *FindSloDefinitionsResponseOneOf1) SetSize(v float64)` + +SetSize sets Size field to given value. + +### HasSize + +`func (o *FindSloDefinitionsResponseOneOf1) HasSize() bool` + +HasSize returns a boolean if a field has been set. + +### GetSearchAfter + +`func (o *FindSloDefinitionsResponseOneOf1) GetSearchAfter() []string` + +GetSearchAfter returns the SearchAfter field if non-nil, zero value otherwise. + +### GetSearchAfterOk + +`func (o *FindSloDefinitionsResponseOneOf1) GetSearchAfterOk() (*[]string, bool)` + +GetSearchAfterOk returns a tuple with the SearchAfter field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSearchAfter + +`func (o *FindSloDefinitionsResponseOneOf1) SetSearchAfter(v []string)` + +SetSearchAfter sets SearchAfter field to given value. + +### HasSearchAfter + +`func (o *FindSloDefinitionsResponseOneOf1) HasSearchAfter() bool` + +HasSearchAfter returns a boolean if a field has been set. + +### GetTotal + +`func (o *FindSloDefinitionsResponseOneOf1) GetTotal() float64` + +GetTotal returns the Total field if non-nil, zero value otherwise. + +### GetTotalOk + +`func (o *FindSloDefinitionsResponseOneOf1) GetTotalOk() (*float64, bool)` + +GetTotalOk returns a tuple with the Total field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTotal + +`func (o *FindSloDefinitionsResponseOneOf1) SetTotal(v float64)` + +SetTotal sets Total field to given value. + +### HasTotal + +`func (o *FindSloDefinitionsResponseOneOf1) HasTotal() bool` + +HasTotal returns a boolean if a field has been set. + +### GetResults + +`func (o *FindSloDefinitionsResponseOneOf1) GetResults() []SloWithSummaryResponse` + +GetResults returns the Results field if non-nil, zero value otherwise. + +### GetResultsOk + +`func (o *FindSloDefinitionsResponseOneOf1) GetResultsOk() (*[]SloWithSummaryResponse, bool)` + +GetResultsOk returns a tuple with the Results field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetResults + +`func (o *FindSloDefinitionsResponseOneOf1) SetResults(v []SloWithSummaryResponse)` + +SetResults sets Results field to given value. + +### HasResults + +`func (o *FindSloDefinitionsResponseOneOf1) HasResults() bool` + +HasResults 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/generated/slo/docs/FindSloResponse.md b/generated/slo/docs/FindSloResponse.md index f881cfaf7..c807a23cb 100644 --- a/generated/slo/docs/FindSloResponse.md +++ b/generated/slo/docs/FindSloResponse.md @@ -4,10 +4,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**Size** | Pointer to **float64** | Size provided for cursor based pagination | [optional] +**SearchAfter** | Pointer to **string** | | [optional] **Page** | Pointer to **float64** | | [optional] **PerPage** | Pointer to **float64** | | [optional] **Total** | Pointer to **float64** | | [optional] -**Results** | Pointer to [**[]SloResponse**](SloResponse.md) | | [optional] +**Results** | Pointer to [**[]SloWithSummaryResponse**](SloWithSummaryResponse.md) | | [optional] ## Methods @@ -28,6 +30,56 @@ NewFindSloResponseWithDefaults instantiates a new FindSloResponse 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 +### GetSize + +`func (o *FindSloResponse) GetSize() float64` + +GetSize returns the Size field if non-nil, zero value otherwise. + +### GetSizeOk + +`func (o *FindSloResponse) GetSizeOk() (*float64, bool)` + +GetSizeOk returns a tuple with the Size field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSize + +`func (o *FindSloResponse) SetSize(v float64)` + +SetSize sets Size field to given value. + +### HasSize + +`func (o *FindSloResponse) HasSize() bool` + +HasSize returns a boolean if a field has been set. + +### GetSearchAfter + +`func (o *FindSloResponse) GetSearchAfter() string` + +GetSearchAfter returns the SearchAfter field if non-nil, zero value otherwise. + +### GetSearchAfterOk + +`func (o *FindSloResponse) GetSearchAfterOk() (*string, bool)` + +GetSearchAfterOk returns a tuple with the SearchAfter field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSearchAfter + +`func (o *FindSloResponse) SetSearchAfter(v string)` + +SetSearchAfter sets SearchAfter field to given value. + +### HasSearchAfter + +`func (o *FindSloResponse) HasSearchAfter() bool` + +HasSearchAfter returns a boolean if a field has been set. + ### GetPage `func (o *FindSloResponse) GetPage() float64` @@ -105,20 +157,20 @@ HasTotal returns a boolean if a field has been set. ### GetResults -`func (o *FindSloResponse) GetResults() []SloResponse` +`func (o *FindSloResponse) GetResults() []SloWithSummaryResponse` GetResults returns the Results field if non-nil, zero value otherwise. ### GetResultsOk -`func (o *FindSloResponse) GetResultsOk() (*[]SloResponse, bool)` +`func (o *FindSloResponse) GetResultsOk() (*[]SloWithSummaryResponse, bool)` GetResultsOk returns a tuple with the Results field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetResults -`func (o *FindSloResponse) SetResults(v []SloResponse)` +`func (o *FindSloResponse) SetResults(v []SloWithSummaryResponse)` SetResults sets Results field to given value. diff --git a/generated/slo/docs/GroupBy.md b/generated/slo/docs/GroupBy.md new file mode 100644 index 000000000..1d8f878a1 --- /dev/null +++ b/generated/slo/docs/GroupBy.md @@ -0,0 +1,30 @@ +# GroupBy + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Methods + +### NewGroupBy + +`func NewGroupBy() *GroupBy` + +NewGroupBy instantiates a new GroupBy 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 + +### NewGroupByWithDefaults + +`func NewGroupByWithDefaults() *GroupBy` + +NewGroupByWithDefaults instantiates a new GroupBy 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 + + +[[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/generated/slo/docs/IndicatorPropertiesCustomKqlParams.md b/generated/slo/docs/IndicatorPropertiesCustomKqlParams.md index 317db1569..9b044dfbf 100644 --- a/generated/slo/docs/IndicatorPropertiesCustomKqlParams.md +++ b/generated/slo/docs/IndicatorPropertiesCustomKqlParams.md @@ -5,16 +5,17 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Index** | **string** | The index or index pattern to use | -**Filter** | Pointer to **string** | the KQL query to filter the documents with. | [optional] -**Good** | **string** | the KQL query used to define the good events. | -**Total** | **string** | the KQL query used to define all events. | +**DataViewId** | Pointer to **string** | The kibana data view id to use, primarily used to include data view runtime mappings. Make sure to save SLO again if you add/update run time fields to the data view and if those fields are being used in slo queries. | [optional] +**Filter** | Pointer to [**KqlWithFilters**](KqlWithFilters.md) | | [optional] +**Good** | [**KqlWithFiltersGood**](KqlWithFiltersGood.md) | | +**Total** | [**KqlWithFiltersTotal**](KqlWithFiltersTotal.md) | | **TimestampField** | **string** | The timestamp field used in the source indice. | ## Methods ### NewIndicatorPropertiesCustomKqlParams -`func NewIndicatorPropertiesCustomKqlParams(index string, good string, total string, timestampField string, ) *IndicatorPropertiesCustomKqlParams` +`func NewIndicatorPropertiesCustomKqlParams(index string, good KqlWithFiltersGood, total KqlWithFiltersTotal, timestampField string, ) *IndicatorPropertiesCustomKqlParams` NewIndicatorPropertiesCustomKqlParams instantiates a new IndicatorPropertiesCustomKqlParams object This constructor will assign default values to properties that have it defined, @@ -49,22 +50,47 @@ and a boolean to check if the value has been set. SetIndex sets Index field to given value. +### GetDataViewId + +`func (o *IndicatorPropertiesCustomKqlParams) GetDataViewId() string` + +GetDataViewId returns the DataViewId field if non-nil, zero value otherwise. + +### GetDataViewIdOk + +`func (o *IndicatorPropertiesCustomKqlParams) GetDataViewIdOk() (*string, bool)` + +GetDataViewIdOk returns a tuple with the DataViewId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDataViewId + +`func (o *IndicatorPropertiesCustomKqlParams) SetDataViewId(v string)` + +SetDataViewId sets DataViewId field to given value. + +### HasDataViewId + +`func (o *IndicatorPropertiesCustomKqlParams) HasDataViewId() bool` + +HasDataViewId returns a boolean if a field has been set. + ### GetFilter -`func (o *IndicatorPropertiesCustomKqlParams) GetFilter() string` +`func (o *IndicatorPropertiesCustomKqlParams) GetFilter() KqlWithFilters` GetFilter returns the Filter field if non-nil, zero value otherwise. ### GetFilterOk -`func (o *IndicatorPropertiesCustomKqlParams) GetFilterOk() (*string, bool)` +`func (o *IndicatorPropertiesCustomKqlParams) GetFilterOk() (*KqlWithFilters, bool)` GetFilterOk returns a tuple with the Filter field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetFilter -`func (o *IndicatorPropertiesCustomKqlParams) SetFilter(v string)` +`func (o *IndicatorPropertiesCustomKqlParams) SetFilter(v KqlWithFilters)` SetFilter sets Filter field to given value. @@ -76,40 +102,40 @@ HasFilter returns a boolean if a field has been set. ### GetGood -`func (o *IndicatorPropertiesCustomKqlParams) GetGood() string` +`func (o *IndicatorPropertiesCustomKqlParams) GetGood() KqlWithFiltersGood` GetGood returns the Good field if non-nil, zero value otherwise. ### GetGoodOk -`func (o *IndicatorPropertiesCustomKqlParams) GetGoodOk() (*string, bool)` +`func (o *IndicatorPropertiesCustomKqlParams) GetGoodOk() (*KqlWithFiltersGood, bool)` GetGoodOk returns a tuple with the Good field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetGood -`func (o *IndicatorPropertiesCustomKqlParams) SetGood(v string)` +`func (o *IndicatorPropertiesCustomKqlParams) SetGood(v KqlWithFiltersGood)` SetGood sets Good field to given value. ### GetTotal -`func (o *IndicatorPropertiesCustomKqlParams) GetTotal() string` +`func (o *IndicatorPropertiesCustomKqlParams) GetTotal() KqlWithFiltersTotal` GetTotal returns the Total field if non-nil, zero value otherwise. ### GetTotalOk -`func (o *IndicatorPropertiesCustomKqlParams) GetTotalOk() (*string, bool)` +`func (o *IndicatorPropertiesCustomKqlParams) GetTotalOk() (*KqlWithFiltersTotal, bool)` GetTotalOk returns a tuple with the Total field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetTotal -`func (o *IndicatorPropertiesCustomKqlParams) SetTotal(v string)` +`func (o *IndicatorPropertiesCustomKqlParams) SetTotal(v KqlWithFiltersTotal)` SetTotal sets Total field to given value. diff --git a/generated/slo/docs/IndicatorPropertiesCustomMetricParams.md b/generated/slo/docs/IndicatorPropertiesCustomMetricParams.md index ea6814410..28532ea6b 100644 --- a/generated/slo/docs/IndicatorPropertiesCustomMetricParams.md +++ b/generated/slo/docs/IndicatorPropertiesCustomMetricParams.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Index** | **string** | The index or index pattern to use | +**DataViewId** | Pointer to **string** | The kibana data view id to use, primarily used to include data view runtime mappings. Make sure to save SLO again if you add/update run time fields to the data view and if those fields are being used in slo queries. | [optional] **Filter** | Pointer to **string** | the KQL query to filter the documents with. | [optional] **TimestampField** | **string** | The timestamp field used in the source indice. | **Good** | [**IndicatorPropertiesCustomMetricParamsGood**](IndicatorPropertiesCustomMetricParamsGood.md) | | @@ -49,6 +50,31 @@ and a boolean to check if the value has been set. SetIndex sets Index field to given value. +### GetDataViewId + +`func (o *IndicatorPropertiesCustomMetricParams) GetDataViewId() string` + +GetDataViewId returns the DataViewId field if non-nil, zero value otherwise. + +### GetDataViewIdOk + +`func (o *IndicatorPropertiesCustomMetricParams) GetDataViewIdOk() (*string, bool)` + +GetDataViewIdOk returns a tuple with the DataViewId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDataViewId + +`func (o *IndicatorPropertiesCustomMetricParams) SetDataViewId(v string)` + +SetDataViewId sets DataViewId field to given value. + +### HasDataViewId + +`func (o *IndicatorPropertiesCustomMetricParams) HasDataViewId() bool` + +HasDataViewId returns a boolean if a field has been set. + ### GetFilter `func (o *IndicatorPropertiesCustomMetricParams) GetFilter() string` diff --git a/generated/slo/docs/IndicatorPropertiesCustomMetricParamsGoodMetricsInner.md b/generated/slo/docs/IndicatorPropertiesCustomMetricParamsGoodMetricsInner.md index 3d485fa6c..579856e03 100644 --- a/generated/slo/docs/IndicatorPropertiesCustomMetricParamsGoodMetricsInner.md +++ b/generated/slo/docs/IndicatorPropertiesCustomMetricParamsGoodMetricsInner.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Name** | **string** | The name of the metric. Only valid options are A-Z | -**Aggregation** | **string** | The aggregation type of the metric. Only valid option is \"sum\" | +**Aggregation** | **string** | The aggregation type of the metric. | **Field** | **string** | The field of the metric. | **Filter** | Pointer to **string** | The filter to apply to the metric. | [optional] diff --git a/generated/slo/docs/IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf.md b/generated/slo/docs/IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf.md new file mode 100644 index 000000000..ec617ebd4 --- /dev/null +++ b/generated/slo/docs/IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf.md @@ -0,0 +1,119 @@ +# IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | The name of the metric. Only valid options are A-Z | +**Aggregation** | **string** | The aggregation type of the metric. | +**Field** | **string** | The field of the metric. | +**Filter** | Pointer to **string** | The filter to apply to the metric. | [optional] + +## Methods + +### NewIndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf + +`func NewIndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf(name string, aggregation string, field string, ) *IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf` + +NewIndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf instantiates a new IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf 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 + +### NewIndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOfWithDefaults + +`func NewIndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOfWithDefaults() *IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf` + +NewIndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOfWithDefaults instantiates a new IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf 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 + +### GetName + +`func (o *IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf) 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 *IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf) SetName(v string)` + +SetName sets Name field to given value. + + +### GetAggregation + +`func (o *IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf) GetAggregation() string` + +GetAggregation returns the Aggregation field if non-nil, zero value otherwise. + +### GetAggregationOk + +`func (o *IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf) GetAggregationOk() (*string, bool)` + +GetAggregationOk returns a tuple with the Aggregation field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAggregation + +`func (o *IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf) SetAggregation(v string)` + +SetAggregation sets Aggregation field to given value. + + +### GetField + +`func (o *IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf) GetField() string` + +GetField returns the Field field if non-nil, zero value otherwise. + +### GetFieldOk + +`func (o *IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf) GetFieldOk() (*string, bool)` + +GetFieldOk returns a tuple with the Field field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetField + +`func (o *IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf) SetField(v string)` + +SetField sets Field field to given value. + + +### GetFilter + +`func (o *IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf) GetFilter() string` + +GetFilter returns the Filter field if non-nil, zero value otherwise. + +### GetFilterOk + +`func (o *IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf) GetFilterOk() (*string, bool)` + +GetFilterOk returns a tuple with the Filter field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFilter + +`func (o *IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf) SetFilter(v string)` + +SetFilter sets Filter field to given value. + +### HasFilter + +`func (o *IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf) HasFilter() bool` + +HasFilter 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/generated/slo/docs/IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1.md b/generated/slo/docs/IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1.md new file mode 100644 index 000000000..4920938d9 --- /dev/null +++ b/generated/slo/docs/IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1.md @@ -0,0 +1,98 @@ +# IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | The name of the metric. Only valid options are A-Z | +**Aggregation** | **string** | The aggregation type of the metric. | +**Filter** | Pointer to **string** | The filter to apply to the metric. | [optional] + +## Methods + +### NewIndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1 + +`func NewIndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1(name string, aggregation string, ) *IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1` + +NewIndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1 instantiates a new IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1 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 + +### NewIndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1WithDefaults + +`func NewIndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1WithDefaults() *IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1` + +NewIndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1WithDefaults instantiates a new IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1 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 + +### GetName + +`func (o *IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1) 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 *IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1) SetName(v string)` + +SetName sets Name field to given value. + + +### GetAggregation + +`func (o *IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1) GetAggregation() string` + +GetAggregation returns the Aggregation field if non-nil, zero value otherwise. + +### GetAggregationOk + +`func (o *IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1) GetAggregationOk() (*string, bool)` + +GetAggregationOk returns a tuple with the Aggregation field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAggregation + +`func (o *IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1) SetAggregation(v string)` + +SetAggregation sets Aggregation field to given value. + + +### GetFilter + +`func (o *IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1) GetFilter() string` + +GetFilter returns the Filter field if non-nil, zero value otherwise. + +### GetFilterOk + +`func (o *IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1) GetFilterOk() (*string, bool)` + +GetFilterOk returns a tuple with the Filter field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFilter + +`func (o *IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1) SetFilter(v string)` + +SetFilter sets Filter field to given value. + +### HasFilter + +`func (o *IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1) HasFilter() bool` + +HasFilter 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/generated/slo/docs/IndicatorPropertiesCustomMetricParamsTotal.md b/generated/slo/docs/IndicatorPropertiesCustomMetricParamsTotal.md index 9b33ee2fe..f0f1df1af 100644 --- a/generated/slo/docs/IndicatorPropertiesCustomMetricParamsTotal.md +++ b/generated/slo/docs/IndicatorPropertiesCustomMetricParamsTotal.md @@ -4,14 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Metrics** | [**[]IndicatorPropertiesCustomMetricParamsTotalMetricsInner**](IndicatorPropertiesCustomMetricParamsTotalMetricsInner.md) | List of metrics with their name, aggregation type, and field. | +**Metrics** | [**[]IndicatorPropertiesCustomMetricParamsGoodMetricsInner**](IndicatorPropertiesCustomMetricParamsGoodMetricsInner.md) | List of metrics with their name, aggregation type, and field. | **Equation** | **string** | The equation to calculate the \"total\" metric. | ## Methods ### NewIndicatorPropertiesCustomMetricParamsTotal -`func NewIndicatorPropertiesCustomMetricParamsTotal(metrics []IndicatorPropertiesCustomMetricParamsTotalMetricsInner, equation string, ) *IndicatorPropertiesCustomMetricParamsTotal` +`func NewIndicatorPropertiesCustomMetricParamsTotal(metrics []IndicatorPropertiesCustomMetricParamsGoodMetricsInner, equation string, ) *IndicatorPropertiesCustomMetricParamsTotal` NewIndicatorPropertiesCustomMetricParamsTotal instantiates a new IndicatorPropertiesCustomMetricParamsTotal object This constructor will assign default values to properties that have it defined, @@ -28,20 +28,20 @@ but it doesn't guarantee that properties required by API are set ### GetMetrics -`func (o *IndicatorPropertiesCustomMetricParamsTotal) GetMetrics() []IndicatorPropertiesCustomMetricParamsTotalMetricsInner` +`func (o *IndicatorPropertiesCustomMetricParamsTotal) GetMetrics() []IndicatorPropertiesCustomMetricParamsGoodMetricsInner` GetMetrics returns the Metrics field if non-nil, zero value otherwise. ### GetMetricsOk -`func (o *IndicatorPropertiesCustomMetricParamsTotal) GetMetricsOk() (*[]IndicatorPropertiesCustomMetricParamsTotalMetricsInner, bool)` +`func (o *IndicatorPropertiesCustomMetricParamsTotal) GetMetricsOk() (*[]IndicatorPropertiesCustomMetricParamsGoodMetricsInner, bool)` GetMetricsOk returns a tuple with the Metrics field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetMetrics -`func (o *IndicatorPropertiesCustomMetricParamsTotal) SetMetrics(v []IndicatorPropertiesCustomMetricParamsTotalMetricsInner)` +`func (o *IndicatorPropertiesCustomMetricParamsTotal) SetMetrics(v []IndicatorPropertiesCustomMetricParamsGoodMetricsInner)` SetMetrics sets Metrics field to given value. diff --git a/generated/slo/docs/IndicatorPropertiesCustomMetricParamsTotalMetricsInner.md b/generated/slo/docs/IndicatorPropertiesCustomMetricParamsTotalMetricsInner.md index 6f528a370..ff6409aa9 100644 --- a/generated/slo/docs/IndicatorPropertiesCustomMetricParamsTotalMetricsInner.md +++ b/generated/slo/docs/IndicatorPropertiesCustomMetricParamsTotalMetricsInner.md @@ -6,14 +6,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Name** | **string** | The name of the metric. Only valid options are A-Z | **Aggregation** | **string** | The aggregation type of the metric. Only valid option is \"sum\" | -**Field** | **string** | The field of the metric. | +**Field** | Pointer to **string** | The field of the metric. | [optional] **Filter** | Pointer to **string** | The filter to apply to the metric. | [optional] ## Methods ### NewIndicatorPropertiesCustomMetricParamsTotalMetricsInner -`func NewIndicatorPropertiesCustomMetricParamsTotalMetricsInner(name string, aggregation string, field string, ) *IndicatorPropertiesCustomMetricParamsTotalMetricsInner` +`func NewIndicatorPropertiesCustomMetricParamsTotalMetricsInner(name string, aggregation string, ) *IndicatorPropertiesCustomMetricParamsTotalMetricsInner` NewIndicatorPropertiesCustomMetricParamsTotalMetricsInner instantiates a new IndicatorPropertiesCustomMetricParamsTotalMetricsInner object This constructor will assign default values to properties that have it defined, @@ -87,6 +87,11 @@ and a boolean to check if the value has been set. SetField sets Field field to given value. +### HasField + +`func (o *IndicatorPropertiesCustomMetricParamsTotalMetricsInner) HasField() bool` + +HasField returns a boolean if a field has been set. ### GetFilter diff --git a/generated/slo/docs/IndicatorPropertiesHistogramParams.md b/generated/slo/docs/IndicatorPropertiesHistogramParams.md index 89263c048..f2b432a67 100644 --- a/generated/slo/docs/IndicatorPropertiesHistogramParams.md +++ b/generated/slo/docs/IndicatorPropertiesHistogramParams.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Index** | **string** | The index or index pattern to use | +**DataViewId** | Pointer to **string** | The kibana data view id to use, primarily used to include data view runtime mappings. Make sure to save SLO again if you add/update run time fields to the data view and if those fields are being used in slo queries. | [optional] **Filter** | Pointer to **string** | the KQL query to filter the documents with. | [optional] **TimestampField** | **string** | The timestamp field used in the source indice. | **Good** | [**IndicatorPropertiesHistogramParamsGood**](IndicatorPropertiesHistogramParamsGood.md) | | @@ -49,6 +50,31 @@ and a boolean to check if the value has been set. SetIndex sets Index field to given value. +### GetDataViewId + +`func (o *IndicatorPropertiesHistogramParams) GetDataViewId() string` + +GetDataViewId returns the DataViewId field if non-nil, zero value otherwise. + +### GetDataViewIdOk + +`func (o *IndicatorPropertiesHistogramParams) GetDataViewIdOk() (*string, bool)` + +GetDataViewIdOk returns a tuple with the DataViewId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDataViewId + +`func (o *IndicatorPropertiesHistogramParams) SetDataViewId(v string)` + +SetDataViewId sets DataViewId field to given value. + +### HasDataViewId + +`func (o *IndicatorPropertiesHistogramParams) HasDataViewId() bool` + +HasDataViewId returns a boolean if a field has been set. + ### GetFilter `func (o *IndicatorPropertiesHistogramParams) GetFilter() string` diff --git a/generated/slo/docs/IndicatorPropertiesTimesliceMetricParams.md b/generated/slo/docs/IndicatorPropertiesTimesliceMetricParams.md index ad08d9256..89e8825c0 100644 --- a/generated/slo/docs/IndicatorPropertiesTimesliceMetricParams.md +++ b/generated/slo/docs/IndicatorPropertiesTimesliceMetricParams.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Index** | **string** | The index or index pattern to use | +**DataViewId** | Pointer to **string** | The kibana data view id to use, primarily used to include data view runtime mappings. Make sure to save SLO again if you add/update run time fields to the data view and if those fields are being used in slo queries. | [optional] **Filter** | Pointer to **string** | the KQL query to filter the documents with. | [optional] **TimestampField** | **string** | The timestamp field used in the source indice. | **Metric** | [**IndicatorPropertiesTimesliceMetricParamsMetric**](IndicatorPropertiesTimesliceMetricParamsMetric.md) | | @@ -48,6 +49,31 @@ and a boolean to check if the value has been set. SetIndex sets Index field to given value. +### GetDataViewId + +`func (o *IndicatorPropertiesTimesliceMetricParams) GetDataViewId() string` + +GetDataViewId returns the DataViewId field if non-nil, zero value otherwise. + +### GetDataViewIdOk + +`func (o *IndicatorPropertiesTimesliceMetricParams) GetDataViewIdOk() (*string, bool)` + +GetDataViewIdOk returns a tuple with the DataViewId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDataViewId + +`func (o *IndicatorPropertiesTimesliceMetricParams) SetDataViewId(v string)` + +SetDataViewId sets DataViewId field to given value. + +### HasDataViewId + +`func (o *IndicatorPropertiesTimesliceMetricParams) HasDataViewId() bool` + +HasDataViewId returns a boolean if a field has been set. + ### GetFilter `func (o *IndicatorPropertiesTimesliceMetricParams) GetFilter() string` diff --git a/generated/slo/docs/KqlWithFilters.md b/generated/slo/docs/KqlWithFilters.md new file mode 100644 index 000000000..bf349231e --- /dev/null +++ b/generated/slo/docs/KqlWithFilters.md @@ -0,0 +1,82 @@ +# KqlWithFilters + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**KqlQuery** | Pointer to **string** | | [optional] +**Filters** | Pointer to [**[]Filter**](Filter.md) | | [optional] + +## Methods + +### NewKqlWithFilters + +`func NewKqlWithFilters() *KqlWithFilters` + +NewKqlWithFilters instantiates a new KqlWithFilters 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 + +### NewKqlWithFiltersWithDefaults + +`func NewKqlWithFiltersWithDefaults() *KqlWithFilters` + +NewKqlWithFiltersWithDefaults instantiates a new KqlWithFilters 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 + +### GetKqlQuery + +`func (o *KqlWithFilters) GetKqlQuery() string` + +GetKqlQuery returns the KqlQuery field if non-nil, zero value otherwise. + +### GetKqlQueryOk + +`func (o *KqlWithFilters) GetKqlQueryOk() (*string, bool)` + +GetKqlQueryOk returns a tuple with the KqlQuery field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetKqlQuery + +`func (o *KqlWithFilters) SetKqlQuery(v string)` + +SetKqlQuery sets KqlQuery field to given value. + +### HasKqlQuery + +`func (o *KqlWithFilters) HasKqlQuery() bool` + +HasKqlQuery returns a boolean if a field has been set. + +### GetFilters + +`func (o *KqlWithFilters) GetFilters() []Filter` + +GetFilters returns the Filters field if non-nil, zero value otherwise. + +### GetFiltersOk + +`func (o *KqlWithFilters) GetFiltersOk() (*[]Filter, bool)` + +GetFiltersOk returns a tuple with the Filters field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFilters + +`func (o *KqlWithFilters) SetFilters(v []Filter)` + +SetFilters sets Filters field to given value. + +### HasFilters + +`func (o *KqlWithFilters) HasFilters() bool` + +HasFilters 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/generated/slo/docs/KqlWithFiltersGood.md b/generated/slo/docs/KqlWithFiltersGood.md new file mode 100644 index 000000000..9fb63f991 --- /dev/null +++ b/generated/slo/docs/KqlWithFiltersGood.md @@ -0,0 +1,82 @@ +# KqlWithFiltersGood + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**KqlQuery** | Pointer to **string** | | [optional] +**Filters** | Pointer to [**[]Filter**](Filter.md) | | [optional] + +## Methods + +### NewKqlWithFiltersGood + +`func NewKqlWithFiltersGood() *KqlWithFiltersGood` + +NewKqlWithFiltersGood instantiates a new KqlWithFiltersGood 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 + +### NewKqlWithFiltersGoodWithDefaults + +`func NewKqlWithFiltersGoodWithDefaults() *KqlWithFiltersGood` + +NewKqlWithFiltersGoodWithDefaults instantiates a new KqlWithFiltersGood 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 + +### GetKqlQuery + +`func (o *KqlWithFiltersGood) GetKqlQuery() string` + +GetKqlQuery returns the KqlQuery field if non-nil, zero value otherwise. + +### GetKqlQueryOk + +`func (o *KqlWithFiltersGood) GetKqlQueryOk() (*string, bool)` + +GetKqlQueryOk returns a tuple with the KqlQuery field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetKqlQuery + +`func (o *KqlWithFiltersGood) SetKqlQuery(v string)` + +SetKqlQuery sets KqlQuery field to given value. + +### HasKqlQuery + +`func (o *KqlWithFiltersGood) HasKqlQuery() bool` + +HasKqlQuery returns a boolean if a field has been set. + +### GetFilters + +`func (o *KqlWithFiltersGood) GetFilters() []Filter` + +GetFilters returns the Filters field if non-nil, zero value otherwise. + +### GetFiltersOk + +`func (o *KqlWithFiltersGood) GetFiltersOk() (*[]Filter, bool)` + +GetFiltersOk returns a tuple with the Filters field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFilters + +`func (o *KqlWithFiltersGood) SetFilters(v []Filter)` + +SetFilters sets Filters field to given value. + +### HasFilters + +`func (o *KqlWithFiltersGood) HasFilters() bool` + +HasFilters 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/generated/slo/docs/KqlWithFiltersOneOf.md b/generated/slo/docs/KqlWithFiltersOneOf.md new file mode 100644 index 000000000..335fe503a --- /dev/null +++ b/generated/slo/docs/KqlWithFiltersOneOf.md @@ -0,0 +1,82 @@ +# KqlWithFiltersOneOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**KqlQuery** | Pointer to **string** | | [optional] +**Filters** | Pointer to [**[]Filter**](Filter.md) | | [optional] + +## Methods + +### NewKqlWithFiltersOneOf + +`func NewKqlWithFiltersOneOf() *KqlWithFiltersOneOf` + +NewKqlWithFiltersOneOf instantiates a new KqlWithFiltersOneOf 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 + +### NewKqlWithFiltersOneOfWithDefaults + +`func NewKqlWithFiltersOneOfWithDefaults() *KqlWithFiltersOneOf` + +NewKqlWithFiltersOneOfWithDefaults instantiates a new KqlWithFiltersOneOf 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 + +### GetKqlQuery + +`func (o *KqlWithFiltersOneOf) GetKqlQuery() string` + +GetKqlQuery returns the KqlQuery field if non-nil, zero value otherwise. + +### GetKqlQueryOk + +`func (o *KqlWithFiltersOneOf) GetKqlQueryOk() (*string, bool)` + +GetKqlQueryOk returns a tuple with the KqlQuery field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetKqlQuery + +`func (o *KqlWithFiltersOneOf) SetKqlQuery(v string)` + +SetKqlQuery sets KqlQuery field to given value. + +### HasKqlQuery + +`func (o *KqlWithFiltersOneOf) HasKqlQuery() bool` + +HasKqlQuery returns a boolean if a field has been set. + +### GetFilters + +`func (o *KqlWithFiltersOneOf) GetFilters() []Filter` + +GetFilters returns the Filters field if non-nil, zero value otherwise. + +### GetFiltersOk + +`func (o *KqlWithFiltersOneOf) GetFiltersOk() (*[]Filter, bool)` + +GetFiltersOk returns a tuple with the Filters field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFilters + +`func (o *KqlWithFiltersOneOf) SetFilters(v []Filter)` + +SetFilters sets Filters field to given value. + +### HasFilters + +`func (o *KqlWithFiltersOneOf) HasFilters() bool` + +HasFilters 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/generated/slo/docs/KqlWithFiltersTotal.md b/generated/slo/docs/KqlWithFiltersTotal.md new file mode 100644 index 000000000..afb7e2072 --- /dev/null +++ b/generated/slo/docs/KqlWithFiltersTotal.md @@ -0,0 +1,82 @@ +# KqlWithFiltersTotal + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**KqlQuery** | Pointer to **string** | | [optional] +**Filters** | Pointer to [**[]Filter**](Filter.md) | | [optional] + +## Methods + +### NewKqlWithFiltersTotal + +`func NewKqlWithFiltersTotal() *KqlWithFiltersTotal` + +NewKqlWithFiltersTotal instantiates a new KqlWithFiltersTotal 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 + +### NewKqlWithFiltersTotalWithDefaults + +`func NewKqlWithFiltersTotalWithDefaults() *KqlWithFiltersTotal` + +NewKqlWithFiltersTotalWithDefaults instantiates a new KqlWithFiltersTotal 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 + +### GetKqlQuery + +`func (o *KqlWithFiltersTotal) GetKqlQuery() string` + +GetKqlQuery returns the KqlQuery field if non-nil, zero value otherwise. + +### GetKqlQueryOk + +`func (o *KqlWithFiltersTotal) GetKqlQueryOk() (*string, bool)` + +GetKqlQueryOk returns a tuple with the KqlQuery field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetKqlQuery + +`func (o *KqlWithFiltersTotal) SetKqlQuery(v string)` + +SetKqlQuery sets KqlQuery field to given value. + +### HasKqlQuery + +`func (o *KqlWithFiltersTotal) HasKqlQuery() bool` + +HasKqlQuery returns a boolean if a field has been set. + +### GetFilters + +`func (o *KqlWithFiltersTotal) GetFilters() []Filter` + +GetFilters returns the Filters field if non-nil, zero value otherwise. + +### GetFiltersOk + +`func (o *KqlWithFiltersTotal) GetFiltersOk() (*[]Filter, bool)` + +GetFiltersOk returns a tuple with the Filters field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFilters + +`func (o *KqlWithFiltersTotal) SetFilters(v []Filter)` + +SetFilters sets Filters field to given value. + +### HasFilters + +`func (o *KqlWithFiltersTotal) HasFilters() bool` + +HasFilters 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/generated/slo/docs/Settings.md b/generated/slo/docs/Settings.md index d501ad1eb..65528a3d1 100644 --- a/generated/slo/docs/Settings.md +++ b/generated/slo/docs/Settings.md @@ -4,8 +4,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**SyncDelay** | Pointer to **string** | The synch delay to apply to the transform. Default 1m | [optional] -**Frequency** | Pointer to **string** | Configure how often the transform runs, default 1m | [optional] +**SyncField** | Pointer to **string** | The date field that is used to identify new documents in the source. It is strongly recommended to use a field that contains the ingest timestamp. If you use a different field, you might need to set the delay such that it accounts for data transmission delays. When unspecified, we use the indicator timestamp field. | [optional] +**SyncDelay** | Pointer to **string** | The time delay in minutes between the current time and the latest source data time. Increasing the value will delay any alerting. The default value is 1 minute. The minimum value is 1m and the maximum is 359m. It should always be greater then source index refresh interval. | [optional] [default to "1m"] +**Frequency** | Pointer to **string** | The interval between checks for changes in the source data. The minimum value is 1m and the maximum is 59m. The default value is 1 minute. | [optional] [default to "1m"] +**PreventInitialBackfill** | Pointer to **bool** | Start aggregating data from the time the SLO is created, instead of backfilling data from the beginning of the time window. | [optional] [default to false] ## Methods @@ -26,6 +28,31 @@ NewSettingsWithDefaults instantiates a new Settings 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 +### GetSyncField + +`func (o *Settings) GetSyncField() string` + +GetSyncField returns the SyncField field if non-nil, zero value otherwise. + +### GetSyncFieldOk + +`func (o *Settings) GetSyncFieldOk() (*string, bool)` + +GetSyncFieldOk returns a tuple with the SyncField field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSyncField + +`func (o *Settings) SetSyncField(v string)` + +SetSyncField sets SyncField field to given value. + +### HasSyncField + +`func (o *Settings) HasSyncField() bool` + +HasSyncField returns a boolean if a field has been set. + ### GetSyncDelay `func (o *Settings) GetSyncDelay() string` @@ -76,6 +103,31 @@ SetFrequency sets Frequency field to given value. HasFrequency returns a boolean if a field has been set. +### GetPreventInitialBackfill + +`func (o *Settings) GetPreventInitialBackfill() bool` + +GetPreventInitialBackfill returns the PreventInitialBackfill field if non-nil, zero value otherwise. + +### GetPreventInitialBackfillOk + +`func (o *Settings) GetPreventInitialBackfillOk() (*bool, bool)` + +GetPreventInitialBackfillOk returns a tuple with the PreventInitialBackfill field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPreventInitialBackfill + +`func (o *Settings) SetPreventInitialBackfill(v bool)` + +SetPreventInitialBackfill sets PreventInitialBackfill field to given value. + +### HasPreventInitialBackfill + +`func (o *Settings) HasPreventInitialBackfill() bool` + +HasPreventInitialBackfill 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/generated/slo/docs/SloApi.md b/generated/slo/docs/SloApi.md index 7297aeebf..7c507ae2d 100644 --- a/generated/slo/docs/SloApi.md +++ b/generated/slo/docs/SloApi.md @@ -1,18 +1,19 @@ # \SloAPI -All URIs are relative to *http://localhost:5601* +All URIs are relative to *https://localhost:5601* Method | HTTP request | Description ------------- | ------------- | ------------- -[**CreateSloOp**](SloAPI.md#CreateSloOp) | **Post** /s/{spaceId}/api/observability/slos | Creates an SLO. -[**DeleteSloInstancesOp**](SloAPI.md#DeleteSloInstancesOp) | **Post** /s/{spaceId}/api/observability/slos/_delete_instances | Batch delete rollup and summary data for the matching list of sloId and instanceId -[**DeleteSloOp**](SloAPI.md#DeleteSloOp) | **Delete** /s/{spaceId}/api/observability/slos/{sloId} | Deletes an SLO -[**DisableSloOp**](SloAPI.md#DisableSloOp) | **Post** /s/{spaceId}/api/observability/slos/{sloId}/disable | Disables an SLO -[**EnableSloOp**](SloAPI.md#EnableSloOp) | **Post** /s/{spaceId}/api/observability/slos/{sloId}/enable | Enables an SLO -[**FindSlosOp**](SloAPI.md#FindSlosOp) | **Get** /s/{spaceId}/api/observability/slos | Retrieves a paginated list of SLOs -[**GetSloOp**](SloAPI.md#GetSloOp) | **Get** /s/{spaceId}/api/observability/slos/{sloId} | Retrieves a SLO -[**HistoricalSummaryOp**](SloAPI.md#HistoricalSummaryOp) | **Post** /s/{spaceId}/internal/observability/slos/_historical_summary | Retrieves the historical summary for a list of SLOs -[**UpdateSloOp**](SloAPI.md#UpdateSloOp) | **Put** /s/{spaceId}/api/observability/slos/{sloId} | Updates an SLO +[**CreateSloOp**](SloAPI.md#CreateSloOp) | **Post** /s/{spaceId}/api/observability/slos | Create an SLO +[**DeleteSloInstancesOp**](SloAPI.md#DeleteSloInstancesOp) | **Post** /s/{spaceId}/api/observability/slos/_delete_instances | Batch delete rollup and summary data +[**DeleteSloOp**](SloAPI.md#DeleteSloOp) | **Delete** /s/{spaceId}/api/observability/slos/{sloId} | Delete an SLO +[**DisableSloOp**](SloAPI.md#DisableSloOp) | **Post** /s/{spaceId}/api/observability/slos/{sloId}/disable | Disable an SLO +[**EnableSloOp**](SloAPI.md#EnableSloOp) | **Post** /s/{spaceId}/api/observability/slos/{sloId}/enable | Enable an SLO +[**FindSlosOp**](SloAPI.md#FindSlosOp) | **Get** /s/{spaceId}/api/observability/slos | Get a paginated list of SLOs +[**GetDefinitionsOp**](SloAPI.md#GetDefinitionsOp) | **Get** /s/{spaceId}/internal/observability/slos/_definitions | Get the SLO definitions +[**GetSloOp**](SloAPI.md#GetSloOp) | **Get** /s/{spaceId}/api/observability/slos/{sloId} | Get an SLO +[**ResetSloOp**](SloAPI.md#ResetSloOp) | **Post** /s/{spaceId}/api/observability/slos/{sloId}/_reset | Reset an SLO +[**UpdateSloOp**](SloAPI.md#UpdateSloOp) | **Put** /s/{spaceId}/api/observability/slos/{sloId} | Update an SLO @@ -20,7 +21,7 @@ Method | HTTP request | Description > CreateSloResponse CreateSloOp(ctx, spaceId).KbnXsrf(kbnXsrf).CreateSloRequest(createSloRequest).Execute() -Creates an SLO. +Create an SLO @@ -78,7 +79,7 @@ Name | Type | Description | Notes ### Authorization -[basicAuth](../README.md#basicAuth), [apiKeyAuth](../README.md#apiKeyAuth) +No authorization required ### HTTP request headers @@ -94,7 +95,7 @@ Name | Type | Description | Notes > DeleteSloInstancesOp(ctx, spaceId).KbnXsrf(kbnXsrf).DeleteSloInstancesRequest(deleteSloInstancesRequest).Execute() -Batch delete rollup and summary data for the matching list of sloId and instanceId +Batch delete rollup and summary data @@ -150,7 +151,7 @@ Name | Type | Description | Notes ### Authorization -[basicAuth](../README.md#basicAuth), [apiKeyAuth](../README.md#apiKeyAuth) +No authorization required ### HTTP request headers @@ -166,7 +167,7 @@ Name | Type | Description | Notes > DeleteSloOp(ctx, spaceId, sloId).KbnXsrf(kbnXsrf).Execute() -Deletes an SLO +Delete an SLO @@ -223,7 +224,7 @@ Name | Type | Description | Notes ### Authorization -[basicAuth](../README.md#basicAuth), [apiKeyAuth](../README.md#apiKeyAuth) +No authorization required ### HTTP request headers @@ -239,7 +240,7 @@ Name | Type | Description | Notes > DisableSloOp(ctx, spaceId, sloId).KbnXsrf(kbnXsrf).Execute() -Disables an SLO +Disable an SLO @@ -296,7 +297,7 @@ Name | Type | Description | Notes ### Authorization -[basicAuth](../README.md#basicAuth), [apiKeyAuth](../README.md#apiKeyAuth) +No authorization required ### HTTP request headers @@ -312,7 +313,7 @@ Name | Type | Description | Notes > EnableSloOp(ctx, spaceId, sloId).KbnXsrf(kbnXsrf).Execute() -Enables an SLO +Enable an SLO @@ -369,7 +370,7 @@ Name | Type | Description | Notes ### Authorization -[basicAuth](../README.md#basicAuth), [apiKeyAuth](../README.md#apiKeyAuth) +No authorization required ### HTTP request headers @@ -383,9 +384,9 @@ Name | Type | Description | Notes ## FindSlosOp -> FindSloResponse FindSlosOp(ctx, spaceId).KbnXsrf(kbnXsrf).KqlQuery(kqlQuery).Page(page).PerPage(perPage).SortBy(sortBy).SortDirection(sortDirection).Execute() +> FindSloResponse FindSlosOp(ctx, spaceId).KbnXsrf(kbnXsrf).KqlQuery(kqlQuery).Size(size).SearchAfter(searchAfter).Page(page).PerPage(perPage).SortBy(sortBy).SortDirection(sortDirection).HideStale(hideStale).Execute() -Retrieves a paginated list of SLOs +Get a paginated list of SLOs @@ -405,14 +406,17 @@ func main() { kbnXsrf := "kbnXsrf_example" // string | Cross-site request forgery protection spaceId := "default" // string | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. kqlQuery := "slo.name:latency* and slo.tags : "prod"" // string | A valid kql query to filter the SLO with (optional) - page := int32(1) // int32 | The page number to return (optional) (default to 1) - perPage := int32(25) // int32 | The number of SLOs to return per page (optional) (default to 25) + size := int32(1) // int32 | The page size to use for cursor-based pagination, must be greater or equal than 1 (optional) (default to 1) + searchAfter := []string{"Inner_example"} // []string | The cursor to use for fetching the results from, when using a cursor-base pagination. (optional) + page := int32(1) // int32 | The page to use for pagination, must be greater or equal than 1 (optional) (default to 1) + perPage := int32(25) // int32 | Number of SLOs returned by page (optional) (default to 25) sortBy := "status" // string | Sort by field (optional) (default to "status") sortDirection := "asc" // string | Sort order (optional) (default to "asc") + hideStale := true // bool | Hide stale SLOs from the list as defined by stale SLO threshold in SLO settings (optional) configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.SloAPI.FindSlosOp(context.Background(), spaceId).KbnXsrf(kbnXsrf).KqlQuery(kqlQuery).Page(page).PerPage(perPage).SortBy(sortBy).SortDirection(sortDirection).Execute() + resp, r, err := apiClient.SloAPI.FindSlosOp(context.Background(), spaceId).KbnXsrf(kbnXsrf).KqlQuery(kqlQuery).Size(size).SearchAfter(searchAfter).Page(page).PerPage(perPage).SortBy(sortBy).SortDirection(sortDirection).HideStale(hideStale).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `SloAPI.FindSlosOp``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -440,10 +444,13 @@ Name | Type | Description | Notes **kbnXsrf** | **string** | Cross-site request forgery protection | **kqlQuery** | **string** | A valid kql query to filter the SLO with | - **page** | **int32** | The page number to return | [default to 1] - **perPage** | **int32** | The number of SLOs to return per page | [default to 25] + **size** | **int32** | The page size to use for cursor-based pagination, must be greater or equal than 1 | [default to 1] + **searchAfter** | **[]string** | The cursor to use for fetching the results from, when using a cursor-base pagination. | + **page** | **int32** | The page to use for pagination, must be greater or equal than 1 | [default to 1] + **perPage** | **int32** | Number of SLOs returned by page | [default to 25] **sortBy** | **string** | Sort by field | [default to "status"] **sortDirection** | **string** | Sort order | [default to "asc"] + **hideStale** | **bool** | Hide stale SLOs from the list as defined by stale SLO threshold in SLO settings | ### Return type @@ -451,7 +458,87 @@ Name | Type | Description | Notes ### Authorization -[basicAuth](../README.md#basicAuth), [apiKeyAuth](../README.md#apiKeyAuth) +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetDefinitionsOp + +> FindSloDefinitionsResponse GetDefinitionsOp(ctx, spaceId).KbnXsrf(kbnXsrf).IncludeOutdatedOnly(includeOutdatedOnly).Search(search).Page(page).PerPage(perPage).Execute() + +Get the SLO definitions + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/elastic/terraform-provider-elasticstack/slo" +) + +func main() { + kbnXsrf := "kbnXsrf_example" // string | Cross-site request forgery protection + spaceId := "default" // string | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. + includeOutdatedOnly := true // bool | Indicates if the API returns only outdated SLO or all SLO definitions (optional) + search := "my service availability" // string | Filters the SLOs by name (optional) + page := float64(1) // float64 | The page to use for pagination, must be greater or equal than 1 (optional) + perPage := int32(100) // int32 | Number of SLOs returned by page (optional) (default to 100) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.SloAPI.GetDefinitionsOp(context.Background(), spaceId).KbnXsrf(kbnXsrf).IncludeOutdatedOnly(includeOutdatedOnly).Search(search).Page(page).PerPage(perPage).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `SloAPI.GetDefinitionsOp``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetDefinitionsOp`: FindSloDefinitionsResponse + fmt.Fprintf(os.Stdout, "Response from `SloAPI.GetDefinitionsOp`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**spaceId** | **string** | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetDefinitionsOpRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **kbnXsrf** | **string** | Cross-site request forgery protection | + + **includeOutdatedOnly** | **bool** | Indicates if the API returns only outdated SLO or all SLO definitions | + **search** | **string** | Filters the SLOs by name | + **page** | **float64** | The page to use for pagination, must be greater or equal than 1 | + **perPage** | **int32** | Number of SLOs returned by page | [default to 100] + +### Return type + +[**FindSloDefinitionsResponse**](FindSloDefinitionsResponse.md) + +### Authorization + +No authorization required ### HTTP request headers @@ -465,9 +552,9 @@ Name | Type | Description | Notes ## GetSloOp -> SloResponse GetSloOp(ctx, spaceId, sloId).KbnXsrf(kbnXsrf).InstanceId(instanceId).Execute() +> SloWithSummaryResponse GetSloOp(ctx, spaceId, sloId).KbnXsrf(kbnXsrf).InstanceId(instanceId).Execute() -Retrieves a SLO +Get an SLO @@ -496,7 +583,7 @@ func main() { fmt.Fprintf(os.Stderr, "Error when calling `SloAPI.GetSloOp``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } - // response from `GetSloOp`: SloResponse + // response from `GetSloOp`: SloWithSummaryResponse fmt.Fprintf(os.Stdout, "Response from `SloAPI.GetSloOp`: %v\n", resp) } ``` @@ -524,11 +611,11 @@ Name | Type | Description | Notes ### Return type -[**SloResponse**](SloResponse.md) +[**SloWithSummaryResponse**](SloWithSummaryResponse.md) ### Authorization -[basicAuth](../README.md#basicAuth), [apiKeyAuth](../README.md#apiKeyAuth) +No authorization required ### HTTP request headers @@ -540,11 +627,11 @@ Name | Type | Description | Notes [[Back to README]](../README.md) -## HistoricalSummaryOp +## ResetSloOp -> map[string][]HistoricalSummaryResponseInner HistoricalSummaryOp(ctx, spaceId).KbnXsrf(kbnXsrf).HistoricalSummaryRequest(historicalSummaryRequest).Execute() +> SloDefinitionResponse ResetSloOp(ctx, spaceId, sloId).KbnXsrf(kbnXsrf).Execute() -Retrieves the historical summary for a list of SLOs +Reset an SLO @@ -563,17 +650,17 @@ import ( func main() { kbnXsrf := "kbnXsrf_example" // string | Cross-site request forgery protection spaceId := "default" // string | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. - historicalSummaryRequest := *openapiclient.NewHistoricalSummaryRequest([]string{"8853df00-ae2e-11ed-90af-09bb6422b258"}) // HistoricalSummaryRequest | + sloId := "9c235211-6834-11ea-a78c-6feb38a34414" // string | An identifier for the slo. configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.SloAPI.HistoricalSummaryOp(context.Background(), spaceId).KbnXsrf(kbnXsrf).HistoricalSummaryRequest(historicalSummaryRequest).Execute() + resp, r, err := apiClient.SloAPI.ResetSloOp(context.Background(), spaceId, sloId).KbnXsrf(kbnXsrf).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `SloAPI.HistoricalSummaryOp``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `SloAPI.ResetSloOp``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } - // response from `HistoricalSummaryOp`: map[string][]HistoricalSummaryResponseInner - fmt.Fprintf(os.Stdout, "Response from `SloAPI.HistoricalSummaryOp`: %v\n", resp) + // response from `ResetSloOp`: SloDefinitionResponse + fmt.Fprintf(os.Stdout, "Response from `SloAPI.ResetSloOp`: %v\n", resp) } ``` @@ -584,29 +671,30 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **spaceId** | **string** | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. | +**sloId** | **string** | An identifier for the slo. | ### Other Parameters -Other parameters are passed through a pointer to a apiHistoricalSummaryOpRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiResetSloOpRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **kbnXsrf** | **string** | Cross-site request forgery protection | - **historicalSummaryRequest** | [**HistoricalSummaryRequest**](HistoricalSummaryRequest.md) | | + ### Return type -[**map[string][]HistoricalSummaryResponseInner**](array.md) +[**SloDefinitionResponse**](SloDefinitionResponse.md) ### Authorization -[basicAuth](../README.md#basicAuth), [apiKeyAuth](../README.md#apiKeyAuth) +No authorization required ### HTTP request headers -- **Content-Type**: application/json +- **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) @@ -616,9 +704,9 @@ Name | Type | Description | Notes ## UpdateSloOp -> SloResponse UpdateSloOp(ctx, spaceId, sloId).KbnXsrf(kbnXsrf).UpdateSloRequest(updateSloRequest).Execute() +> SloDefinitionResponse UpdateSloOp(ctx, spaceId, sloId).KbnXsrf(kbnXsrf).UpdateSloRequest(updateSloRequest).Execute() -Updates an SLO +Update an SLO @@ -647,7 +735,7 @@ func main() { fmt.Fprintf(os.Stderr, "Error when calling `SloAPI.UpdateSloOp``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } - // response from `UpdateSloOp`: SloResponse + // response from `UpdateSloOp`: SloDefinitionResponse fmt.Fprintf(os.Stdout, "Response from `SloAPI.UpdateSloOp`: %v\n", resp) } ``` @@ -675,11 +763,11 @@ Name | Type | Description | Notes ### Return type -[**SloResponse**](SloResponse.md) +[**SloDefinitionResponse**](SloDefinitionResponse.md) ### Authorization -[basicAuth](../README.md#basicAuth), [apiKeyAuth](../README.md#apiKeyAuth) +No authorization required ### HTTP request headers diff --git a/generated/slo/docs/SloDefinitionResponse.md b/generated/slo/docs/SloDefinitionResponse.md new file mode 100644 index 000000000..5fdaa4081 --- /dev/null +++ b/generated/slo/docs/SloDefinitionResponse.md @@ -0,0 +1,345 @@ +# SloDefinitionResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | The identifier of the SLO. | +**Name** | **string** | The name of the SLO. | +**Description** | **string** | The description of the SLO. | +**Indicator** | [**SloWithSummaryResponseIndicator**](SloWithSummaryResponseIndicator.md) | | +**TimeWindow** | [**TimeWindow**](TimeWindow.md) | | +**BudgetingMethod** | [**BudgetingMethod**](BudgetingMethod.md) | | +**Objective** | [**Objective**](Objective.md) | | +**Settings** | [**Settings**](Settings.md) | | +**Revision** | **float64** | The SLO revision | +**Enabled** | **bool** | Indicate if the SLO is enabled | +**GroupBy** | [**GroupBy**](GroupBy.md) | | +**Tags** | **[]string** | List of tags | +**CreatedAt** | **string** | The creation date | +**UpdatedAt** | **string** | The last update date | +**Version** | **float64** | The internal SLO version | + +## Methods + +### NewSloDefinitionResponse + +`func NewSloDefinitionResponse(id string, name string, description string, indicator SloWithSummaryResponseIndicator, timeWindow TimeWindow, budgetingMethod BudgetingMethod, objective Objective, settings Settings, revision float64, enabled bool, groupBy GroupBy, tags []string, createdAt string, updatedAt string, version float64, ) *SloDefinitionResponse` + +NewSloDefinitionResponse instantiates a new SloDefinitionResponse 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 + +### NewSloDefinitionResponseWithDefaults + +`func NewSloDefinitionResponseWithDefaults() *SloDefinitionResponse` + +NewSloDefinitionResponseWithDefaults instantiates a new SloDefinitionResponse 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 + +### GetId + +`func (o *SloDefinitionResponse) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *SloDefinitionResponse) 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 *SloDefinitionResponse) SetId(v string)` + +SetId sets Id field to given value. + + +### GetName + +`func (o *SloDefinitionResponse) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *SloDefinitionResponse) 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 *SloDefinitionResponse) SetName(v string)` + +SetName sets Name field to given value. + + +### GetDescription + +`func (o *SloDefinitionResponse) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *SloDefinitionResponse) 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 *SloDefinitionResponse) SetDescription(v string)` + +SetDescription sets Description field to given value. + + +### GetIndicator + +`func (o *SloDefinitionResponse) GetIndicator() SloWithSummaryResponseIndicator` + +GetIndicator returns the Indicator field if non-nil, zero value otherwise. + +### GetIndicatorOk + +`func (o *SloDefinitionResponse) GetIndicatorOk() (*SloWithSummaryResponseIndicator, bool)` + +GetIndicatorOk returns a tuple with the Indicator field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIndicator + +`func (o *SloDefinitionResponse) SetIndicator(v SloWithSummaryResponseIndicator)` + +SetIndicator sets Indicator field to given value. + + +### GetTimeWindow + +`func (o *SloDefinitionResponse) GetTimeWindow() TimeWindow` + +GetTimeWindow returns the TimeWindow field if non-nil, zero value otherwise. + +### GetTimeWindowOk + +`func (o *SloDefinitionResponse) GetTimeWindowOk() (*TimeWindow, bool)` + +GetTimeWindowOk returns a tuple with the TimeWindow field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTimeWindow + +`func (o *SloDefinitionResponse) SetTimeWindow(v TimeWindow)` + +SetTimeWindow sets TimeWindow field to given value. + + +### GetBudgetingMethod + +`func (o *SloDefinitionResponse) GetBudgetingMethod() BudgetingMethod` + +GetBudgetingMethod returns the BudgetingMethod field if non-nil, zero value otherwise. + +### GetBudgetingMethodOk + +`func (o *SloDefinitionResponse) GetBudgetingMethodOk() (*BudgetingMethod, bool)` + +GetBudgetingMethodOk returns a tuple with the BudgetingMethod field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBudgetingMethod + +`func (o *SloDefinitionResponse) SetBudgetingMethod(v BudgetingMethod)` + +SetBudgetingMethod sets BudgetingMethod field to given value. + + +### GetObjective + +`func (o *SloDefinitionResponse) GetObjective() Objective` + +GetObjective returns the Objective field if non-nil, zero value otherwise. + +### GetObjectiveOk + +`func (o *SloDefinitionResponse) GetObjectiveOk() (*Objective, bool)` + +GetObjectiveOk returns a tuple with the Objective field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetObjective + +`func (o *SloDefinitionResponse) SetObjective(v Objective)` + +SetObjective sets Objective field to given value. + + +### GetSettings + +`func (o *SloDefinitionResponse) GetSettings() Settings` + +GetSettings returns the Settings field if non-nil, zero value otherwise. + +### GetSettingsOk + +`func (o *SloDefinitionResponse) GetSettingsOk() (*Settings, bool)` + +GetSettingsOk returns a tuple with the Settings field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSettings + +`func (o *SloDefinitionResponse) SetSettings(v Settings)` + +SetSettings sets Settings field to given value. + + +### GetRevision + +`func (o *SloDefinitionResponse) GetRevision() float64` + +GetRevision returns the Revision field if non-nil, zero value otherwise. + +### GetRevisionOk + +`func (o *SloDefinitionResponse) GetRevisionOk() (*float64, bool)` + +GetRevisionOk returns a tuple with the Revision field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRevision + +`func (o *SloDefinitionResponse) SetRevision(v float64)` + +SetRevision sets Revision field to given value. + + +### GetEnabled + +`func (o *SloDefinitionResponse) GetEnabled() bool` + +GetEnabled returns the Enabled field if non-nil, zero value otherwise. + +### GetEnabledOk + +`func (o *SloDefinitionResponse) GetEnabledOk() (*bool, bool)` + +GetEnabledOk returns a tuple with the Enabled field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEnabled + +`func (o *SloDefinitionResponse) SetEnabled(v bool)` + +SetEnabled sets Enabled field to given value. + + +### GetGroupBy + +`func (o *SloDefinitionResponse) GetGroupBy() GroupBy` + +GetGroupBy returns the GroupBy field if non-nil, zero value otherwise. + +### GetGroupByOk + +`func (o *SloDefinitionResponse) GetGroupByOk() (*GroupBy, bool)` + +GetGroupByOk returns a tuple with the GroupBy field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGroupBy + +`func (o *SloDefinitionResponse) SetGroupBy(v GroupBy)` + +SetGroupBy sets GroupBy field to given value. + + +### GetTags + +`func (o *SloDefinitionResponse) GetTags() []string` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *SloDefinitionResponse) 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 *SloDefinitionResponse) SetTags(v []string)` + +SetTags sets Tags field to given value. + + +### GetCreatedAt + +`func (o *SloDefinitionResponse) GetCreatedAt() string` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *SloDefinitionResponse) GetCreatedAtOk() (*string, 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 *SloDefinitionResponse) SetCreatedAt(v string)` + +SetCreatedAt sets CreatedAt field to given value. + + +### GetUpdatedAt + +`func (o *SloDefinitionResponse) GetUpdatedAt() string` + +GetUpdatedAt returns the UpdatedAt field if non-nil, zero value otherwise. + +### GetUpdatedAtOk + +`func (o *SloDefinitionResponse) GetUpdatedAtOk() (*string, bool)` + +GetUpdatedAtOk returns a tuple with the UpdatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUpdatedAt + +`func (o *SloDefinitionResponse) SetUpdatedAt(v string)` + +SetUpdatedAt sets UpdatedAt field to given value. + + +### GetVersion + +`func (o *SloDefinitionResponse) GetVersion() float64` + +GetVersion returns the Version field if non-nil, zero value otherwise. + +### GetVersionOk + +`func (o *SloDefinitionResponse) GetVersionOk() (*float64, bool)` + +GetVersionOk returns a tuple with the Version field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVersion + +`func (o *SloDefinitionResponse) SetVersion(v float64)` + +SetVersion sets Version field to given value. + + + +[[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/generated/slo/docs/SloWithSummaryResponse.md b/generated/slo/docs/SloWithSummaryResponse.md new file mode 100644 index 000000000..2a57a3050 --- /dev/null +++ b/generated/slo/docs/SloWithSummaryResponse.md @@ -0,0 +1,387 @@ +# SloWithSummaryResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | The identifier of the SLO. | +**Name** | **string** | The name of the SLO. | +**Description** | **string** | The description of the SLO. | +**Indicator** | [**SloWithSummaryResponseIndicator**](SloWithSummaryResponseIndicator.md) | | +**TimeWindow** | [**TimeWindow**](TimeWindow.md) | | +**BudgetingMethod** | [**BudgetingMethod**](BudgetingMethod.md) | | +**Objective** | [**Objective**](Objective.md) | | +**Settings** | [**Settings**](Settings.md) | | +**Revision** | **float64** | The SLO revision | +**Summary** | [**Summary**](Summary.md) | | +**Enabled** | **bool** | Indicate if the SLO is enabled | +**GroupBy** | [**GroupBy**](GroupBy.md) | | +**InstanceId** | **string** | the value derived from the groupBy field, if present, otherwise '*' | +**Tags** | **[]string** | List of tags | +**CreatedAt** | **string** | The creation date | +**UpdatedAt** | **string** | The last update date | +**Version** | **float64** | The internal SLO version | + +## Methods + +### NewSloWithSummaryResponse + +`func NewSloWithSummaryResponse(id string, name string, description string, indicator SloWithSummaryResponseIndicator, timeWindow TimeWindow, budgetingMethod BudgetingMethod, objective Objective, settings Settings, revision float64, summary Summary, enabled bool, groupBy GroupBy, instanceId string, tags []string, createdAt string, updatedAt string, version float64, ) *SloWithSummaryResponse` + +NewSloWithSummaryResponse instantiates a new SloWithSummaryResponse 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 + +### NewSloWithSummaryResponseWithDefaults + +`func NewSloWithSummaryResponseWithDefaults() *SloWithSummaryResponse` + +NewSloWithSummaryResponseWithDefaults instantiates a new SloWithSummaryResponse 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 + +### GetId + +`func (o *SloWithSummaryResponse) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *SloWithSummaryResponse) 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 *SloWithSummaryResponse) SetId(v string)` + +SetId sets Id field to given value. + + +### GetName + +`func (o *SloWithSummaryResponse) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *SloWithSummaryResponse) 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 *SloWithSummaryResponse) SetName(v string)` + +SetName sets Name field to given value. + + +### GetDescription + +`func (o *SloWithSummaryResponse) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *SloWithSummaryResponse) 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 *SloWithSummaryResponse) SetDescription(v string)` + +SetDescription sets Description field to given value. + + +### GetIndicator + +`func (o *SloWithSummaryResponse) GetIndicator() SloWithSummaryResponseIndicator` + +GetIndicator returns the Indicator field if non-nil, zero value otherwise. + +### GetIndicatorOk + +`func (o *SloWithSummaryResponse) GetIndicatorOk() (*SloWithSummaryResponseIndicator, bool)` + +GetIndicatorOk returns a tuple with the Indicator field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIndicator + +`func (o *SloWithSummaryResponse) SetIndicator(v SloWithSummaryResponseIndicator)` + +SetIndicator sets Indicator field to given value. + + +### GetTimeWindow + +`func (o *SloWithSummaryResponse) GetTimeWindow() TimeWindow` + +GetTimeWindow returns the TimeWindow field if non-nil, zero value otherwise. + +### GetTimeWindowOk + +`func (o *SloWithSummaryResponse) GetTimeWindowOk() (*TimeWindow, bool)` + +GetTimeWindowOk returns a tuple with the TimeWindow field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTimeWindow + +`func (o *SloWithSummaryResponse) SetTimeWindow(v TimeWindow)` + +SetTimeWindow sets TimeWindow field to given value. + + +### GetBudgetingMethod + +`func (o *SloWithSummaryResponse) GetBudgetingMethod() BudgetingMethod` + +GetBudgetingMethod returns the BudgetingMethod field if non-nil, zero value otherwise. + +### GetBudgetingMethodOk + +`func (o *SloWithSummaryResponse) GetBudgetingMethodOk() (*BudgetingMethod, bool)` + +GetBudgetingMethodOk returns a tuple with the BudgetingMethod field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBudgetingMethod + +`func (o *SloWithSummaryResponse) SetBudgetingMethod(v BudgetingMethod)` + +SetBudgetingMethod sets BudgetingMethod field to given value. + + +### GetObjective + +`func (o *SloWithSummaryResponse) GetObjective() Objective` + +GetObjective returns the Objective field if non-nil, zero value otherwise. + +### GetObjectiveOk + +`func (o *SloWithSummaryResponse) GetObjectiveOk() (*Objective, bool)` + +GetObjectiveOk returns a tuple with the Objective field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetObjective + +`func (o *SloWithSummaryResponse) SetObjective(v Objective)` + +SetObjective sets Objective field to given value. + + +### GetSettings + +`func (o *SloWithSummaryResponse) GetSettings() Settings` + +GetSettings returns the Settings field if non-nil, zero value otherwise. + +### GetSettingsOk + +`func (o *SloWithSummaryResponse) GetSettingsOk() (*Settings, bool)` + +GetSettingsOk returns a tuple with the Settings field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSettings + +`func (o *SloWithSummaryResponse) SetSettings(v Settings)` + +SetSettings sets Settings field to given value. + + +### GetRevision + +`func (o *SloWithSummaryResponse) GetRevision() float64` + +GetRevision returns the Revision field if non-nil, zero value otherwise. + +### GetRevisionOk + +`func (o *SloWithSummaryResponse) GetRevisionOk() (*float64, bool)` + +GetRevisionOk returns a tuple with the Revision field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRevision + +`func (o *SloWithSummaryResponse) SetRevision(v float64)` + +SetRevision sets Revision field to given value. + + +### GetSummary + +`func (o *SloWithSummaryResponse) GetSummary() Summary` + +GetSummary returns the Summary field if non-nil, zero value otherwise. + +### GetSummaryOk + +`func (o *SloWithSummaryResponse) GetSummaryOk() (*Summary, bool)` + +GetSummaryOk returns a tuple with the Summary field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSummary + +`func (o *SloWithSummaryResponse) SetSummary(v Summary)` + +SetSummary sets Summary field to given value. + + +### GetEnabled + +`func (o *SloWithSummaryResponse) GetEnabled() bool` + +GetEnabled returns the Enabled field if non-nil, zero value otherwise. + +### GetEnabledOk + +`func (o *SloWithSummaryResponse) GetEnabledOk() (*bool, bool)` + +GetEnabledOk returns a tuple with the Enabled field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEnabled + +`func (o *SloWithSummaryResponse) SetEnabled(v bool)` + +SetEnabled sets Enabled field to given value. + + +### GetGroupBy + +`func (o *SloWithSummaryResponse) GetGroupBy() GroupBy` + +GetGroupBy returns the GroupBy field if non-nil, zero value otherwise. + +### GetGroupByOk + +`func (o *SloWithSummaryResponse) GetGroupByOk() (*GroupBy, bool)` + +GetGroupByOk returns a tuple with the GroupBy field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGroupBy + +`func (o *SloWithSummaryResponse) SetGroupBy(v GroupBy)` + +SetGroupBy sets GroupBy field to given value. + + +### GetInstanceId + +`func (o *SloWithSummaryResponse) GetInstanceId() string` + +GetInstanceId returns the InstanceId field if non-nil, zero value otherwise. + +### GetInstanceIdOk + +`func (o *SloWithSummaryResponse) GetInstanceIdOk() (*string, bool)` + +GetInstanceIdOk returns a tuple with the InstanceId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInstanceId + +`func (o *SloWithSummaryResponse) SetInstanceId(v string)` + +SetInstanceId sets InstanceId field to given value. + + +### GetTags + +`func (o *SloWithSummaryResponse) GetTags() []string` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *SloWithSummaryResponse) 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 *SloWithSummaryResponse) SetTags(v []string)` + +SetTags sets Tags field to given value. + + +### GetCreatedAt + +`func (o *SloWithSummaryResponse) GetCreatedAt() string` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *SloWithSummaryResponse) GetCreatedAtOk() (*string, 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 *SloWithSummaryResponse) SetCreatedAt(v string)` + +SetCreatedAt sets CreatedAt field to given value. + + +### GetUpdatedAt + +`func (o *SloWithSummaryResponse) GetUpdatedAt() string` + +GetUpdatedAt returns the UpdatedAt field if non-nil, zero value otherwise. + +### GetUpdatedAtOk + +`func (o *SloWithSummaryResponse) GetUpdatedAtOk() (*string, bool)` + +GetUpdatedAtOk returns a tuple with the UpdatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUpdatedAt + +`func (o *SloWithSummaryResponse) SetUpdatedAt(v string)` + +SetUpdatedAt sets UpdatedAt field to given value. + + +### GetVersion + +`func (o *SloWithSummaryResponse) GetVersion() float64` + +GetVersion returns the Version field if non-nil, zero value otherwise. + +### GetVersionOk + +`func (o *SloWithSummaryResponse) GetVersionOk() (*float64, bool)` + +GetVersionOk returns a tuple with the Version field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVersion + +`func (o *SloWithSummaryResponse) SetVersion(v float64)` + +SetVersion sets Version field to given value. + + + +[[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/generated/slo/docs/SloWithSummaryResponseIndicator.md b/generated/slo/docs/SloWithSummaryResponseIndicator.md new file mode 100644 index 000000000..269441cc0 --- /dev/null +++ b/generated/slo/docs/SloWithSummaryResponseIndicator.md @@ -0,0 +1,72 @@ +# SloWithSummaryResponseIndicator + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Params** | [**IndicatorPropertiesTimesliceMetricParams**](IndicatorPropertiesTimesliceMetricParams.md) | | +**Type** | **string** | The type of indicator. | + +## Methods + +### NewSloWithSummaryResponseIndicator + +`func NewSloWithSummaryResponseIndicator(params IndicatorPropertiesTimesliceMetricParams, type_ string, ) *SloWithSummaryResponseIndicator` + +NewSloWithSummaryResponseIndicator instantiates a new SloWithSummaryResponseIndicator 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 + +### NewSloWithSummaryResponseIndicatorWithDefaults + +`func NewSloWithSummaryResponseIndicatorWithDefaults() *SloWithSummaryResponseIndicator` + +NewSloWithSummaryResponseIndicatorWithDefaults instantiates a new SloWithSummaryResponseIndicator 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 + +### GetParams + +`func (o *SloWithSummaryResponseIndicator) GetParams() IndicatorPropertiesTimesliceMetricParams` + +GetParams returns the Params field if non-nil, zero value otherwise. + +### GetParamsOk + +`func (o *SloWithSummaryResponseIndicator) GetParamsOk() (*IndicatorPropertiesTimesliceMetricParams, bool)` + +GetParamsOk returns a tuple with the Params field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetParams + +`func (o *SloWithSummaryResponseIndicator) SetParams(v IndicatorPropertiesTimesliceMetricParams)` + +SetParams sets Params field to given value. + + +### GetType + +`func (o *SloWithSummaryResponseIndicator) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *SloWithSummaryResponseIndicator) GetTypeOk() (*string, 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 *SloWithSummaryResponseIndicator) SetType(v string)` + +SetType sets Type field to given value. + + + +[[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/generated/slo/docs/UpdateSloRequest.md b/generated/slo/docs/UpdateSloRequest.md index 2a4cdb393..4518217c5 100644 --- a/generated/slo/docs/UpdateSloRequest.md +++ b/generated/slo/docs/UpdateSloRequest.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes **BudgetingMethod** | Pointer to [**BudgetingMethod**](BudgetingMethod.md) | | [optional] **Objective** | Pointer to [**Objective**](Objective.md) | | [optional] **Settings** | Pointer to [**Settings**](Settings.md) | | [optional] -**GroupBy** | Pointer to [**SloResponseGroupBy**](SloResponseGroupBy.md) | | [optional] +**GroupBy** | Pointer to [**GroupBy**](GroupBy.md) | | [optional] **Tags** | Pointer to **[]string** | List of tags | [optional] ## Methods @@ -210,20 +210,20 @@ HasSettings returns a boolean if a field has been set. ### GetGroupBy -`func (o *UpdateSloRequest) GetGroupBy() SloResponseGroupBy` +`func (o *UpdateSloRequest) GetGroupBy() GroupBy` GetGroupBy returns the GroupBy field if non-nil, zero value otherwise. ### GetGroupByOk -`func (o *UpdateSloRequest) GetGroupByOk() (*SloResponseGroupBy, bool)` +`func (o *UpdateSloRequest) GetGroupByOk() (*GroupBy, bool)` GetGroupByOk returns a tuple with the GroupBy field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetGroupBy -`func (o *UpdateSloRequest) SetGroupBy(v SloResponseGroupBy)` +`func (o *UpdateSloRequest) SetGroupBy(v GroupBy)` SetGroupBy sets GroupBy field to given value. diff --git a/generated/slo/model_400_response.go b/generated/slo/model_400_response.go index 1965ef831..cc5b81cbd 100644 --- a/generated/slo/model_400_response.go +++ b/generated/slo/model_400_response.go @@ -3,7 +3,7 @@ SLOs OpenAPI schema for SLOs endpoints -API version: 1.0 +API version: 1.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/generated/slo/model_401_response.go b/generated/slo/model_401_response.go index b4f7f83e7..d971daee0 100644 --- a/generated/slo/model_401_response.go +++ b/generated/slo/model_401_response.go @@ -3,7 +3,7 @@ SLOs OpenAPI schema for SLOs endpoints -API version: 1.0 +API version: 1.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/generated/slo/model_403_response.go b/generated/slo/model_403_response.go index 4ccd57a9a..339e40e7a 100644 --- a/generated/slo/model_403_response.go +++ b/generated/slo/model_403_response.go @@ -3,7 +3,7 @@ SLOs OpenAPI schema for SLOs endpoints -API version: 1.0 +API version: 1.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/generated/slo/model_404_response.go b/generated/slo/model_404_response.go index a52e5d6e3..f31dc6a5a 100644 --- a/generated/slo/model_404_response.go +++ b/generated/slo/model_404_response.go @@ -3,7 +3,7 @@ SLOs OpenAPI schema for SLOs endpoints -API version: 1.0 +API version: 1.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/generated/slo/model_409_response.go b/generated/slo/model_409_response.go index 8d3405b68..c9ac7217d 100644 --- a/generated/slo/model_409_response.go +++ b/generated/slo/model_409_response.go @@ -3,7 +3,7 @@ SLOs OpenAPI schema for SLOs endpoints -API version: 1.0 +API version: 1.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/generated/slo/model_budgeting_method.go b/generated/slo/model_budgeting_method.go index b22d09e1c..f0b471661 100644 --- a/generated/slo/model_budgeting_method.go +++ b/generated/slo/model_budgeting_method.go @@ -3,7 +3,7 @@ SLOs OpenAPI schema for SLOs endpoints -API version: 1.0 +API version: 1.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/generated/slo/model_create_slo_request.go b/generated/slo/model_create_slo_request.go index 02210deb0..7c2add5b3 100644 --- a/generated/slo/model_create_slo_request.go +++ b/generated/slo/model_create_slo_request.go @@ -3,7 +3,7 @@ SLOs OpenAPI schema for SLOs endpoints -API version: 1.0 +API version: 1.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -30,7 +30,7 @@ type CreateSloRequest struct { BudgetingMethod BudgetingMethod `json:"budgetingMethod"` Objective Objective `json:"objective"` Settings *Settings `json:"settings,omitempty"` - GroupBy *SloResponseGroupBy `json:"groupBy,omitempty"` + GroupBy *GroupBy `json:"groupBy,omitempty"` // List of tags Tags []string `json:"tags,omitempty"` } @@ -267,9 +267,9 @@ func (o *CreateSloRequest) SetSettings(v Settings) { } // GetGroupBy returns the GroupBy field value if set, zero value otherwise. -func (o *CreateSloRequest) GetGroupBy() SloResponseGroupBy { +func (o *CreateSloRequest) GetGroupBy() GroupBy { if o == nil || IsNil(o.GroupBy) { - var ret SloResponseGroupBy + var ret GroupBy return ret } return *o.GroupBy @@ -277,7 +277,7 @@ func (o *CreateSloRequest) GetGroupBy() SloResponseGroupBy { // GetGroupByOk returns a tuple with the GroupBy field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateSloRequest) GetGroupByOk() (*SloResponseGroupBy, bool) { +func (o *CreateSloRequest) GetGroupByOk() (*GroupBy, bool) { if o == nil || IsNil(o.GroupBy) { return nil, false } @@ -293,8 +293,8 @@ func (o *CreateSloRequest) HasGroupBy() bool { return false } -// SetGroupBy gets a reference to the given SloResponseGroupBy and assigns it to the GroupBy field. -func (o *CreateSloRequest) SetGroupBy(v SloResponseGroupBy) { +// SetGroupBy gets a reference to the given GroupBy and assigns it to the GroupBy field. +func (o *CreateSloRequest) SetGroupBy(v GroupBy) { o.GroupBy = &v } diff --git a/generated/slo/model_create_slo_request_indicator.go b/generated/slo/model_create_slo_request_indicator.go index 56c4975b2..8c46f30ed 100644 --- a/generated/slo/model_create_slo_request_indicator.go +++ b/generated/slo/model_create_slo_request_indicator.go @@ -3,7 +3,7 @@ SLOs OpenAPI schema for SLOs endpoints -API version: 1.0 +API version: 1.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/generated/slo/model_create_slo_response.go b/generated/slo/model_create_slo_response.go index 53d6c95db..793f7a05c 100644 --- a/generated/slo/model_create_slo_response.go +++ b/generated/slo/model_create_slo_response.go @@ -3,7 +3,7 @@ SLOs OpenAPI schema for SLOs endpoints -API version: 1.0 +API version: 1.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/generated/slo/model_delete_slo_instances_request.go b/generated/slo/model_delete_slo_instances_request.go index a8a4be95f..c9e381a7e 100644 --- a/generated/slo/model_delete_slo_instances_request.go +++ b/generated/slo/model_delete_slo_instances_request.go @@ -3,7 +3,7 @@ SLOs OpenAPI schema for SLOs endpoints -API version: 1.0 +API version: 1.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/generated/slo/model_delete_slo_instances_request_list_inner.go b/generated/slo/model_delete_slo_instances_request_list_inner.go index 22694c856..1dcc1042a 100644 --- a/generated/slo/model_delete_slo_instances_request_list_inner.go +++ b/generated/slo/model_delete_slo_instances_request_list_inner.go @@ -3,7 +3,7 @@ SLOs OpenAPI schema for SLOs endpoints -API version: 1.0 +API version: 1.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/generated/slo/model_error_budget.go b/generated/slo/model_error_budget.go index d7d8e6b6d..ff30efc8a 100644 --- a/generated/slo/model_error_budget.go +++ b/generated/slo/model_error_budget.go @@ -3,7 +3,7 @@ SLOs OpenAPI schema for SLOs endpoints -API version: 1.0 +API version: 1.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/generated/slo/model_filter.go b/generated/slo/model_filter.go new file mode 100644 index 000000000..df99bdb07 --- /dev/null +++ b/generated/slo/model_filter.go @@ -0,0 +1,160 @@ +/* +SLOs + +OpenAPI schema for SLOs endpoints + +API version: 1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package slo + +import ( + "encoding/json" +) + +// checks if the Filter type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Filter{} + +// Filter Defines properties for a filter +type Filter struct { + Query map[string]interface{} `json:"query,omitempty"` + Meta *FilterMeta `json:"meta,omitempty"` +} + +// NewFilter instantiates a new Filter 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 NewFilter() *Filter { + this := Filter{} + return &this +} + +// NewFilterWithDefaults instantiates a new Filter 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 NewFilterWithDefaults() *Filter { + this := Filter{} + return &this +} + +// GetQuery returns the Query field value if set, zero value otherwise. +func (o *Filter) GetQuery() map[string]interface{} { + if o == nil || IsNil(o.Query) { + var ret map[string]interface{} + 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 *Filter) GetQueryOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Query) { + return map[string]interface{}{}, false + } + return o.Query, true +} + +// HasQuery returns a boolean if a field has been set. +func (o *Filter) HasQuery() bool { + if o != nil && !IsNil(o.Query) { + return true + } + + return false +} + +// SetQuery gets a reference to the given map[string]interface{} and assigns it to the Query field. +func (o *Filter) SetQuery(v map[string]interface{}) { + o.Query = v +} + +// GetMeta returns the Meta field value if set, zero value otherwise. +func (o *Filter) GetMeta() FilterMeta { + if o == nil || IsNil(o.Meta) { + var ret FilterMeta + return ret + } + return *o.Meta +} + +// GetMetaOk returns a tuple with the Meta field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Filter) GetMetaOk() (*FilterMeta, bool) { + if o == nil || IsNil(o.Meta) { + return nil, false + } + return o.Meta, true +} + +// HasMeta returns a boolean if a field has been set. +func (o *Filter) HasMeta() bool { + if o != nil && !IsNil(o.Meta) { + return true + } + + return false +} + +// SetMeta gets a reference to the given FilterMeta and assigns it to the Meta field. +func (o *Filter) SetMeta(v FilterMeta) { + o.Meta = &v +} + +func (o Filter) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Filter) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Query) { + toSerialize["query"] = o.Query + } + if !IsNil(o.Meta) { + toSerialize["meta"] = o.Meta + } + return toSerialize, nil +} + +type NullableFilter struct { + value *Filter + isSet bool +} + +func (v NullableFilter) Get() *Filter { + return v.value +} + +func (v *NullableFilter) Set(val *Filter) { + v.value = val + v.isSet = true +} + +func (v NullableFilter) IsSet() bool { + return v.isSet +} + +func (v *NullableFilter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFilter(val *Filter) *NullableFilter { + return &NullableFilter{value: val, isSet: true} +} + +func (v NullableFilter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFilter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/generated/slo/model_filter_meta.go b/generated/slo/model_filter_meta.go new file mode 100644 index 000000000..8565f7ddd --- /dev/null +++ b/generated/slo/model_filter_meta.go @@ -0,0 +1,531 @@ +/* +SLOs + +OpenAPI schema for SLOs endpoints + +API version: 1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package slo + +import ( + "encoding/json" +) + +// checks if the FilterMeta type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FilterMeta{} + +// FilterMeta Defines properties for a filter +type FilterMeta struct { + Alias NullableString `json:"alias,omitempty"` + Disabled *bool `json:"disabled,omitempty"` + Negate *bool `json:"negate,omitempty"` + ControlledBy *string `json:"controlledBy,omitempty"` + Group *string `json:"group,omitempty"` + Index *string `json:"index,omitempty"` + IsMultiIndex *bool `json:"isMultiIndex,omitempty"` + Type *string `json:"type,omitempty"` + Key *string `json:"key,omitempty"` + Params map[string]interface{} `json:"params,omitempty"` + Value *string `json:"value,omitempty"` + Field *string `json:"field,omitempty"` +} + +// NewFilterMeta instantiates a new FilterMeta 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 NewFilterMeta() *FilterMeta { + this := FilterMeta{} + return &this +} + +// NewFilterMetaWithDefaults instantiates a new FilterMeta 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 NewFilterMetaWithDefaults() *FilterMeta { + this := FilterMeta{} + return &this +} + +// GetAlias returns the Alias field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *FilterMeta) GetAlias() string { + if o == nil || IsNil(o.Alias.Get()) { + var ret string + return ret + } + return *o.Alias.Get() +} + +// GetAliasOk returns a tuple with the Alias 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 *FilterMeta) GetAliasOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Alias.Get(), o.Alias.IsSet() +} + +// HasAlias returns a boolean if a field has been set. +func (o *FilterMeta) HasAlias() bool { + if o != nil && o.Alias.IsSet() { + return true + } + + return false +} + +// SetAlias gets a reference to the given NullableString and assigns it to the Alias field. +func (o *FilterMeta) SetAlias(v string) { + o.Alias.Set(&v) +} + +// SetAliasNil sets the value for Alias to be an explicit nil +func (o *FilterMeta) SetAliasNil() { + o.Alias.Set(nil) +} + +// UnsetAlias ensures that no value is present for Alias, not even an explicit nil +func (o *FilterMeta) UnsetAlias() { + o.Alias.Unset() +} + +// GetDisabled returns the Disabled field value if set, zero value otherwise. +func (o *FilterMeta) GetDisabled() bool { + if o == nil || IsNil(o.Disabled) { + var ret bool + return ret + } + return *o.Disabled +} + +// GetDisabledOk returns a tuple with the Disabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FilterMeta) GetDisabledOk() (*bool, bool) { + if o == nil || IsNil(o.Disabled) { + return nil, false + } + return o.Disabled, true +} + +// HasDisabled returns a boolean if a field has been set. +func (o *FilterMeta) HasDisabled() bool { + if o != nil && !IsNil(o.Disabled) { + return true + } + + return false +} + +// SetDisabled gets a reference to the given bool and assigns it to the Disabled field. +func (o *FilterMeta) SetDisabled(v bool) { + o.Disabled = &v +} + +// GetNegate returns the Negate field value if set, zero value otherwise. +func (o *FilterMeta) GetNegate() bool { + if o == nil || IsNil(o.Negate) { + var ret bool + return ret + } + return *o.Negate +} + +// GetNegateOk returns a tuple with the Negate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FilterMeta) GetNegateOk() (*bool, bool) { + if o == nil || IsNil(o.Negate) { + return nil, false + } + return o.Negate, true +} + +// HasNegate returns a boolean if a field has been set. +func (o *FilterMeta) HasNegate() bool { + if o != nil && !IsNil(o.Negate) { + return true + } + + return false +} + +// SetNegate gets a reference to the given bool and assigns it to the Negate field. +func (o *FilterMeta) SetNegate(v bool) { + o.Negate = &v +} + +// GetControlledBy returns the ControlledBy field value if set, zero value otherwise. +func (o *FilterMeta) GetControlledBy() string { + if o == nil || IsNil(o.ControlledBy) { + var ret string + return ret + } + return *o.ControlledBy +} + +// GetControlledByOk returns a tuple with the ControlledBy field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FilterMeta) GetControlledByOk() (*string, bool) { + if o == nil || IsNil(o.ControlledBy) { + return nil, false + } + return o.ControlledBy, true +} + +// HasControlledBy returns a boolean if a field has been set. +func (o *FilterMeta) HasControlledBy() bool { + if o != nil && !IsNil(o.ControlledBy) { + return true + } + + return false +} + +// SetControlledBy gets a reference to the given string and assigns it to the ControlledBy field. +func (o *FilterMeta) SetControlledBy(v string) { + o.ControlledBy = &v +} + +// GetGroup returns the Group field value if set, zero value otherwise. +func (o *FilterMeta) GetGroup() string { + if o == nil || IsNil(o.Group) { + var ret string + return ret + } + return *o.Group +} + +// GetGroupOk returns a tuple with the Group field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FilterMeta) GetGroupOk() (*string, bool) { + if o == nil || IsNil(o.Group) { + return nil, false + } + return o.Group, true +} + +// HasGroup returns a boolean if a field has been set. +func (o *FilterMeta) HasGroup() bool { + if o != nil && !IsNil(o.Group) { + return true + } + + return false +} + +// SetGroup gets a reference to the given string and assigns it to the Group field. +func (o *FilterMeta) SetGroup(v string) { + o.Group = &v +} + +// GetIndex returns the Index field value if set, zero value otherwise. +func (o *FilterMeta) GetIndex() string { + if o == nil || IsNil(o.Index) { + var ret string + return ret + } + return *o.Index +} + +// GetIndexOk returns a tuple with the Index field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FilterMeta) GetIndexOk() (*string, bool) { + if o == nil || IsNil(o.Index) { + return nil, false + } + return o.Index, true +} + +// HasIndex returns a boolean if a field has been set. +func (o *FilterMeta) HasIndex() bool { + if o != nil && !IsNil(o.Index) { + return true + } + + return false +} + +// SetIndex gets a reference to the given string and assigns it to the Index field. +func (o *FilterMeta) SetIndex(v string) { + o.Index = &v +} + +// GetIsMultiIndex returns the IsMultiIndex field value if set, zero value otherwise. +func (o *FilterMeta) GetIsMultiIndex() bool { + if o == nil || IsNil(o.IsMultiIndex) { + var ret bool + return ret + } + return *o.IsMultiIndex +} + +// GetIsMultiIndexOk returns a tuple with the IsMultiIndex field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FilterMeta) GetIsMultiIndexOk() (*bool, bool) { + if o == nil || IsNil(o.IsMultiIndex) { + return nil, false + } + return o.IsMultiIndex, true +} + +// HasIsMultiIndex returns a boolean if a field has been set. +func (o *FilterMeta) HasIsMultiIndex() bool { + if o != nil && !IsNil(o.IsMultiIndex) { + return true + } + + return false +} + +// SetIsMultiIndex gets a reference to the given bool and assigns it to the IsMultiIndex field. +func (o *FilterMeta) SetIsMultiIndex(v bool) { + o.IsMultiIndex = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *FilterMeta) GetType() string { + if o == nil || IsNil(o.Type) { + var ret string + 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 *FilterMeta) GetTypeOk() (*string, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *FilterMeta) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *FilterMeta) SetType(v string) { + o.Type = &v +} + +// GetKey returns the Key field value if set, zero value otherwise. +func (o *FilterMeta) GetKey() string { + if o == nil || IsNil(o.Key) { + var ret string + return ret + } + return *o.Key +} + +// GetKeyOk returns a tuple with the Key field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FilterMeta) GetKeyOk() (*string, bool) { + if o == nil || IsNil(o.Key) { + return nil, false + } + return o.Key, true +} + +// HasKey returns a boolean if a field has been set. +func (o *FilterMeta) HasKey() bool { + if o != nil && !IsNil(o.Key) { + return true + } + + return false +} + +// SetKey gets a reference to the given string and assigns it to the Key field. +func (o *FilterMeta) SetKey(v string) { + o.Key = &v +} + +// GetParams returns the Params field value if set, zero value otherwise. +func (o *FilterMeta) GetParams() map[string]interface{} { + if o == nil || IsNil(o.Params) { + var ret map[string]interface{} + return ret + } + return o.Params +} + +// GetParamsOk returns a tuple with the Params field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FilterMeta) GetParamsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Params) { + return map[string]interface{}{}, false + } + return o.Params, true +} + +// HasParams returns a boolean if a field has been set. +func (o *FilterMeta) HasParams() bool { + if o != nil && !IsNil(o.Params) { + return true + } + + return false +} + +// SetParams gets a reference to the given map[string]interface{} and assigns it to the Params field. +func (o *FilterMeta) SetParams(v map[string]interface{}) { + o.Params = v +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *FilterMeta) GetValue() string { + if o == nil || IsNil(o.Value) { + var ret string + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FilterMeta) GetValueOk() (*string, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *FilterMeta) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given string and assigns it to the Value field. +func (o *FilterMeta) SetValue(v string) { + o.Value = &v +} + +// GetField returns the Field field value if set, zero value otherwise. +func (o *FilterMeta) GetField() string { + if o == nil || IsNil(o.Field) { + var ret string + return ret + } + return *o.Field +} + +// GetFieldOk returns a tuple with the Field field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FilterMeta) GetFieldOk() (*string, bool) { + if o == nil || IsNil(o.Field) { + return nil, false + } + return o.Field, true +} + +// HasField returns a boolean if a field has been set. +func (o *FilterMeta) HasField() bool { + if o != nil && !IsNil(o.Field) { + return true + } + + return false +} + +// SetField gets a reference to the given string and assigns it to the Field field. +func (o *FilterMeta) SetField(v string) { + o.Field = &v +} + +func (o FilterMeta) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o FilterMeta) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Alias.IsSet() { + toSerialize["alias"] = o.Alias.Get() + } + if !IsNil(o.Disabled) { + toSerialize["disabled"] = o.Disabled + } + if !IsNil(o.Negate) { + toSerialize["negate"] = o.Negate + } + if !IsNil(o.ControlledBy) { + toSerialize["controlledBy"] = o.ControlledBy + } + if !IsNil(o.Group) { + toSerialize["group"] = o.Group + } + if !IsNil(o.Index) { + toSerialize["index"] = o.Index + } + if !IsNil(o.IsMultiIndex) { + toSerialize["isMultiIndex"] = o.IsMultiIndex + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !IsNil(o.Key) { + toSerialize["key"] = o.Key + } + if !IsNil(o.Params) { + toSerialize["params"] = o.Params + } + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Field) { + toSerialize["field"] = o.Field + } + return toSerialize, nil +} + +type NullableFilterMeta struct { + value *FilterMeta + isSet bool +} + +func (v NullableFilterMeta) Get() *FilterMeta { + return v.value +} + +func (v *NullableFilterMeta) Set(val *FilterMeta) { + v.value = val + v.isSet = true +} + +func (v NullableFilterMeta) IsSet() bool { + return v.isSet +} + +func (v *NullableFilterMeta) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFilterMeta(val *FilterMeta) *NullableFilterMeta { + return &NullableFilterMeta{value: val, isSet: true} +} + +func (v NullableFilterMeta) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFilterMeta) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/generated/slo/model_find_slo_definitions_response.go b/generated/slo/model_find_slo_definitions_response.go new file mode 100644 index 000000000..7f10a786b --- /dev/null +++ b/generated/slo/model_find_slo_definitions_response.go @@ -0,0 +1,145 @@ +/* +SLOs + +OpenAPI schema for SLOs endpoints + +API version: 1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package slo + +import ( + "encoding/json" + "fmt" +) + +// FindSloDefinitionsResponse - A paginated response of SLO definitions matching the query. +type FindSloDefinitionsResponse struct { + FindSloDefinitionsResponseOneOf *FindSloDefinitionsResponseOneOf + FindSloDefinitionsResponseOneOf1 *FindSloDefinitionsResponseOneOf1 +} + +// FindSloDefinitionsResponseOneOfAsFindSloDefinitionsResponse is a convenience function that returns FindSloDefinitionsResponseOneOf wrapped in FindSloDefinitionsResponse +func FindSloDefinitionsResponseOneOfAsFindSloDefinitionsResponse(v *FindSloDefinitionsResponseOneOf) FindSloDefinitionsResponse { + return FindSloDefinitionsResponse{ + FindSloDefinitionsResponseOneOf: v, + } +} + +// FindSloDefinitionsResponseOneOf1AsFindSloDefinitionsResponse is a convenience function that returns FindSloDefinitionsResponseOneOf1 wrapped in FindSloDefinitionsResponse +func FindSloDefinitionsResponseOneOf1AsFindSloDefinitionsResponse(v *FindSloDefinitionsResponseOneOf1) FindSloDefinitionsResponse { + return FindSloDefinitionsResponse{ + FindSloDefinitionsResponseOneOf1: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *FindSloDefinitionsResponse) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into FindSloDefinitionsResponseOneOf + err = json.Unmarshal(data, &dst.FindSloDefinitionsResponseOneOf) + if err == nil { + jsonFindSloDefinitionsResponseOneOf, _ := json.Marshal(dst.FindSloDefinitionsResponseOneOf) + if string(jsonFindSloDefinitionsResponseOneOf) == "{}" { // empty struct + dst.FindSloDefinitionsResponseOneOf = nil + } else { + match++ + } + } else { + dst.FindSloDefinitionsResponseOneOf = nil + } + + // try to unmarshal data into FindSloDefinitionsResponseOneOf1 + err = json.Unmarshal(data, &dst.FindSloDefinitionsResponseOneOf1) + if err == nil { + jsonFindSloDefinitionsResponseOneOf1, _ := json.Marshal(dst.FindSloDefinitionsResponseOneOf1) + if string(jsonFindSloDefinitionsResponseOneOf1) == "{}" { // empty struct + dst.FindSloDefinitionsResponseOneOf1 = nil + } else { + match++ + } + } else { + dst.FindSloDefinitionsResponseOneOf1 = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.FindSloDefinitionsResponseOneOf = nil + dst.FindSloDefinitionsResponseOneOf1 = nil + + return fmt.Errorf("data matches more than one schema in oneOf(FindSloDefinitionsResponse)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(FindSloDefinitionsResponse)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src FindSloDefinitionsResponse) MarshalJSON() ([]byte, error) { + if src.FindSloDefinitionsResponseOneOf != nil { + return json.Marshal(&src.FindSloDefinitionsResponseOneOf) + } + + if src.FindSloDefinitionsResponseOneOf1 != nil { + return json.Marshal(&src.FindSloDefinitionsResponseOneOf1) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *FindSloDefinitionsResponse) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.FindSloDefinitionsResponseOneOf != nil { + return obj.FindSloDefinitionsResponseOneOf + } + + if obj.FindSloDefinitionsResponseOneOf1 != nil { + return obj.FindSloDefinitionsResponseOneOf1 + } + + // all schemas are nil + return nil +} + +type NullableFindSloDefinitionsResponse struct { + value *FindSloDefinitionsResponse + isSet bool +} + +func (v NullableFindSloDefinitionsResponse) Get() *FindSloDefinitionsResponse { + return v.value +} + +func (v *NullableFindSloDefinitionsResponse) Set(val *FindSloDefinitionsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableFindSloDefinitionsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableFindSloDefinitionsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFindSloDefinitionsResponse(val *FindSloDefinitionsResponse) *NullableFindSloDefinitionsResponse { + return &NullableFindSloDefinitionsResponse{value: val, isSet: true} +} + +func (v NullableFindSloDefinitionsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFindSloDefinitionsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/generated/slo/model_find_slo_definitions_response_one_of.go b/generated/slo/model_find_slo_definitions_response_one_of.go new file mode 100644 index 000000000..67ff9551d --- /dev/null +++ b/generated/slo/model_find_slo_definitions_response_one_of.go @@ -0,0 +1,232 @@ +/* +SLOs + +OpenAPI schema for SLOs endpoints + +API version: 1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package slo + +import ( + "encoding/json" +) + +// checks if the FindSloDefinitionsResponseOneOf type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FindSloDefinitionsResponseOneOf{} + +// FindSloDefinitionsResponseOneOf struct for FindSloDefinitionsResponseOneOf +type FindSloDefinitionsResponseOneOf struct { + Page *float64 `json:"page,omitempty"` + PerPage *float64 `json:"perPage,omitempty"` + Total *float64 `json:"total,omitempty"` + Results []SloWithSummaryResponse `json:"results,omitempty"` +} + +// NewFindSloDefinitionsResponseOneOf instantiates a new FindSloDefinitionsResponseOneOf 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 NewFindSloDefinitionsResponseOneOf() *FindSloDefinitionsResponseOneOf { + this := FindSloDefinitionsResponseOneOf{} + return &this +} + +// NewFindSloDefinitionsResponseOneOfWithDefaults instantiates a new FindSloDefinitionsResponseOneOf 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 NewFindSloDefinitionsResponseOneOfWithDefaults() *FindSloDefinitionsResponseOneOf { + this := FindSloDefinitionsResponseOneOf{} + return &this +} + +// GetPage returns the Page field value if set, zero value otherwise. +func (o *FindSloDefinitionsResponseOneOf) GetPage() float64 { + if o == nil || IsNil(o.Page) { + var ret float64 + return ret + } + return *o.Page +} + +// GetPageOk returns a tuple with the Page field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FindSloDefinitionsResponseOneOf) GetPageOk() (*float64, bool) { + if o == nil || IsNil(o.Page) { + return nil, false + } + return o.Page, true +} + +// HasPage returns a boolean if a field has been set. +func (o *FindSloDefinitionsResponseOneOf) HasPage() bool { + if o != nil && !IsNil(o.Page) { + return true + } + + return false +} + +// SetPage gets a reference to the given float64 and assigns it to the Page field. +func (o *FindSloDefinitionsResponseOneOf) SetPage(v float64) { + o.Page = &v +} + +// GetPerPage returns the PerPage field value if set, zero value otherwise. +func (o *FindSloDefinitionsResponseOneOf) GetPerPage() float64 { + if o == nil || IsNil(o.PerPage) { + var ret float64 + return ret + } + return *o.PerPage +} + +// GetPerPageOk returns a tuple with the PerPage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FindSloDefinitionsResponseOneOf) GetPerPageOk() (*float64, bool) { + if o == nil || IsNil(o.PerPage) { + return nil, false + } + return o.PerPage, true +} + +// HasPerPage returns a boolean if a field has been set. +func (o *FindSloDefinitionsResponseOneOf) HasPerPage() bool { + if o != nil && !IsNil(o.PerPage) { + return true + } + + return false +} + +// SetPerPage gets a reference to the given float64 and assigns it to the PerPage field. +func (o *FindSloDefinitionsResponseOneOf) SetPerPage(v float64) { + o.PerPage = &v +} + +// GetTotal returns the Total field value if set, zero value otherwise. +func (o *FindSloDefinitionsResponseOneOf) GetTotal() float64 { + if o == nil || IsNil(o.Total) { + var ret float64 + return ret + } + return *o.Total +} + +// GetTotalOk returns a tuple with the Total field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FindSloDefinitionsResponseOneOf) GetTotalOk() (*float64, bool) { + if o == nil || IsNil(o.Total) { + return nil, false + } + return o.Total, true +} + +// HasTotal returns a boolean if a field has been set. +func (o *FindSloDefinitionsResponseOneOf) HasTotal() bool { + if o != nil && !IsNil(o.Total) { + return true + } + + return false +} + +// SetTotal gets a reference to the given float64 and assigns it to the Total field. +func (o *FindSloDefinitionsResponseOneOf) SetTotal(v float64) { + o.Total = &v +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *FindSloDefinitionsResponseOneOf) GetResults() []SloWithSummaryResponse { + if o == nil || IsNil(o.Results) { + var ret []SloWithSummaryResponse + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FindSloDefinitionsResponseOneOf) GetResultsOk() ([]SloWithSummaryResponse, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *FindSloDefinitionsResponseOneOf) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []SloWithSummaryResponse and assigns it to the Results field. +func (o *FindSloDefinitionsResponseOneOf) SetResults(v []SloWithSummaryResponse) { + o.Results = v +} + +func (o FindSloDefinitionsResponseOneOf) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o FindSloDefinitionsResponseOneOf) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Page) { + toSerialize["page"] = o.Page + } + if !IsNil(o.PerPage) { + toSerialize["perPage"] = o.PerPage + } + if !IsNil(o.Total) { + toSerialize["total"] = o.Total + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + return toSerialize, nil +} + +type NullableFindSloDefinitionsResponseOneOf struct { + value *FindSloDefinitionsResponseOneOf + isSet bool +} + +func (v NullableFindSloDefinitionsResponseOneOf) Get() *FindSloDefinitionsResponseOneOf { + return v.value +} + +func (v *NullableFindSloDefinitionsResponseOneOf) Set(val *FindSloDefinitionsResponseOneOf) { + v.value = val + v.isSet = true +} + +func (v NullableFindSloDefinitionsResponseOneOf) IsSet() bool { + return v.isSet +} + +func (v *NullableFindSloDefinitionsResponseOneOf) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFindSloDefinitionsResponseOneOf(val *FindSloDefinitionsResponseOneOf) *NullableFindSloDefinitionsResponseOneOf { + return &NullableFindSloDefinitionsResponseOneOf{value: val, isSet: true} +} + +func (v NullableFindSloDefinitionsResponseOneOf) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFindSloDefinitionsResponseOneOf) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/generated/slo/model_find_slo_definitions_response_one_of_1.go b/generated/slo/model_find_slo_definitions_response_one_of_1.go new file mode 100644 index 000000000..9476c49af --- /dev/null +++ b/generated/slo/model_find_slo_definitions_response_one_of_1.go @@ -0,0 +1,311 @@ +/* +SLOs + +OpenAPI schema for SLOs endpoints + +API version: 1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package slo + +import ( + "encoding/json" +) + +// checks if the FindSloDefinitionsResponseOneOf1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FindSloDefinitionsResponseOneOf1{} + +// FindSloDefinitionsResponseOneOf1 struct for FindSloDefinitionsResponseOneOf1 +type FindSloDefinitionsResponseOneOf1 struct { + // for backward compability + Page *float64 `json:"page,omitempty"` + // for backward compability + PerPage *float64 `json:"perPage,omitempty"` + Size *float64 `json:"size,omitempty"` + // the cursor to provide to get the next paged results + SearchAfter []string `json:"searchAfter,omitempty"` + Total *float64 `json:"total,omitempty"` + Results []SloWithSummaryResponse `json:"results,omitempty"` +} + +// NewFindSloDefinitionsResponseOneOf1 instantiates a new FindSloDefinitionsResponseOneOf1 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 NewFindSloDefinitionsResponseOneOf1() *FindSloDefinitionsResponseOneOf1 { + this := FindSloDefinitionsResponseOneOf1{} + var page float64 = 1 + this.Page = &page + return &this +} + +// NewFindSloDefinitionsResponseOneOf1WithDefaults instantiates a new FindSloDefinitionsResponseOneOf1 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 NewFindSloDefinitionsResponseOneOf1WithDefaults() *FindSloDefinitionsResponseOneOf1 { + this := FindSloDefinitionsResponseOneOf1{} + var page float64 = 1 + this.Page = &page + return &this +} + +// GetPage returns the Page field value if set, zero value otherwise. +func (o *FindSloDefinitionsResponseOneOf1) GetPage() float64 { + if o == nil || IsNil(o.Page) { + var ret float64 + return ret + } + return *o.Page +} + +// GetPageOk returns a tuple with the Page field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FindSloDefinitionsResponseOneOf1) GetPageOk() (*float64, bool) { + if o == nil || IsNil(o.Page) { + return nil, false + } + return o.Page, true +} + +// HasPage returns a boolean if a field has been set. +func (o *FindSloDefinitionsResponseOneOf1) HasPage() bool { + if o != nil && !IsNil(o.Page) { + return true + } + + return false +} + +// SetPage gets a reference to the given float64 and assigns it to the Page field. +func (o *FindSloDefinitionsResponseOneOf1) SetPage(v float64) { + o.Page = &v +} + +// GetPerPage returns the PerPage field value if set, zero value otherwise. +func (o *FindSloDefinitionsResponseOneOf1) GetPerPage() float64 { + if o == nil || IsNil(o.PerPage) { + var ret float64 + return ret + } + return *o.PerPage +} + +// GetPerPageOk returns a tuple with the PerPage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FindSloDefinitionsResponseOneOf1) GetPerPageOk() (*float64, bool) { + if o == nil || IsNil(o.PerPage) { + return nil, false + } + return o.PerPage, true +} + +// HasPerPage returns a boolean if a field has been set. +func (o *FindSloDefinitionsResponseOneOf1) HasPerPage() bool { + if o != nil && !IsNil(o.PerPage) { + return true + } + + return false +} + +// SetPerPage gets a reference to the given float64 and assigns it to the PerPage field. +func (o *FindSloDefinitionsResponseOneOf1) SetPerPage(v float64) { + o.PerPage = &v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *FindSloDefinitionsResponseOneOf1) GetSize() float64 { + if o == nil || IsNil(o.Size) { + var ret float64 + return ret + } + return *o.Size +} + +// GetSizeOk returns a tuple with the Size field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FindSloDefinitionsResponseOneOf1) GetSizeOk() (*float64, bool) { + if o == nil || IsNil(o.Size) { + return nil, false + } + return o.Size, true +} + +// HasSize returns a boolean if a field has been set. +func (o *FindSloDefinitionsResponseOneOf1) HasSize() bool { + if o != nil && !IsNil(o.Size) { + return true + } + + return false +} + +// SetSize gets a reference to the given float64 and assigns it to the Size field. +func (o *FindSloDefinitionsResponseOneOf1) SetSize(v float64) { + o.Size = &v +} + +// GetSearchAfter returns the SearchAfter field value if set, zero value otherwise. +func (o *FindSloDefinitionsResponseOneOf1) GetSearchAfter() []string { + if o == nil || IsNil(o.SearchAfter) { + var ret []string + return ret + } + return o.SearchAfter +} + +// GetSearchAfterOk returns a tuple with the SearchAfter field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FindSloDefinitionsResponseOneOf1) GetSearchAfterOk() ([]string, bool) { + if o == nil || IsNil(o.SearchAfter) { + return nil, false + } + return o.SearchAfter, true +} + +// HasSearchAfter returns a boolean if a field has been set. +func (o *FindSloDefinitionsResponseOneOf1) HasSearchAfter() bool { + if o != nil && !IsNil(o.SearchAfter) { + return true + } + + return false +} + +// SetSearchAfter gets a reference to the given []string and assigns it to the SearchAfter field. +func (o *FindSloDefinitionsResponseOneOf1) SetSearchAfter(v []string) { + o.SearchAfter = v +} + +// GetTotal returns the Total field value if set, zero value otherwise. +func (o *FindSloDefinitionsResponseOneOf1) GetTotal() float64 { + if o == nil || IsNil(o.Total) { + var ret float64 + return ret + } + return *o.Total +} + +// GetTotalOk returns a tuple with the Total field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FindSloDefinitionsResponseOneOf1) GetTotalOk() (*float64, bool) { + if o == nil || IsNil(o.Total) { + return nil, false + } + return o.Total, true +} + +// HasTotal returns a boolean if a field has been set. +func (o *FindSloDefinitionsResponseOneOf1) HasTotal() bool { + if o != nil && !IsNil(o.Total) { + return true + } + + return false +} + +// SetTotal gets a reference to the given float64 and assigns it to the Total field. +func (o *FindSloDefinitionsResponseOneOf1) SetTotal(v float64) { + o.Total = &v +} + +// GetResults returns the Results field value if set, zero value otherwise. +func (o *FindSloDefinitionsResponseOneOf1) GetResults() []SloWithSummaryResponse { + if o == nil || IsNil(o.Results) { + var ret []SloWithSummaryResponse + return ret + } + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FindSloDefinitionsResponseOneOf1) GetResultsOk() ([]SloWithSummaryResponse, bool) { + if o == nil || IsNil(o.Results) { + return nil, false + } + return o.Results, true +} + +// HasResults returns a boolean if a field has been set. +func (o *FindSloDefinitionsResponseOneOf1) HasResults() bool { + if o != nil && !IsNil(o.Results) { + return true + } + + return false +} + +// SetResults gets a reference to the given []SloWithSummaryResponse and assigns it to the Results field. +func (o *FindSloDefinitionsResponseOneOf1) SetResults(v []SloWithSummaryResponse) { + o.Results = v +} + +func (o FindSloDefinitionsResponseOneOf1) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o FindSloDefinitionsResponseOneOf1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Page) { + toSerialize["page"] = o.Page + } + if !IsNil(o.PerPage) { + toSerialize["perPage"] = o.PerPage + } + if !IsNil(o.Size) { + toSerialize["size"] = o.Size + } + if !IsNil(o.SearchAfter) { + toSerialize["searchAfter"] = o.SearchAfter + } + if !IsNil(o.Total) { + toSerialize["total"] = o.Total + } + if !IsNil(o.Results) { + toSerialize["results"] = o.Results + } + return toSerialize, nil +} + +type NullableFindSloDefinitionsResponseOneOf1 struct { + value *FindSloDefinitionsResponseOneOf1 + isSet bool +} + +func (v NullableFindSloDefinitionsResponseOneOf1) Get() *FindSloDefinitionsResponseOneOf1 { + return v.value +} + +func (v *NullableFindSloDefinitionsResponseOneOf1) Set(val *FindSloDefinitionsResponseOneOf1) { + v.value = val + v.isSet = true +} + +func (v NullableFindSloDefinitionsResponseOneOf1) IsSet() bool { + return v.isSet +} + +func (v *NullableFindSloDefinitionsResponseOneOf1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFindSloDefinitionsResponseOneOf1(val *FindSloDefinitionsResponseOneOf1) *NullableFindSloDefinitionsResponseOneOf1 { + return &NullableFindSloDefinitionsResponseOneOf1{value: val, isSet: true} +} + +func (v NullableFindSloDefinitionsResponseOneOf1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFindSloDefinitionsResponseOneOf1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/generated/slo/model_find_slo_response.go b/generated/slo/model_find_slo_response.go index fe90673e2..8937d77c8 100644 --- a/generated/slo/model_find_slo_response.go +++ b/generated/slo/model_find_slo_response.go @@ -3,7 +3,7 @@ SLOs OpenAPI schema for SLOs endpoints -API version: 1.0 +API version: 1.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -19,10 +19,13 @@ var _ MappedNullable = &FindSloResponse{} // FindSloResponse A paginated response of SLOs matching the query. type FindSloResponse struct { - Page *float64 `json:"page,omitempty"` - PerPage *float64 `json:"perPage,omitempty"` - Total *float64 `json:"total,omitempty"` - Results []SloResponse `json:"results,omitempty"` + // Size provided for cursor based pagination + Size *float64 `json:"size,omitempty"` + SearchAfter *string `json:"searchAfter,omitempty"` + Page *float64 `json:"page,omitempty"` + PerPage *float64 `json:"perPage,omitempty"` + Total *float64 `json:"total,omitempty"` + Results []SloWithSummaryResponse `json:"results,omitempty"` } // NewFindSloResponse instantiates a new FindSloResponse object @@ -42,6 +45,70 @@ func NewFindSloResponseWithDefaults() *FindSloResponse { return &this } +// GetSize returns the Size field value if set, zero value otherwise. +func (o *FindSloResponse) GetSize() float64 { + if o == nil || IsNil(o.Size) { + var ret float64 + return ret + } + return *o.Size +} + +// GetSizeOk returns a tuple with the Size field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FindSloResponse) GetSizeOk() (*float64, bool) { + if o == nil || IsNil(o.Size) { + return nil, false + } + return o.Size, true +} + +// HasSize returns a boolean if a field has been set. +func (o *FindSloResponse) HasSize() bool { + if o != nil && !IsNil(o.Size) { + return true + } + + return false +} + +// SetSize gets a reference to the given float64 and assigns it to the Size field. +func (o *FindSloResponse) SetSize(v float64) { + o.Size = &v +} + +// GetSearchAfter returns the SearchAfter field value if set, zero value otherwise. +func (o *FindSloResponse) GetSearchAfter() string { + if o == nil || IsNil(o.SearchAfter) { + var ret string + return ret + } + return *o.SearchAfter +} + +// GetSearchAfterOk returns a tuple with the SearchAfter field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FindSloResponse) GetSearchAfterOk() (*string, bool) { + if o == nil || IsNil(o.SearchAfter) { + return nil, false + } + return o.SearchAfter, true +} + +// HasSearchAfter returns a boolean if a field has been set. +func (o *FindSloResponse) HasSearchAfter() bool { + if o != nil && !IsNil(o.SearchAfter) { + return true + } + + return false +} + +// SetSearchAfter gets a reference to the given string and assigns it to the SearchAfter field. +func (o *FindSloResponse) SetSearchAfter(v string) { + o.SearchAfter = &v +} + // GetPage returns the Page field value if set, zero value otherwise. func (o *FindSloResponse) GetPage() float64 { if o == nil || IsNil(o.Page) { @@ -139,9 +206,9 @@ func (o *FindSloResponse) SetTotal(v float64) { } // GetResults returns the Results field value if set, zero value otherwise. -func (o *FindSloResponse) GetResults() []SloResponse { +func (o *FindSloResponse) GetResults() []SloWithSummaryResponse { if o == nil || IsNil(o.Results) { - var ret []SloResponse + var ret []SloWithSummaryResponse return ret } return o.Results @@ -149,7 +216,7 @@ func (o *FindSloResponse) GetResults() []SloResponse { // GetResultsOk returns a tuple with the Results field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *FindSloResponse) GetResultsOk() ([]SloResponse, bool) { +func (o *FindSloResponse) GetResultsOk() ([]SloWithSummaryResponse, bool) { if o == nil || IsNil(o.Results) { return nil, false } @@ -165,8 +232,8 @@ func (o *FindSloResponse) HasResults() bool { return false } -// SetResults gets a reference to the given []SloResponse and assigns it to the Results field. -func (o *FindSloResponse) SetResults(v []SloResponse) { +// SetResults gets a reference to the given []SloWithSummaryResponse and assigns it to the Results field. +func (o *FindSloResponse) SetResults(v []SloWithSummaryResponse) { o.Results = v } @@ -180,6 +247,12 @@ func (o FindSloResponse) MarshalJSON() ([]byte, error) { func (o FindSloResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} + if !IsNil(o.Size) { + toSerialize["size"] = o.Size + } + if !IsNil(o.SearchAfter) { + toSerialize["searchAfter"] = o.SearchAfter + } if !IsNil(o.Page) { toSerialize["page"] = o.Page } diff --git a/generated/slo/model_group_by.go b/generated/slo/model_group_by.go new file mode 100644 index 000000000..6ed2ac30b --- /dev/null +++ b/generated/slo/model_group_by.go @@ -0,0 +1,148 @@ +/* +SLOs + +OpenAPI schema for SLOs endpoints + +API version: 1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package slo + +import ( + "encoding/json" + "fmt" +) + +// GroupBy - optional group by field or fields to use to generate an SLO per distinct value +type GroupBy struct { + ArrayOfString *[]string + String *string +} + +// []stringAsGroupBy is a convenience function that returns []string wrapped in GroupBy +func ArrayOfStringAsGroupBy(v *[]string) GroupBy { + return GroupBy{ + ArrayOfString: v, + } +} + +// stringAsGroupBy is a convenience function that returns string wrapped in GroupBy +func StringAsGroupBy(v *string) GroupBy { + return GroupBy{ + String: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *GroupBy) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into ArrayOfString + err = json.Unmarshal(data, &dst.ArrayOfString) + if err == nil { + jsonArrayString, _ := json.Marshal(dst.ArrayOfString) + if string(jsonArrayString) == "{}" { // empty struct + dst.ArrayOfString = nil + } else { + match++ + } + } else { + dst.ArrayOfString = nil + } + + // try to unmarshal data into String + err = json.Unmarshal(data, &dst.String) + if err == nil { + jsonstring, _ := json.Marshal(dst.String) + if string(jsonstring) == "{}" { // empty struct + dst.String = nil + } else { + match++ + } + } else { + dst.String = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.ArrayOfString = nil + dst.String = nil + + return fmt.Errorf("data matches more than one schema in oneOf(GroupBy)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(GroupBy)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src GroupBy) MarshalJSON() ([]byte, error) { + if src.ArrayOfString != nil { + return json.Marshal(&src.ArrayOfString) + } + + if src.String != nil { + return json.Marshal(&src.String) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *GroupBy) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.ArrayOfString != nil { + return obj.ArrayOfString + } + + if obj.String != nil { + return obj.String + } + + // all schemas are nil + return nil +} + +type NullableGroupBy struct { + value *GroupBy + isSet bool +} + +func (v NullableGroupBy) Get() *GroupBy { + return v.value +} + +func (v *NullableGroupBy) Set(val *GroupBy) { + v.value = val + v.isSet = true +} + +func (v NullableGroupBy) IsSet() bool { + return v.isSet +} + +func (v *NullableGroupBy) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGroupBy(val *GroupBy) *NullableGroupBy { + return &NullableGroupBy{value: val, isSet: true} +} + +func (v NullableGroupBy) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGroupBy) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/generated/slo/model_indicator_properties_apm_availability.go b/generated/slo/model_indicator_properties_apm_availability.go index a449183cc..376e00abb 100644 --- a/generated/slo/model_indicator_properties_apm_availability.go +++ b/generated/slo/model_indicator_properties_apm_availability.go @@ -3,7 +3,7 @@ SLOs OpenAPI schema for SLOs endpoints -API version: 1.0 +API version: 1.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/generated/slo/model_indicator_properties_apm_availability_params.go b/generated/slo/model_indicator_properties_apm_availability_params.go index 5872135c1..7f6b63959 100644 --- a/generated/slo/model_indicator_properties_apm_availability_params.go +++ b/generated/slo/model_indicator_properties_apm_availability_params.go @@ -3,7 +3,7 @@ SLOs OpenAPI schema for SLOs endpoints -API version: 1.0 +API version: 1.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/generated/slo/model_indicator_properties_apm_latency.go b/generated/slo/model_indicator_properties_apm_latency.go index 5876d056a..29fe5f4b6 100644 --- a/generated/slo/model_indicator_properties_apm_latency.go +++ b/generated/slo/model_indicator_properties_apm_latency.go @@ -3,7 +3,7 @@ SLOs OpenAPI schema for SLOs endpoints -API version: 1.0 +API version: 1.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/generated/slo/model_indicator_properties_apm_latency_params.go b/generated/slo/model_indicator_properties_apm_latency_params.go index 74c484f39..00afb00bd 100644 --- a/generated/slo/model_indicator_properties_apm_latency_params.go +++ b/generated/slo/model_indicator_properties_apm_latency_params.go @@ -3,7 +3,7 @@ SLOs OpenAPI schema for SLOs endpoints -API version: 1.0 +API version: 1.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/generated/slo/model_indicator_properties_custom_kql.go b/generated/slo/model_indicator_properties_custom_kql.go index 657856d3f..c2ca95e32 100644 --- a/generated/slo/model_indicator_properties_custom_kql.go +++ b/generated/slo/model_indicator_properties_custom_kql.go @@ -3,7 +3,7 @@ SLOs OpenAPI schema for SLOs endpoints -API version: 1.0 +API version: 1.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -17,7 +17,7 @@ import ( // checks if the IndicatorPropertiesCustomKql type satisfies the MappedNullable interface at compile time var _ MappedNullable = &IndicatorPropertiesCustomKql{} -// IndicatorPropertiesCustomKql Defines properties for a custom KQL indicator type +// IndicatorPropertiesCustomKql Defines properties for a custom query indicator type type IndicatorPropertiesCustomKql struct { Params IndicatorPropertiesCustomKqlParams `json:"params"` // The type of indicator. diff --git a/generated/slo/model_indicator_properties_custom_kql_params.go b/generated/slo/model_indicator_properties_custom_kql_params.go index e84d0b41d..8920b91b8 100644 --- a/generated/slo/model_indicator_properties_custom_kql_params.go +++ b/generated/slo/model_indicator_properties_custom_kql_params.go @@ -3,7 +3,7 @@ SLOs OpenAPI schema for SLOs endpoints -API version: 1.0 +API version: 1.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -21,12 +21,11 @@ var _ MappedNullable = &IndicatorPropertiesCustomKqlParams{} type IndicatorPropertiesCustomKqlParams struct { // The index or index pattern to use Index string `json:"index"` - // the KQL query to filter the documents with. - Filter *string `json:"filter,omitempty"` - // the KQL query used to define the good events. - Good string `json:"good"` - // the KQL query used to define all events. - Total string `json:"total"` + // The kibana data view id to use, primarily used to include data view runtime mappings. Make sure to save SLO again if you add/update run time fields to the data view and if those fields are being used in slo queries. + DataViewId *string `json:"dataViewId,omitempty"` + Filter *KqlWithFilters `json:"filter,omitempty"` + Good KqlWithFiltersGood `json:"good"` + Total KqlWithFiltersTotal `json:"total"` // The timestamp field used in the source indice. TimestampField string `json:"timestampField"` } @@ -35,7 +34,7 @@ type IndicatorPropertiesCustomKqlParams struct { // 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 NewIndicatorPropertiesCustomKqlParams(index string, good string, total string, timestampField string) *IndicatorPropertiesCustomKqlParams { +func NewIndicatorPropertiesCustomKqlParams(index string, good KqlWithFiltersGood, total KqlWithFiltersTotal, timestampField string) *IndicatorPropertiesCustomKqlParams { this := IndicatorPropertiesCustomKqlParams{} this.Index = index this.Good = good @@ -76,10 +75,42 @@ func (o *IndicatorPropertiesCustomKqlParams) SetIndex(v string) { o.Index = v } +// GetDataViewId returns the DataViewId field value if set, zero value otherwise. +func (o *IndicatorPropertiesCustomKqlParams) GetDataViewId() string { + if o == nil || IsNil(o.DataViewId) { + var ret string + return ret + } + return *o.DataViewId +} + +// GetDataViewIdOk returns a tuple with the DataViewId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IndicatorPropertiesCustomKqlParams) GetDataViewIdOk() (*string, bool) { + if o == nil || IsNil(o.DataViewId) { + return nil, false + } + return o.DataViewId, true +} + +// HasDataViewId returns a boolean if a field has been set. +func (o *IndicatorPropertiesCustomKqlParams) HasDataViewId() bool { + if o != nil && !IsNil(o.DataViewId) { + return true + } + + return false +} + +// SetDataViewId gets a reference to the given string and assigns it to the DataViewId field. +func (o *IndicatorPropertiesCustomKqlParams) SetDataViewId(v string) { + o.DataViewId = &v +} + // GetFilter returns the Filter field value if set, zero value otherwise. -func (o *IndicatorPropertiesCustomKqlParams) GetFilter() string { +func (o *IndicatorPropertiesCustomKqlParams) GetFilter() KqlWithFilters { if o == nil || IsNil(o.Filter) { - var ret string + var ret KqlWithFilters return ret } return *o.Filter @@ -87,7 +118,7 @@ func (o *IndicatorPropertiesCustomKqlParams) GetFilter() string { // GetFilterOk returns a tuple with the Filter field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *IndicatorPropertiesCustomKqlParams) GetFilterOk() (*string, bool) { +func (o *IndicatorPropertiesCustomKqlParams) GetFilterOk() (*KqlWithFilters, bool) { if o == nil || IsNil(o.Filter) { return nil, false } @@ -103,15 +134,15 @@ func (o *IndicatorPropertiesCustomKqlParams) HasFilter() bool { return false } -// SetFilter gets a reference to the given string and assigns it to the Filter field. -func (o *IndicatorPropertiesCustomKqlParams) SetFilter(v string) { +// SetFilter gets a reference to the given KqlWithFilters and assigns it to the Filter field. +func (o *IndicatorPropertiesCustomKqlParams) SetFilter(v KqlWithFilters) { o.Filter = &v } // GetGood returns the Good field value -func (o *IndicatorPropertiesCustomKqlParams) GetGood() string { +func (o *IndicatorPropertiesCustomKqlParams) GetGood() KqlWithFiltersGood { if o == nil { - var ret string + var ret KqlWithFiltersGood return ret } @@ -120,7 +151,7 @@ func (o *IndicatorPropertiesCustomKqlParams) GetGood() string { // GetGoodOk returns a tuple with the Good field value // and a boolean to check if the value has been set. -func (o *IndicatorPropertiesCustomKqlParams) GetGoodOk() (*string, bool) { +func (o *IndicatorPropertiesCustomKqlParams) GetGoodOk() (*KqlWithFiltersGood, bool) { if o == nil { return nil, false } @@ -128,14 +159,14 @@ func (o *IndicatorPropertiesCustomKqlParams) GetGoodOk() (*string, bool) { } // SetGood sets field value -func (o *IndicatorPropertiesCustomKqlParams) SetGood(v string) { +func (o *IndicatorPropertiesCustomKqlParams) SetGood(v KqlWithFiltersGood) { o.Good = v } // GetTotal returns the Total field value -func (o *IndicatorPropertiesCustomKqlParams) GetTotal() string { +func (o *IndicatorPropertiesCustomKqlParams) GetTotal() KqlWithFiltersTotal { if o == nil { - var ret string + var ret KqlWithFiltersTotal return ret } @@ -144,7 +175,7 @@ func (o *IndicatorPropertiesCustomKqlParams) GetTotal() string { // GetTotalOk returns a tuple with the Total field value // and a boolean to check if the value has been set. -func (o *IndicatorPropertiesCustomKqlParams) GetTotalOk() (*string, bool) { +func (o *IndicatorPropertiesCustomKqlParams) GetTotalOk() (*KqlWithFiltersTotal, bool) { if o == nil { return nil, false } @@ -152,7 +183,7 @@ func (o *IndicatorPropertiesCustomKqlParams) GetTotalOk() (*string, bool) { } // SetTotal sets field value -func (o *IndicatorPropertiesCustomKqlParams) SetTotal(v string) { +func (o *IndicatorPropertiesCustomKqlParams) SetTotal(v KqlWithFiltersTotal) { o.Total = v } @@ -191,6 +222,9 @@ func (o IndicatorPropertiesCustomKqlParams) MarshalJSON() ([]byte, error) { func (o IndicatorPropertiesCustomKqlParams) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["index"] = o.Index + if !IsNil(o.DataViewId) { + toSerialize["dataViewId"] = o.DataViewId + } if !IsNil(o.Filter) { toSerialize["filter"] = o.Filter } diff --git a/generated/slo/model_indicator_properties_custom_metric.go b/generated/slo/model_indicator_properties_custom_metric.go index 80b194643..0c611620e 100644 --- a/generated/slo/model_indicator_properties_custom_metric.go +++ b/generated/slo/model_indicator_properties_custom_metric.go @@ -3,7 +3,7 @@ SLOs OpenAPI schema for SLOs endpoints -API version: 1.0 +API version: 1.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/generated/slo/model_indicator_properties_custom_metric_params.go b/generated/slo/model_indicator_properties_custom_metric_params.go index 88f7cc8db..d866a92db 100644 --- a/generated/slo/model_indicator_properties_custom_metric_params.go +++ b/generated/slo/model_indicator_properties_custom_metric_params.go @@ -3,7 +3,7 @@ SLOs OpenAPI schema for SLOs endpoints -API version: 1.0 +API version: 1.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -21,6 +21,8 @@ var _ MappedNullable = &IndicatorPropertiesCustomMetricParams{} type IndicatorPropertiesCustomMetricParams struct { // The index or index pattern to use Index string `json:"index"` + // The kibana data view id to use, primarily used to include data view runtime mappings. Make sure to save SLO again if you add/update run time fields to the data view and if those fields are being used in slo queries. + DataViewId *string `json:"dataViewId,omitempty"` // the KQL query to filter the documents with. Filter *string `json:"filter,omitempty"` // The timestamp field used in the source indice. @@ -74,6 +76,38 @@ func (o *IndicatorPropertiesCustomMetricParams) SetIndex(v string) { o.Index = v } +// GetDataViewId returns the DataViewId field value if set, zero value otherwise. +func (o *IndicatorPropertiesCustomMetricParams) GetDataViewId() string { + if o == nil || IsNil(o.DataViewId) { + var ret string + return ret + } + return *o.DataViewId +} + +// GetDataViewIdOk returns a tuple with the DataViewId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IndicatorPropertiesCustomMetricParams) GetDataViewIdOk() (*string, bool) { + if o == nil || IsNil(o.DataViewId) { + return nil, false + } + return o.DataViewId, true +} + +// HasDataViewId returns a boolean if a field has been set. +func (o *IndicatorPropertiesCustomMetricParams) HasDataViewId() bool { + if o != nil && !IsNil(o.DataViewId) { + return true + } + + return false +} + +// SetDataViewId gets a reference to the given string and assigns it to the DataViewId field. +func (o *IndicatorPropertiesCustomMetricParams) SetDataViewId(v string) { + o.DataViewId = &v +} + // GetFilter returns the Filter field value if set, zero value otherwise. func (o *IndicatorPropertiesCustomMetricParams) GetFilter() string { if o == nil || IsNil(o.Filter) { @@ -189,6 +223,9 @@ func (o IndicatorPropertiesCustomMetricParams) MarshalJSON() ([]byte, error) { func (o IndicatorPropertiesCustomMetricParams) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["index"] = o.Index + if !IsNil(o.DataViewId) { + toSerialize["dataViewId"] = o.DataViewId + } if !IsNil(o.Filter) { toSerialize["filter"] = o.Filter } diff --git a/generated/slo/model_indicator_properties_custom_metric_params_good.go b/generated/slo/model_indicator_properties_custom_metric_params_good.go index ada18b405..a3ae2db5f 100644 --- a/generated/slo/model_indicator_properties_custom_metric_params_good.go +++ b/generated/slo/model_indicator_properties_custom_metric_params_good.go @@ -3,7 +3,7 @@ SLOs OpenAPI schema for SLOs endpoints -API version: 1.0 +API version: 1.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/generated/slo/model_indicator_properties_custom_metric_params_good_metrics_inner.go b/generated/slo/model_indicator_properties_custom_metric_params_good_metrics_inner.go index 59c91d2fb..ce66a415c 100644 --- a/generated/slo/model_indicator_properties_custom_metric_params_good_metrics_inner.go +++ b/generated/slo/model_indicator_properties_custom_metric_params_good_metrics_inner.go @@ -3,7 +3,7 @@ SLOs OpenAPI schema for SLOs endpoints -API version: 1.0 +API version: 1.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -12,164 +12,100 @@ package slo import ( "encoding/json" + "fmt" ) -// checks if the IndicatorPropertiesCustomMetricParamsGoodMetricsInner type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &IndicatorPropertiesCustomMetricParamsGoodMetricsInner{} - -// IndicatorPropertiesCustomMetricParamsGoodMetricsInner struct for IndicatorPropertiesCustomMetricParamsGoodMetricsInner +// IndicatorPropertiesCustomMetricParamsGoodMetricsInner - struct for IndicatorPropertiesCustomMetricParamsGoodMetricsInner type IndicatorPropertiesCustomMetricParamsGoodMetricsInner struct { - // The name of the metric. Only valid options are A-Z - Name string `json:"name"` - // The aggregation type of the metric. Only valid option is \"sum\" - Aggregation string `json:"aggregation"` - // The field of the metric. - Field string `json:"field"` - // The filter to apply to the metric. - Filter *string `json:"filter,omitempty"` -} - -// NewIndicatorPropertiesCustomMetricParamsGoodMetricsInner instantiates a new IndicatorPropertiesCustomMetricParamsGoodMetricsInner 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 NewIndicatorPropertiesCustomMetricParamsGoodMetricsInner(name string, aggregation string, field string) *IndicatorPropertiesCustomMetricParamsGoodMetricsInner { - this := IndicatorPropertiesCustomMetricParamsGoodMetricsInner{} - this.Name = name - this.Aggregation = aggregation - this.Field = field - return &this + IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf *IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf + IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1 *IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1 } -// NewIndicatorPropertiesCustomMetricParamsGoodMetricsInnerWithDefaults instantiates a new IndicatorPropertiesCustomMetricParamsGoodMetricsInner 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 NewIndicatorPropertiesCustomMetricParamsGoodMetricsInnerWithDefaults() *IndicatorPropertiesCustomMetricParamsGoodMetricsInner { - this := IndicatorPropertiesCustomMetricParamsGoodMetricsInner{} - return &this -} - -// GetName returns the Name field value -func (o *IndicatorPropertiesCustomMetricParamsGoodMetricsInner) GetName() string { - if o == nil { - var ret string - return ret +// IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOfAsIndicatorPropertiesCustomMetricParamsGoodMetricsInner is a convenience function that returns IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf wrapped in IndicatorPropertiesCustomMetricParamsGoodMetricsInner +func IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOfAsIndicatorPropertiesCustomMetricParamsGoodMetricsInner(v *IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf) IndicatorPropertiesCustomMetricParamsGoodMetricsInner { + return IndicatorPropertiesCustomMetricParamsGoodMetricsInner{ + IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf: v, } - - return o.Name } -// GetNameOk returns a tuple with the Name field value -// and a boolean to check if the value has been set. -func (o *IndicatorPropertiesCustomMetricParamsGoodMetricsInner) GetNameOk() (*string, bool) { - if o == nil { - return nil, false +// IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1AsIndicatorPropertiesCustomMetricParamsGoodMetricsInner is a convenience function that returns IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1 wrapped in IndicatorPropertiesCustomMetricParamsGoodMetricsInner +func IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1AsIndicatorPropertiesCustomMetricParamsGoodMetricsInner(v *IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1) IndicatorPropertiesCustomMetricParamsGoodMetricsInner { + return IndicatorPropertiesCustomMetricParamsGoodMetricsInner{ + IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1: v, } - return &o.Name, true } -// SetName sets field value -func (o *IndicatorPropertiesCustomMetricParamsGoodMetricsInner) SetName(v string) { - o.Name = v -} - -// GetAggregation returns the Aggregation field value -func (o *IndicatorPropertiesCustomMetricParamsGoodMetricsInner) GetAggregation() string { - if o == nil { - var ret string - return ret +// Unmarshal JSON data into one of the pointers in the struct +func (dst *IndicatorPropertiesCustomMetricParamsGoodMetricsInner) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf + err = json.Unmarshal(data, &dst.IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf) + if err == nil { + jsonIndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf, _ := json.Marshal(dst.IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf) + if string(jsonIndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf) == "{}" { // empty struct + dst.IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf = nil + } else { + match++ + } + } else { + dst.IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf = nil } - return o.Aggregation -} - -// GetAggregationOk returns a tuple with the Aggregation field value -// and a boolean to check if the value has been set. -func (o *IndicatorPropertiesCustomMetricParamsGoodMetricsInner) GetAggregationOk() (*string, bool) { - if o == nil { - return nil, false + // try to unmarshal data into IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1 + err = json.Unmarshal(data, &dst.IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1) + if err == nil { + jsonIndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1, _ := json.Marshal(dst.IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1) + if string(jsonIndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1) == "{}" { // empty struct + dst.IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1 = nil + } else { + match++ + } + } else { + dst.IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1 = nil } - return &o.Aggregation, true -} -// SetAggregation sets field value -func (o *IndicatorPropertiesCustomMetricParamsGoodMetricsInner) SetAggregation(v string) { - o.Aggregation = v -} + if match > 1 { // more than 1 match + // reset to nil + dst.IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf = nil + dst.IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1 = nil -// GetField returns the Field field value -func (o *IndicatorPropertiesCustomMetricParamsGoodMetricsInner) GetField() string { - if o == nil { - var ret string - return ret + return fmt.Errorf("data matches more than one schema in oneOf(IndicatorPropertiesCustomMetricParamsGoodMetricsInner)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(IndicatorPropertiesCustomMetricParamsGoodMetricsInner)") } - - return o.Field } -// GetFieldOk returns a tuple with the Field field value -// and a boolean to check if the value has been set. -func (o *IndicatorPropertiesCustomMetricParamsGoodMetricsInner) GetFieldOk() (*string, bool) { - if o == nil { - return nil, false +// Marshal data from the first non-nil pointers in the struct to JSON +func (src IndicatorPropertiesCustomMetricParamsGoodMetricsInner) MarshalJSON() ([]byte, error) { + if src.IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf != nil { + return json.Marshal(&src.IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf) } - return &o.Field, true -} - -// SetField sets field value -func (o *IndicatorPropertiesCustomMetricParamsGoodMetricsInner) SetField(v string) { - o.Field = v -} -// GetFilter returns the Filter field value if set, zero value otherwise. -func (o *IndicatorPropertiesCustomMetricParamsGoodMetricsInner) GetFilter() string { - if o == nil || IsNil(o.Filter) { - var ret string - return ret + if src.IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1 != nil { + return json.Marshal(&src.IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1) } - return *o.Filter -} -// GetFilterOk returns a tuple with the Filter field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *IndicatorPropertiesCustomMetricParamsGoodMetricsInner) GetFilterOk() (*string, bool) { - if o == nil || IsNil(o.Filter) { - return nil, false - } - return o.Filter, true + return nil, nil // no data in oneOf schemas } -// HasFilter returns a boolean if a field has been set. -func (o *IndicatorPropertiesCustomMetricParamsGoodMetricsInner) HasFilter() bool { - if o != nil && !IsNil(o.Filter) { - return true +// Get the actual instance +func (obj *IndicatorPropertiesCustomMetricParamsGoodMetricsInner) GetActualInstance() interface{} { + if obj == nil { + return nil } - - return false -} - -// SetFilter gets a reference to the given string and assigns it to the Filter field. -func (o *IndicatorPropertiesCustomMetricParamsGoodMetricsInner) SetFilter(v string) { - o.Filter = &v -} - -func (o IndicatorPropertiesCustomMetricParamsGoodMetricsInner) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err + if obj.IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf != nil { + return obj.IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf } - return json.Marshal(toSerialize) -} -func (o IndicatorPropertiesCustomMetricParamsGoodMetricsInner) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["name"] = o.Name - toSerialize["aggregation"] = o.Aggregation - toSerialize["field"] = o.Field - if !IsNil(o.Filter) { - toSerialize["filter"] = o.Filter + if obj.IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1 != nil { + return obj.IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1 } - return toSerialize, nil + + // all schemas are nil + return nil } type NullableIndicatorPropertiesCustomMetricParamsGoodMetricsInner struct { diff --git a/generated/slo/model_indicator_properties_custom_metric_params_good_metrics_inner_one_of.go b/generated/slo/model_indicator_properties_custom_metric_params_good_metrics_inner_one_of.go new file mode 100644 index 000000000..2e2a11c07 --- /dev/null +++ b/generated/slo/model_indicator_properties_custom_metric_params_good_metrics_inner_one_of.go @@ -0,0 +1,209 @@ +/* +SLOs + +OpenAPI schema for SLOs endpoints + +API version: 1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package slo + +import ( + "encoding/json" +) + +// checks if the IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf{} + +// IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf struct for IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf +type IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf struct { + // The name of the metric. Only valid options are A-Z + Name string `json:"name"` + // The aggregation type of the metric. + Aggregation string `json:"aggregation"` + // The field of the metric. + Field string `json:"field"` + // The filter to apply to the metric. + Filter *string `json:"filter,omitempty"` +} + +// NewIndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf instantiates a new IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf 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 NewIndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf(name string, aggregation string, field string) *IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf { + this := IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf{} + this.Name = name + this.Aggregation = aggregation + this.Field = field + return &this +} + +// NewIndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOfWithDefaults instantiates a new IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf 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 NewIndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOfWithDefaults() *IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf { + this := IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf{} + return &this +} + +// GetName returns the Name field value +func (o *IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf) SetName(v string) { + o.Name = v +} + +// GetAggregation returns the Aggregation field value +func (o *IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf) GetAggregation() string { + if o == nil { + var ret string + return ret + } + + return o.Aggregation +} + +// GetAggregationOk returns a tuple with the Aggregation field value +// and a boolean to check if the value has been set. +func (o *IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf) GetAggregationOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Aggregation, true +} + +// SetAggregation sets field value +func (o *IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf) SetAggregation(v string) { + o.Aggregation = v +} + +// GetField returns the Field field value +func (o *IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf) GetField() string { + if o == nil { + var ret string + return ret + } + + return o.Field +} + +// GetFieldOk returns a tuple with the Field field value +// and a boolean to check if the value has been set. +func (o *IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf) GetFieldOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Field, true +} + +// SetField sets field value +func (o *IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf) SetField(v string) { + o.Field = v +} + +// GetFilter returns the Filter field value if set, zero value otherwise. +func (o *IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf) GetFilter() string { + if o == nil || IsNil(o.Filter) { + var ret string + return ret + } + return *o.Filter +} + +// GetFilterOk returns a tuple with the Filter field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf) GetFilterOk() (*string, bool) { + if o == nil || IsNil(o.Filter) { + return nil, false + } + return o.Filter, true +} + +// HasFilter returns a boolean if a field has been set. +func (o *IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf) HasFilter() bool { + if o != nil && !IsNil(o.Filter) { + return true + } + + return false +} + +// SetFilter gets a reference to the given string and assigns it to the Filter field. +func (o *IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf) SetFilter(v string) { + o.Filter = &v +} + +func (o IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["aggregation"] = o.Aggregation + toSerialize["field"] = o.Field + if !IsNil(o.Filter) { + toSerialize["filter"] = o.Filter + } + return toSerialize, nil +} + +type NullableIndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf struct { + value *IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf + isSet bool +} + +func (v NullableIndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf) Get() *IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf { + return v.value +} + +func (v *NullableIndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf) Set(val *IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf) { + v.value = val + v.isSet = true +} + +func (v NullableIndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf) IsSet() bool { + return v.isSet +} + +func (v *NullableIndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf(val *IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf) *NullableIndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf { + return &NullableIndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf{value: val, isSet: true} +} + +func (v NullableIndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/generated/slo/model_indicator_properties_custom_metric_params_good_metrics_inner_one_of_1.go b/generated/slo/model_indicator_properties_custom_metric_params_good_metrics_inner_one_of_1.go new file mode 100644 index 000000000..e5db45989 --- /dev/null +++ b/generated/slo/model_indicator_properties_custom_metric_params_good_metrics_inner_one_of_1.go @@ -0,0 +1,181 @@ +/* +SLOs + +OpenAPI schema for SLOs endpoints + +API version: 1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package slo + +import ( + "encoding/json" +) + +// checks if the IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1{} + +// IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1 struct for IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1 +type IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1 struct { + // The name of the metric. Only valid options are A-Z + Name string `json:"name"` + // The aggregation type of the metric. + Aggregation string `json:"aggregation"` + // The filter to apply to the metric. + Filter *string `json:"filter,omitempty"` +} + +// NewIndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1 instantiates a new IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1 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 NewIndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1(name string, aggregation string) *IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1 { + this := IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1{} + this.Name = name + this.Aggregation = aggregation + return &this +} + +// NewIndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1WithDefaults instantiates a new IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1 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 NewIndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1WithDefaults() *IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1 { + this := IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1{} + return &this +} + +// GetName returns the Name field value +func (o *IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1) SetName(v string) { + o.Name = v +} + +// GetAggregation returns the Aggregation field value +func (o *IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1) GetAggregation() string { + if o == nil { + var ret string + return ret + } + + return o.Aggregation +} + +// GetAggregationOk returns a tuple with the Aggregation field value +// and a boolean to check if the value has been set. +func (o *IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1) GetAggregationOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Aggregation, true +} + +// SetAggregation sets field value +func (o *IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1) SetAggregation(v string) { + o.Aggregation = v +} + +// GetFilter returns the Filter field value if set, zero value otherwise. +func (o *IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1) GetFilter() string { + if o == nil || IsNil(o.Filter) { + var ret string + return ret + } + return *o.Filter +} + +// GetFilterOk returns a tuple with the Filter field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1) GetFilterOk() (*string, bool) { + if o == nil || IsNil(o.Filter) { + return nil, false + } + return o.Filter, true +} + +// HasFilter returns a boolean if a field has been set. +func (o *IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1) HasFilter() bool { + if o != nil && !IsNil(o.Filter) { + return true + } + + return false +} + +// SetFilter gets a reference to the given string and assigns it to the Filter field. +func (o *IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1) SetFilter(v string) { + o.Filter = &v +} + +func (o IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["aggregation"] = o.Aggregation + if !IsNil(o.Filter) { + toSerialize["filter"] = o.Filter + } + return toSerialize, nil +} + +type NullableIndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1 struct { + value *IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1 + isSet bool +} + +func (v NullableIndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1) Get() *IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1 { + return v.value +} + +func (v *NullableIndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1) Set(val *IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1) { + v.value = val + v.isSet = true +} + +func (v NullableIndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1) IsSet() bool { + return v.isSet +} + +func (v *NullableIndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1(val *IndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1) *NullableIndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1 { + return &NullableIndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1{value: val, isSet: true} +} + +func (v NullableIndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIndicatorPropertiesCustomMetricParamsGoodMetricsInnerOneOf1) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/generated/slo/model_indicator_properties_custom_metric_params_total.go b/generated/slo/model_indicator_properties_custom_metric_params_total.go index 58d6d255b..5fa26b8ec 100644 --- a/generated/slo/model_indicator_properties_custom_metric_params_total.go +++ b/generated/slo/model_indicator_properties_custom_metric_params_total.go @@ -3,7 +3,7 @@ SLOs OpenAPI schema for SLOs endpoints -API version: 1.0 +API version: 1.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -20,7 +20,7 @@ var _ MappedNullable = &IndicatorPropertiesCustomMetricParamsTotal{} // IndicatorPropertiesCustomMetricParamsTotal An object defining the \"total\" metrics and equation type IndicatorPropertiesCustomMetricParamsTotal struct { // List of metrics with their name, aggregation type, and field. - Metrics []IndicatorPropertiesCustomMetricParamsTotalMetricsInner `json:"metrics"` + Metrics []IndicatorPropertiesCustomMetricParamsGoodMetricsInner `json:"metrics"` // The equation to calculate the \"total\" metric. Equation string `json:"equation"` } @@ -29,7 +29,7 @@ type IndicatorPropertiesCustomMetricParamsTotal struct { // 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 NewIndicatorPropertiesCustomMetricParamsTotal(metrics []IndicatorPropertiesCustomMetricParamsTotalMetricsInner, equation string) *IndicatorPropertiesCustomMetricParamsTotal { +func NewIndicatorPropertiesCustomMetricParamsTotal(metrics []IndicatorPropertiesCustomMetricParamsGoodMetricsInner, equation string) *IndicatorPropertiesCustomMetricParamsTotal { this := IndicatorPropertiesCustomMetricParamsTotal{} this.Metrics = metrics this.Equation = equation @@ -45,9 +45,9 @@ func NewIndicatorPropertiesCustomMetricParamsTotalWithDefaults() *IndicatorPrope } // GetMetrics returns the Metrics field value -func (o *IndicatorPropertiesCustomMetricParamsTotal) GetMetrics() []IndicatorPropertiesCustomMetricParamsTotalMetricsInner { +func (o *IndicatorPropertiesCustomMetricParamsTotal) GetMetrics() []IndicatorPropertiesCustomMetricParamsGoodMetricsInner { if o == nil { - var ret []IndicatorPropertiesCustomMetricParamsTotalMetricsInner + var ret []IndicatorPropertiesCustomMetricParamsGoodMetricsInner return ret } @@ -56,7 +56,7 @@ func (o *IndicatorPropertiesCustomMetricParamsTotal) GetMetrics() []IndicatorPro // GetMetricsOk returns a tuple with the Metrics field value // and a boolean to check if the value has been set. -func (o *IndicatorPropertiesCustomMetricParamsTotal) GetMetricsOk() ([]IndicatorPropertiesCustomMetricParamsTotalMetricsInner, bool) { +func (o *IndicatorPropertiesCustomMetricParamsTotal) GetMetricsOk() ([]IndicatorPropertiesCustomMetricParamsGoodMetricsInner, bool) { if o == nil { return nil, false } @@ -64,7 +64,7 @@ func (o *IndicatorPropertiesCustomMetricParamsTotal) GetMetricsOk() ([]Indicator } // SetMetrics sets field value -func (o *IndicatorPropertiesCustomMetricParamsTotal) SetMetrics(v []IndicatorPropertiesCustomMetricParamsTotalMetricsInner) { +func (o *IndicatorPropertiesCustomMetricParamsTotal) SetMetrics(v []IndicatorPropertiesCustomMetricParamsGoodMetricsInner) { o.Metrics = v } diff --git a/generated/slo/model_indicator_properties_custom_metric_params_total_metrics_inner.go b/generated/slo/model_indicator_properties_custom_metric_params_total_metrics_inner.go index 59a0aa676..bfafbf613 100644 --- a/generated/slo/model_indicator_properties_custom_metric_params_total_metrics_inner.go +++ b/generated/slo/model_indicator_properties_custom_metric_params_total_metrics_inner.go @@ -24,7 +24,7 @@ type IndicatorPropertiesCustomMetricParamsTotalMetricsInner struct { // The aggregation type of the metric. Only valid option is \"sum\" Aggregation string `json:"aggregation"` // The field of the metric. - Field string `json:"field"` + Field *string `json:"field,omitempty"` // The filter to apply to the metric. Filter *string `json:"filter,omitempty"` } @@ -33,11 +33,10 @@ type IndicatorPropertiesCustomMetricParamsTotalMetricsInner struct { // 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 NewIndicatorPropertiesCustomMetricParamsTotalMetricsInner(name string, aggregation string, field string) *IndicatorPropertiesCustomMetricParamsTotalMetricsInner { +func NewIndicatorPropertiesCustomMetricParamsTotalMetricsInner(name string, aggregation string) *IndicatorPropertiesCustomMetricParamsTotalMetricsInner { this := IndicatorPropertiesCustomMetricParamsTotalMetricsInner{} this.Name = name this.Aggregation = aggregation - this.Field = field return &this } @@ -97,28 +96,36 @@ func (o *IndicatorPropertiesCustomMetricParamsTotalMetricsInner) SetAggregation( o.Aggregation = v } -// GetField returns the Field field value +// GetField returns the Field field value if set, zero value otherwise. func (o *IndicatorPropertiesCustomMetricParamsTotalMetricsInner) GetField() string { - if o == nil { + if o == nil || IsNil(o.Field) { var ret string return ret } - - return o.Field + return *o.Field } -// GetFieldOk returns a tuple with the Field field value +// GetFieldOk returns a tuple with the Field field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *IndicatorPropertiesCustomMetricParamsTotalMetricsInner) GetFieldOk() (*string, bool) { - if o == nil { + if o == nil || IsNil(o.Field) { return nil, false } - return &o.Field, true + return o.Field, true +} + +// HasField returns a boolean if a field has been set. +func (o *IndicatorPropertiesCustomMetricParamsTotalMetricsInner) HasField() bool { + if o != nil && !IsNil(o.Field) { + return true + } + + return false } -// SetField sets field value +// SetField gets a reference to the given string and assigns it to the Field field. func (o *IndicatorPropertiesCustomMetricParamsTotalMetricsInner) SetField(v string) { - o.Field = v + o.Field = &v } // GetFilter returns the Filter field value if set, zero value otherwise. @@ -165,7 +172,9 @@ func (o IndicatorPropertiesCustomMetricParamsTotalMetricsInner) ToMap() (map[str toSerialize := map[string]interface{}{} toSerialize["name"] = o.Name toSerialize["aggregation"] = o.Aggregation - toSerialize["field"] = o.Field + if !IsNil(o.Field) { + toSerialize["field"] = o.Field + } if !IsNil(o.Filter) { toSerialize["filter"] = o.Filter } diff --git a/generated/slo/model_indicator_properties_histogram.go b/generated/slo/model_indicator_properties_histogram.go index 1ac522fc6..e04cc8e51 100644 --- a/generated/slo/model_indicator_properties_histogram.go +++ b/generated/slo/model_indicator_properties_histogram.go @@ -3,7 +3,7 @@ SLOs OpenAPI schema for SLOs endpoints -API version: 1.0 +API version: 1.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/generated/slo/model_indicator_properties_histogram_params.go b/generated/slo/model_indicator_properties_histogram_params.go index 5d9348681..9c2ca7d15 100644 --- a/generated/slo/model_indicator_properties_histogram_params.go +++ b/generated/slo/model_indicator_properties_histogram_params.go @@ -3,7 +3,7 @@ SLOs OpenAPI schema for SLOs endpoints -API version: 1.0 +API version: 1.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -21,6 +21,8 @@ var _ MappedNullable = &IndicatorPropertiesHistogramParams{} type IndicatorPropertiesHistogramParams struct { // The index or index pattern to use Index string `json:"index"` + // The kibana data view id to use, primarily used to include data view runtime mappings. Make sure to save SLO again if you add/update run time fields to the data view and if those fields are being used in slo queries. + DataViewId *string `json:"dataViewId,omitempty"` // the KQL query to filter the documents with. Filter *string `json:"filter,omitempty"` // The timestamp field used in the source indice. @@ -74,6 +76,38 @@ func (o *IndicatorPropertiesHistogramParams) SetIndex(v string) { o.Index = v } +// GetDataViewId returns the DataViewId field value if set, zero value otherwise. +func (o *IndicatorPropertiesHistogramParams) GetDataViewId() string { + if o == nil || IsNil(o.DataViewId) { + var ret string + return ret + } + return *o.DataViewId +} + +// GetDataViewIdOk returns a tuple with the DataViewId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IndicatorPropertiesHistogramParams) GetDataViewIdOk() (*string, bool) { + if o == nil || IsNil(o.DataViewId) { + return nil, false + } + return o.DataViewId, true +} + +// HasDataViewId returns a boolean if a field has been set. +func (o *IndicatorPropertiesHistogramParams) HasDataViewId() bool { + if o != nil && !IsNil(o.DataViewId) { + return true + } + + return false +} + +// SetDataViewId gets a reference to the given string and assigns it to the DataViewId field. +func (o *IndicatorPropertiesHistogramParams) SetDataViewId(v string) { + o.DataViewId = &v +} + // GetFilter returns the Filter field value if set, zero value otherwise. func (o *IndicatorPropertiesHistogramParams) GetFilter() string { if o == nil || IsNil(o.Filter) { @@ -189,6 +223,9 @@ func (o IndicatorPropertiesHistogramParams) MarshalJSON() ([]byte, error) { func (o IndicatorPropertiesHistogramParams) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["index"] = o.Index + if !IsNil(o.DataViewId) { + toSerialize["dataViewId"] = o.DataViewId + } if !IsNil(o.Filter) { toSerialize["filter"] = o.Filter } diff --git a/generated/slo/model_indicator_properties_histogram_params_good.go b/generated/slo/model_indicator_properties_histogram_params_good.go index 2d4f845f6..8a74efd41 100644 --- a/generated/slo/model_indicator_properties_histogram_params_good.go +++ b/generated/slo/model_indicator_properties_histogram_params_good.go @@ -3,7 +3,7 @@ SLOs OpenAPI schema for SLOs endpoints -API version: 1.0 +API version: 1.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/generated/slo/model_indicator_properties_histogram_params_total.go b/generated/slo/model_indicator_properties_histogram_params_total.go index 7581231f4..acdc4fbc8 100644 --- a/generated/slo/model_indicator_properties_histogram_params_total.go +++ b/generated/slo/model_indicator_properties_histogram_params_total.go @@ -3,7 +3,7 @@ SLOs OpenAPI schema for SLOs endpoints -API version: 1.0 +API version: 1.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/generated/slo/model_indicator_properties_timeslice_metric.go b/generated/slo/model_indicator_properties_timeslice_metric.go index bd5e6fde0..0b5815036 100644 --- a/generated/slo/model_indicator_properties_timeslice_metric.go +++ b/generated/slo/model_indicator_properties_timeslice_metric.go @@ -3,7 +3,7 @@ SLOs OpenAPI schema for SLOs endpoints -API version: 1.0 +API version: 1.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/generated/slo/model_indicator_properties_timeslice_metric_params.go b/generated/slo/model_indicator_properties_timeslice_metric_params.go index d702e10b5..686ea523e 100644 --- a/generated/slo/model_indicator_properties_timeslice_metric_params.go +++ b/generated/slo/model_indicator_properties_timeslice_metric_params.go @@ -3,7 +3,7 @@ SLOs OpenAPI schema for SLOs endpoints -API version: 1.0 +API version: 1.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -21,6 +21,8 @@ var _ MappedNullable = &IndicatorPropertiesTimesliceMetricParams{} type IndicatorPropertiesTimesliceMetricParams struct { // The index or index pattern to use Index string `json:"index"` + // The kibana data view id to use, primarily used to include data view runtime mappings. Make sure to save SLO again if you add/update run time fields to the data view and if those fields are being used in slo queries. + DataViewId *string `json:"dataViewId,omitempty"` // the KQL query to filter the documents with. Filter *string `json:"filter,omitempty"` // The timestamp field used in the source indice. @@ -72,6 +74,38 @@ func (o *IndicatorPropertiesTimesliceMetricParams) SetIndex(v string) { o.Index = v } +// GetDataViewId returns the DataViewId field value if set, zero value otherwise. +func (o *IndicatorPropertiesTimesliceMetricParams) GetDataViewId() string { + if o == nil || IsNil(o.DataViewId) { + var ret string + return ret + } + return *o.DataViewId +} + +// GetDataViewIdOk returns a tuple with the DataViewId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IndicatorPropertiesTimesliceMetricParams) GetDataViewIdOk() (*string, bool) { + if o == nil || IsNil(o.DataViewId) { + return nil, false + } + return o.DataViewId, true +} + +// HasDataViewId returns a boolean if a field has been set. +func (o *IndicatorPropertiesTimesliceMetricParams) HasDataViewId() bool { + if o != nil && !IsNil(o.DataViewId) { + return true + } + + return false +} + +// SetDataViewId gets a reference to the given string and assigns it to the DataViewId field. +func (o *IndicatorPropertiesTimesliceMetricParams) SetDataViewId(v string) { + o.DataViewId = &v +} + // GetFilter returns the Filter field value if set, zero value otherwise. func (o *IndicatorPropertiesTimesliceMetricParams) GetFilter() string { if o == nil || IsNil(o.Filter) { @@ -163,6 +197,9 @@ func (o IndicatorPropertiesTimesliceMetricParams) MarshalJSON() ([]byte, error) func (o IndicatorPropertiesTimesliceMetricParams) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["index"] = o.Index + if !IsNil(o.DataViewId) { + toSerialize["dataViewId"] = o.DataViewId + } if !IsNil(o.Filter) { toSerialize["filter"] = o.Filter } diff --git a/generated/slo/model_indicator_properties_timeslice_metric_params_metric.go b/generated/slo/model_indicator_properties_timeslice_metric_params_metric.go index 89435056d..da0c37817 100644 --- a/generated/slo/model_indicator_properties_timeslice_metric_params_metric.go +++ b/generated/slo/model_indicator_properties_timeslice_metric_params_metric.go @@ -3,7 +3,7 @@ SLOs OpenAPI schema for SLOs endpoints -API version: 1.0 +API version: 1.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/generated/slo/model_indicator_properties_timeslice_metric_params_metric_metrics_inner.go b/generated/slo/model_indicator_properties_timeslice_metric_params_metric_metrics_inner.go index 828f796ee..aab00b9c0 100644 --- a/generated/slo/model_indicator_properties_timeslice_metric_params_metric_metrics_inner.go +++ b/generated/slo/model_indicator_properties_timeslice_metric_params_metric_metrics_inner.go @@ -3,7 +3,7 @@ SLOs OpenAPI schema for SLOs endpoints -API version: 1.0 +API version: 1.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/generated/slo/model_kql_with_filters.go b/generated/slo/model_kql_with_filters.go new file mode 100644 index 000000000..b8c17d0f0 --- /dev/null +++ b/generated/slo/model_kql_with_filters.go @@ -0,0 +1,145 @@ +/* +SLOs + +OpenAPI schema for SLOs endpoints + +API version: 1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package slo + +import ( + "encoding/json" + "fmt" +) + +// KqlWithFilters - Defines properties for a filter +type KqlWithFilters struct { + KqlWithFiltersOneOf *KqlWithFiltersOneOf + String *string +} + +// KqlWithFiltersOneOfAsKqlWithFilters is a convenience function that returns KqlWithFiltersOneOf wrapped in KqlWithFilters +func KqlWithFiltersOneOfAsKqlWithFilters(v *KqlWithFiltersOneOf) KqlWithFilters { + return KqlWithFilters{ + KqlWithFiltersOneOf: v, + } +} + +// stringAsKqlWithFilters is a convenience function that returns string wrapped in KqlWithFilters +func StringAsKqlWithFilters(v *string) KqlWithFilters { + return KqlWithFilters{ + String: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *KqlWithFilters) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into KqlWithFiltersOneOf + err = json.Unmarshal(data, &dst.KqlWithFiltersOneOf) + if err == nil { + jsonKqlWithFiltersOneOf, _ := json.Marshal(dst.KqlWithFiltersOneOf) + if string(jsonKqlWithFiltersOneOf) == "{}" { // empty struct + dst.KqlWithFiltersOneOf = nil + } else { + match++ + } + } else { + dst.KqlWithFiltersOneOf = nil + } + + // try to unmarshal data into String + err = json.Unmarshal(data, &dst.String) + if err == nil { + jsonstring, _ := json.Marshal(dst.String) + if string(jsonstring) == "{}" { // empty struct + dst.String = nil + } else { + match++ + } + } else { + dst.String = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.KqlWithFiltersOneOf = nil + dst.String = nil + + return fmt.Errorf("data matches more than one schema in oneOf(KqlWithFilters)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(KqlWithFilters)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src KqlWithFilters) MarshalJSON() ([]byte, error) { + if src.KqlWithFiltersOneOf != nil { + return json.Marshal(&src.KqlWithFiltersOneOf) + } + + if src.String != nil { + return json.Marshal(&src.String) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *KqlWithFilters) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.KqlWithFiltersOneOf != nil { + return obj.KqlWithFiltersOneOf + } + + if obj.String != nil { + return obj.String + } + + // all schemas are nil + return nil +} + +type NullableKqlWithFilters struct { + value *KqlWithFilters + isSet bool +} + +func (v NullableKqlWithFilters) Get() *KqlWithFilters { + return v.value +} + +func (v *NullableKqlWithFilters) Set(val *KqlWithFilters) { + v.value = val + v.isSet = true +} + +func (v NullableKqlWithFilters) IsSet() bool { + return v.isSet +} + +func (v *NullableKqlWithFilters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableKqlWithFilters(val *KqlWithFilters) *NullableKqlWithFilters { + return &NullableKqlWithFilters{value: val, isSet: true} +} + +func (v NullableKqlWithFilters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableKqlWithFilters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/generated/slo/model_kql_with_filters_good.go b/generated/slo/model_kql_with_filters_good.go new file mode 100644 index 000000000..1f9cda190 --- /dev/null +++ b/generated/slo/model_kql_with_filters_good.go @@ -0,0 +1,145 @@ +/* +SLOs + +OpenAPI schema for SLOs endpoints + +API version: 1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package slo + +import ( + "encoding/json" + "fmt" +) + +// KqlWithFiltersGood - The KQL query used to define the good events. +type KqlWithFiltersGood struct { + KqlWithFiltersOneOf *KqlWithFiltersOneOf + String *string +} + +// KqlWithFiltersOneOfAsKqlWithFiltersGood is a convenience function that returns KqlWithFiltersOneOf wrapped in KqlWithFiltersGood +func KqlWithFiltersOneOfAsKqlWithFiltersGood(v *KqlWithFiltersOneOf) KqlWithFiltersGood { + return KqlWithFiltersGood{ + KqlWithFiltersOneOf: v, + } +} + +// stringAsKqlWithFiltersGood is a convenience function that returns string wrapped in KqlWithFiltersGood +func StringAsKqlWithFiltersGood(v *string) KqlWithFiltersGood { + return KqlWithFiltersGood{ + String: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *KqlWithFiltersGood) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into KqlWithFiltersOneOf + err = json.Unmarshal(data, &dst.KqlWithFiltersOneOf) + if err == nil { + jsonKqlWithFiltersOneOf, _ := json.Marshal(dst.KqlWithFiltersOneOf) + if string(jsonKqlWithFiltersOneOf) == "{}" { // empty struct + dst.KqlWithFiltersOneOf = nil + } else { + match++ + } + } else { + dst.KqlWithFiltersOneOf = nil + } + + // try to unmarshal data into String + err = json.Unmarshal(data, &dst.String) + if err == nil { + jsonstring, _ := json.Marshal(dst.String) + if string(jsonstring) == "{}" { // empty struct + dst.String = nil + } else { + match++ + } + } else { + dst.String = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.KqlWithFiltersOneOf = nil + dst.String = nil + + return fmt.Errorf("data matches more than one schema in oneOf(KqlWithFiltersGood)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(KqlWithFiltersGood)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src KqlWithFiltersGood) MarshalJSON() ([]byte, error) { + if src.KqlWithFiltersOneOf != nil { + return json.Marshal(&src.KqlWithFiltersOneOf) + } + + if src.String != nil { + return json.Marshal(&src.String) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *KqlWithFiltersGood) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.KqlWithFiltersOneOf != nil { + return obj.KqlWithFiltersOneOf + } + + if obj.String != nil { + return obj.String + } + + // all schemas are nil + return nil +} + +type NullableKqlWithFiltersGood struct { + value *KqlWithFiltersGood + isSet bool +} + +func (v NullableKqlWithFiltersGood) Get() *KqlWithFiltersGood { + return v.value +} + +func (v *NullableKqlWithFiltersGood) Set(val *KqlWithFiltersGood) { + v.value = val + v.isSet = true +} + +func (v NullableKqlWithFiltersGood) IsSet() bool { + return v.isSet +} + +func (v *NullableKqlWithFiltersGood) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableKqlWithFiltersGood(val *KqlWithFiltersGood) *NullableKqlWithFiltersGood { + return &NullableKqlWithFiltersGood{value: val, isSet: true} +} + +func (v NullableKqlWithFiltersGood) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableKqlWithFiltersGood) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/generated/slo/model_kql_with_filters_one_of.go b/generated/slo/model_kql_with_filters_one_of.go new file mode 100644 index 000000000..177edfc0c --- /dev/null +++ b/generated/slo/model_kql_with_filters_one_of.go @@ -0,0 +1,160 @@ +/* +SLOs + +OpenAPI schema for SLOs endpoints + +API version: 1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package slo + +import ( + "encoding/json" +) + +// checks if the KqlWithFiltersOneOf type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &KqlWithFiltersOneOf{} + +// KqlWithFiltersOneOf struct for KqlWithFiltersOneOf +type KqlWithFiltersOneOf struct { + KqlQuery *string `json:"kqlQuery,omitempty"` + Filters []Filter `json:"filters,omitempty"` +} + +// NewKqlWithFiltersOneOf instantiates a new KqlWithFiltersOneOf 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 NewKqlWithFiltersOneOf() *KqlWithFiltersOneOf { + this := KqlWithFiltersOneOf{} + return &this +} + +// NewKqlWithFiltersOneOfWithDefaults instantiates a new KqlWithFiltersOneOf 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 NewKqlWithFiltersOneOfWithDefaults() *KqlWithFiltersOneOf { + this := KqlWithFiltersOneOf{} + return &this +} + +// GetKqlQuery returns the KqlQuery field value if set, zero value otherwise. +func (o *KqlWithFiltersOneOf) GetKqlQuery() string { + if o == nil || IsNil(o.KqlQuery) { + var ret string + return ret + } + return *o.KqlQuery +} + +// GetKqlQueryOk returns a tuple with the KqlQuery field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KqlWithFiltersOneOf) GetKqlQueryOk() (*string, bool) { + if o == nil || IsNil(o.KqlQuery) { + return nil, false + } + return o.KqlQuery, true +} + +// HasKqlQuery returns a boolean if a field has been set. +func (o *KqlWithFiltersOneOf) HasKqlQuery() bool { + if o != nil && !IsNil(o.KqlQuery) { + return true + } + + return false +} + +// SetKqlQuery gets a reference to the given string and assigns it to the KqlQuery field. +func (o *KqlWithFiltersOneOf) SetKqlQuery(v string) { + o.KqlQuery = &v +} + +// GetFilters returns the Filters field value if set, zero value otherwise. +func (o *KqlWithFiltersOneOf) GetFilters() []Filter { + if o == nil || IsNil(o.Filters) { + var ret []Filter + return ret + } + return o.Filters +} + +// GetFiltersOk returns a tuple with the Filters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KqlWithFiltersOneOf) GetFiltersOk() ([]Filter, bool) { + if o == nil || IsNil(o.Filters) { + return nil, false + } + return o.Filters, true +} + +// HasFilters returns a boolean if a field has been set. +func (o *KqlWithFiltersOneOf) HasFilters() bool { + if o != nil && !IsNil(o.Filters) { + return true + } + + return false +} + +// SetFilters gets a reference to the given []Filter and assigns it to the Filters field. +func (o *KqlWithFiltersOneOf) SetFilters(v []Filter) { + o.Filters = v +} + +func (o KqlWithFiltersOneOf) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o KqlWithFiltersOneOf) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.KqlQuery) { + toSerialize["kqlQuery"] = o.KqlQuery + } + if !IsNil(o.Filters) { + toSerialize["filters"] = o.Filters + } + return toSerialize, nil +} + +type NullableKqlWithFiltersOneOf struct { + value *KqlWithFiltersOneOf + isSet bool +} + +func (v NullableKqlWithFiltersOneOf) Get() *KqlWithFiltersOneOf { + return v.value +} + +func (v *NullableKqlWithFiltersOneOf) Set(val *KqlWithFiltersOneOf) { + v.value = val + v.isSet = true +} + +func (v NullableKqlWithFiltersOneOf) IsSet() bool { + return v.isSet +} + +func (v *NullableKqlWithFiltersOneOf) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableKqlWithFiltersOneOf(val *KqlWithFiltersOneOf) *NullableKqlWithFiltersOneOf { + return &NullableKqlWithFiltersOneOf{value: val, isSet: true} +} + +func (v NullableKqlWithFiltersOneOf) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableKqlWithFiltersOneOf) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/generated/slo/model_kql_with_filters_total.go b/generated/slo/model_kql_with_filters_total.go new file mode 100644 index 000000000..c33cac612 --- /dev/null +++ b/generated/slo/model_kql_with_filters_total.go @@ -0,0 +1,145 @@ +/* +SLOs + +OpenAPI schema for SLOs endpoints + +API version: 1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package slo + +import ( + "encoding/json" + "fmt" +) + +// KqlWithFiltersTotal - The KQL query used to define all events. +type KqlWithFiltersTotal struct { + KqlWithFiltersOneOf *KqlWithFiltersOneOf + String *string +} + +// KqlWithFiltersOneOfAsKqlWithFiltersTotal is a convenience function that returns KqlWithFiltersOneOf wrapped in KqlWithFiltersTotal +func KqlWithFiltersOneOfAsKqlWithFiltersTotal(v *KqlWithFiltersOneOf) KqlWithFiltersTotal { + return KqlWithFiltersTotal{ + KqlWithFiltersOneOf: v, + } +} + +// stringAsKqlWithFiltersTotal is a convenience function that returns string wrapped in KqlWithFiltersTotal +func StringAsKqlWithFiltersTotal(v *string) KqlWithFiltersTotal { + return KqlWithFiltersTotal{ + String: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *KqlWithFiltersTotal) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into KqlWithFiltersOneOf + err = json.Unmarshal(data, &dst.KqlWithFiltersOneOf) + if err == nil { + jsonKqlWithFiltersOneOf, _ := json.Marshal(dst.KqlWithFiltersOneOf) + if string(jsonKqlWithFiltersOneOf) == "{}" { // empty struct + dst.KqlWithFiltersOneOf = nil + } else { + match++ + } + } else { + dst.KqlWithFiltersOneOf = nil + } + + // try to unmarshal data into String + err = json.Unmarshal(data, &dst.String) + if err == nil { + jsonstring, _ := json.Marshal(dst.String) + if string(jsonstring) == "{}" { // empty struct + dst.String = nil + } else { + match++ + } + } else { + dst.String = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.KqlWithFiltersOneOf = nil + dst.String = nil + + return fmt.Errorf("data matches more than one schema in oneOf(KqlWithFiltersTotal)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(KqlWithFiltersTotal)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src KqlWithFiltersTotal) MarshalJSON() ([]byte, error) { + if src.KqlWithFiltersOneOf != nil { + return json.Marshal(&src.KqlWithFiltersOneOf) + } + + if src.String != nil { + return json.Marshal(&src.String) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *KqlWithFiltersTotal) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.KqlWithFiltersOneOf != nil { + return obj.KqlWithFiltersOneOf + } + + if obj.String != nil { + return obj.String + } + + // all schemas are nil + return nil +} + +type NullableKqlWithFiltersTotal struct { + value *KqlWithFiltersTotal + isSet bool +} + +func (v NullableKqlWithFiltersTotal) Get() *KqlWithFiltersTotal { + return v.value +} + +func (v *NullableKqlWithFiltersTotal) Set(val *KqlWithFiltersTotal) { + v.value = val + v.isSet = true +} + +func (v NullableKqlWithFiltersTotal) IsSet() bool { + return v.isSet +} + +func (v *NullableKqlWithFiltersTotal) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableKqlWithFiltersTotal(val *KqlWithFiltersTotal) *NullableKqlWithFiltersTotal { + return &NullableKqlWithFiltersTotal{value: val, isSet: true} +} + +func (v NullableKqlWithFiltersTotal) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableKqlWithFiltersTotal) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/generated/slo/model_objective.go b/generated/slo/model_objective.go index cad95abd2..b9f51f1cd 100644 --- a/generated/slo/model_objective.go +++ b/generated/slo/model_objective.go @@ -3,7 +3,7 @@ SLOs OpenAPI schema for SLOs endpoints -API version: 1.0 +API version: 1.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/generated/slo/model_settings.go b/generated/slo/model_settings.go index f7cc30ba7..1d8b88ccb 100644 --- a/generated/slo/model_settings.go +++ b/generated/slo/model_settings.go @@ -3,7 +3,7 @@ SLOs OpenAPI schema for SLOs endpoints -API version: 1.0 +API version: 1.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -19,10 +19,14 @@ var _ MappedNullable = &Settings{} // Settings Defines properties for SLO settings. type Settings struct { - // The synch delay to apply to the transform. Default 1m + // The date field that is used to identify new documents in the source. It is strongly recommended to use a field that contains the ingest timestamp. If you use a different field, you might need to set the delay such that it accounts for data transmission delays. When unspecified, we use the indicator timestamp field. + SyncField *string `json:"syncField,omitempty"` + // The time delay in minutes between the current time and the latest source data time. Increasing the value will delay any alerting. The default value is 1 minute. The minimum value is 1m and the maximum is 359m. It should always be greater then source index refresh interval. SyncDelay *string `json:"syncDelay,omitempty"` - // Configure how often the transform runs, default 1m + // The interval between checks for changes in the source data. The minimum value is 1m and the maximum is 59m. The default value is 1 minute. Frequency *string `json:"frequency,omitempty"` + // Start aggregating data from the time the SLO is created, instead of backfilling data from the beginning of the time window. + PreventInitialBackfill *bool `json:"preventInitialBackfill,omitempty"` } // NewSettings instantiates a new Settings object @@ -31,6 +35,12 @@ type Settings struct { // will change when the set of required properties is changed func NewSettings() *Settings { this := Settings{} + var syncDelay string = "1m" + this.SyncDelay = &syncDelay + var frequency string = "1m" + this.Frequency = &frequency + var preventInitialBackfill bool = false + this.PreventInitialBackfill = &preventInitialBackfill return &this } @@ -39,9 +49,47 @@ func NewSettings() *Settings { // but it doesn't guarantee that properties required by API are set func NewSettingsWithDefaults() *Settings { this := Settings{} + var syncDelay string = "1m" + this.SyncDelay = &syncDelay + var frequency string = "1m" + this.Frequency = &frequency + var preventInitialBackfill bool = false + this.PreventInitialBackfill = &preventInitialBackfill return &this } +// GetSyncField returns the SyncField field value if set, zero value otherwise. +func (o *Settings) GetSyncField() string { + if o == nil || IsNil(o.SyncField) { + var ret string + return ret + } + return *o.SyncField +} + +// GetSyncFieldOk returns a tuple with the SyncField field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Settings) GetSyncFieldOk() (*string, bool) { + if o == nil || IsNil(o.SyncField) { + return nil, false + } + return o.SyncField, true +} + +// HasSyncField returns a boolean if a field has been set. +func (o *Settings) HasSyncField() bool { + if o != nil && !IsNil(o.SyncField) { + return true + } + + return false +} + +// SetSyncField gets a reference to the given string and assigns it to the SyncField field. +func (o *Settings) SetSyncField(v string) { + o.SyncField = &v +} + // GetSyncDelay returns the SyncDelay field value if set, zero value otherwise. func (o *Settings) GetSyncDelay() string { if o == nil || IsNil(o.SyncDelay) { @@ -106,6 +154,38 @@ func (o *Settings) SetFrequency(v string) { o.Frequency = &v } +// GetPreventInitialBackfill returns the PreventInitialBackfill field value if set, zero value otherwise. +func (o *Settings) GetPreventInitialBackfill() bool { + if o == nil || IsNil(o.PreventInitialBackfill) { + var ret bool + return ret + } + return *o.PreventInitialBackfill +} + +// GetPreventInitialBackfillOk returns a tuple with the PreventInitialBackfill field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Settings) GetPreventInitialBackfillOk() (*bool, bool) { + if o == nil || IsNil(o.PreventInitialBackfill) { + return nil, false + } + return o.PreventInitialBackfill, true +} + +// HasPreventInitialBackfill returns a boolean if a field has been set. +func (o *Settings) HasPreventInitialBackfill() bool { + if o != nil && !IsNil(o.PreventInitialBackfill) { + return true + } + + return false +} + +// SetPreventInitialBackfill gets a reference to the given bool and assigns it to the PreventInitialBackfill field. +func (o *Settings) SetPreventInitialBackfill(v bool) { + o.PreventInitialBackfill = &v +} + func (o Settings) MarshalJSON() ([]byte, error) { toSerialize, err := o.ToMap() if err != nil { @@ -116,12 +196,18 @@ func (o Settings) MarshalJSON() ([]byte, error) { func (o Settings) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} + if !IsNil(o.SyncField) { + toSerialize["syncField"] = o.SyncField + } if !IsNil(o.SyncDelay) { toSerialize["syncDelay"] = o.SyncDelay } if !IsNil(o.Frequency) { toSerialize["frequency"] = o.Frequency } + if !IsNil(o.PreventInitialBackfill) { + toSerialize["preventInitialBackfill"] = o.PreventInitialBackfill + } return toSerialize, nil } diff --git a/generated/slo/model_slo_definition_response.go b/generated/slo/model_slo_definition_response.go new file mode 100644 index 000000000..dd9e2aa3d --- /dev/null +++ b/generated/slo/model_slo_definition_response.go @@ -0,0 +1,502 @@ +/* +SLOs + +OpenAPI schema for SLOs endpoints + +API version: 1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package slo + +import ( + "encoding/json" +) + +// checks if the SloDefinitionResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SloDefinitionResponse{} + +// SloDefinitionResponse struct for SloDefinitionResponse +type SloDefinitionResponse struct { + // The identifier of the SLO. + Id string `json:"id"` + // The name of the SLO. + Name string `json:"name"` + // The description of the SLO. + Description string `json:"description"` + Indicator SloWithSummaryResponseIndicator `json:"indicator"` + TimeWindow TimeWindow `json:"timeWindow"` + BudgetingMethod BudgetingMethod `json:"budgetingMethod"` + Objective Objective `json:"objective"` + Settings Settings `json:"settings"` + // The SLO revision + Revision float64 `json:"revision"` + // Indicate if the SLO is enabled + Enabled bool `json:"enabled"` + GroupBy GroupBy `json:"groupBy"` + // List of tags + Tags []string `json:"tags"` + // The creation date + CreatedAt string `json:"createdAt"` + // The last update date + UpdatedAt string `json:"updatedAt"` + // The internal SLO version + Version float64 `json:"version"` +} + +// NewSloDefinitionResponse instantiates a new SloDefinitionResponse 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 NewSloDefinitionResponse(id string, name string, description string, indicator SloWithSummaryResponseIndicator, timeWindow TimeWindow, budgetingMethod BudgetingMethod, objective Objective, settings Settings, revision float64, enabled bool, groupBy GroupBy, tags []string, createdAt string, updatedAt string, version float64) *SloDefinitionResponse { + this := SloDefinitionResponse{} + this.Id = id + this.Name = name + this.Description = description + this.Indicator = indicator + this.TimeWindow = timeWindow + this.BudgetingMethod = budgetingMethod + this.Objective = objective + this.Settings = settings + this.Revision = revision + this.Enabled = enabled + this.GroupBy = groupBy + this.Tags = tags + this.CreatedAt = createdAt + this.UpdatedAt = updatedAt + this.Version = version + return &this +} + +// NewSloDefinitionResponseWithDefaults instantiates a new SloDefinitionResponse 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 NewSloDefinitionResponseWithDefaults() *SloDefinitionResponse { + this := SloDefinitionResponse{} + return &this +} + +// GetId returns the Id field value +func (o *SloDefinitionResponse) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *SloDefinitionResponse) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *SloDefinitionResponse) SetId(v string) { + o.Id = v +} + +// GetName returns the Name field value +func (o *SloDefinitionResponse) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *SloDefinitionResponse) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *SloDefinitionResponse) SetName(v string) { + o.Name = v +} + +// GetDescription returns the Description field value +func (o *SloDefinitionResponse) GetDescription() string { + if o == nil { + var ret string + return ret + } + + return o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value +// and a boolean to check if the value has been set. +func (o *SloDefinitionResponse) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Description, true +} + +// SetDescription sets field value +func (o *SloDefinitionResponse) SetDescription(v string) { + o.Description = v +} + +// GetIndicator returns the Indicator field value +func (o *SloDefinitionResponse) GetIndicator() SloWithSummaryResponseIndicator { + if o == nil { + var ret SloWithSummaryResponseIndicator + return ret + } + + return o.Indicator +} + +// GetIndicatorOk returns a tuple with the Indicator field value +// and a boolean to check if the value has been set. +func (o *SloDefinitionResponse) GetIndicatorOk() (*SloWithSummaryResponseIndicator, bool) { + if o == nil { + return nil, false + } + return &o.Indicator, true +} + +// SetIndicator sets field value +func (o *SloDefinitionResponse) SetIndicator(v SloWithSummaryResponseIndicator) { + o.Indicator = v +} + +// GetTimeWindow returns the TimeWindow field value +func (o *SloDefinitionResponse) GetTimeWindow() TimeWindow { + if o == nil { + var ret TimeWindow + return ret + } + + return o.TimeWindow +} + +// GetTimeWindowOk returns a tuple with the TimeWindow field value +// and a boolean to check if the value has been set. +func (o *SloDefinitionResponse) GetTimeWindowOk() (*TimeWindow, bool) { + if o == nil { + return nil, false + } + return &o.TimeWindow, true +} + +// SetTimeWindow sets field value +func (o *SloDefinitionResponse) SetTimeWindow(v TimeWindow) { + o.TimeWindow = v +} + +// GetBudgetingMethod returns the BudgetingMethod field value +func (o *SloDefinitionResponse) GetBudgetingMethod() BudgetingMethod { + if o == nil { + var ret BudgetingMethod + return ret + } + + return o.BudgetingMethod +} + +// GetBudgetingMethodOk returns a tuple with the BudgetingMethod field value +// and a boolean to check if the value has been set. +func (o *SloDefinitionResponse) GetBudgetingMethodOk() (*BudgetingMethod, bool) { + if o == nil { + return nil, false + } + return &o.BudgetingMethod, true +} + +// SetBudgetingMethod sets field value +func (o *SloDefinitionResponse) SetBudgetingMethod(v BudgetingMethod) { + o.BudgetingMethod = v +} + +// GetObjective returns the Objective field value +func (o *SloDefinitionResponse) GetObjective() Objective { + if o == nil { + var ret Objective + return ret + } + + return o.Objective +} + +// GetObjectiveOk returns a tuple with the Objective field value +// and a boolean to check if the value has been set. +func (o *SloDefinitionResponse) GetObjectiveOk() (*Objective, bool) { + if o == nil { + return nil, false + } + return &o.Objective, true +} + +// SetObjective sets field value +func (o *SloDefinitionResponse) SetObjective(v Objective) { + o.Objective = v +} + +// GetSettings returns the Settings field value +func (o *SloDefinitionResponse) GetSettings() Settings { + if o == nil { + var ret Settings + return ret + } + + return o.Settings +} + +// GetSettingsOk returns a tuple with the Settings field value +// and a boolean to check if the value has been set. +func (o *SloDefinitionResponse) GetSettingsOk() (*Settings, bool) { + if o == nil { + return nil, false + } + return &o.Settings, true +} + +// SetSettings sets field value +func (o *SloDefinitionResponse) SetSettings(v Settings) { + o.Settings = v +} + +// GetRevision returns the Revision field value +func (o *SloDefinitionResponse) GetRevision() float64 { + if o == nil { + var ret float64 + return ret + } + + return o.Revision +} + +// GetRevisionOk returns a tuple with the Revision field value +// and a boolean to check if the value has been set. +func (o *SloDefinitionResponse) GetRevisionOk() (*float64, bool) { + if o == nil { + return nil, false + } + return &o.Revision, true +} + +// SetRevision sets field value +func (o *SloDefinitionResponse) SetRevision(v float64) { + o.Revision = v +} + +// GetEnabled returns the Enabled field value +func (o *SloDefinitionResponse) GetEnabled() bool { + if o == nil { + var ret bool + return ret + } + + return o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value +// and a boolean to check if the value has been set. +func (o *SloDefinitionResponse) GetEnabledOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Enabled, true +} + +// SetEnabled sets field value +func (o *SloDefinitionResponse) SetEnabled(v bool) { + o.Enabled = v +} + +// GetGroupBy returns the GroupBy field value +func (o *SloDefinitionResponse) GetGroupBy() GroupBy { + if o == nil { + var ret GroupBy + return ret + } + + return o.GroupBy +} + +// GetGroupByOk returns a tuple with the GroupBy field value +// and a boolean to check if the value has been set. +func (o *SloDefinitionResponse) GetGroupByOk() (*GroupBy, bool) { + if o == nil { + return nil, false + } + return &o.GroupBy, true +} + +// SetGroupBy sets field value +func (o *SloDefinitionResponse) SetGroupBy(v GroupBy) { + o.GroupBy = v +} + +// GetTags returns the Tags field value +func (o *SloDefinitionResponse) GetTags() []string { + if o == nil { + var ret []string + return ret + } + + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value +// and a boolean to check if the value has been set. +func (o *SloDefinitionResponse) GetTagsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Tags, true +} + +// SetTags sets field value +func (o *SloDefinitionResponse) SetTags(v []string) { + o.Tags = v +} + +// GetCreatedAt returns the CreatedAt field value +func (o *SloDefinitionResponse) GetCreatedAt() string { + if o == nil { + var ret string + return ret + } + + return o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value +// and a boolean to check if the value has been set. +func (o *SloDefinitionResponse) GetCreatedAtOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CreatedAt, true +} + +// SetCreatedAt sets field value +func (o *SloDefinitionResponse) SetCreatedAt(v string) { + o.CreatedAt = v +} + +// GetUpdatedAt returns the UpdatedAt field value +func (o *SloDefinitionResponse) GetUpdatedAt() string { + if o == nil { + var ret string + return ret + } + + return o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value +// and a boolean to check if the value has been set. +func (o *SloDefinitionResponse) GetUpdatedAtOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.UpdatedAt, true +} + +// SetUpdatedAt sets field value +func (o *SloDefinitionResponse) SetUpdatedAt(v string) { + o.UpdatedAt = v +} + +// GetVersion returns the Version field value +func (o *SloDefinitionResponse) GetVersion() float64 { + if o == nil { + var ret float64 + return ret + } + + return o.Version +} + +// GetVersionOk returns a tuple with the Version field value +// and a boolean to check if the value has been set. +func (o *SloDefinitionResponse) GetVersionOk() (*float64, bool) { + if o == nil { + return nil, false + } + return &o.Version, true +} + +// SetVersion sets field value +func (o *SloDefinitionResponse) SetVersion(v float64) { + o.Version = v +} + +func (o SloDefinitionResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SloDefinitionResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["name"] = o.Name + toSerialize["description"] = o.Description + toSerialize["indicator"] = o.Indicator + toSerialize["timeWindow"] = o.TimeWindow + toSerialize["budgetingMethod"] = o.BudgetingMethod + toSerialize["objective"] = o.Objective + toSerialize["settings"] = o.Settings + toSerialize["revision"] = o.Revision + toSerialize["enabled"] = o.Enabled + toSerialize["groupBy"] = o.GroupBy + toSerialize["tags"] = o.Tags + toSerialize["createdAt"] = o.CreatedAt + toSerialize["updatedAt"] = o.UpdatedAt + toSerialize["version"] = o.Version + return toSerialize, nil +} + +type NullableSloDefinitionResponse struct { + value *SloDefinitionResponse + isSet bool +} + +func (v NullableSloDefinitionResponse) Get() *SloDefinitionResponse { + return v.value +} + +func (v *NullableSloDefinitionResponse) Set(val *SloDefinitionResponse) { + v.value = val + v.isSet = true +} + +func (v NullableSloDefinitionResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableSloDefinitionResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSloDefinitionResponse(val *SloDefinitionResponse) *NullableSloDefinitionResponse { + return &NullableSloDefinitionResponse{value: val, isSet: true} +} + +func (v NullableSloDefinitionResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSloDefinitionResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/generated/slo/model_slo_with_summary_response.go b/generated/slo/model_slo_with_summary_response.go new file mode 100644 index 000000000..c498dee0f --- /dev/null +++ b/generated/slo/model_slo_with_summary_response.go @@ -0,0 +1,557 @@ +/* +SLOs + +OpenAPI schema for SLOs endpoints + +API version: 1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package slo + +import ( + "encoding/json" +) + +// checks if the SloWithSummaryResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SloWithSummaryResponse{} + +// SloWithSummaryResponse struct for SloWithSummaryResponse +type SloWithSummaryResponse struct { + // The identifier of the SLO. + Id string `json:"id"` + // The name of the SLO. + Name string `json:"name"` + // The description of the SLO. + Description string `json:"description"` + Indicator SloWithSummaryResponseIndicator `json:"indicator"` + TimeWindow TimeWindow `json:"timeWindow"` + BudgetingMethod BudgetingMethod `json:"budgetingMethod"` + Objective Objective `json:"objective"` + Settings Settings `json:"settings"` + // The SLO revision + Revision float64 `json:"revision"` + Summary Summary `json:"summary"` + // Indicate if the SLO is enabled + Enabled bool `json:"enabled"` + GroupBy GroupBy `json:"groupBy"` + // the value derived from the groupBy field, if present, otherwise '*' + InstanceId string `json:"instanceId"` + // List of tags + Tags []string `json:"tags"` + // The creation date + CreatedAt string `json:"createdAt"` + // The last update date + UpdatedAt string `json:"updatedAt"` + // The internal SLO version + Version float64 `json:"version"` +} + +// NewSloWithSummaryResponse instantiates a new SloWithSummaryResponse 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 NewSloWithSummaryResponse(id string, name string, description string, indicator SloWithSummaryResponseIndicator, timeWindow TimeWindow, budgetingMethod BudgetingMethod, objective Objective, settings Settings, revision float64, summary Summary, enabled bool, groupBy GroupBy, instanceId string, tags []string, createdAt string, updatedAt string, version float64) *SloWithSummaryResponse { + this := SloWithSummaryResponse{} + this.Id = id + this.Name = name + this.Description = description + this.Indicator = indicator + this.TimeWindow = timeWindow + this.BudgetingMethod = budgetingMethod + this.Objective = objective + this.Settings = settings + this.Revision = revision + this.Summary = summary + this.Enabled = enabled + this.GroupBy = groupBy + this.InstanceId = instanceId + this.Tags = tags + this.CreatedAt = createdAt + this.UpdatedAt = updatedAt + this.Version = version + return &this +} + +// NewSloWithSummaryResponseWithDefaults instantiates a new SloWithSummaryResponse 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 NewSloWithSummaryResponseWithDefaults() *SloWithSummaryResponse { + this := SloWithSummaryResponse{} + return &this +} + +// GetId returns the Id field value +func (o *SloWithSummaryResponse) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *SloWithSummaryResponse) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *SloWithSummaryResponse) SetId(v string) { + o.Id = v +} + +// GetName returns the Name field value +func (o *SloWithSummaryResponse) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *SloWithSummaryResponse) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *SloWithSummaryResponse) SetName(v string) { + o.Name = v +} + +// GetDescription returns the Description field value +func (o *SloWithSummaryResponse) GetDescription() string { + if o == nil { + var ret string + return ret + } + + return o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value +// and a boolean to check if the value has been set. +func (o *SloWithSummaryResponse) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Description, true +} + +// SetDescription sets field value +func (o *SloWithSummaryResponse) SetDescription(v string) { + o.Description = v +} + +// GetIndicator returns the Indicator field value +func (o *SloWithSummaryResponse) GetIndicator() SloWithSummaryResponseIndicator { + if o == nil { + var ret SloWithSummaryResponseIndicator + return ret + } + + return o.Indicator +} + +// GetIndicatorOk returns a tuple with the Indicator field value +// and a boolean to check if the value has been set. +func (o *SloWithSummaryResponse) GetIndicatorOk() (*SloWithSummaryResponseIndicator, bool) { + if o == nil { + return nil, false + } + return &o.Indicator, true +} + +// SetIndicator sets field value +func (o *SloWithSummaryResponse) SetIndicator(v SloWithSummaryResponseIndicator) { + o.Indicator = v +} + +// GetTimeWindow returns the TimeWindow field value +func (o *SloWithSummaryResponse) GetTimeWindow() TimeWindow { + if o == nil { + var ret TimeWindow + return ret + } + + return o.TimeWindow +} + +// GetTimeWindowOk returns a tuple with the TimeWindow field value +// and a boolean to check if the value has been set. +func (o *SloWithSummaryResponse) GetTimeWindowOk() (*TimeWindow, bool) { + if o == nil { + return nil, false + } + return &o.TimeWindow, true +} + +// SetTimeWindow sets field value +func (o *SloWithSummaryResponse) SetTimeWindow(v TimeWindow) { + o.TimeWindow = v +} + +// GetBudgetingMethod returns the BudgetingMethod field value +func (o *SloWithSummaryResponse) GetBudgetingMethod() BudgetingMethod { + if o == nil { + var ret BudgetingMethod + return ret + } + + return o.BudgetingMethod +} + +// GetBudgetingMethodOk returns a tuple with the BudgetingMethod field value +// and a boolean to check if the value has been set. +func (o *SloWithSummaryResponse) GetBudgetingMethodOk() (*BudgetingMethod, bool) { + if o == nil { + return nil, false + } + return &o.BudgetingMethod, true +} + +// SetBudgetingMethod sets field value +func (o *SloWithSummaryResponse) SetBudgetingMethod(v BudgetingMethod) { + o.BudgetingMethod = v +} + +// GetObjective returns the Objective field value +func (o *SloWithSummaryResponse) GetObjective() Objective { + if o == nil { + var ret Objective + return ret + } + + return o.Objective +} + +// GetObjectiveOk returns a tuple with the Objective field value +// and a boolean to check if the value has been set. +func (o *SloWithSummaryResponse) GetObjectiveOk() (*Objective, bool) { + if o == nil { + return nil, false + } + return &o.Objective, true +} + +// SetObjective sets field value +func (o *SloWithSummaryResponse) SetObjective(v Objective) { + o.Objective = v +} + +// GetSettings returns the Settings field value +func (o *SloWithSummaryResponse) GetSettings() Settings { + if o == nil { + var ret Settings + return ret + } + + return o.Settings +} + +// GetSettingsOk returns a tuple with the Settings field value +// and a boolean to check if the value has been set. +func (o *SloWithSummaryResponse) GetSettingsOk() (*Settings, bool) { + if o == nil { + return nil, false + } + return &o.Settings, true +} + +// SetSettings sets field value +func (o *SloWithSummaryResponse) SetSettings(v Settings) { + o.Settings = v +} + +// GetRevision returns the Revision field value +func (o *SloWithSummaryResponse) GetRevision() float64 { + if o == nil { + var ret float64 + return ret + } + + return o.Revision +} + +// GetRevisionOk returns a tuple with the Revision field value +// and a boolean to check if the value has been set. +func (o *SloWithSummaryResponse) GetRevisionOk() (*float64, bool) { + if o == nil { + return nil, false + } + return &o.Revision, true +} + +// SetRevision sets field value +func (o *SloWithSummaryResponse) SetRevision(v float64) { + o.Revision = v +} + +// GetSummary returns the Summary field value +func (o *SloWithSummaryResponse) GetSummary() Summary { + if o == nil { + var ret Summary + return ret + } + + return o.Summary +} + +// GetSummaryOk returns a tuple with the Summary field value +// and a boolean to check if the value has been set. +func (o *SloWithSummaryResponse) GetSummaryOk() (*Summary, bool) { + if o == nil { + return nil, false + } + return &o.Summary, true +} + +// SetSummary sets field value +func (o *SloWithSummaryResponse) SetSummary(v Summary) { + o.Summary = v +} + +// GetEnabled returns the Enabled field value +func (o *SloWithSummaryResponse) GetEnabled() bool { + if o == nil { + var ret bool + return ret + } + + return o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value +// and a boolean to check if the value has been set. +func (o *SloWithSummaryResponse) GetEnabledOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Enabled, true +} + +// SetEnabled sets field value +func (o *SloWithSummaryResponse) SetEnabled(v bool) { + o.Enabled = v +} + +// GetGroupBy returns the GroupBy field value +func (o *SloWithSummaryResponse) GetGroupBy() GroupBy { + if o == nil { + var ret GroupBy + return ret + } + + return o.GroupBy +} + +// GetGroupByOk returns a tuple with the GroupBy field value +// and a boolean to check if the value has been set. +func (o *SloWithSummaryResponse) GetGroupByOk() (*GroupBy, bool) { + if o == nil { + return nil, false + } + return &o.GroupBy, true +} + +// SetGroupBy sets field value +func (o *SloWithSummaryResponse) SetGroupBy(v GroupBy) { + o.GroupBy = v +} + +// GetInstanceId returns the InstanceId field value +func (o *SloWithSummaryResponse) GetInstanceId() string { + if o == nil { + var ret string + return ret + } + + return o.InstanceId +} + +// GetInstanceIdOk returns a tuple with the InstanceId field value +// and a boolean to check if the value has been set. +func (o *SloWithSummaryResponse) GetInstanceIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.InstanceId, true +} + +// SetInstanceId sets field value +func (o *SloWithSummaryResponse) SetInstanceId(v string) { + o.InstanceId = v +} + +// GetTags returns the Tags field value +func (o *SloWithSummaryResponse) GetTags() []string { + if o == nil { + var ret []string + return ret + } + + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value +// and a boolean to check if the value has been set. +func (o *SloWithSummaryResponse) GetTagsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Tags, true +} + +// SetTags sets field value +func (o *SloWithSummaryResponse) SetTags(v []string) { + o.Tags = v +} + +// GetCreatedAt returns the CreatedAt field value +func (o *SloWithSummaryResponse) GetCreatedAt() string { + if o == nil { + var ret string + return ret + } + + return o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value +// and a boolean to check if the value has been set. +func (o *SloWithSummaryResponse) GetCreatedAtOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CreatedAt, true +} + +// SetCreatedAt sets field value +func (o *SloWithSummaryResponse) SetCreatedAt(v string) { + o.CreatedAt = v +} + +// GetUpdatedAt returns the UpdatedAt field value +func (o *SloWithSummaryResponse) GetUpdatedAt() string { + if o == nil { + var ret string + return ret + } + + return o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value +// and a boolean to check if the value has been set. +func (o *SloWithSummaryResponse) GetUpdatedAtOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.UpdatedAt, true +} + +// SetUpdatedAt sets field value +func (o *SloWithSummaryResponse) SetUpdatedAt(v string) { + o.UpdatedAt = v +} + +// GetVersion returns the Version field value +func (o *SloWithSummaryResponse) GetVersion() float64 { + if o == nil { + var ret float64 + return ret + } + + return o.Version +} + +// GetVersionOk returns a tuple with the Version field value +// and a boolean to check if the value has been set. +func (o *SloWithSummaryResponse) GetVersionOk() (*float64, bool) { + if o == nil { + return nil, false + } + return &o.Version, true +} + +// SetVersion sets field value +func (o *SloWithSummaryResponse) SetVersion(v float64) { + o.Version = v +} + +func (o SloWithSummaryResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SloWithSummaryResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["name"] = o.Name + toSerialize["description"] = o.Description + toSerialize["indicator"] = o.Indicator + toSerialize["timeWindow"] = o.TimeWindow + toSerialize["budgetingMethod"] = o.BudgetingMethod + toSerialize["objective"] = o.Objective + toSerialize["settings"] = o.Settings + toSerialize["revision"] = o.Revision + toSerialize["summary"] = o.Summary + toSerialize["enabled"] = o.Enabled + toSerialize["groupBy"] = o.GroupBy + toSerialize["instanceId"] = o.InstanceId + toSerialize["tags"] = o.Tags + toSerialize["createdAt"] = o.CreatedAt + toSerialize["updatedAt"] = o.UpdatedAt + toSerialize["version"] = o.Version + return toSerialize, nil +} + +type NullableSloWithSummaryResponse struct { + value *SloWithSummaryResponse + isSet bool +} + +func (v NullableSloWithSummaryResponse) Get() *SloWithSummaryResponse { + return v.value +} + +func (v *NullableSloWithSummaryResponse) Set(val *SloWithSummaryResponse) { + v.value = val + v.isSet = true +} + +func (v NullableSloWithSummaryResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableSloWithSummaryResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSloWithSummaryResponse(val *SloWithSummaryResponse) *NullableSloWithSummaryResponse { + return &NullableSloWithSummaryResponse{value: val, isSet: true} +} + +func (v NullableSloWithSummaryResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSloWithSummaryResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/generated/slo/model_slo_with_summary_response_indicator.go b/generated/slo/model_slo_with_summary_response_indicator.go new file mode 100644 index 000000000..4e5fc86e6 --- /dev/null +++ b/generated/slo/model_slo_with_summary_response_indicator.go @@ -0,0 +1,323 @@ +/* +SLOs + +OpenAPI schema for SLOs endpoints + +API version: 1.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package slo + +import ( + "encoding/json" + "fmt" +) + +// SloWithSummaryResponseIndicator - struct for SloWithSummaryResponseIndicator +type SloWithSummaryResponseIndicator struct { + IndicatorPropertiesApmAvailability *IndicatorPropertiesApmAvailability + IndicatorPropertiesApmLatency *IndicatorPropertiesApmLatency + IndicatorPropertiesCustomKql *IndicatorPropertiesCustomKql + IndicatorPropertiesCustomMetric *IndicatorPropertiesCustomMetric + IndicatorPropertiesHistogram *IndicatorPropertiesHistogram + IndicatorPropertiesTimesliceMetric *IndicatorPropertiesTimesliceMetric +} + +// IndicatorPropertiesApmAvailabilityAsSloWithSummaryResponseIndicator is a convenience function that returns IndicatorPropertiesApmAvailability wrapped in SloWithSummaryResponseIndicator +func IndicatorPropertiesApmAvailabilityAsSloWithSummaryResponseIndicator(v *IndicatorPropertiesApmAvailability) SloWithSummaryResponseIndicator { + return SloWithSummaryResponseIndicator{ + IndicatorPropertiesApmAvailability: v, + } +} + +// IndicatorPropertiesApmLatencyAsSloWithSummaryResponseIndicator is a convenience function that returns IndicatorPropertiesApmLatency wrapped in SloWithSummaryResponseIndicator +func IndicatorPropertiesApmLatencyAsSloWithSummaryResponseIndicator(v *IndicatorPropertiesApmLatency) SloWithSummaryResponseIndicator { + return SloWithSummaryResponseIndicator{ + IndicatorPropertiesApmLatency: v, + } +} + +// IndicatorPropertiesCustomKqlAsSloWithSummaryResponseIndicator is a convenience function that returns IndicatorPropertiesCustomKql wrapped in SloWithSummaryResponseIndicator +func IndicatorPropertiesCustomKqlAsSloWithSummaryResponseIndicator(v *IndicatorPropertiesCustomKql) SloWithSummaryResponseIndicator { + return SloWithSummaryResponseIndicator{ + IndicatorPropertiesCustomKql: v, + } +} + +// IndicatorPropertiesCustomMetricAsSloWithSummaryResponseIndicator is a convenience function that returns IndicatorPropertiesCustomMetric wrapped in SloWithSummaryResponseIndicator +func IndicatorPropertiesCustomMetricAsSloWithSummaryResponseIndicator(v *IndicatorPropertiesCustomMetric) SloWithSummaryResponseIndicator { + return SloWithSummaryResponseIndicator{ + IndicatorPropertiesCustomMetric: v, + } +} + +// IndicatorPropertiesHistogramAsSloWithSummaryResponseIndicator is a convenience function that returns IndicatorPropertiesHistogram wrapped in SloWithSummaryResponseIndicator +func IndicatorPropertiesHistogramAsSloWithSummaryResponseIndicator(v *IndicatorPropertiesHistogram) SloWithSummaryResponseIndicator { + return SloWithSummaryResponseIndicator{ + IndicatorPropertiesHistogram: v, + } +} + +// IndicatorPropertiesTimesliceMetricAsSloWithSummaryResponseIndicator is a convenience function that returns IndicatorPropertiesTimesliceMetric wrapped in SloWithSummaryResponseIndicator +func IndicatorPropertiesTimesliceMetricAsSloWithSummaryResponseIndicator(v *IndicatorPropertiesTimesliceMetric) SloWithSummaryResponseIndicator { + return SloWithSummaryResponseIndicator{ + IndicatorPropertiesTimesliceMetric: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *SloWithSummaryResponseIndicator) UnmarshalJSON(data []byte) error { + var err error + // use discriminator value to speed up the lookup + var jsonDict map[string]interface{} + err = newStrictDecoder(data).Decode(&jsonDict) + if err != nil { + return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup") + } + + // check if the discriminator value is 'indicator_properties_apm_availability' + if jsonDict["type"] == "indicator_properties_apm_availability" { + // try to unmarshal JSON data into IndicatorPropertiesApmAvailability + err = json.Unmarshal(data, &dst.IndicatorPropertiesApmAvailability) + if err == nil { + return nil // data stored in dst.IndicatorPropertiesApmAvailability, return on the first match + } else { + dst.IndicatorPropertiesApmAvailability = nil + return fmt.Errorf("failed to unmarshal SloWithSummaryResponseIndicator as IndicatorPropertiesApmAvailability: %s", err.Error()) + } + } + + // check if the discriminator value is 'indicator_properties_apm_latency' + if jsonDict["type"] == "indicator_properties_apm_latency" { + // try to unmarshal JSON data into IndicatorPropertiesApmLatency + err = json.Unmarshal(data, &dst.IndicatorPropertiesApmLatency) + if err == nil { + return nil // data stored in dst.IndicatorPropertiesApmLatency, return on the first match + } else { + dst.IndicatorPropertiesApmLatency = nil + return fmt.Errorf("failed to unmarshal SloWithSummaryResponseIndicator as IndicatorPropertiesApmLatency: %s", err.Error()) + } + } + + // check if the discriminator value is 'indicator_properties_custom_kql' + if jsonDict["type"] == "indicator_properties_custom_kql" { + // try to unmarshal JSON data into IndicatorPropertiesCustomKql + err = json.Unmarshal(data, &dst.IndicatorPropertiesCustomKql) + if err == nil { + return nil // data stored in dst.IndicatorPropertiesCustomKql, return on the first match + } else { + dst.IndicatorPropertiesCustomKql = nil + return fmt.Errorf("failed to unmarshal SloWithSummaryResponseIndicator as IndicatorPropertiesCustomKql: %s", err.Error()) + } + } + + // check if the discriminator value is 'indicator_properties_custom_metric' + if jsonDict["type"] == "indicator_properties_custom_metric" { + // try to unmarshal JSON data into IndicatorPropertiesCustomMetric + err = json.Unmarshal(data, &dst.IndicatorPropertiesCustomMetric) + if err == nil { + return nil // data stored in dst.IndicatorPropertiesCustomMetric, return on the first match + } else { + dst.IndicatorPropertiesCustomMetric = nil + return fmt.Errorf("failed to unmarshal SloWithSummaryResponseIndicator as IndicatorPropertiesCustomMetric: %s", err.Error()) + } + } + + // check if the discriminator value is 'indicator_properties_histogram' + if jsonDict["type"] == "indicator_properties_histogram" { + // try to unmarshal JSON data into IndicatorPropertiesHistogram + err = json.Unmarshal(data, &dst.IndicatorPropertiesHistogram) + if err == nil { + return nil // data stored in dst.IndicatorPropertiesHistogram, return on the first match + } else { + dst.IndicatorPropertiesHistogram = nil + return fmt.Errorf("failed to unmarshal SloWithSummaryResponseIndicator as IndicatorPropertiesHistogram: %s", err.Error()) + } + } + + // check if the discriminator value is 'indicator_properties_timeslice_metric' + if jsonDict["type"] == "indicator_properties_timeslice_metric" { + // try to unmarshal JSON data into IndicatorPropertiesTimesliceMetric + err = json.Unmarshal(data, &dst.IndicatorPropertiesTimesliceMetric) + if err == nil { + return nil // data stored in dst.IndicatorPropertiesTimesliceMetric, return on the first match + } else { + dst.IndicatorPropertiesTimesliceMetric = nil + return fmt.Errorf("failed to unmarshal SloWithSummaryResponseIndicator as IndicatorPropertiesTimesliceMetric: %s", err.Error()) + } + } + + // check if the discriminator value is 'sli.apm.transactionDuration' + if jsonDict["type"] == "sli.apm.transactionDuration" { + // try to unmarshal JSON data into IndicatorPropertiesApmLatency + err = json.Unmarshal(data, &dst.IndicatorPropertiesApmLatency) + if err == nil { + return nil // data stored in dst.IndicatorPropertiesApmLatency, return on the first match + } else { + dst.IndicatorPropertiesApmLatency = nil + return fmt.Errorf("failed to unmarshal SloWithSummaryResponseIndicator as IndicatorPropertiesApmLatency: %s", err.Error()) + } + } + + // check if the discriminator value is 'sli.apm.transactionErrorRate' + if jsonDict["type"] == "sli.apm.transactionErrorRate" { + // try to unmarshal JSON data into IndicatorPropertiesApmAvailability + err = json.Unmarshal(data, &dst.IndicatorPropertiesApmAvailability) + if err == nil { + return nil // data stored in dst.IndicatorPropertiesApmAvailability, return on the first match + } else { + dst.IndicatorPropertiesApmAvailability = nil + return fmt.Errorf("failed to unmarshal SloWithSummaryResponseIndicator as IndicatorPropertiesApmAvailability: %s", err.Error()) + } + } + + // check if the discriminator value is 'sli.histogram.custom' + if jsonDict["type"] == "sli.histogram.custom" { + // try to unmarshal JSON data into IndicatorPropertiesHistogram + err = json.Unmarshal(data, &dst.IndicatorPropertiesHistogram) + if err == nil { + return nil // data stored in dst.IndicatorPropertiesHistogram, return on the first match + } else { + dst.IndicatorPropertiesHistogram = nil + return fmt.Errorf("failed to unmarshal SloWithSummaryResponseIndicator as IndicatorPropertiesHistogram: %s", err.Error()) + } + } + + // check if the discriminator value is 'sli.kql.custom' + if jsonDict["type"] == "sli.kql.custom" { + // try to unmarshal JSON data into IndicatorPropertiesCustomKql + err = json.Unmarshal(data, &dst.IndicatorPropertiesCustomKql) + if err == nil { + return nil // data stored in dst.IndicatorPropertiesCustomKql, return on the first match + } else { + dst.IndicatorPropertiesCustomKql = nil + return fmt.Errorf("failed to unmarshal SloWithSummaryResponseIndicator as IndicatorPropertiesCustomKql: %s", err.Error()) + } + } + + // check if the discriminator value is 'sli.metric.custom' + if jsonDict["type"] == "sli.metric.custom" { + // try to unmarshal JSON data into IndicatorPropertiesCustomMetric + err = json.Unmarshal(data, &dst.IndicatorPropertiesCustomMetric) + if err == nil { + return nil // data stored in dst.IndicatorPropertiesCustomMetric, return on the first match + } else { + dst.IndicatorPropertiesCustomMetric = nil + return fmt.Errorf("failed to unmarshal SloWithSummaryResponseIndicator as IndicatorPropertiesCustomMetric: %s", err.Error()) + } + } + + // check if the discriminator value is 'sli.metric.timeslice' + if jsonDict["type"] == "sli.metric.timeslice" { + // try to unmarshal JSON data into IndicatorPropertiesTimesliceMetric + err = json.Unmarshal(data, &dst.IndicatorPropertiesTimesliceMetric) + if err == nil { + return nil // data stored in dst.IndicatorPropertiesTimesliceMetric, return on the first match + } else { + dst.IndicatorPropertiesTimesliceMetric = nil + return fmt.Errorf("failed to unmarshal SloWithSummaryResponseIndicator as IndicatorPropertiesTimesliceMetric: %s", err.Error()) + } + } + + return nil +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src SloWithSummaryResponseIndicator) MarshalJSON() ([]byte, error) { + if src.IndicatorPropertiesApmAvailability != nil { + return json.Marshal(&src.IndicatorPropertiesApmAvailability) + } + + if src.IndicatorPropertiesApmLatency != nil { + return json.Marshal(&src.IndicatorPropertiesApmLatency) + } + + if src.IndicatorPropertiesCustomKql != nil { + return json.Marshal(&src.IndicatorPropertiesCustomKql) + } + + if src.IndicatorPropertiesCustomMetric != nil { + return json.Marshal(&src.IndicatorPropertiesCustomMetric) + } + + if src.IndicatorPropertiesHistogram != nil { + return json.Marshal(&src.IndicatorPropertiesHistogram) + } + + if src.IndicatorPropertiesTimesliceMetric != nil { + return json.Marshal(&src.IndicatorPropertiesTimesliceMetric) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *SloWithSummaryResponseIndicator) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.IndicatorPropertiesApmAvailability != nil { + return obj.IndicatorPropertiesApmAvailability + } + + if obj.IndicatorPropertiesApmLatency != nil { + return obj.IndicatorPropertiesApmLatency + } + + if obj.IndicatorPropertiesCustomKql != nil { + return obj.IndicatorPropertiesCustomKql + } + + if obj.IndicatorPropertiesCustomMetric != nil { + return obj.IndicatorPropertiesCustomMetric + } + + if obj.IndicatorPropertiesHistogram != nil { + return obj.IndicatorPropertiesHistogram + } + + if obj.IndicatorPropertiesTimesliceMetric != nil { + return obj.IndicatorPropertiesTimesliceMetric + } + + // all schemas are nil + return nil +} + +type NullableSloWithSummaryResponseIndicator struct { + value *SloWithSummaryResponseIndicator + isSet bool +} + +func (v NullableSloWithSummaryResponseIndicator) Get() *SloWithSummaryResponseIndicator { + return v.value +} + +func (v *NullableSloWithSummaryResponseIndicator) Set(val *SloWithSummaryResponseIndicator) { + v.value = val + v.isSet = true +} + +func (v NullableSloWithSummaryResponseIndicator) IsSet() bool { + return v.isSet +} + +func (v *NullableSloWithSummaryResponseIndicator) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSloWithSummaryResponseIndicator(val *SloWithSummaryResponseIndicator) *NullableSloWithSummaryResponseIndicator { + return &NullableSloWithSummaryResponseIndicator{value: val, isSet: true} +} + +func (v NullableSloWithSummaryResponseIndicator) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSloWithSummaryResponseIndicator) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/generated/slo/model_summary.go b/generated/slo/model_summary.go index e04aea289..251539a2e 100644 --- a/generated/slo/model_summary.go +++ b/generated/slo/model_summary.go @@ -3,7 +3,7 @@ SLOs OpenAPI schema for SLOs endpoints -API version: 1.0 +API version: 1.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/generated/slo/model_summary_status.go b/generated/slo/model_summary_status.go index 4ebe3d0f5..a942168d9 100644 --- a/generated/slo/model_summary_status.go +++ b/generated/slo/model_summary_status.go @@ -3,7 +3,7 @@ SLOs OpenAPI schema for SLOs endpoints -API version: 1.0 +API version: 1.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/generated/slo/model_time_window.go b/generated/slo/model_time_window.go index e7ca20150..71e713707 100644 --- a/generated/slo/model_time_window.go +++ b/generated/slo/model_time_window.go @@ -3,7 +3,7 @@ SLOs OpenAPI schema for SLOs endpoints -API version: 1.0 +API version: 1.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/generated/slo/model_timeslice_metric_basic_metric_with_field.go b/generated/slo/model_timeslice_metric_basic_metric_with_field.go index 6f3e23eda..e54d5af2a 100644 --- a/generated/slo/model_timeslice_metric_basic_metric_with_field.go +++ b/generated/slo/model_timeslice_metric_basic_metric_with_field.go @@ -3,7 +3,7 @@ SLOs OpenAPI schema for SLOs endpoints -API version: 1.0 +API version: 1.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/generated/slo/model_timeslice_metric_doc_count_metric.go b/generated/slo/model_timeslice_metric_doc_count_metric.go index ac35571c3..efcba9abe 100644 --- a/generated/slo/model_timeslice_metric_doc_count_metric.go +++ b/generated/slo/model_timeslice_metric_doc_count_metric.go @@ -3,7 +3,7 @@ SLOs OpenAPI schema for SLOs endpoints -API version: 1.0 +API version: 1.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/generated/slo/model_timeslice_metric_percentile_metric.go b/generated/slo/model_timeslice_metric_percentile_metric.go index ada902804..0d2844b2c 100644 --- a/generated/slo/model_timeslice_metric_percentile_metric.go +++ b/generated/slo/model_timeslice_metric_percentile_metric.go @@ -3,7 +3,7 @@ SLOs OpenAPI schema for SLOs endpoints -API version: 1.0 +API version: 1.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/generated/slo/model_update_slo_request.go b/generated/slo/model_update_slo_request.go index 242972bca..607c081c8 100644 --- a/generated/slo/model_update_slo_request.go +++ b/generated/slo/model_update_slo_request.go @@ -3,7 +3,7 @@ SLOs OpenAPI schema for SLOs endpoints -API version: 1.0 +API version: 1.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. @@ -28,7 +28,7 @@ type UpdateSloRequest struct { BudgetingMethod *BudgetingMethod `json:"budgetingMethod,omitempty"` Objective *Objective `json:"objective,omitempty"` Settings *Settings `json:"settings,omitempty"` - GroupBy *SloResponseGroupBy `json:"groupBy,omitempty"` + GroupBy *GroupBy `json:"groupBy,omitempty"` // List of tags Tags []string `json:"tags,omitempty"` } @@ -275,9 +275,9 @@ func (o *UpdateSloRequest) SetSettings(v Settings) { } // GetGroupBy returns the GroupBy field value if set, zero value otherwise. -func (o *UpdateSloRequest) GetGroupBy() SloResponseGroupBy { +func (o *UpdateSloRequest) GetGroupBy() GroupBy { if o == nil || IsNil(o.GroupBy) { - var ret SloResponseGroupBy + var ret GroupBy return ret } return *o.GroupBy @@ -285,7 +285,7 @@ func (o *UpdateSloRequest) GetGroupBy() SloResponseGroupBy { // GetGroupByOk returns a tuple with the GroupBy field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UpdateSloRequest) GetGroupByOk() (*SloResponseGroupBy, bool) { +func (o *UpdateSloRequest) GetGroupByOk() (*GroupBy, bool) { if o == nil || IsNil(o.GroupBy) { return nil, false } @@ -301,8 +301,8 @@ func (o *UpdateSloRequest) HasGroupBy() bool { return false } -// SetGroupBy gets a reference to the given SloResponseGroupBy and assigns it to the GroupBy field. -func (o *UpdateSloRequest) SetGroupBy(v SloResponseGroupBy) { +// SetGroupBy gets a reference to the given GroupBy and assigns it to the GroupBy field. +func (o *UpdateSloRequest) SetGroupBy(v GroupBy) { o.GroupBy = &v } diff --git a/generated/slo/response.go b/generated/slo/response.go index 2875928ac..2cb1fb208 100644 --- a/generated/slo/response.go +++ b/generated/slo/response.go @@ -3,7 +3,7 @@ SLOs OpenAPI schema for SLOs endpoints -API version: 1.0 +API version: 1.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/generated/slo/utils.go b/generated/slo/utils.go index 7907b693f..826d18aca 100644 --- a/generated/slo/utils.go +++ b/generated/slo/utils.go @@ -3,7 +3,7 @@ SLOs OpenAPI schema for SLOs endpoints -API version: 1.0 +API version: 1.1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. diff --git a/internal/kibana/slo.go b/internal/kibana/slo.go index ce8c6bd8c..99d73ee24 100644 --- a/internal/kibana/slo.go +++ b/internal/kibana/slo.go @@ -599,7 +599,7 @@ func getSloFromResourceData(d *schema.ResourceData) (models.Slo, diag.Diagnostic idx := fmt.Sprint(n) goodMetrics = append(goodMetrics, slo.IndicatorPropertiesCustomMetricParamsGoodMetricsInner{ Name: d.Get(indicatorType + ".0.good.0.metrics." + idx + ".name").(string), - Field: d.Get(indicatorType + ".0.good.0.metrics." + idx + ".field").(string), + Field: getOrNilString(indicatorType+".0.good.0.metrics."+idx+".field", d), Aggregation: d.Get(indicatorType + ".0.good.0.metrics." + idx + ".aggregation").(string), Filter: getOrNilString(indicatorType+".0.good.0.metrics."+idx+".filter", d), }) @@ -610,7 +610,7 @@ func getSloFromResourceData(d *schema.ResourceData) (models.Slo, diag.Diagnostic idx := fmt.Sprint(n) totalMetrics = append(totalMetrics, slo.IndicatorPropertiesCustomMetricParamsTotalMetricsInner{ Name: d.Get(indicatorType + ".0.total.0.metrics." + idx + ".name").(string), - Field: d.Get(indicatorType + ".0.total.0.metrics." + idx + ".field").(string), + Field: getOrNilString(indicatorType+".0.total.0.metrics."+idx+".field", d), Aggregation: d.Get(indicatorType + ".0.total.0.metrics." + idx + ".aggregation").(string), Filter: getOrNilString(indicatorType+".0.total.0.metrics."+idx+".filter", d), })