From be705ea0c5c692c688e125ca4a4590339f4f33f0 Mon Sep 17 00:00:00 2001 From: Raymond Lynch Date: Fri, 25 Oct 2024 11:45:30 -0400 Subject: [PATCH 01/15] dataview and kibana gen --- generated/data_views/.gitignore | 24 - .../data_views/.openapi-generator-ignore | 23 - generated/data_views/.openapi-generator/FILES | 50 - .../data_views/.openapi-generator/VERSION | 1 - generated/data_views/.travis.yml | 8 - generated/data_views/README.md | 176 -- generated/data_views/api/openapi.yaml | 2607 ----------------- generated/data_views/api_data_views.go | 2050 ------------- generated/data_views/bundled.yaml | 2221 -------------- generated/data_views/client.go | 666 ----- generated/data_views/configuration.go | 220 -- .../docs/CreateDataViewRequestObject.md | 77 - .../CreateDataViewRequestObjectDataView.md | 389 --- .../docs/CreateRuntimeFieldRequest.md | 92 - .../CreateUpdateRuntimeField200Response.md | 82 - .../docs/CreateUpdateRuntimeFieldRequest.md | 72 - .../data_views/docs/DataViewResponseObject.md | 56 - .../docs/DataViewResponseObjectDataView.md | 368 --- generated/data_views/docs/DataViewsAPI.md | 987 ------- .../docs/GetAllDataViews200Response.md | 56 - ...GetAllDataViews200ResponseDataViewInner.md | 160 - .../docs/GetDefaultDataView200Response.md | 56 - .../docs/GetRuntimeField200Response.md | 82 - generated/data_views/docs/Model400Response.md | 93 - generated/data_views/docs/Model404Response.md | 108 - .../docs/SetDefaultDatailView200Response.md | 56 - .../docs/SetDefaultDatailViewRequest.md | 87 - .../data_views/docs/SourcefiltersInner.md | 51 - .../docs/UpdateDataViewRequestObject.md | 77 - .../UpdateDataViewRequestObjectDataView.md | 290 -- .../docs/UpdateFieldsMetadata200Response.md | 56 - .../docs/UpdateFieldsMetadataRequest.md | 51 - .../docs/UpdateRuntimeFieldRequest.md | 51 - generated/data_views/git_push.sh | 57 - generated/data_views/model_400_response.go | 169 -- generated/data_views/model_404_response.go | 196 -- .../model_create_data_view_request_object.go | 156 - ...eate_data_view_request_object_data_view.go | 594 ---- .../model_create_runtime_field_request.go | 152 - ...reate_update_runtime_field_200_response.go | 160 - ...del_create_update_runtime_field_request.go | 144 - .../model_data_view_response_object.go | 124 - ...del_data_view_response_object_data_view.go | 566 ---- .../model_get_all_data_views_200_response.go | 124 - ...data_views_200_response_data_view_inner.go | 268 -- ...odel_get_default_data_view_200_response.go | 124 - .../model_get_runtime_field_200_response.go | 160 - ...el_set_default_datail_view_200_response.go | 124 - .../model_set_default_datail_view_request.go | 161 - .../data_views/model_sourcefilters_inner.go | 115 - .../model_update_data_view_request_object.go | 156 - ...date_data_view_request_object_data_view.go | 456 --- ...del_update_fields_metadata_200_response.go | 124 - .../model_update_fields_metadata_request.go | 116 - .../model_update_runtime_field_request.go | 116 - generated/data_views/response.go | 47 - generated/data_views/utils.go | 347 --- generated/kibana/.gitignore | 2 + generated/kibana/Makefile | 34 + generated/kibana/kibana.gen.go | 1067 +++++++ generated/kibana/oapi-config.yaml | 9 + generated/kibana/transform_schema.go | 885 ++++++ internal/clients/api_client.go | 78 +- internal/clients/config/base.go | 8 + internal/clients/config/client.go | 2 + internal/clients/config/env.go | 6 +- internal/clients/config/fleet.go | 4 +- internal/clients/config/fleet_test.go | 64 +- internal/clients/config/framework.go | 10 +- internal/clients/config/kibana.go | 11 - internal/clients/config/kibana2.go | 122 + internal/clients/config/kibana2_test.go | 299 ++ internal/clients/config/sdk.go | 10 +- internal/clients/fleet/fleet.go | 6 +- internal/clients/kibana2/client.go | 105 + internal/clients/kibana2/data_views.go | 89 + internal/clients/kibana2/errors.go | 16 + internal/fleet/integration_policy/models.go | 2 +- internal/kibana/data_view/create.go | 51 +- internal/kibana/data_view/delete.go | 30 +- internal/kibana/data_view/import.go | 13 - internal/kibana/data_view/models.go | 281 ++ internal/kibana/data_view/models_test.go | 354 +++ internal/kibana/data_view/read.go | 64 +- internal/kibana/data_view/resource.go | 52 + internal/kibana/data_view/schema.go | 517 +--- internal/kibana/data_view/schema_test.go | 339 --- internal/kibana/data_view/update.go | 46 +- internal/utils/tfsdk.go | 198 +- internal/utils/tfsdk_test.go | 567 +++- internal/utils/utils.go | 20 +- provider/plugin_framework.go | 2 +- tools/kibana_gen.go | 3 + 93 files changed, 4124 insertions(+), 17441 deletions(-) delete mode 100644 generated/data_views/.gitignore delete mode 100644 generated/data_views/.openapi-generator-ignore delete mode 100644 generated/data_views/.openapi-generator/FILES delete mode 100644 generated/data_views/.openapi-generator/VERSION delete mode 100644 generated/data_views/.travis.yml delete mode 100644 generated/data_views/README.md delete mode 100644 generated/data_views/api/openapi.yaml delete mode 100644 generated/data_views/api_data_views.go delete mode 100644 generated/data_views/bundled.yaml delete mode 100644 generated/data_views/client.go delete mode 100644 generated/data_views/configuration.go delete mode 100644 generated/data_views/docs/CreateDataViewRequestObject.md delete mode 100644 generated/data_views/docs/CreateDataViewRequestObjectDataView.md delete mode 100644 generated/data_views/docs/CreateRuntimeFieldRequest.md delete mode 100644 generated/data_views/docs/CreateUpdateRuntimeField200Response.md delete mode 100644 generated/data_views/docs/CreateUpdateRuntimeFieldRequest.md delete mode 100644 generated/data_views/docs/DataViewResponseObject.md delete mode 100644 generated/data_views/docs/DataViewResponseObjectDataView.md delete mode 100644 generated/data_views/docs/DataViewsAPI.md delete mode 100644 generated/data_views/docs/GetAllDataViews200Response.md delete mode 100644 generated/data_views/docs/GetAllDataViews200ResponseDataViewInner.md delete mode 100644 generated/data_views/docs/GetDefaultDataView200Response.md delete mode 100644 generated/data_views/docs/GetRuntimeField200Response.md delete mode 100644 generated/data_views/docs/Model400Response.md delete mode 100644 generated/data_views/docs/Model404Response.md delete mode 100644 generated/data_views/docs/SetDefaultDatailView200Response.md delete mode 100644 generated/data_views/docs/SetDefaultDatailViewRequest.md delete mode 100644 generated/data_views/docs/SourcefiltersInner.md delete mode 100644 generated/data_views/docs/UpdateDataViewRequestObject.md delete mode 100644 generated/data_views/docs/UpdateDataViewRequestObjectDataView.md delete mode 100644 generated/data_views/docs/UpdateFieldsMetadata200Response.md delete mode 100644 generated/data_views/docs/UpdateFieldsMetadataRequest.md delete mode 100644 generated/data_views/docs/UpdateRuntimeFieldRequest.md delete mode 100644 generated/data_views/git_push.sh delete mode 100644 generated/data_views/model_400_response.go delete mode 100644 generated/data_views/model_404_response.go delete mode 100644 generated/data_views/model_create_data_view_request_object.go delete mode 100644 generated/data_views/model_create_data_view_request_object_data_view.go delete mode 100644 generated/data_views/model_create_runtime_field_request.go delete mode 100644 generated/data_views/model_create_update_runtime_field_200_response.go delete mode 100644 generated/data_views/model_create_update_runtime_field_request.go delete mode 100644 generated/data_views/model_data_view_response_object.go delete mode 100644 generated/data_views/model_data_view_response_object_data_view.go delete mode 100644 generated/data_views/model_get_all_data_views_200_response.go delete mode 100644 generated/data_views/model_get_all_data_views_200_response_data_view_inner.go delete mode 100644 generated/data_views/model_get_default_data_view_200_response.go delete mode 100644 generated/data_views/model_get_runtime_field_200_response.go delete mode 100644 generated/data_views/model_set_default_datail_view_200_response.go delete mode 100644 generated/data_views/model_set_default_datail_view_request.go delete mode 100644 generated/data_views/model_sourcefilters_inner.go delete mode 100644 generated/data_views/model_update_data_view_request_object.go delete mode 100644 generated/data_views/model_update_data_view_request_object_data_view.go delete mode 100644 generated/data_views/model_update_fields_metadata_200_response.go delete mode 100644 generated/data_views/model_update_fields_metadata_request.go delete mode 100644 generated/data_views/model_update_runtime_field_request.go delete mode 100644 generated/data_views/response.go delete mode 100644 generated/data_views/utils.go create mode 100644 generated/kibana/.gitignore create mode 100644 generated/kibana/Makefile create mode 100644 generated/kibana/kibana.gen.go create mode 100644 generated/kibana/oapi-config.yaml create mode 100644 generated/kibana/transform_schema.go create mode 100644 internal/clients/config/kibana2.go create mode 100644 internal/clients/config/kibana2_test.go create mode 100644 internal/clients/kibana2/client.go create mode 100644 internal/clients/kibana2/data_views.go create mode 100644 internal/clients/kibana2/errors.go delete mode 100644 internal/kibana/data_view/import.go create mode 100644 internal/kibana/data_view/models.go create mode 100644 internal/kibana/data_view/models_test.go create mode 100644 internal/kibana/data_view/resource.go delete mode 100644 internal/kibana/data_view/schema_test.go create mode 100644 tools/kibana_gen.go diff --git a/generated/data_views/.gitignore b/generated/data_views/.gitignore deleted file mode 100644 index daf913b1b..000000000 --- a/generated/data_views/.gitignore +++ /dev/null @@ -1,24 +0,0 @@ -# Compiled Object files, Static and Dynamic libs (Shared Objects) -*.o -*.a -*.so - -# Folders -_obj -_test - -# Architecture specific extensions/prefixes -*.[568vq] -[568vq].out - -*.cgo1.go -*.cgo2.c -_cgo_defun.c -_cgo_gotypes.go -_cgo_export.* - -_testmain.go - -*.exe -*.test -*.prof diff --git a/generated/data_views/.openapi-generator-ignore b/generated/data_views/.openapi-generator-ignore deleted file mode 100644 index 7484ee590..000000000 --- a/generated/data_views/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/generated/data_views/.openapi-generator/FILES b/generated/data_views/.openapi-generator/FILES deleted file mode 100644 index 0de6b469a..000000000 --- a/generated/data_views/.openapi-generator/FILES +++ /dev/null @@ -1,50 +0,0 @@ -.gitignore -.travis.yml -README.md -api/openapi.yaml -api_data_views.go -client.go -configuration.go -docs/CreateDataViewRequestObject.md -docs/CreateDataViewRequestObjectDataView.md -docs/CreateUpdateRuntimeField200Response.md -docs/CreateUpdateRuntimeFieldRequest.md -docs/DataViewResponseObject.md -docs/DataViewResponseObjectDataView.md -docs/DataViewsAPI.md -docs/GetAllDataViews200Response.md -docs/GetAllDataViews200ResponseDataViewInner.md -docs/GetDefaultDataView200Response.md -docs/Model400Response.md -docs/Model404Response.md -docs/SetDefaultDatailView200Response.md -docs/SetDefaultDatailViewRequest.md -docs/SourcefiltersInner.md -docs/UpdateDataViewRequestObject.md -docs/UpdateDataViewRequestObjectDataView.md -docs/UpdateFieldsMetadataRequest.md -docs/UpdateRuntimeFieldRequest.md -git_push.sh -go.mod -go.sum -model_400_response.go -model_404_response.go -model_create_data_view_request_object.go -model_create_data_view_request_object_data_view.go -model_create_update_runtime_field_200_response.go -model_create_update_runtime_field_request.go -model_data_view_response_object.go -model_data_view_response_object_data_view.go -model_get_all_data_views_200_response.go -model_get_all_data_views_200_response_data_view_inner.go -model_get_default_data_view_200_response.go -model_set_default_datail_view_200_response.go -model_set_default_datail_view_request.go -model_sourcefilters_inner.go -model_update_data_view_request_object.go -model_update_data_view_request_object_data_view.go -model_update_fields_metadata_request.go -model_update_runtime_field_request.go -response.go -test/api_data_views_test.go -utils.go diff --git a/generated/data_views/.openapi-generator/VERSION b/generated/data_views/.openapi-generator/VERSION deleted file mode 100644 index 73a86b197..000000000 --- a/generated/data_views/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -7.0.1 \ No newline at end of file diff --git a/generated/data_views/.travis.yml b/generated/data_views/.travis.yml deleted file mode 100644 index f5cb2ce9a..000000000 --- a/generated/data_views/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -language: go - -install: - - go get -d -v . - -script: - - go build -v ./ - diff --git a/generated/data_views/README.md b/generated/data_views/README.md deleted file mode 100644 index 93b07ea26..000000000 --- a/generated/data_views/README.md +++ /dev/null @@ -1,176 +0,0 @@ -# Go API client for data_views - -OpenAPI schema for data view 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: 0.1 -- Package version: 1.0.0 -- Build package: org.openapitools.codegen.languages.GoClientCodegen - -## Installation - -Install the following dependencies: - -```shell -go get github.com/stretchr/testify/assert -go get golang.org/x/net/context -``` - -Put the package under your project folder and add the following in import: - -```golang -import data_views "github.com/elastic/terraform-provider-elasticstack/data_views" -``` - -To use a proxy, set the environment variable `HTTP_PROXY`: - -```golang -os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") -``` - -## Configuration of Server URL - -Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. - -### Select Server Configuration - -For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. - -```golang -ctx := context.WithValue(context.Background(), data_views.ContextServerIndex, 1) -``` - -### Templated Server URL - -Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. - -```golang -ctx := context.WithValue(context.Background(), data_views.ContextServerVariables, map[string]string{ - "basePath": "v2", -}) -``` - -Note, enum values are always validated and all unused variables are silently ignored. - -### URLs Configuration per Operation - -Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. -An operation is uniquely identified by `"{classname}Service.{nickname}"` string. -Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. - -```golang -ctx := context.WithValue(context.Background(), data_views.ContextOperationServerIndices, map[string]int{ - "{classname}Service.{nickname}": 2, -}) -ctx = context.WithValue(context.Background(), data_views.ContextOperationServerVariables, map[string]map[string]string{ - "{classname}Service.{nickname}": { - "port": "8443", - }, -}) -``` - -## Documentation for API Endpoints - -All URIs are relative to *http://localhost* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*DataViewsAPI* | [**CreateDataView**](docs/DataViewsAPI.md#createdataview) | **Post** /s/{spaceId}/api/data_views/data_view | Creates a data view. -*DataViewsAPI* | [**CreateRuntimeField**](docs/DataViewsAPI.md#createruntimefield) | **Post** /s/{spaceId}/api/data_views/data_view/{viewId}/runtime_field | Creates a runtime field. -*DataViewsAPI* | [**CreateUpdateRuntimeField**](docs/DataViewsAPI.md#createupdateruntimefield) | **Put** /s/{spaceId}/api/data_views/data_view/{viewId}/runtime_field | Create or update an existing runtime field. -*DataViewsAPI* | [**DeleteDataView**](docs/DataViewsAPI.md#deletedataview) | **Delete** /s/{spaceId}/api/data_views/data_view/{viewId} | Deletes a data view. -*DataViewsAPI* | [**DeleteRuntimeField**](docs/DataViewsAPI.md#deleteruntimefield) | **Delete** /s/{spaceId}/api/data_views/data_view/{viewId}/runtime_field/{fieldName} | Delete a runtime field from a data view. -*DataViewsAPI* | [**GetAllDataViews**](docs/DataViewsAPI.md#getalldataviews) | **Get** /s/{spaceId}/api/data_views | Retrieves a list of all data views. -*DataViewsAPI* | [**GetDataView**](docs/DataViewsAPI.md#getdataview) | **Get** /s/{spaceId}/api/data_views/data_view/{viewId} | Retrieves a single data view by identifier. -*DataViewsAPI* | [**GetDefaultDataView**](docs/DataViewsAPI.md#getdefaultdataview) | **Get** /s/{spaceId}/api/data_views/default | Retrieves the default data view identifier. -*DataViewsAPI* | [**GetRuntimeField**](docs/DataViewsAPI.md#getruntimefield) | **Get** /s/{spaceId}/api/data_views/data_view/{viewId}/runtime_field/{fieldName} | Retrieves a runtime field. -*DataViewsAPI* | [**SetDefaultDatailView**](docs/DataViewsAPI.md#setdefaultdatailview) | **Post** /s/{spaceId}/api/data_views/default | Sets the default data view identifier. -*DataViewsAPI* | [**UpdateDataView**](docs/DataViewsAPI.md#updatedataview) | **Post** /s/{spaceId}/api/data_views/data_view/{viewId} | Updates a data view. -*DataViewsAPI* | [**UpdateFieldsMetadata**](docs/DataViewsAPI.md#updatefieldsmetadata) | **Post** /s/{spaceId}/api/data_views/data_view/{viewId}/fields | Update fields presentation metadata such as count, customLabel and format. -*DataViewsAPI* | [**UpdateRuntimeField**](docs/DataViewsAPI.md#updateruntimefield) | **Post** /s/{spaceId}/api/data_views/data_view/{viewId}/runtime_field/{fieldName} | Update an existing runtime field. - - -## Documentation For Models - - - [CreateDataViewRequestObject](docs/CreateDataViewRequestObject.md) - - [CreateDataViewRequestObjectDataView](docs/CreateDataViewRequestObjectDataView.md) - - [CreateUpdateRuntimeField200Response](docs/CreateUpdateRuntimeField200Response.md) - - [CreateUpdateRuntimeFieldRequest](docs/CreateUpdateRuntimeFieldRequest.md) - - [DataViewResponseObject](docs/DataViewResponseObject.md) - - [DataViewResponseObjectDataView](docs/DataViewResponseObjectDataView.md) - - [GetAllDataViews200Response](docs/GetAllDataViews200Response.md) - - [GetAllDataViews200ResponseDataViewInner](docs/GetAllDataViews200ResponseDataViewInner.md) - - [GetDefaultDataView200Response](docs/GetDefaultDataView200Response.md) - - [Model400Response](docs/Model400Response.md) - - [Model404Response](docs/Model404Response.md) - - [SetDefaultDatailView200Response](docs/SetDefaultDatailView200Response.md) - - [SetDefaultDatailViewRequest](docs/SetDefaultDatailViewRequest.md) - - [SourcefiltersInner](docs/SourcefiltersInner.md) - - [UpdateDataViewRequestObject](docs/UpdateDataViewRequestObject.md) - - [UpdateDataViewRequestObjectDataView](docs/UpdateDataViewRequestObjectDataView.md) - - [UpdateFieldsMetadataRequest](docs/UpdateFieldsMetadataRequest.md) - - [UpdateRuntimeFieldRequest](docs/UpdateRuntimeFieldRequest.md) - - -## 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) -``` - - -## Documentation for Utility Methods - -Due to the fact that model structure members are all pointers, this package contains -a number of utility functions to easily obtain pointers to values of basic types. -Each of these functions takes a value of the given basic type and returns a pointer to it: - -* `PtrBool` -* `PtrInt` -* `PtrInt32` -* `PtrInt64` -* `PtrFloat` -* `PtrFloat32` -* `PtrFloat64` -* `PtrString` -* `PtrTime` - -## Author - - - diff --git a/generated/data_views/api/openapi.yaml b/generated/data_views/api/openapi.yaml deleted file mode 100644 index 5bab9687f..000000000 --- a/generated/data_views/api/openapi.yaml +++ /dev/null @@ -1,2607 +0,0 @@ -openapi: 3.0.1 -info: - contact: - name: Kibana Core Team - description: OpenAPI schema for data view endpoints - license: - name: Elastic License 2.0 - url: https://www.elastic.co/licensing/elastic-license - title: Data views - version: "0.1" -servers: -- url: / -security: -- basicAuth: [] -- apiKeyAuth: [] -tags: -- description: "Data view APIs enable you to manage data views, formerly known as\ - \ Kibana index patterns." - name: data views -paths: - /s/{spaceId}/api/data_views: - get: - description: | - This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. - operationId: getAllDataViews - parameters: - - 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: - type: string - style: simple - responses: - "200": - content: - application/json: - examples: - getAllDataViewsResponse: - $ref: '#/components/examples/get_data_views_response' - schema: - $ref: '#/components/schemas/getAllDataViews_200_response' - description: Indicates a successful call. - "400": - content: - application/json: - schema: - $ref: '#/components/schemas/400_response' - description: Bad request - summary: Retrieves a list of all data views. - tags: - - data views - /s/{spaceId}/api/data_views/data_view: - post: - description: | - This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. - operationId: createDataView - 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: - type: string - style: simple - requestBody: - content: - application/json: - examples: - createDataViewRequest: - $ref: '#/components/examples/create_data_view_request' - schema: - $ref: '#/components/schemas/create_data_view_request_object' - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/data_view_response_object' - description: Indicates a successful call. - "400": - content: - application/json: - schema: - $ref: '#/components/schemas/400_response' - description: Bad request - summary: Creates a data view. - tags: - - data views - /s/{spaceId}/api/data_views/data_view/{viewId}: - delete: - description: | - WARNING: When you delete a data view, it cannot be recovered. This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. - operationId: deleteDataView - 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 data view. - explode: false - in: path - name: viewId - required: true - schema: - example: ff959d40-b880-11e8-a6d9-e546fe2bba5f - 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: - type: string - style: simple - responses: - "204": - description: Indicates a successful call. - "404": - content: - application/json: - schema: - $ref: '#/components/schemas/404_response' - description: Object is not found. - summary: Deletes a data view. - tags: - - data views - get: - description: | - This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. - operationId: getDataView - parameters: - - description: An identifier for the data view. - explode: false - in: path - name: viewId - required: true - schema: - example: ff959d40-b880-11e8-a6d9-e546fe2bba5f - 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: - type: string - style: simple - responses: - "200": - content: - application/json: - examples: - getDataViewResponse: - $ref: '#/components/examples/get_data_view_response' - schema: - $ref: '#/components/schemas/data_view_response_object' - description: Indicates a successful call. - "404": - content: - application/json: - schema: - $ref: '#/components/schemas/404_response' - description: Object is not found. - summary: Retrieves a single data view by identifier. - tags: - - data views - post: - description: | - This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. - operationId: updateDataView - 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 data view. - explode: false - in: path - name: viewId - required: true - schema: - example: ff959d40-b880-11e8-a6d9-e546fe2bba5f - 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: - type: string - style: simple - requestBody: - content: - application/json: - examples: - updateDataViewRequest: - $ref: '#/components/examples/update_data_view_request' - schema: - $ref: '#/components/schemas/update_data_view_request_object' - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/data_view_response_object' - description: Indicates a successful call. - "400": - content: - application/json: - schema: - $ref: '#/components/schemas/400_response' - description: Bad request - summary: Updates a data view. - tags: - - data views - /s/{spaceId}/api/data_views/default: - get: - description: | - This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. - operationId: getDefaultDataView - parameters: - - 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: - type: string - style: simple - responses: - "200": - content: - application/json: - examples: - getDefaultDataViewResponse: - $ref: '#/components/examples/get_default_data_view_response' - schema: - $ref: '#/components/schemas/getDefaultDataView_200_response' - description: Indicates a successful call. - "400": - content: - application/json: - schema: - $ref: '#/components/schemas/400_response' - description: Bad request - summary: Retrieves the default data view identifier. - tags: - - data views - post: - description: | - This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. - operationId: setDefaultDatailView - 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: - type: string - style: simple - requestBody: - content: - application/json: - examples: - setDefaultDataViewRequest: - $ref: '#/components/examples/set_default_data_view_request' - schema: - $ref: '#/components/schemas/setDefaultDatailView_request' - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/setDefaultDatailView_200_response' - description: Indicates a successful call. - "400": - content: - application/json: - schema: - $ref: '#/components/schemas/400_response' - description: Bad request - summary: Sets the default data view identifier. - tags: - - data views - /s/{spaceId}/api/data_views/data_view/{viewId}/fields: - post: - description: | - This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. You can update multiple fields in one request. Updates are merged with persisted metadata. To remove existing metadata, specify null as the value. - operationId: updateFieldsMetadata - 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 data view. - explode: false - in: path - name: viewId - required: true - schema: - example: ff959d40-b880-11e8-a6d9-e546fe2bba5f - 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: - type: string - style: simple - requestBody: - content: - application/json: - examples: - updateFieldsMetadataRequest: - $ref: '#/components/examples/update_field_metadata_request' - schema: - $ref: '#/components/schemas/updateFieldsMetadata_request' - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/setDefaultDatailView_200_response' - description: Indicates a successful call. - "400": - content: - application/json: - schema: - $ref: '#/components/schemas/400_response' - description: Bad request - summary: "Update fields presentation metadata such as count, customLabel and\ - \ format." - tags: - - data views - /s/{spaceId}/api/data_views/data_view/{viewId}/runtime_field: - post: - description: | - This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. - operationId: createRuntimeField - 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 data view. - explode: false - in: path - name: viewId - required: true - schema: - example: ff959d40-b880-11e8-a6d9-e546fe2bba5f - 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: - type: string - style: simple - requestBody: - content: - application/json: - examples: - createRuntimeFieldRequest: - $ref: '#/components/examples/create_runtime_field_request' - schema: - $ref: '#/components/schemas/createUpdateRuntimeField_request' - required: true - summary: Creates a runtime field. - tags: - - data views - put: - description: | - This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. - operationId: createUpdateRuntimeField - 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: - type: string - style: simple - - description: | - The ID of the data view fields you want to update. - explode: false - in: path - name: viewId - required: true - schema: - type: string - style: simple - requestBody: - content: - application/json: - examples: - updateRuntimeFieldRequest: - $ref: '#/components/examples/create_runtime_field_request' - schema: - $ref: '#/components/schemas/createUpdateRuntimeField_request' - required: true - responses: - "200": - content: - application/json: - examples: - createRuntimeFieldResponse: - $ref: '#/components/examples/create_runtime_field_response' - schema: - $ref: '#/components/schemas/createUpdateRuntimeField_200_response' - description: Indicates a successful call. - "400": - content: - application/json: - schema: - $ref: '#/components/schemas/400_response' - description: Bad request - summary: Create or update an existing runtime field. - tags: - - data views - /s/{spaceId}/api/data_views/data_view/{viewId}/runtime_field/{fieldName}: - delete: - description: | - This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. - operationId: deleteRuntimeField - parameters: - - description: The name of the runtime field. - explode: false - in: path - name: fieldName - required: true - schema: - example: hour_of_day - type: string - style: simple - - description: An identifier for the data view. - explode: false - in: path - name: viewId - required: true - schema: - example: ff959d40-b880-11e8-a6d9-e546fe2bba5f - 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: - type: string - style: simple - responses: - "200": - description: Indicates a successful call. - "404": - content: - application/json: - schema: - $ref: '#/components/schemas/404_response' - description: Object is not found. - summary: Delete a runtime field from a data view. - tags: - - data views - get: - description: | - This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. - operationId: getRuntimeField - parameters: - - description: The name of the runtime field. - explode: false - in: path - name: fieldName - required: true - schema: - example: hour_of_day - type: string - style: simple - - description: An identifier for the data view. - explode: false - in: path - name: viewId - required: true - schema: - example: ff959d40-b880-11e8-a6d9-e546fe2bba5f - 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: - type: string - style: simple - responses: - "200": - content: - application/json: - examples: - getRuntimeFieldResponse: - $ref: '#/components/examples/get_runtime_field_response' - schema: - $ref: '#/components/schemas/createUpdateRuntimeField_200_response' - description: Indicates a successful call. - "404": - content: - application/json: - schema: - $ref: '#/components/schemas/404_response' - description: Object is not found. - summary: Retrieves a runtime field. - tags: - - data views - post: - description: | - This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. - operationId: updateRuntimeField - parameters: - - description: The name of the runtime field. - explode: false - in: path - name: fieldName - required: true - schema: - example: hour_of_day - type: string - style: simple - - description: An identifier for the data view. - explode: false - in: path - name: viewId - required: true - schema: - example: ff959d40-b880-11e8-a6d9-e546fe2bba5f - 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: - type: string - style: simple - requestBody: - content: - application/json: - examples: - updateRuntimeFieldRequest: - $ref: '#/components/examples/update_runtime_field_request' - schema: - $ref: '#/components/schemas/updateRuntimeField_request' - required: true - responses: - "200": - description: Indicates a successful call. - "400": - content: - application/json: - schema: - $ref: '#/components/schemas/400_response' - description: Bad request - summary: Update an existing runtime field. - tags: - - data views -components: - examples: - get_data_views_response: - summary: The get all data views API returns a list of data views. - value: - data_view: - - id: ff959d40-b880-11e8-a6d9-e546fe2bba5f - namespaces: - - default - title: kibana_sample_data_ecommerce - typeMeta: {} - name: Kibana Sample Data eCommerce - - id: d3d7af60-4c81-11e8-b3d7-01146121b73d - namespaces: - - default - title: kibana_sample_data_flights - name: Kibana Sample Data Flights - - id: 90943e30-9a47-11e8-b64d-95841ca0b247 - namespaces: - - default - title: kibana_sample_data_logs - name: Kibana Sample Data Logs - create_data_view_request: - summary: Create a data view with runtime fields. - value: - data_view: - title: logstash-* - name: My Logstash data view - runtimeFieldMap: - runtime_shape_name: - type: keyword - script: - source: "emit(doc['shape_name'].value)" - get_data_view_response: - summary: The get data view API returns a JSON object that contains information - about the data view. - value: - data_view: - id: ff959d40-b880-11e8-a6d9-e546fe2bba5f - version: WzUsMV0= - title: kibana_sample_data_ecommerce - timeFieldName: order_date - sourceFilters: [] - fields: - _id: - count: 0 - name: _id - type: string - esTypes: - - _id - scripted: false - searchable: true - aggregatable: false - readFromDocValues: false - format: - id: string - shortDotsEnable: false - isMapped: true - _index: - count: 0 - name: _index - type: string - esTypes: - - _index - scripted: false - searchable: true - aggregatable: true - readFromDocValues: false - format: - id: string - shortDotsEnable: false - isMapped: true - _score: - count: 0 - name: _score - type: number - scripted: false - searchable: false - aggregatable: false - readFromDocValues: false - format: - id: number - shortDotsEnable: false - isMapped: true - _source: - count: 0 - name: _source - type: _source - esTypes: - - _source - scripted: false - searchable: false - aggregatable: false - readFromDocValues: false - format: - id: _source - shortDotsEnable: false - isMapped: true - category: - count: 0 - name: category - type: string - esTypes: - - text - scripted: false - searchable: true - aggregatable: false - readFromDocValues: false - format: - id: string - shortDotsEnable: false - isMapped: true - category.keyword: - count: 0 - name: category.keyword - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - subType: - multi: - parent: category - format: - id: string - shortDotsEnable: false - isMapped: true - currency: - count: 0 - name: currency - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: string - shortDotsEnable: false - isMapped: true - customer_birth_date: - count: 0 - name: customer_birth_date - type: date - esTypes: - - date - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: date - shortDotsEnable: false - isMapped: true - customer_first_name: - count: 0 - name: customer_first_name - type: string - esTypes: - - text - scripted: false - searchable: true - aggregatable: false - readFromDocValues: false - format: - id: string - shortDotsEnable: false - isMapped: true - customer_first_name.keyword: - count: 0 - name: customer_first_name.keyword - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - subType: - multi: - parent: customer_first_name - format: - id: string - shortDotsEnable: false - isMapped: true - customer_full_name: - count: 0 - name: customer_full_name - type: string - esTypes: - - text - scripted: false - searchable: true - aggregatable: false - readFromDocValues: false - format: - id: string - shortDotsEnable: false - isMapped: true - customer_full_name.keyword: - count: 0 - name: customer_full_name.keyword - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - subType: - multi: - parent: customer_full_name - format: - id: string - shortDotsEnable: false - isMapped: true - customer_gender: - count: 0 - name: customer_gender - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: string - shortDotsEnable: false - isMapped: true - customer_id: - count: 0 - name: customer_id - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: string - shortDotsEnable: false - isMapped: true - customer_last_name: - count: 0 - name: customer_last_name - type: string - esTypes: - - text - scripted: false - searchable: true - aggregatable: false - readFromDocValues: false - format: - id: string - shortDotsEnable: false - isMapped: true - customer_last_name.keyword: - count: 0 - name: customer_last_name.keyword - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - subType: - multi: - parent: customer_last_name - format: - id: string - shortDotsEnable: false - isMapped: true - customer_phone: - count: 0 - name: customer_phone - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: string - shortDotsEnable: false - isMapped: true - day_of_week: - count: 0 - name: day_of_week - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: string - shortDotsEnable: false - isMapped: true - day_of_week_i: - count: 0 - name: day_of_week_i - type: number - esTypes: - - integer - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: number - shortDotsEnable: false - isMapped: true - email: - count: 0 - name: email - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: string - shortDotsEnable: false - isMapped: true - event.dataset: - count: 0 - name: event.dataset - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: string - shortDotsEnable: false - isMapped: true - geoip.city_name: - count: 0 - name: geoip.city_name - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: string - shortDotsEnable: false - isMapped: true - geoip.continent_name: - count: 0 - name: geoip.continent_name - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: string - shortDotsEnable: false - isMapped: true - geoip.country_iso_code: - count: 0 - name: geoip.country_iso_code - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: string - shortDotsEnable: false - isMapped: true - geoip.location: - count: 0 - name: geoip.location - type: geo_point - esTypes: - - geo_point - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: geo_point - params: - transform: wkt - shortDotsEnable: false - isMapped: true - geoip.region_name: - count: 0 - name: geoip.region_name - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: string - shortDotsEnable: false - isMapped: true - manufacturer: - count: 0 - name: manufacturer - type: string - esTypes: - - text - scripted: false - searchable: true - aggregatable: false - readFromDocValues: false - format: - id: string - shortDotsEnable: false - isMapped: true - manufacturer.keyword: - count: 0 - name: manufacturer.keyword - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - subType: - multi: - parent: manufacturer - format: - id: string - shortDotsEnable: false - isMapped: true - order_date: - count: 0 - name: order_date - type: date - esTypes: - - date - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: date - shortDotsEnable: false - isMapped: true - order_id: - count: 0 - name: order_id - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: string - shortDotsEnable: false - isMapped: true - products._id: - count: 0 - name: products._id - type: string - esTypes: - - text - scripted: false - searchable: true - aggregatable: false - readFromDocValues: false - format: - id: string - shortDotsEnable: false - isMapped: true - products._id.keyword: - count: 0 - name: products._id.keyword - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - subType: - multi: - parent: products._id - format: - id: string - shortDotsEnable: false - isMapped: true - products.base_price: - count: 0 - name: products.base_price - type: number - esTypes: - - half_float - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: number - params: - pattern: "$0,0.00" - shortDotsEnable: false - isMapped: true - products.base_unit_price: - count: 0 - name: products.base_unit_price - type: number - esTypes: - - half_float - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: number - params: - pattern: "$0,0.00" - shortDotsEnable: false - isMapped: true - products.category: - count: 0 - name: products.category - type: string - esTypes: - - text - scripted: false - searchable: true - aggregatable: false - readFromDocValues: false - format: - id: string - shortDotsEnable: false - isMapped: true - products.category.keyword: - count: 0 - name: products.category.keyword - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - subType: - multi: - parent: products.category - format: - id: string - shortDotsEnable: false - isMapped: true - products.created_on: - count: 0 - name: products.created_on - type: date - esTypes: - - date - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: date - shortDotsEnable: false - isMapped: true - products.discount_amount: - count: 0 - name: products.discount_amount - type: number - esTypes: - - half_float - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: number - shortDotsEnable: false - isMapped: true - products.discount_percentage: - count: 0 - name: products.discount_percentage - type: number - esTypes: - - half_float - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: number - shortDotsEnable: false - isMapped: true - products.manufacturer: - count: 1 - name: products.manufacturer - type: string - esTypes: - - text - scripted: false - searchable: true - aggregatable: false - readFromDocValues: false - format: - id: string - shortDotsEnable: false - isMapped: true - products.manufacturer.keyword: - count: 0 - name: products.manufacturer.keyword - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - subType: - multi: - parent: products.manufacturer - format: - id: string - shortDotsEnable: false - isMapped: true - products.min_price: - count: 0 - name: products.min_price - type: number - esTypes: - - half_float - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: number - params: - pattern: "$0,0.00" - shortDotsEnable: false - isMapped: true - products.price: - count: 1 - name: products.price - type: number - esTypes: - - half_float - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: number - params: - pattern: "$0,0.00" - shortDotsEnable: false - isMapped: true - products.product_id: - count: 0 - name: products.product_id - type: number - esTypes: - - long - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: number - shortDotsEnable: false - isMapped: true - products.product_name: - count: 1 - name: products.product_name - type: string - esTypes: - - text - scripted: false - searchable: true - aggregatable: false - readFromDocValues: false - format: - id: string - shortDotsEnable: false - isMapped: true - products.product_name.keyword: - count: 0 - name: products.product_name.keyword - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - subType: - multi: - parent: products.product_name - format: - id: string - shortDotsEnable: false - isMapped: true - products.quantity: - count: 0 - name: products.quantity - type: number - esTypes: - - integer - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: number - shortDotsEnable: false - isMapped: true - products.sku: - count: 0 - name: products.sku - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: string - shortDotsEnable: false - isMapped: true - products.tax_amount: - count: 0 - name: products.tax_amount - type: number - esTypes: - - half_float - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: number - shortDotsEnable: false - isMapped: true - products.taxful_price: - count: 0 - name: products.taxful_price - type: number - esTypes: - - half_float - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: number - params: - pattern: "$0,0.00" - shortDotsEnable: false - isMapped: true - products.taxless_price: - count: 0 - name: products.taxless_price - type: number - esTypes: - - half_float - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: number - params: - pattern: "$0,0.00" - shortDotsEnable: false - isMapped: true - products.unit_discount_amount: - count: 0 - name: products.unit_discount_amount - type: number - esTypes: - - half_float - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: number - shortDotsEnable: false - isMapped: true - sku: - count: 0 - name: sku - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: string - shortDotsEnable: false - isMapped: true - taxful_total_price: - count: 0 - name: taxful_total_price - type: number - esTypes: - - half_float - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: number - params: - pattern: "$0,0.[00]" - shortDotsEnable: false - isMapped: true - taxless_total_price: - count: 0 - name: taxless_total_price - type: number - esTypes: - - half_float - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: number - params: - pattern: "$0,0.00" - shortDotsEnable: false - isMapped: true - total_quantity: - count: 1 - name: total_quantity - type: number - esTypes: - - integer - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: number - shortDotsEnable: false - isMapped: true - total_unique_products: - count: 0 - name: total_unique_products - type: number - esTypes: - - integer - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: number - shortDotsEnable: false - isMapped: true - type: - count: 0 - name: type - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: string - shortDotsEnable: false - isMapped: true - user: - count: 0 - name: user - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: string - shortDotsEnable: false - isMapped: true - typeMeta: {} - fieldFormats: - taxful_total_price: - id: number - params: - pattern: "$0,0.[00]" - products.price: - id: number - params: - pattern: "$0,0.00" - taxless_total_price: - id: number - params: - pattern: "$0,0.00" - products.taxless_price: - id: number - params: - pattern: "$0,0.00" - products.taxful_price: - id: number - params: - pattern: "$0,0.00" - products.min_price: - id: number - params: - pattern: "$0,0.00" - products.base_unit_price: - id: number - params: - pattern: "$0,0.00" - products.base_price: - id: number - params: - pattern: "$0,0.00" - runtimeFieldMap: {} - fieldAttrs: - products.manufacturer: - count: 1 - products.price: - count: 1 - products.product_name: - count: 1 - total_quantity: - count: 1 - allowNoIndex: false - name: Kibana Sample Data eCommerce - namespaces: - - default - update_data_view_request: - summary: Update some properties for a data view. - value: - data_view: - title: kibana_sample_data_ecommerce - timeFieldName: order_date - allowNoIndex: false - name: Kibana Sample Data eCommerce - refresh_fields: true - get_default_data_view_response: - summary: The get default data view API returns the default data view identifier. - value: - data_view_id: ff959d40-b880-11e8-a6d9-e546fe2bba5f - set_default_data_view_request: - summary: Set the default data view identifier. - value: - data_view_id: ff959d40-b880-11e8-a6d9-e546fe2bba5f - force: true - update_field_metadata_request: - summary: Set popularity count for field foo. - value: - fields: - foo: - count: 123 - create_runtime_field_request: - summary: Create a runtime field. - value: - name: runtimeFoo - runtimeField: - type: long - script: - source: "emit(doc[\"foo\"].value)" - create_runtime_field_response: - summary: The API returns created runtime field object array and updated data - view object. - value: - data_view: - "...": null - fields: - - '...' - get_runtime_field_response: - summary: The get runtime field API returns a JSON object that contains information - about the runtime field (`hour_of_day`) and the data view (`d3d7af60-4c81-11e8-b3d7-01146121b73d`). - value: - fields: - - count: 0 - name: hour_of_day - type: number - esTypes: - - long - scripted: false - searchable: true - aggregatable: true - readFromDocValues: false - shortDotsEnable: false - runtimeField: - type: long - script: - source: "emit(doc['timestamp'].value.getHour());" - data_view: - id: d3d7af60-4c81-11e8-b3d7-01146121b73d - version: WzM2LDJd - title: kibana_sample_data_flights - timeFieldName: timestamp - sourceFilters: [] - fields: - hour_of_day: - count: 0 - name: hour_of_day - type: number - esTypes: - - long - scripted: false - searchable: true - aggregatable: true - readFromDocValues: false - format: - id: number - params: - pattern: "00" - shortDotsEnable: false - runtimeField: - type: long - script: - source: "emit(doc['timestamp'].value.getHour());" - AvgTicketPrice: - count: 0 - name: AvgTicketPrice - type: number - esTypes: - - float - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: number - params: - pattern: "$0,0.[00]" - shortDotsEnable: false - isMapped: true - Cancelled: - count: 0 - name: Cancelled - type: boolean - esTypes: - - boolean - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: boolean - shortDotsEnable: false - isMapped: true - Carrier: - count: 0 - name: Carrier - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: string - shortDotsEnable: false - isMapped: true - Dest: - count: 0 - name: Dest - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: string - shortDotsEnable: false - isMapped: true - DestAirportID: - count: 0 - name: DestAirportID - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: string - shortDotsEnable: false - isMapped: true - DestCityName: - count: 0 - name: DestCityName - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: string - shortDotsEnable: false - isMapped: true - DestCountry: - count: 0 - name: DestCountry - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: string - shortDotsEnable: false - isMapped: true - DestLocation: - count: 0 - name: DestLocation - type: geo_point - esTypes: - - geo_point - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: geo_point - params: - transform: wkt - shortDotsEnable: false - isMapped: true - DestRegion: - count: 0 - name: DestRegion - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: string - shortDotsEnable: false - isMapped: true - DestWeather: - count: 0 - name: DestWeather - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: string - shortDotsEnable: false - isMapped: true - DistanceKilometers: - count: 0 - name: DistanceKilometers - type: number - esTypes: - - float - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: number - shortDotsEnable: false - isMapped: true - DistanceMiles: - count: 0 - name: DistanceMiles - type: number - esTypes: - - float - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: number - shortDotsEnable: false - isMapped: true - FlightDelay: - count: 0 - name: FlightDelay - type: boolean - esTypes: - - boolean - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: boolean - shortDotsEnable: false - isMapped: true - FlightDelayMin: - count: 0 - name: FlightDelayMin - type: number - esTypes: - - integer - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: number - shortDotsEnable: false - isMapped: true - FlightDelayType: - count: 0 - name: FlightDelayType - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: string - shortDotsEnable: false - isMapped: true - FlightNum: - count: 0 - name: FlightNum - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: string - shortDotsEnable: false - isMapped: true - FlightTimeHour: - count: 0 - name: FlightTimeHour - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: string - shortDotsEnable: false - isMapped: true - FlightTimeMin: - count: 0 - name: FlightTimeMin - type: number - esTypes: - - float - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: number - shortDotsEnable: false - isMapped: true - Origin: - count: 0 - name: Origin - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: string - shortDotsEnable: false - isMapped: true - OriginAirportID: - count: 0 - name: OriginAirportID - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: string - shortDotsEnable: false - isMapped: true - OriginCityName: - count: 0 - name: OriginCityName - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: string - shortDotsEnable: false - isMapped: true - OriginCountry: - count: 0 - name: OriginCountry - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: string - shortDotsEnable: false - isMapped: true - OriginLocation: - count: 0 - name: OriginLocation - type: geo_point - esTypes: - - geo_point - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: geo_point - params: - transform: wkt - shortDotsEnable: false - isMapped: true - OriginRegion: - count: 0 - name: OriginRegion - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: string - shortDotsEnable: false - isMapped: true - OriginWeather: - count: 0 - name: OriginWeather - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: string - shortDotsEnable: false - isMapped: true - _id: - count: 0 - name: _id - type: string - esTypes: - - _id - scripted: false - searchable: true - aggregatable: false - readFromDocValues: false - format: - id: string - shortDotsEnable: false - isMapped: true - _index: - count: 0 - name: _index - type: string - esTypes: - - _index - scripted: false - searchable: true - aggregatable: true - readFromDocValues: false - format: - id: string - shortDotsEnable: false - isMapped: true - _score: - count: 0 - name: _score - type: number - scripted: false - searchable: false - aggregatable: false - readFromDocValues: false - format: - id: number - shortDotsEnable: false - isMapped: true - _source: - count: 0 - name: _source - type: _source - esTypes: - - _source - scripted: false - searchable: false - aggregatable: false - readFromDocValues: false - format: - id: _source - shortDotsEnable: false - isMapped: true - dayOfWeek: - count: 0 - name: dayOfWeek - type: number - esTypes: - - integer - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: number - shortDotsEnable: false - isMapped: true - timestamp: - count: 0 - name: timestamp - type: date - esTypes: - - date - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: date - shortDotsEnable: false - isMapped: true - fieldFormats: - hour_of_day: - id: number - params: - pattern: "00" - AvgTicketPrice: - id: number - params: - pattern: "$0,0.[00]" - runtimeFieldMap: - hour_of_day: - type: long - script: - source: "emit(doc['timestamp'].value.getHour());" - fieldAttrs: {} - allowNoIndex: false - name: Kibana Sample Data Flights - update_runtime_field_request: - summary: Update an existing runtime field on a data view. - value: - runtimeField: - script: - source: "emit(doc[\"bar\"].value)" - parameters: - space_id: - 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: - type: string - style: simple - kbn_xsrf: - description: Cross-site request forgery protection - explode: false - in: header - name: kbn-xsrf - required: true - schema: - type: string - style: simple - view_id: - description: An identifier for the data view. - explode: false - in: path - name: viewId - required: true - schema: - example: ff959d40-b880-11e8-a6d9-e546fe2bba5f - type: string - style: simple - field_name: - description: The name of the runtime field. - explode: false - in: path - name: fieldName - required: true - schema: - example: hour_of_day - type: string - style: simple - schemas: - "400_response": - properties: - statusCode: - example: 400 - type: number - error: - example: Bad Request - type: string - message: - type: string - required: - - error - - message - - statusCode - title: Bad request - type: object - allownoindex: - description: Allows the data view saved object to exist before the data is available. - type: boolean - fieldattrs: - description: A map of field attributes by field name. - type: object - fieldformats: - description: A map of field formats by field name. - type: object - namespaces: - description: An array of space identifiers for sharing the data view between - multiple spaces. - items: - default: default - type: string - type: array - runtimefieldmap: - description: A map of runtime field definitions by field name. - type: object - sourcefilters: - description: The array of field names you want to filter out in Discover. - items: - $ref: '#/components/schemas/sourcefilters_inner' - type: array - timefieldname: - description: "The timestamp field name, which you use for time-based data views." - type: string - title: - description: "Comma-separated list of data streams, indices, and aliases that\ - \ you want to search. Supports wildcards (`*`)." - type: string - type: - description: "When set to `rollup`, identifies the rollup data views." - type: string - typemeta: - description: "When you use rollup indices, contains the field list for the rollup\ - \ data view API endpoints." - type: object - create_data_view_request_object: - properties: - data_view: - $ref: '#/components/schemas/create_data_view_request_object_data_view' - override: - default: false - description: Override an existing data view if a data view with the provided - title already exists. - type: boolean - required: - - data_view - title: Create data view request - type: object - data_view_response_object: - example: - data_view: - title: title - version: WzQ2LDJd - allowNoIndex: true - runtimeFieldMap: "{}" - fieldAttrs: "{}" - sourceFilters: - - value: value - - value: value - typeMeta: "{}" - timeFieldName: timeFieldName - fieldFormats: "{}" - name: name - id: ff959d40-b880-11e8-a6d9-e546fe2bba5f - fields: "{}" - namespaces: - - default - - default - properties: - data_view: - $ref: '#/components/schemas/data_view_response_object_data_view' - title: Data view response properties - type: object - "404_response": - properties: - error: - enum: - - Not Found - example: Not Found - type: string - message: - example: "Saved object [index-pattern/caaad6d0-920c-11ed-b36a-874bd1548a00]\ - \ not found" - type: string - statusCode: - enum: - - 404 - example: 404 - type: integer - type: object - update_data_view_request_object: - properties: - data_view: - $ref: '#/components/schemas/update_data_view_request_object_data_view' - refresh_fields: - default: false - description: Reloads the data view fields after the data view is updated. - type: boolean - required: - - data_view - title: Update data view request - type: object - getAllDataViews_200_response_data_view_inner: - example: - typeMeta: "{}" - name: name - id: id - title: title - namespaces: - - namespaces - - namespaces - properties: - id: - type: string - name: - type: string - namespaces: - items: - type: string - type: array - title: - type: string - typeMeta: - type: object - type: object - getAllDataViews_200_response: - example: - data_view: - - typeMeta: "{}" - name: name - id: id - title: title - namespaces: - - namespaces - - namespaces - - typeMeta: "{}" - name: name - id: id - title: title - namespaces: - - namespaces - - namespaces - properties: - data_view: - items: - $ref: '#/components/schemas/getAllDataViews_200_response_data_view_inner' - type: array - type: object - getDefaultDataView_200_response: - example: - data_view_id: data_view_id - properties: - data_view_id: - type: string - type: object - setDefaultDatailView_request: - properties: - data_view_id: - description: | - The data view identifier. NOTE: The API does not validate whether it is a valid identifier. Use `null` to unset the default data view. - force: - default: false - description: Update an existing default data view identifier. - type: boolean - required: - - data_view_id - type: object - setDefaultDatailView_200_response: - example: - acknowledged: true - properties: - acknowledged: - type: boolean - type: object - updateFieldsMetadata_request: - properties: - fields: - description: The field object. - type: object - required: - - fields - type: object - createUpdateRuntimeField_request: - properties: - name: - description: | - The name for a runtime field. - type: string - runtimeField: - description: | - The runtime field definition object. - type: object - required: - - name - - runtimeField - type: object - createUpdateRuntimeField_200_response: - example: - data_view: "{}" - fields: - - "{}" - - "{}" - properties: - data_view: - type: object - fields: - items: - type: object - type: array - type: object - updateRuntimeField_request: - properties: - runtimeField: - description: | - The runtime field definition object. - - You can update following fields: - - - `type` - - `script` - type: object - required: - - runtimeField - type: object - sourcefilters_inner: - example: - value: value - properties: - value: - type: string - required: - - value - type: object - create_data_view_request_object_data_view: - description: The data view object. - properties: - allowNoIndex: - description: Allows the data view saved object to exist before the data - is available. - type: boolean - fieldAttrs: - description: A map of field attributes by field name. - type: object - fieldFormats: - description: A map of field formats by field name. - type: object - fields: - type: object - id: - type: string - name: - description: The data view name. - type: string - namespaces: - description: An array of space identifiers for sharing the data view between - multiple spaces. - items: - default: default - type: string - type: array - runtimeFieldMap: - description: A map of runtime field definitions by field name. - type: object - sourceFilters: - description: The array of field names you want to filter out in Discover. - items: - $ref: '#/components/schemas/sourcefilters_inner' - type: array - timeFieldName: - description: "The timestamp field name, which you use for time-based data\ - \ views." - type: string - title: - description: "Comma-separated list of data streams, indices, and aliases\ - \ that you want to search. Supports wildcards (`*`)." - type: string - type: - description: "When set to `rollup`, identifies the rollup data views." - type: string - typeMeta: - description: "When you use rollup indices, contains the field list for the\ - \ rollup data view API endpoints." - type: object - version: - type: string - required: - - title - type: object - data_view_response_object_data_view: - example: - title: title - version: WzQ2LDJd - allowNoIndex: true - runtimeFieldMap: "{}" - fieldAttrs: "{}" - sourceFilters: - - value: value - - value: value - typeMeta: "{}" - timeFieldName: timeFieldName - fieldFormats: "{}" - name: name - id: ff959d40-b880-11e8-a6d9-e546fe2bba5f - fields: "{}" - namespaces: - - default - - default - properties: - allowNoIndex: - description: Allows the data view saved object to exist before the data - is available. - type: boolean - fieldAttrs: - description: A map of field attributes by field name. - type: object - fieldFormats: - description: A map of field formats by field name. - type: object - fields: - type: object - id: - example: ff959d40-b880-11e8-a6d9-e546fe2bba5f - type: string - name: - description: The data view name. - type: string - namespaces: - description: An array of space identifiers for sharing the data view between - multiple spaces. - items: - default: default - type: string - type: array - runtimeFieldMap: - description: A map of runtime field definitions by field name. - type: object - sourceFilters: - description: The array of field names you want to filter out in Discover. - items: - $ref: '#/components/schemas/sourcefilters_inner' - type: array - timeFieldName: - description: "The timestamp field name, which you use for time-based data\ - \ views." - type: string - title: - description: "Comma-separated list of data streams, indices, and aliases\ - \ that you want to search. Supports wildcards (`*`)." - type: string - typeMeta: - description: "When you use rollup indices, contains the field list for the\ - \ rollup data view API endpoints." - type: object - version: - example: WzQ2LDJd - type: string - type: object - update_data_view_request_object_data_view: - description: | - The data view properties you want to update. Only the specified properties are updated in the data view. Unspecified fields stay as they are persisted. - properties: - allowNoIndex: - description: Allows the data view saved object to exist before the data - is available. - type: boolean - fieldFormats: - description: A map of field formats by field name. - type: object - fields: - type: object - name: - type: string - runtimeFieldMap: - description: A map of runtime field definitions by field name. - type: object - sourceFilters: - description: The array of field names you want to filter out in Discover. - items: - $ref: '#/components/schemas/sourcefilters_inner' - type: array - timeFieldName: - description: "The timestamp field name, which you use for time-based data\ - \ views." - type: string - title: - description: "Comma-separated list of data streams, indices, and aliases\ - \ that you want to search. Supports wildcards (`*`)." - type: string - type: - description: "When set to `rollup`, identifies the rollup data views." - type: string - typeMeta: - description: "When you use rollup indices, contains the field list for the\ - \ rollup data view API endpoints." - type: object - 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/data_views/api_data_views.go b/generated/data_views/api_data_views.go deleted file mode 100644 index 81beddc04..000000000 --- a/generated/data_views/api_data_views.go +++ /dev/null @@ -1,2050 +0,0 @@ -/* -Data views - -OpenAPI schema for data view endpoints - -API version: 0.1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package data_views - -import ( - "bytes" - "context" - "io" - "net/http" - "net/url" - "strings" -) - -type DataViewsAPI interface { - - /* - CreateDataView Creates a data view. - - This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. - - - @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 ApiCreateDataViewRequest - */ - CreateDataView(ctx context.Context, spaceId string) ApiCreateDataViewRequest - - // CreateDataViewExecute executes the request - // @return DataViewResponseObject - CreateDataViewExecute(r ApiCreateDataViewRequest) (*DataViewResponseObject, *http.Response, error) - - /* - CreateRuntimeField Creates a runtime field. - - This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param viewId An identifier for the data view. - @param spaceId An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. - @return ApiCreateRuntimeFieldRequest - */ - CreateRuntimeField(ctx context.Context, viewId string, spaceId string) ApiCreateRuntimeFieldRequest - - // CreateRuntimeFieldExecute executes the request - CreateRuntimeFieldExecute(r ApiCreateRuntimeFieldRequest) (*http.Response, error) - - /* - CreateUpdateRuntimeField Create or update an existing runtime field. - - This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. - - - @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. - @param viewId The ID of the data view fields you want to update. - @return ApiCreateUpdateRuntimeFieldRequest - */ - CreateUpdateRuntimeField(ctx context.Context, spaceId string, viewId string) ApiCreateUpdateRuntimeFieldRequest - - // CreateUpdateRuntimeFieldExecute executes the request - // @return CreateUpdateRuntimeField200Response - CreateUpdateRuntimeFieldExecute(r ApiCreateUpdateRuntimeFieldRequest) (*CreateUpdateRuntimeField200Response, *http.Response, error) - - /* - DeleteDataView Deletes a data view. - - WARNING: When you delete a data view, it cannot be recovered. This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param viewId An identifier for the data view. - @param spaceId An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. - @return ApiDeleteDataViewRequest - */ - DeleteDataView(ctx context.Context, viewId string, spaceId string) ApiDeleteDataViewRequest - - // DeleteDataViewExecute executes the request - DeleteDataViewExecute(r ApiDeleteDataViewRequest) (*http.Response, error) - - /* - DeleteRuntimeField Delete a runtime field from a data view. - - This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param fieldName The name of the runtime field. - @param viewId An identifier for the data view. - @param spaceId An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. - @return ApiDeleteRuntimeFieldRequest - */ - DeleteRuntimeField(ctx context.Context, fieldName string, viewId string, spaceId string) ApiDeleteRuntimeFieldRequest - - // DeleteRuntimeFieldExecute executes the request - DeleteRuntimeFieldExecute(r ApiDeleteRuntimeFieldRequest) (*http.Response, error) - - /* - GetAllDataViews Retrieves a list of all data views. - - This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. - - - @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 ApiGetAllDataViewsRequest - */ - GetAllDataViews(ctx context.Context, spaceId string) ApiGetAllDataViewsRequest - - // GetAllDataViewsExecute executes the request - // @return GetAllDataViews200Response - GetAllDataViewsExecute(r ApiGetAllDataViewsRequest) (*GetAllDataViews200Response, *http.Response, error) - - /* - GetDataView Retrieves a single data view by identifier. - - This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param viewId An identifier for the data view. - @param spaceId An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. - @return ApiGetDataViewRequest - */ - GetDataView(ctx context.Context, viewId string, spaceId string) ApiGetDataViewRequest - - // GetDataViewExecute executes the request - // @return DataViewResponseObject - GetDataViewExecute(r ApiGetDataViewRequest) (*DataViewResponseObject, *http.Response, error) - - /* - GetDefaultDataView Retrieves the default data view identifier. - - This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. - - - @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 ApiGetDefaultDataViewRequest - */ - GetDefaultDataView(ctx context.Context, spaceId string) ApiGetDefaultDataViewRequest - - // GetDefaultDataViewExecute executes the request - // @return GetDefaultDataView200Response - GetDefaultDataViewExecute(r ApiGetDefaultDataViewRequest) (*GetDefaultDataView200Response, *http.Response, error) - - /* - GetRuntimeField Retrieves a runtime field. - - This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param fieldName The name of the runtime field. - @param viewId An identifier for the data view. - @param spaceId An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. - @return ApiGetRuntimeFieldRequest - */ - GetRuntimeField(ctx context.Context, fieldName string, viewId string, spaceId string) ApiGetRuntimeFieldRequest - - // GetRuntimeFieldExecute executes the request - // @return CreateUpdateRuntimeField200Response - GetRuntimeFieldExecute(r ApiGetRuntimeFieldRequest) (*CreateUpdateRuntimeField200Response, *http.Response, error) - - /* - SetDefaultDatailView Sets the default data view identifier. - - This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. - - - @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 ApiSetDefaultDatailViewRequest - */ - SetDefaultDatailView(ctx context.Context, spaceId string) ApiSetDefaultDatailViewRequest - - // SetDefaultDatailViewExecute executes the request - // @return SetDefaultDatailView200Response - SetDefaultDatailViewExecute(r ApiSetDefaultDatailViewRequest) (*SetDefaultDatailView200Response, *http.Response, error) - - /* - UpdateDataView Updates a data view. - - This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param viewId An identifier for the data view. - @param spaceId An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. - @return ApiUpdateDataViewRequest - */ - UpdateDataView(ctx context.Context, viewId string, spaceId string) ApiUpdateDataViewRequest - - // UpdateDataViewExecute executes the request - // @return DataViewResponseObject - UpdateDataViewExecute(r ApiUpdateDataViewRequest) (*DataViewResponseObject, *http.Response, error) - - /* - UpdateFieldsMetadata Update fields presentation metadata such as count, customLabel and format. - - This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. You can update multiple fields in one request. Updates are merged with persisted metadata. To remove existing metadata, specify null as the value. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param viewId An identifier for the data view. - @param spaceId An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. - @return ApiUpdateFieldsMetadataRequest - */ - UpdateFieldsMetadata(ctx context.Context, viewId string, spaceId string) ApiUpdateFieldsMetadataRequest - - // UpdateFieldsMetadataExecute executes the request - // @return SetDefaultDatailView200Response - UpdateFieldsMetadataExecute(r ApiUpdateFieldsMetadataRequest) (*SetDefaultDatailView200Response, *http.Response, error) - - /* - UpdateRuntimeField Update an existing runtime field. - - This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. - - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param fieldName The name of the runtime field. - @param viewId An identifier for the data view. - @param spaceId An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. - @return ApiUpdateRuntimeFieldRequest - */ - UpdateRuntimeField(ctx context.Context, fieldName string, viewId string, spaceId string) ApiUpdateRuntimeFieldRequest - - // UpdateRuntimeFieldExecute executes the request - UpdateRuntimeFieldExecute(r ApiUpdateRuntimeFieldRequest) (*http.Response, error) -} - -// DataViewsAPIService DataViewsAPI service -type DataViewsAPIService service - -type ApiCreateDataViewRequest struct { - ctx context.Context - ApiService DataViewsAPI - kbnXsrf *string - spaceId string - createDataViewRequestObject *CreateDataViewRequestObject -} - -// Cross-site request forgery protection -func (r ApiCreateDataViewRequest) KbnXsrf(kbnXsrf string) ApiCreateDataViewRequest { - r.kbnXsrf = &kbnXsrf - return r -} - -func (r ApiCreateDataViewRequest) CreateDataViewRequestObject(createDataViewRequestObject CreateDataViewRequestObject) ApiCreateDataViewRequest { - r.createDataViewRequestObject = &createDataViewRequestObject - return r -} - -func (r ApiCreateDataViewRequest) Execute() (*DataViewResponseObject, *http.Response, error) { - return r.ApiService.CreateDataViewExecute(r) -} - -/* -CreateDataView Creates a data view. - -This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. - - @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 ApiCreateDataViewRequest -*/ -func (a *DataViewsAPIService) CreateDataView(ctx context.Context, spaceId string) ApiCreateDataViewRequest { - return ApiCreateDataViewRequest{ - ApiService: a, - ctx: ctx, - spaceId: spaceId, - } -} - -// Execute executes the request -// -// @return DataViewResponseObject -func (a *DataViewsAPIService) CreateDataViewExecute(r ApiCreateDataViewRequest) (*DataViewResponseObject, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *DataViewResponseObject - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DataViewsAPIService.CreateDataView") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/s/{spaceId}/api/data_views/data_view" - 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.createDataViewRequestObject == nil { - return localVarReturnValue, nil, reportError("createDataViewRequestObject is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // 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, "") - // body params - localVarPostBody = r.createDataViewRequestObject - 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 - } - - 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 - } - - 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 ApiCreateRuntimeFieldRequest struct { - ctx context.Context - ApiService DataViewsAPI - kbnXsrf *string - viewId string - spaceId string - createUpdateRuntimeFieldRequest *CreateUpdateRuntimeFieldRequest -} - -// Cross-site request forgery protection -func (r ApiCreateRuntimeFieldRequest) KbnXsrf(kbnXsrf string) ApiCreateRuntimeFieldRequest { - r.kbnXsrf = &kbnXsrf - return r -} - -func (r ApiCreateRuntimeFieldRequest) CreateUpdateRuntimeFieldRequest(createUpdateRuntimeFieldRequest CreateUpdateRuntimeFieldRequest) ApiCreateRuntimeFieldRequest { - r.createUpdateRuntimeFieldRequest = &createUpdateRuntimeFieldRequest - return r -} - -func (r ApiCreateRuntimeFieldRequest) Execute() (*http.Response, error) { - return r.ApiService.CreateRuntimeFieldExecute(r) -} - -/* -CreateRuntimeField Creates a runtime field. - -This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param viewId An identifier for the data view. - @param spaceId An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. - @return ApiCreateRuntimeFieldRequest -*/ -func (a *DataViewsAPIService) CreateRuntimeField(ctx context.Context, viewId string, spaceId string) ApiCreateRuntimeFieldRequest { - return ApiCreateRuntimeFieldRequest{ - ApiService: a, - ctx: ctx, - viewId: viewId, - spaceId: spaceId, - } -} - -// Execute executes the request -func (a *DataViewsAPIService) CreateRuntimeFieldExecute(r ApiCreateRuntimeFieldRequest) (*http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DataViewsAPIService.CreateRuntimeField") - if err != nil { - return nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/s/{spaceId}/api/data_views/data_view/{viewId}/runtime_field" - localVarPath = strings.Replace(localVarPath, "{"+"viewId"+"}", url.PathEscape(parameterValueToString(r.viewId, "viewId")), -1) - 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 nil, reportError("kbnXsrf is required and must be specified") - } - if r.createUpdateRuntimeFieldRequest == nil { - return nil, reportError("createUpdateRuntimeFieldRequest is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - parameterAddToHeaderOrQuery(localVarHeaderParams, "kbn-xsrf", r.kbnXsrf, "") - // body params - localVarPostBody = r.createUpdateRuntimeFieldRequest - 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 - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiCreateUpdateRuntimeFieldRequest struct { - ctx context.Context - ApiService DataViewsAPI - kbnXsrf *string - spaceId string - viewId string - createUpdateRuntimeFieldRequest *CreateUpdateRuntimeFieldRequest -} - -// Cross-site request forgery protection -func (r ApiCreateUpdateRuntimeFieldRequest) KbnXsrf(kbnXsrf string) ApiCreateUpdateRuntimeFieldRequest { - r.kbnXsrf = &kbnXsrf - return r -} - -func (r ApiCreateUpdateRuntimeFieldRequest) CreateUpdateRuntimeFieldRequest(createUpdateRuntimeFieldRequest CreateUpdateRuntimeFieldRequest) ApiCreateUpdateRuntimeFieldRequest { - r.createUpdateRuntimeFieldRequest = &createUpdateRuntimeFieldRequest - return r -} - -func (r ApiCreateUpdateRuntimeFieldRequest) Execute() (*CreateUpdateRuntimeField200Response, *http.Response, error) { - return r.ApiService.CreateUpdateRuntimeFieldExecute(r) -} - -/* -CreateUpdateRuntimeField Create or update an existing runtime field. - -This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. - - @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. - @param viewId The ID of the data view fields you want to update. - @return ApiCreateUpdateRuntimeFieldRequest -*/ -func (a *DataViewsAPIService) CreateUpdateRuntimeField(ctx context.Context, spaceId string, viewId string) ApiCreateUpdateRuntimeFieldRequest { - return ApiCreateUpdateRuntimeFieldRequest{ - ApiService: a, - ctx: ctx, - spaceId: spaceId, - viewId: viewId, - } -} - -// Execute executes the request -// -// @return CreateUpdateRuntimeField200Response -func (a *DataViewsAPIService) CreateUpdateRuntimeFieldExecute(r ApiCreateUpdateRuntimeFieldRequest) (*CreateUpdateRuntimeField200Response, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPut - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *CreateUpdateRuntimeField200Response - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DataViewsAPIService.CreateUpdateRuntimeField") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/s/{spaceId}/api/data_views/data_view/{viewId}/runtime_field" - localVarPath = strings.Replace(localVarPath, "{"+"spaceId"+"}", url.PathEscape(parameterValueToString(r.spaceId, "spaceId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"viewId"+"}", url.PathEscape(parameterValueToString(r.viewId, "viewId")), -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.createUpdateRuntimeFieldRequest == nil { - return localVarReturnValue, nil, reportError("createUpdateRuntimeFieldRequest is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // 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, "") - // body params - localVarPostBody = r.createUpdateRuntimeFieldRequest - 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 - } - - 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 - } - - 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 ApiDeleteDataViewRequest struct { - ctx context.Context - ApiService DataViewsAPI - kbnXsrf *string - viewId string - spaceId string -} - -// Cross-site request forgery protection -func (r ApiDeleteDataViewRequest) KbnXsrf(kbnXsrf string) ApiDeleteDataViewRequest { - r.kbnXsrf = &kbnXsrf - return r -} - -func (r ApiDeleteDataViewRequest) Execute() (*http.Response, error) { - return r.ApiService.DeleteDataViewExecute(r) -} - -/* -DeleteDataView Deletes a data view. - -WARNING: When you delete a data view, it cannot be recovered. This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param viewId An identifier for the data view. - @param spaceId An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. - @return ApiDeleteDataViewRequest -*/ -func (a *DataViewsAPIService) DeleteDataView(ctx context.Context, viewId string, spaceId string) ApiDeleteDataViewRequest { - return ApiDeleteDataViewRequest{ - ApiService: a, - ctx: ctx, - viewId: viewId, - spaceId: spaceId, - } -} - -// Execute executes the request -func (a *DataViewsAPIService) DeleteDataViewExecute(r ApiDeleteDataViewRequest) (*http.Response, error) { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DataViewsAPIService.DeleteDataView") - if err != nil { - return nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/s/{spaceId}/api/data_views/data_view/{viewId}" - localVarPath = strings.Replace(localVarPath, "{"+"viewId"+"}", url.PathEscape(parameterValueToString(r.viewId, "viewId")), -1) - 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 nil, reportError("kbnXsrf is required and must be specified") - } - - // 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, "") - 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 - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - 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 localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiDeleteRuntimeFieldRequest struct { - ctx context.Context - ApiService DataViewsAPI - fieldName string - viewId string - spaceId string -} - -func (r ApiDeleteRuntimeFieldRequest) Execute() (*http.Response, error) { - return r.ApiService.DeleteRuntimeFieldExecute(r) -} - -/* -DeleteRuntimeField Delete a runtime field from a data view. - -This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param fieldName The name of the runtime field. - @param viewId An identifier for the data view. - @param spaceId An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. - @return ApiDeleteRuntimeFieldRequest -*/ -func (a *DataViewsAPIService) DeleteRuntimeField(ctx context.Context, fieldName string, viewId string, spaceId string) ApiDeleteRuntimeFieldRequest { - return ApiDeleteRuntimeFieldRequest{ - ApiService: a, - ctx: ctx, - fieldName: fieldName, - viewId: viewId, - spaceId: spaceId, - } -} - -// Execute executes the request -func (a *DataViewsAPIService) DeleteRuntimeFieldExecute(r ApiDeleteRuntimeFieldRequest) (*http.Response, error) { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DataViewsAPIService.DeleteRuntimeField") - if err != nil { - return nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/s/{spaceId}/api/data_views/data_view/{viewId}/runtime_field/{fieldName}" - localVarPath = strings.Replace(localVarPath, "{"+"fieldName"+"}", url.PathEscape(parameterValueToString(r.fieldName, "fieldName")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"viewId"+"}", url.PathEscape(parameterValueToString(r.viewId, "viewId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"spaceId"+"}", url.PathEscape(parameterValueToString(r.spaceId, "spaceId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // 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 - } - 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 - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - 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 localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiGetAllDataViewsRequest struct { - ctx context.Context - ApiService DataViewsAPI - spaceId string -} - -func (r ApiGetAllDataViewsRequest) Execute() (*GetAllDataViews200Response, *http.Response, error) { - return r.ApiService.GetAllDataViewsExecute(r) -} - -/* -GetAllDataViews Retrieves a list of all data views. - -This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. - - @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 ApiGetAllDataViewsRequest -*/ -func (a *DataViewsAPIService) GetAllDataViews(ctx context.Context, spaceId string) ApiGetAllDataViewsRequest { - return ApiGetAllDataViewsRequest{ - ApiService: a, - ctx: ctx, - spaceId: spaceId, - } -} - -// Execute executes the request -// -// @return GetAllDataViews200Response -func (a *DataViewsAPIService) GetAllDataViewsExecute(r ApiGetAllDataViewsRequest) (*GetAllDataViews200Response, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *GetAllDataViews200Response - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DataViewsAPIService.GetAllDataViews") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/s/{spaceId}/api/data_views" - localVarPath = strings.Replace(localVarPath, "{"+"spaceId"+"}", url.PathEscape(parameterValueToString(r.spaceId, "spaceId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // 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 - } - 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 - } - - 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 - } - - 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 ApiGetDataViewRequest struct { - ctx context.Context - ApiService DataViewsAPI - viewId string - spaceId string -} - -func (r ApiGetDataViewRequest) Execute() (*DataViewResponseObject, *http.Response, error) { - return r.ApiService.GetDataViewExecute(r) -} - -/* -GetDataView Retrieves a single data view by identifier. - -This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param viewId An identifier for the data view. - @param spaceId An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. - @return ApiGetDataViewRequest -*/ -func (a *DataViewsAPIService) GetDataView(ctx context.Context, viewId string, spaceId string) ApiGetDataViewRequest { - return ApiGetDataViewRequest{ - ApiService: a, - ctx: ctx, - viewId: viewId, - spaceId: spaceId, - } -} - -// Execute executes the request -// -// @return DataViewResponseObject -func (a *DataViewsAPIService) GetDataViewExecute(r ApiGetDataViewRequest) (*DataViewResponseObject, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *DataViewResponseObject - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DataViewsAPIService.GetDataView") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/s/{spaceId}/api/data_views/data_view/{viewId}" - localVarPath = strings.Replace(localVarPath, "{"+"viewId"+"}", url.PathEscape(parameterValueToString(r.viewId, "viewId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"spaceId"+"}", url.PathEscape(parameterValueToString(r.spaceId, "spaceId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // 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 - } - 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 - } - - 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 == 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 - } - - 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 ApiGetDefaultDataViewRequest struct { - ctx context.Context - ApiService DataViewsAPI - spaceId string -} - -func (r ApiGetDefaultDataViewRequest) Execute() (*GetDefaultDataView200Response, *http.Response, error) { - return r.ApiService.GetDefaultDataViewExecute(r) -} - -/* -GetDefaultDataView Retrieves the default data view identifier. - -This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. - - @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 ApiGetDefaultDataViewRequest -*/ -func (a *DataViewsAPIService) GetDefaultDataView(ctx context.Context, spaceId string) ApiGetDefaultDataViewRequest { - return ApiGetDefaultDataViewRequest{ - ApiService: a, - ctx: ctx, - spaceId: spaceId, - } -} - -// Execute executes the request -// -// @return GetDefaultDataView200Response -func (a *DataViewsAPIService) GetDefaultDataViewExecute(r ApiGetDefaultDataViewRequest) (*GetDefaultDataView200Response, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *GetDefaultDataView200Response - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DataViewsAPIService.GetDefaultDataView") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/s/{spaceId}/api/data_views/default" - localVarPath = strings.Replace(localVarPath, "{"+"spaceId"+"}", url.PathEscape(parameterValueToString(r.spaceId, "spaceId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // 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 - } - 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 - } - - 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 - } - - 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 ApiGetRuntimeFieldRequest struct { - ctx context.Context - ApiService DataViewsAPI - fieldName string - viewId string - spaceId string -} - -func (r ApiGetRuntimeFieldRequest) Execute() (*CreateUpdateRuntimeField200Response, *http.Response, error) { - return r.ApiService.GetRuntimeFieldExecute(r) -} - -/* -GetRuntimeField Retrieves a runtime field. - -This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param fieldName The name of the runtime field. - @param viewId An identifier for the data view. - @param spaceId An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. - @return ApiGetRuntimeFieldRequest -*/ -func (a *DataViewsAPIService) GetRuntimeField(ctx context.Context, fieldName string, viewId string, spaceId string) ApiGetRuntimeFieldRequest { - return ApiGetRuntimeFieldRequest{ - ApiService: a, - ctx: ctx, - fieldName: fieldName, - viewId: viewId, - spaceId: spaceId, - } -} - -// Execute executes the request -// -// @return CreateUpdateRuntimeField200Response -func (a *DataViewsAPIService) GetRuntimeFieldExecute(r ApiGetRuntimeFieldRequest) (*CreateUpdateRuntimeField200Response, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *CreateUpdateRuntimeField200Response - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DataViewsAPIService.GetRuntimeField") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/s/{spaceId}/api/data_views/data_view/{viewId}/runtime_field/{fieldName}" - localVarPath = strings.Replace(localVarPath, "{"+"fieldName"+"}", url.PathEscape(parameterValueToString(r.fieldName, "fieldName")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"viewId"+"}", url.PathEscape(parameterValueToString(r.viewId, "viewId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"spaceId"+"}", url.PathEscape(parameterValueToString(r.spaceId, "spaceId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // 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 - } - 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 - } - - 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 == 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 - } - - 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 ApiSetDefaultDatailViewRequest struct { - ctx context.Context - ApiService DataViewsAPI - kbnXsrf *string - spaceId string - setDefaultDatailViewRequest *SetDefaultDatailViewRequest -} - -// Cross-site request forgery protection -func (r ApiSetDefaultDatailViewRequest) KbnXsrf(kbnXsrf string) ApiSetDefaultDatailViewRequest { - r.kbnXsrf = &kbnXsrf - return r -} - -func (r ApiSetDefaultDatailViewRequest) SetDefaultDatailViewRequest(setDefaultDatailViewRequest SetDefaultDatailViewRequest) ApiSetDefaultDatailViewRequest { - r.setDefaultDatailViewRequest = &setDefaultDatailViewRequest - return r -} - -func (r ApiSetDefaultDatailViewRequest) Execute() (*SetDefaultDatailView200Response, *http.Response, error) { - return r.ApiService.SetDefaultDatailViewExecute(r) -} - -/* -SetDefaultDatailView Sets the default data view identifier. - -This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. - - @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 ApiSetDefaultDatailViewRequest -*/ -func (a *DataViewsAPIService) SetDefaultDatailView(ctx context.Context, spaceId string) ApiSetDefaultDatailViewRequest { - return ApiSetDefaultDatailViewRequest{ - ApiService: a, - ctx: ctx, - spaceId: spaceId, - } -} - -// Execute executes the request -// -// @return SetDefaultDatailView200Response -func (a *DataViewsAPIService) SetDefaultDatailViewExecute(r ApiSetDefaultDatailViewRequest) (*SetDefaultDatailView200Response, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *SetDefaultDatailView200Response - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DataViewsAPIService.SetDefaultDatailView") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/s/{spaceId}/api/data_views/default" - 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.setDefaultDatailViewRequest == nil { - return localVarReturnValue, nil, reportError("setDefaultDatailViewRequest is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // 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, "") - // body params - localVarPostBody = r.setDefaultDatailViewRequest - 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 - } - - 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 - } - - 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 ApiUpdateDataViewRequest struct { - ctx context.Context - ApiService DataViewsAPI - kbnXsrf *string - viewId string - spaceId string - updateDataViewRequestObject *UpdateDataViewRequestObject -} - -// Cross-site request forgery protection -func (r ApiUpdateDataViewRequest) KbnXsrf(kbnXsrf string) ApiUpdateDataViewRequest { - r.kbnXsrf = &kbnXsrf - return r -} - -func (r ApiUpdateDataViewRequest) UpdateDataViewRequestObject(updateDataViewRequestObject UpdateDataViewRequestObject) ApiUpdateDataViewRequest { - r.updateDataViewRequestObject = &updateDataViewRequestObject - return r -} - -func (r ApiUpdateDataViewRequest) Execute() (*DataViewResponseObject, *http.Response, error) { - return r.ApiService.UpdateDataViewExecute(r) -} - -/* -UpdateDataView Updates a data view. - -This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param viewId An identifier for the data view. - @param spaceId An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. - @return ApiUpdateDataViewRequest -*/ -func (a *DataViewsAPIService) UpdateDataView(ctx context.Context, viewId string, spaceId string) ApiUpdateDataViewRequest { - return ApiUpdateDataViewRequest{ - ApiService: a, - ctx: ctx, - viewId: viewId, - spaceId: spaceId, - } -} - -// Execute executes the request -// -// @return DataViewResponseObject -func (a *DataViewsAPIService) UpdateDataViewExecute(r ApiUpdateDataViewRequest) (*DataViewResponseObject, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *DataViewResponseObject - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DataViewsAPIService.UpdateDataView") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/s/{spaceId}/api/data_views/data_view/{viewId}" - localVarPath = strings.Replace(localVarPath, "{"+"viewId"+"}", url.PathEscape(parameterValueToString(r.viewId, "viewId")), -1) - 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.updateDataViewRequestObject == nil { - return localVarReturnValue, nil, reportError("updateDataViewRequestObject is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // 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, "") - // body params - localVarPostBody = r.updateDataViewRequestObject - 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 - } - - 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 - } - - 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 ApiUpdateFieldsMetadataRequest struct { - ctx context.Context - ApiService DataViewsAPI - kbnXsrf *string - viewId string - spaceId string - updateFieldsMetadataRequest *UpdateFieldsMetadataRequest -} - -// Cross-site request forgery protection -func (r ApiUpdateFieldsMetadataRequest) KbnXsrf(kbnXsrf string) ApiUpdateFieldsMetadataRequest { - r.kbnXsrf = &kbnXsrf - return r -} - -func (r ApiUpdateFieldsMetadataRequest) UpdateFieldsMetadataRequest(updateFieldsMetadataRequest UpdateFieldsMetadataRequest) ApiUpdateFieldsMetadataRequest { - r.updateFieldsMetadataRequest = &updateFieldsMetadataRequest - return r -} - -func (r ApiUpdateFieldsMetadataRequest) Execute() (*SetDefaultDatailView200Response, *http.Response, error) { - return r.ApiService.UpdateFieldsMetadataExecute(r) -} - -/* -UpdateFieldsMetadata Update fields presentation metadata such as count, customLabel and format. - -This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. You can update multiple fields in one request. Updates are merged with persisted metadata. To remove existing metadata, specify null as the value. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param viewId An identifier for the data view. - @param spaceId An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. - @return ApiUpdateFieldsMetadataRequest -*/ -func (a *DataViewsAPIService) UpdateFieldsMetadata(ctx context.Context, viewId string, spaceId string) ApiUpdateFieldsMetadataRequest { - return ApiUpdateFieldsMetadataRequest{ - ApiService: a, - ctx: ctx, - viewId: viewId, - spaceId: spaceId, - } -} - -// Execute executes the request -// -// @return SetDefaultDatailView200Response -func (a *DataViewsAPIService) UpdateFieldsMetadataExecute(r ApiUpdateFieldsMetadataRequest) (*SetDefaultDatailView200Response, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *SetDefaultDatailView200Response - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DataViewsAPIService.UpdateFieldsMetadata") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/s/{spaceId}/api/data_views/data_view/{viewId}/fields" - localVarPath = strings.Replace(localVarPath, "{"+"viewId"+"}", url.PathEscape(parameterValueToString(r.viewId, "viewId")), -1) - 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.updateFieldsMetadataRequest == nil { - return localVarReturnValue, nil, reportError("updateFieldsMetadataRequest is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // 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, "") - // body params - localVarPostBody = r.updateFieldsMetadataRequest - 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 - } - - 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 - } - - 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 ApiUpdateRuntimeFieldRequest struct { - ctx context.Context - ApiService DataViewsAPI - fieldName string - viewId string - spaceId string - updateRuntimeFieldRequest *UpdateRuntimeFieldRequest -} - -func (r ApiUpdateRuntimeFieldRequest) UpdateRuntimeFieldRequest(updateRuntimeFieldRequest UpdateRuntimeFieldRequest) ApiUpdateRuntimeFieldRequest { - r.updateRuntimeFieldRequest = &updateRuntimeFieldRequest - return r -} - -func (r ApiUpdateRuntimeFieldRequest) Execute() (*http.Response, error) { - return r.ApiService.UpdateRuntimeFieldExecute(r) -} - -/* -UpdateRuntimeField Update an existing runtime field. - -This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param fieldName The name of the runtime field. - @param viewId An identifier for the data view. - @param spaceId An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. - @return ApiUpdateRuntimeFieldRequest -*/ -func (a *DataViewsAPIService) UpdateRuntimeField(ctx context.Context, fieldName string, viewId string, spaceId string) ApiUpdateRuntimeFieldRequest { - return ApiUpdateRuntimeFieldRequest{ - ApiService: a, - ctx: ctx, - fieldName: fieldName, - viewId: viewId, - spaceId: spaceId, - } -} - -// Execute executes the request -func (a *DataViewsAPIService) UpdateRuntimeFieldExecute(r ApiUpdateRuntimeFieldRequest) (*http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DataViewsAPIService.UpdateRuntimeField") - if err != nil { - return nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/s/{spaceId}/api/data_views/data_view/{viewId}/runtime_field/{fieldName}" - localVarPath = strings.Replace(localVarPath, "{"+"fieldName"+"}", url.PathEscape(parameterValueToString(r.fieldName, "fieldName")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"viewId"+"}", url.PathEscape(parameterValueToString(r.viewId, "viewId")), -1) - 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.updateRuntimeFieldRequest == nil { - return nil, reportError("updateRuntimeFieldRequest is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // 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 - } - // body params - localVarPostBody = r.updateRuntimeFieldRequest - 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 - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return 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 localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} diff --git a/generated/data_views/bundled.yaml b/generated/data_views/bundled.yaml deleted file mode 100644 index b98135605..000000000 --- a/generated/data_views/bundled.yaml +++ /dev/null @@ -1,2221 +0,0 @@ -openapi: 3.0.1 -info: - title: Data views - description: OpenAPI schema for data view endpoints - version: '0.1' - contact: - name: Kibana Core Team - license: - name: Elastic License 2.0 - url: https://www.elastic.co/licensing/elastic-license -servers: - - url: / -security: - - basicAuth: [] - - apiKeyAuth: [] -tags: - - name: data views - description: Data view APIs enable you to manage data views, formerly known as Kibana index patterns. -paths: - /s/{spaceId}/api/data_views: - get: - summary: Retrieves a list of all data views. - operationId: getAllDataViews - description: | - This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. - tags: - - data views - parameters: - - $ref: '#/components/parameters/space_id' - responses: - '200': - description: Indicates a successful call. - content: - application/json: - schema: - type: object - properties: - data_view: - type: array - items: - type: object - properties: - id: - type: string - name: - type: string - namespaces: - type: array - items: - type: string - title: - type: string - typeMeta: - type: object - examples: - getAllDataViewsResponse: - $ref: '#/components/examples/get_data_views_response' - '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/400_response' - /s/{spaceId}/api/data_views/data_view: - post: - summary: Creates a data view. - operationId: createDataView - description: | - This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. - tags: - - data views - parameters: - - $ref: '#/components/parameters/kbn_xsrf' - - $ref: '#/components/parameters/space_id' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/create_data_view_request_object' - examples: - createDataViewRequest: - $ref: '#/components/examples/create_data_view_request' - responses: - '200': - description: Indicates a successful call. - content: - application/json: - schema: - $ref: '#/components/schemas/data_view_response_object' - '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/400_response' - /s/{spaceId}/api/data_views/data_view/{viewId}: - get: - summary: Retrieves a single data view by identifier. - operationId: getDataView - description: | - This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. - tags: - - data views - parameters: - - $ref: '#/components/parameters/view_id' - - $ref: '#/components/parameters/space_id' - responses: - '200': - description: Indicates a successful call. - content: - application/json: - schema: - $ref: '#/components/schemas/data_view_response_object' - examples: - getDataViewResponse: - $ref: '#/components/examples/get_data_view_response' - '404': - description: Object is not found. - content: - application/json: - schema: - $ref: '#/components/schemas/404_response' - delete: - summary: Deletes a data view. - operationId: deleteDataView - description: | - WARNING: When you delete a data view, it cannot be recovered. This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. - tags: - - data views - parameters: - - $ref: '#/components/parameters/kbn_xsrf' - - $ref: '#/components/parameters/view_id' - - $ref: '#/components/parameters/space_id' - responses: - '204': - description: Indicates a successful call. - '404': - description: Object is not found. - content: - application/json: - schema: - $ref: '#/components/schemas/404_response' - post: - summary: Updates a data view. - operationId: updateDataView - description: | - This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. - tags: - - data views - parameters: - - $ref: '#/components/parameters/kbn_xsrf' - - $ref: '#/components/parameters/view_id' - - $ref: '#/components/parameters/space_id' - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/update_data_view_request_object' - examples: - updateDataViewRequest: - $ref: '#/components/examples/update_data_view_request' - responses: - '200': - description: Indicates a successful call. - content: - application/json: - schema: - $ref: '#/components/schemas/data_view_response_object' - '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/400_response' - /s/{spaceId}/api/data_views/default: - get: - summary: Retrieves the default data view identifier. - operationId: getDefaultDataView - description: | - This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. - tags: - - data views - parameters: - - $ref: '#/components/parameters/space_id' - responses: - '200': - description: Indicates a successful call. - content: - application/json: - schema: - type: object - properties: - data_view_id: - type: string - examples: - getDefaultDataViewResponse: - $ref: '#/components/examples/get_default_data_view_response' - '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/400_response' - post: - summary: Sets the default data view identifier. - operationId: setDefaultDatailView - description: | - This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. - tags: - - data views - parameters: - - $ref: '#/components/parameters/kbn_xsrf' - - $ref: '#/components/parameters/space_id' - requestBody: - required: true - content: - application/json: - schema: - type: object - required: - - data_view_id - properties: - data_view_id: - type: - - string - - 'null' - description: | - The data view identifier. NOTE: The API does not validate whether it is a valid identifier. Use `null` to unset the default data view. - force: - type: boolean - description: Update an existing default data view identifier. - default: false - examples: - setDefaultDataViewRequest: - $ref: '#/components/examples/set_default_data_view_request' - responses: - '200': - description: Indicates a successful call. - content: - application/json: - schema: - type: object - properties: - acknowledged: - type: boolean - '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/400_response' - /s/{spaceId}/api/data_views/data_view/{viewId}/fields: - post: - summary: Update fields presentation metadata such as count, customLabel and format. - operationId: updateFieldsMetadata - description: | - This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. You can update multiple fields in one request. Updates are merged with persisted metadata. To remove existing metadata, specify null as the value. - tags: - - data views - parameters: - - $ref: '#/components/parameters/kbn_xsrf' - - $ref: '#/components/parameters/view_id' - - $ref: '#/components/parameters/space_id' - requestBody: - required: true - content: - application/json: - schema: - type: object - required: - - fields - properties: - fields: - description: The field object. - type: object - examples: - updateFieldsMetadataRequest: - $ref: '#/components/examples/update_field_metadata_request' - responses: - '200': - description: Indicates a successful call. - content: - application/json: - schema: - type: object - properties: - acknowledged: - type: boolean - '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/400_response' - /s/{spaceId}/api/data_views/data_view/{viewId}/runtime_field: - post: - summary: Creates a runtime field. - operationId: createRuntimeField - description: | - This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. - tags: - - data views - parameters: - - $ref: '#/components/parameters/kbn_xsrf' - - $ref: '#/components/parameters/view_id' - - $ref: '#/components/parameters/space_id' - requestBody: - required: true - content: - application/json: - schema: - type: object - required: - - name - - runtimeField - properties: - name: - type: string - description: | - The name for a runtime field. - runtimeField: - type: object - description: | - The runtime field definition object. - examples: - createRuntimeFieldRequest: - $ref: '#/components/examples/create_runtime_field_request' - put: - summary: Create or update an existing runtime field. - operationId: createUpdateRuntimeField - description: | - This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. - tags: - - data views - parameters: - - $ref: '#/components/parameters/kbn_xsrf' - - $ref: '#/components/parameters/space_id' - - name: viewId - in: path - description: | - The ID of the data view fields you want to update. - required: true - schema: - type: string - requestBody: - required: true - content: - application/json: - schema: - type: object - required: - - name - - runtimeField - properties: - name: - type: string - description: | - The name for a runtime field. - runtimeField: - type: object - description: | - The runtime field definition object. - examples: - updateRuntimeFieldRequest: - $ref: '#/components/examples/create_runtime_field_request' - responses: - '200': - description: Indicates a successful call. - content: - application/json: - schema: - type: object - properties: - data_view: - type: object - fields: - type: array - items: - type: object - examples: - createRuntimeFieldResponse: - $ref: '#/components/examples/create_runtime_field_response' - '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/400_response' - /s/{spaceId}/api/data_views/data_view/{viewId}/runtime_field/{fieldName}: - get: - summary: Retrieves a runtime field. - operationId: getRuntimeField - description: | - This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. - tags: - - data views - parameters: - - $ref: '#/components/parameters/field_name' - - $ref: '#/components/parameters/view_id' - - $ref: '#/components/parameters/space_id' - responses: - '200': - description: Indicates a successful call. - content: - application/json: - schema: - type: object - properties: - data_view: - type: object - fields: - type: array - items: - type: object - examples: - getRuntimeFieldResponse: - $ref: '#/components/examples/get_runtime_field_response' - '404': - description: Object is not found. - content: - application/json: - schema: - $ref: '#/components/schemas/404_response' - delete: - summary: Delete a runtime field from a data view. - operationId: deleteRuntimeField - description: | - This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. - tags: - - data views - parameters: - - $ref: '#/components/parameters/field_name' - - $ref: '#/components/parameters/view_id' - - $ref: '#/components/parameters/space_id' - responses: - '200': - description: Indicates a successful call. - '404': - description: Object is not found. - content: - application/json: - schema: - $ref: '#/components/schemas/404_response' - post: - summary: Update an existing runtime field. - operationId: updateRuntimeField - description: | - This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. - tags: - - data views - parameters: - - $ref: '#/components/parameters/field_name' - - $ref: '#/components/parameters/view_id' - - $ref: '#/components/parameters/space_id' - requestBody: - required: true - content: - application/json: - schema: - type: object - required: - - runtimeField - properties: - runtimeField: - type: object - description: | - The runtime field definition object. - - You can update following fields: - - - `type` - - `script` - examples: - updateRuntimeFieldRequest: - $ref: '#/components/examples/update_runtime_field_request' - responses: - '200': - description: Indicates a successful call. - '400': - description: Bad request - content: - application/json: - schema: - $ref: '#/components/schemas/400_response' -components: - securitySchemes: - basicAuth: - type: http - scheme: basic - apiKeyAuth: - type: apiKey - in: header - name: Authorization - description: 'e.g. Authorization: ApiKey base64AccessApiKey' - parameters: - space_id: - in: path - name: spaceId - description: An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. - required: true - schema: - type: string - examples: - - default - kbn_xsrf: - schema: - type: string - in: header - name: kbn-xsrf - description: Cross-site request forgery protection - required: true - view_id: - in: path - name: viewId - description: An identifier for the data view. - required: true - schema: - type: string - example: ff959d40-b880-11e8-a6d9-e546fe2bba5f - field_name: - in: path - name: fieldName - description: The name of the runtime field. - required: true - schema: - type: string - example: hour_of_day - examples: - get_data_views_response: - summary: The get all data views API returns a list of data views. - value: - data_view: - - id: ff959d40-b880-11e8-a6d9-e546fe2bba5f - namespaces: - - default - title: kibana_sample_data_ecommerce - typeMeta: {} - name: Kibana Sample Data eCommerce - - id: d3d7af60-4c81-11e8-b3d7-01146121b73d - namespaces: - - default - title: kibana_sample_data_flights - name: Kibana Sample Data Flights - - id: 90943e30-9a47-11e8-b64d-95841ca0b247 - namespaces: - - default - title: kibana_sample_data_logs - name: Kibana Sample Data Logs - create_data_view_request: - summary: Create a data view with runtime fields. - value: - data_view: - title: logstash-* - name: My Logstash data view - runtimeFieldMap: - runtime_shape_name: - type: keyword - script: - source: emit(doc['shape_name'].value) - get_data_view_response: - summary: The get data view API returns a JSON object that contains information about the data view. - value: - data_view: - id: ff959d40-b880-11e8-a6d9-e546fe2bba5f - version: WzUsMV0= - title: kibana_sample_data_ecommerce - timeFieldName: order_date - sourceFilters: [] - fields: - _id: - count: 0 - name: _id - type: string - esTypes: - - _id - scripted: false - searchable: true - aggregatable: false - readFromDocValues: false - format: - id: string - shortDotsEnable: false - isMapped: true - _index: - count: 0 - name: _index - type: string - esTypes: - - _index - scripted: false - searchable: true - aggregatable: true - readFromDocValues: false - format: - id: string - shortDotsEnable: false - isMapped: true - _score: - count: 0 - name: _score - type: number - scripted: false - searchable: false - aggregatable: false - readFromDocValues: false - format: - id: number - shortDotsEnable: false - isMapped: true - _source: - count: 0 - name: _source - type: _source - esTypes: - - _source - scripted: false - searchable: false - aggregatable: false - readFromDocValues: false - format: - id: _source - shortDotsEnable: false - isMapped: true - category: - count: 0 - name: category - type: string - esTypes: - - text - scripted: false - searchable: true - aggregatable: false - readFromDocValues: false - format: - id: string - shortDotsEnable: false - isMapped: true - category.keyword: - count: 0 - name: category.keyword - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - subType: - multi: - parent: category - format: - id: string - shortDotsEnable: false - isMapped: true - currency: - count: 0 - name: currency - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: string - shortDotsEnable: false - isMapped: true - customer_birth_date: - count: 0 - name: customer_birth_date - type: date - esTypes: - - date - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: date - shortDotsEnable: false - isMapped: true - customer_first_name: - count: 0 - name: customer_first_name - type: string - esTypes: - - text - scripted: false - searchable: true - aggregatable: false - readFromDocValues: false - format: - id: string - shortDotsEnable: false - isMapped: true - customer_first_name.keyword: - count: 0 - name: customer_first_name.keyword - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - subType: - multi: - parent: customer_first_name - format: - id: string - shortDotsEnable: false - isMapped: true - customer_full_name: - count: 0 - name: customer_full_name - type: string - esTypes: - - text - scripted: false - searchable: true - aggregatable: false - readFromDocValues: false - format: - id: string - shortDotsEnable: false - isMapped: true - customer_full_name.keyword: - count: 0 - name: customer_full_name.keyword - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - subType: - multi: - parent: customer_full_name - format: - id: string - shortDotsEnable: false - isMapped: true - customer_gender: - count: 0 - name: customer_gender - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: string - shortDotsEnable: false - isMapped: true - customer_id: - count: 0 - name: customer_id - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: string - shortDotsEnable: false - isMapped: true - customer_last_name: - count: 0 - name: customer_last_name - type: string - esTypes: - - text - scripted: false - searchable: true - aggregatable: false - readFromDocValues: false - format: - id: string - shortDotsEnable: false - isMapped: true - customer_last_name.keyword: - count: 0 - name: customer_last_name.keyword - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - subType: - multi: - parent: customer_last_name - format: - id: string - shortDotsEnable: false - isMapped: true - customer_phone: - count: 0 - name: customer_phone - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: string - shortDotsEnable: false - isMapped: true - day_of_week: - count: 0 - name: day_of_week - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: string - shortDotsEnable: false - isMapped: true - day_of_week_i: - count: 0 - name: day_of_week_i - type: number - esTypes: - - integer - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: number - shortDotsEnable: false - isMapped: true - email: - count: 0 - name: email - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: string - shortDotsEnable: false - isMapped: true - event.dataset: - count: 0 - name: event.dataset - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: string - shortDotsEnable: false - isMapped: true - geoip.city_name: - count: 0 - name: geoip.city_name - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: string - shortDotsEnable: false - isMapped: true - geoip.continent_name: - count: 0 - name: geoip.continent_name - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: string - shortDotsEnable: false - isMapped: true - geoip.country_iso_code: - count: 0 - name: geoip.country_iso_code - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: string - shortDotsEnable: false - isMapped: true - geoip.location: - count: 0 - name: geoip.location - type: geo_point - esTypes: - - geo_point - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: geo_point - params: - transform: wkt - shortDotsEnable: false - isMapped: true - geoip.region_name: - count: 0 - name: geoip.region_name - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: string - shortDotsEnable: false - isMapped: true - manufacturer: - count: 0 - name: manufacturer - type: string - esTypes: - - text - scripted: false - searchable: true - aggregatable: false - readFromDocValues: false - format: - id: string - shortDotsEnable: false - isMapped: true - manufacturer.keyword: - count: 0 - name: manufacturer.keyword - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - subType: - multi: - parent: manufacturer - format: - id: string - shortDotsEnable: false - isMapped: true - order_date: - count: 0 - name: order_date - type: date - esTypes: - - date - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: date - shortDotsEnable: false - isMapped: true - order_id: - count: 0 - name: order_id - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: string - shortDotsEnable: false - isMapped: true - products._id: - count: 0 - name: products._id - type: string - esTypes: - - text - scripted: false - searchable: true - aggregatable: false - readFromDocValues: false - format: - id: string - shortDotsEnable: false - isMapped: true - products._id.keyword: - count: 0 - name: products._id.keyword - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - subType: - multi: - parent: products._id - format: - id: string - shortDotsEnable: false - isMapped: true - products.base_price: - count: 0 - name: products.base_price - type: number - esTypes: - - half_float - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: number - params: - pattern: $0,0.00 - shortDotsEnable: false - isMapped: true - products.base_unit_price: - count: 0 - name: products.base_unit_price - type: number - esTypes: - - half_float - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: number - params: - pattern: $0,0.00 - shortDotsEnable: false - isMapped: true - products.category: - count: 0 - name: products.category - type: string - esTypes: - - text - scripted: false - searchable: true - aggregatable: false - readFromDocValues: false - format: - id: string - shortDotsEnable: false - isMapped: true - products.category.keyword: - count: 0 - name: products.category.keyword - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - subType: - multi: - parent: products.category - format: - id: string - shortDotsEnable: false - isMapped: true - products.created_on: - count: 0 - name: products.created_on - type: date - esTypes: - - date - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: date - shortDotsEnable: false - isMapped: true - products.discount_amount: - count: 0 - name: products.discount_amount - type: number - esTypes: - - half_float - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: number - shortDotsEnable: false - isMapped: true - products.discount_percentage: - count: 0 - name: products.discount_percentage - type: number - esTypes: - - half_float - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: number - shortDotsEnable: false - isMapped: true - products.manufacturer: - count: 1 - name: products.manufacturer - type: string - esTypes: - - text - scripted: false - searchable: true - aggregatable: false - readFromDocValues: false - format: - id: string - shortDotsEnable: false - isMapped: true - products.manufacturer.keyword: - count: 0 - name: products.manufacturer.keyword - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - subType: - multi: - parent: products.manufacturer - format: - id: string - shortDotsEnable: false - isMapped: true - products.min_price: - count: 0 - name: products.min_price - type: number - esTypes: - - half_float - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: number - params: - pattern: $0,0.00 - shortDotsEnable: false - isMapped: true - products.price: - count: 1 - name: products.price - type: number - esTypes: - - half_float - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: number - params: - pattern: $0,0.00 - shortDotsEnable: false - isMapped: true - products.product_id: - count: 0 - name: products.product_id - type: number - esTypes: - - long - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: number - shortDotsEnable: false - isMapped: true - products.product_name: - count: 1 - name: products.product_name - type: string - esTypes: - - text - scripted: false - searchable: true - aggregatable: false - readFromDocValues: false - format: - id: string - shortDotsEnable: false - isMapped: true - products.product_name.keyword: - count: 0 - name: products.product_name.keyword - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - subType: - multi: - parent: products.product_name - format: - id: string - shortDotsEnable: false - isMapped: true - products.quantity: - count: 0 - name: products.quantity - type: number - esTypes: - - integer - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: number - shortDotsEnable: false - isMapped: true - products.sku: - count: 0 - name: products.sku - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: string - shortDotsEnable: false - isMapped: true - products.tax_amount: - count: 0 - name: products.tax_amount - type: number - esTypes: - - half_float - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: number - shortDotsEnable: false - isMapped: true - products.taxful_price: - count: 0 - name: products.taxful_price - type: number - esTypes: - - half_float - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: number - params: - pattern: $0,0.00 - shortDotsEnable: false - isMapped: true - products.taxless_price: - count: 0 - name: products.taxless_price - type: number - esTypes: - - half_float - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: number - params: - pattern: $0,0.00 - shortDotsEnable: false - isMapped: true - products.unit_discount_amount: - count: 0 - name: products.unit_discount_amount - type: number - esTypes: - - half_float - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: number - shortDotsEnable: false - isMapped: true - sku: - count: 0 - name: sku - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: string - shortDotsEnable: false - isMapped: true - taxful_total_price: - count: 0 - name: taxful_total_price - type: number - esTypes: - - half_float - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: number - params: - pattern: $0,0.[00] - shortDotsEnable: false - isMapped: true - taxless_total_price: - count: 0 - name: taxless_total_price - type: number - esTypes: - - half_float - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: number - params: - pattern: $0,0.00 - shortDotsEnable: false - isMapped: true - total_quantity: - count: 1 - name: total_quantity - type: number - esTypes: - - integer - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: number - shortDotsEnable: false - isMapped: true - total_unique_products: - count: 0 - name: total_unique_products - type: number - esTypes: - - integer - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: number - shortDotsEnable: false - isMapped: true - type: - count: 0 - name: type - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: string - shortDotsEnable: false - isMapped: true - user: - count: 0 - name: user - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: string - shortDotsEnable: false - isMapped: true - typeMeta: {} - fieldFormats: - taxful_total_price: - id: number - params: - pattern: $0,0.[00] - products.price: - id: number - params: - pattern: $0,0.00 - taxless_total_price: - id: number - params: - pattern: $0,0.00 - products.taxless_price: - id: number - params: - pattern: $0,0.00 - products.taxful_price: - id: number - params: - pattern: $0,0.00 - products.min_price: - id: number - params: - pattern: $0,0.00 - products.base_unit_price: - id: number - params: - pattern: $0,0.00 - products.base_price: - id: number - params: - pattern: $0,0.00 - runtimeFieldMap: {} - fieldAttrs: - products.manufacturer: - count: 1 - products.price: - count: 1 - products.product_name: - count: 1 - total_quantity: - count: 1 - allowNoIndex: false - name: Kibana Sample Data eCommerce - namespaces: - - default - update_data_view_request: - summary: Update some properties for a data view. - value: - data_view: - title: kibana_sample_data_ecommerce - timeFieldName: order_date - allowNoIndex: false - name: Kibana Sample Data eCommerce - refresh_fields: true - get_default_data_view_response: - summary: The get default data view API returns the default data view identifier. - value: - data_view_id: ff959d40-b880-11e8-a6d9-e546fe2bba5f - set_default_data_view_request: - summary: Set the default data view identifier. - value: - data_view_id: ff959d40-b880-11e8-a6d9-e546fe2bba5f - force: true - update_field_metadata_request: - summary: Set popularity count for field foo. - value: - fields: - foo: - count: 123 - create_runtime_field_request: - summary: Create a runtime field. - value: - name: runtimeFoo - runtimeField: - type: long - script: - source: emit(doc["foo"].value) - create_runtime_field_response: - summary: The API returns created runtime field object array and updated data view object. - value: - data_view: - ...: null - fields: - - ... - get_runtime_field_response: - summary: The get runtime field API returns a JSON object that contains information about the runtime field (`hour_of_day`) and the data view (`d3d7af60-4c81-11e8-b3d7-01146121b73d`). - value: - fields: - - count: 0 - name: hour_of_day - type: number - esTypes: - - long - scripted: false - searchable: true - aggregatable: true - readFromDocValues: false - shortDotsEnable: false - runtimeField: - type: long - script: - source: emit(doc['timestamp'].value.getHour()); - data_view: - id: d3d7af60-4c81-11e8-b3d7-01146121b73d - version: WzM2LDJd - title: kibana_sample_data_flights - timeFieldName: timestamp - sourceFilters: [] - fields: - hour_of_day: - count: 0 - name: hour_of_day - type: number - esTypes: - - long - scripted: false - searchable: true - aggregatable: true - readFromDocValues: false - format: - id: number - params: - pattern: '00' - shortDotsEnable: false - runtimeField: - type: long - script: - source: emit(doc['timestamp'].value.getHour()); - AvgTicketPrice: - count: 0 - name: AvgTicketPrice - type: number - esTypes: - - float - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: number - params: - pattern: $0,0.[00] - shortDotsEnable: false - isMapped: true - Cancelled: - count: 0 - name: Cancelled - type: boolean - esTypes: - - boolean - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: boolean - shortDotsEnable: false - isMapped: true - Carrier: - count: 0 - name: Carrier - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: string - shortDotsEnable: false - isMapped: true - Dest: - count: 0 - name: Dest - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: string - shortDotsEnable: false - isMapped: true - DestAirportID: - count: 0 - name: DestAirportID - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: string - shortDotsEnable: false - isMapped: true - DestCityName: - count: 0 - name: DestCityName - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: string - shortDotsEnable: false - isMapped: true - DestCountry: - count: 0 - name: DestCountry - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: string - shortDotsEnable: false - isMapped: true - DestLocation: - count: 0 - name: DestLocation - type: geo_point - esTypes: - - geo_point - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: geo_point - params: - transform: wkt - shortDotsEnable: false - isMapped: true - DestRegion: - count: 0 - name: DestRegion - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: string - shortDotsEnable: false - isMapped: true - DestWeather: - count: 0 - name: DestWeather - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: string - shortDotsEnable: false - isMapped: true - DistanceKilometers: - count: 0 - name: DistanceKilometers - type: number - esTypes: - - float - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: number - shortDotsEnable: false - isMapped: true - DistanceMiles: - count: 0 - name: DistanceMiles - type: number - esTypes: - - float - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: number - shortDotsEnable: false - isMapped: true - FlightDelay: - count: 0 - name: FlightDelay - type: boolean - esTypes: - - boolean - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: boolean - shortDotsEnable: false - isMapped: true - FlightDelayMin: - count: 0 - name: FlightDelayMin - type: number - esTypes: - - integer - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: number - shortDotsEnable: false - isMapped: true - FlightDelayType: - count: 0 - name: FlightDelayType - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: string - shortDotsEnable: false - isMapped: true - FlightNum: - count: 0 - name: FlightNum - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: string - shortDotsEnable: false - isMapped: true - FlightTimeHour: - count: 0 - name: FlightTimeHour - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: string - shortDotsEnable: false - isMapped: true - FlightTimeMin: - count: 0 - name: FlightTimeMin - type: number - esTypes: - - float - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: number - shortDotsEnable: false - isMapped: true - Origin: - count: 0 - name: Origin - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: string - shortDotsEnable: false - isMapped: true - OriginAirportID: - count: 0 - name: OriginAirportID - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: string - shortDotsEnable: false - isMapped: true - OriginCityName: - count: 0 - name: OriginCityName - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: string - shortDotsEnable: false - isMapped: true - OriginCountry: - count: 0 - name: OriginCountry - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: string - shortDotsEnable: false - isMapped: true - OriginLocation: - count: 0 - name: OriginLocation - type: geo_point - esTypes: - - geo_point - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: geo_point - params: - transform: wkt - shortDotsEnable: false - isMapped: true - OriginRegion: - count: 0 - name: OriginRegion - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: string - shortDotsEnable: false - isMapped: true - OriginWeather: - count: 0 - name: OriginWeather - type: string - esTypes: - - keyword - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: string - shortDotsEnable: false - isMapped: true - _id: - count: 0 - name: _id - type: string - esTypes: - - _id - scripted: false - searchable: true - aggregatable: false - readFromDocValues: false - format: - id: string - shortDotsEnable: false - isMapped: true - _index: - count: 0 - name: _index - type: string - esTypes: - - _index - scripted: false - searchable: true - aggregatable: true - readFromDocValues: false - format: - id: string - shortDotsEnable: false - isMapped: true - _score: - count: 0 - name: _score - type: number - scripted: false - searchable: false - aggregatable: false - readFromDocValues: false - format: - id: number - shortDotsEnable: false - isMapped: true - _source: - count: 0 - name: _source - type: _source - esTypes: - - _source - scripted: false - searchable: false - aggregatable: false - readFromDocValues: false - format: - id: _source - shortDotsEnable: false - isMapped: true - dayOfWeek: - count: 0 - name: dayOfWeek - type: number - esTypes: - - integer - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: number - shortDotsEnable: false - isMapped: true - timestamp: - count: 0 - name: timestamp - type: date - esTypes: - - date - scripted: false - searchable: true - aggregatable: true - readFromDocValues: true - format: - id: date - shortDotsEnable: false - isMapped: true - fieldFormats: - hour_of_day: - id: number - params: - pattern: '00' - AvgTicketPrice: - id: number - params: - pattern: $0,0.[00] - runtimeFieldMap: - hour_of_day: - type: long - script: - source: emit(doc['timestamp'].value.getHour()); - fieldAttrs: {} - allowNoIndex: false - name: Kibana Sample Data Flights - update_runtime_field_request: - summary: Update an existing runtime field on a data view. - value: - runtimeField: - script: - source: emit(doc["bar"].value) - schemas: - 400_response: - title: Bad request - type: object - required: - - statusCode - - error - - message - properties: - statusCode: - type: number - example: 400 - error: - type: string - example: Bad Request - message: - type: string - allownoindex: - type: boolean - description: Allows the data view saved object to exist before the data is available. - fieldattrs: - type: object - description: A map of field attributes by field name. - fieldformats: - type: object - description: A map of field formats by field name. - namespaces: - type: array - description: An array of space identifiers for sharing the data view between multiple spaces. - items: - type: string - default: default - runtimefieldmap: - type: object - description: A map of runtime field definitions by field name. - sourcefilters: - type: array - description: The array of field names you want to filter out in Discover. - items: - type: object - required: - - value - properties: - value: - type: string - timefieldname: - type: string - description: The timestamp field name, which you use for time-based data views. - title: - type: string - description: Comma-separated list of data streams, indices, and aliases that you want to search. Supports wildcards (`*`). - type: - type: string - description: When set to `rollup`, identifies the rollup data views. - typemeta: - type: object - description: When you use rollup indices, contains the field list for the rollup data view API endpoints. - create_data_view_request_object: - title: Create data view request - type: object - required: - - data_view - properties: - data_view: - type: object - required: - - title - description: The data view object. - properties: - allowNoIndex: - $ref: '#/components/schemas/allownoindex' - fieldAttrs: - $ref: '#/components/schemas/fieldattrs' - fieldFormats: - $ref: '#/components/schemas/fieldformats' - fields: - type: object - id: - type: string - name: - type: string - description: The data view name. - namespaces: - $ref: '#/components/schemas/namespaces' - runtimeFieldMap: - $ref: '#/components/schemas/runtimefieldmap' - sourceFilters: - $ref: '#/components/schemas/sourcefilters' - timeFieldName: - $ref: '#/components/schemas/timefieldname' - title: - $ref: '#/components/schemas/title' - type: - $ref: '#/components/schemas/type' - typeMeta: - $ref: '#/components/schemas/typemeta' - version: - type: string - override: - type: boolean - description: Override an existing data view if a data view with the provided title already exists. - default: false - data_view_response_object: - title: Data view response properties - type: object - properties: - data_view: - type: object - properties: - allowNoIndex: - $ref: '#/components/schemas/allownoindex' - fieldAttrs: - $ref: '#/components/schemas/fieldattrs' - fieldFormats: - $ref: '#/components/schemas/fieldformats' - fields: - type: object - id: - type: string - example: ff959d40-b880-11e8-a6d9-e546fe2bba5f - name: - type: string - description: The data view name. - namespaces: - $ref: '#/components/schemas/namespaces' - runtimeFieldMap: - $ref: '#/components/schemas/runtimefieldmap' - sourceFilters: - $ref: '#/components/schemas/sourcefilters' - timeFieldName: - $ref: '#/components/schemas/timefieldname' - title: - $ref: '#/components/schemas/title' - typeMeta: - $ref: '#/components/schemas/typemeta' - version: - type: string - example: WzQ2LDJd - 404_response: - type: object - properties: - error: - type: string - example: Not Found - enum: - - Not Found - message: - type: string - example: Saved object [index-pattern/caaad6d0-920c-11ed-b36a-874bd1548a00] not found - statusCode: - type: integer - example: 404 - enum: - - 404 - update_data_view_request_object: - title: Update data view request - type: object - required: - - data_view - properties: - data_view: - type: object - description: | - The data view properties you want to update. Only the specified properties are updated in the data view. Unspecified fields stay as they are persisted. - properties: - allowNoIndex: - $ref: '#/components/schemas/allownoindex' - fieldFormats: - $ref: '#/components/schemas/fieldformats' - fields: - type: object - name: - type: string - runtimeFieldMap: - $ref: '#/components/schemas/runtimefieldmap' - sourceFilters: - $ref: '#/components/schemas/sourcefilters' - timeFieldName: - $ref: '#/components/schemas/timefieldname' - title: - $ref: '#/components/schemas/title' - type: - $ref: '#/components/schemas/type' - typeMeta: - $ref: '#/components/schemas/typemeta' - refresh_fields: - type: boolean - description: Reloads the data view fields after the data view is updated. - default: false diff --git a/generated/data_views/client.go b/generated/data_views/client.go deleted file mode 100644 index bd364336b..000000000 --- a/generated/data_views/client.go +++ /dev/null @@ -1,666 +0,0 @@ -/* -Data views - -OpenAPI schema for data view endpoints - -API version: 0.1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package data_views - -import ( - "bytes" - "context" - "encoding/json" - "encoding/xml" - "errors" - "fmt" - "io" - "log" - "mime/multipart" - "net/http" - "net/http/httputil" - "net/url" - "os" - "path/filepath" - "reflect" - "regexp" - "strconv" - "strings" - "time" - "unicode/utf8" -) - -var ( - jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) - xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) - queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) - queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]") -) - -// APIClient manages communication with the Data views API v0.1 -// In most cases there should be only one, shared, APIClient. -type APIClient struct { - cfg *Configuration - common service // Reuse a single struct instead of allocating one for each service on the heap. - - // API Services - - DataViewsAPI DataViewsAPI -} - -type service struct { - client *APIClient -} - -// NewAPIClient creates a new API client. Requires a userAgent string describing your application. -// optionally a custom http.Client to allow for advanced features such as caching. -func NewAPIClient(cfg *Configuration) *APIClient { - if cfg.HTTPClient == nil { - cfg.HTTPClient = http.DefaultClient - } - - c := &APIClient{} - c.cfg = cfg - c.common.client = c - - // API Services - c.DataViewsAPI = (*DataViewsAPIService)(&c.common) - - return c -} - -func atoi(in string) (int, error) { - return strconv.Atoi(in) -} - -// selectHeaderContentType select a content type from the available list. -func selectHeaderContentType(contentTypes []string) string { - if len(contentTypes) == 0 { - return "" - } - if contains(contentTypes, "application/json") { - return "application/json" - } - return contentTypes[0] // use the first content type specified in 'consumes' -} - -// selectHeaderAccept join all accept types and return -func selectHeaderAccept(accepts []string) string { - if len(accepts) == 0 { - return "" - } - - if contains(accepts, "application/json") { - return "application/json" - } - - return strings.Join(accepts, ",") -} - -// contains is a case insensitive match, finding needle in a haystack -func contains(haystack []string, needle string) bool { - for _, a := range haystack { - if strings.EqualFold(a, needle) { - return true - } - } - return false -} - -// Verify optional parameters are of the correct type. -func typeCheckParameter(obj interface{}, expected string, name string) error { - // Make sure there is an object. - if obj == nil { - return nil - } - - // Check the type is as expected. - if reflect.TypeOf(obj).String() != expected { - return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) - } - return nil -} - -func parameterValueToString(obj interface{}, key string) string { - if reflect.TypeOf(obj).Kind() != reflect.Ptr { - return fmt.Sprintf("%v", obj) - } - var param, ok = obj.(MappedNullable) - if !ok { - return "" - } - dataMap, err := param.ToMap() - if err != nil { - return "" - } - return fmt.Sprintf("%v", dataMap[key]) -} - -// parameterAddToHeaderOrQuery adds the provided object to the request header or url query -// supporting deep object syntax -func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, collectionType string) { - var v = reflect.ValueOf(obj) - var value = "" - if v == reflect.ValueOf(nil) { - value = "null" - } else { - switch v.Kind() { - case reflect.Invalid: - value = "invalid" - - case reflect.Struct: - if t, ok := obj.(MappedNullable); ok { - dataMap, err := t.ToMap() - if err != nil { - return - } - parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, collectionType) - return - } - if t, ok := obj.(time.Time); ok { - parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType) - return - } - value = v.Type().String() + " value" - case reflect.Slice: - var indValue = reflect.ValueOf(obj) - if indValue == reflect.ValueOf(nil) { - return - } - var lenIndValue = indValue.Len() - for i := 0; i < lenIndValue; i++ { - var arrayValue = indValue.Index(i) - parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, arrayValue.Interface(), collectionType) - } - return - - case reflect.Map: - var indValue = reflect.ValueOf(obj) - if indValue == reflect.ValueOf(nil) { - return - } - iter := indValue.MapRange() - for iter.Next() { - k, v := iter.Key(), iter.Value() - parameterAddToHeaderOrQuery(headerOrQueryParams, fmt.Sprintf("%s[%s]", keyPrefix, k.String()), v.Interface(), collectionType) - } - return - - case reflect.Interface: - fallthrough - case reflect.Ptr: - parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, v.Elem().Interface(), collectionType) - return - - case reflect.Int, reflect.Int8, reflect.Int16, - reflect.Int32, reflect.Int64: - value = strconv.FormatInt(v.Int(), 10) - case reflect.Uint, reflect.Uint8, reflect.Uint16, - reflect.Uint32, reflect.Uint64, reflect.Uintptr: - value = strconv.FormatUint(v.Uint(), 10) - case reflect.Float32, reflect.Float64: - value = strconv.FormatFloat(v.Float(), 'g', -1, 32) - case reflect.Bool: - value = strconv.FormatBool(v.Bool()) - case reflect.String: - value = v.String() - default: - value = v.Type().String() + " value" - } - } - - switch valuesMap := headerOrQueryParams.(type) { - case url.Values: - if collectionType == "csv" && valuesMap.Get(keyPrefix) != "" { - valuesMap.Set(keyPrefix, valuesMap.Get(keyPrefix)+","+value) - } else { - valuesMap.Add(keyPrefix, value) - } - break - case map[string]string: - valuesMap[keyPrefix] = value - break - } -} - -// helper for converting interface{} parameters to json strings -func parameterToJson(obj interface{}) (string, error) { - jsonBuf, err := json.Marshal(obj) - if err != nil { - return "", err - } - return string(jsonBuf), err -} - -// callAPI do the request. -func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { - if c.cfg.Debug { - dump, err := httputil.DumpRequestOut(request, true) - if err != nil { - return nil, err - } - log.Printf("\n%s\n", string(dump)) - } - - resp, err := c.cfg.HTTPClient.Do(request) - if err != nil { - return resp, err - } - - if c.cfg.Debug { - dump, err := httputil.DumpResponse(resp, true) - if err != nil { - return resp, err - } - log.Printf("\n%s\n", string(dump)) - } - return resp, err -} - -// Allow modification of underlying config for alternate implementations and testing -// Caution: modifying the configuration while live can cause data races and potentially unwanted behavior -func (c *APIClient) GetConfig() *Configuration { - return c.cfg -} - -type formFile struct { - fileBytes []byte - fileName string - formFileName string -} - -// prepareRequest build the request -func (c *APIClient) prepareRequest( - ctx context.Context, - path string, method string, - postBody interface{}, - headerParams map[string]string, - queryParams url.Values, - formParams url.Values, - formFiles []formFile) (localVarRequest *http.Request, err error) { - - var body *bytes.Buffer - - // Detect postBody type and post. - if postBody != nil { - contentType := headerParams["Content-Type"] - if contentType == "" { - contentType = detectContentType(postBody) - headerParams["Content-Type"] = contentType - } - - body, err = setBody(postBody, contentType) - if err != nil { - return nil, err - } - } - - // add form parameters and file if available. - if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(formFiles) > 0) { - if body != nil { - return nil, errors.New("Cannot specify postBody and multipart form at the same time.") - } - body = &bytes.Buffer{} - w := multipart.NewWriter(body) - - for k, v := range formParams { - for _, iv := range v { - if strings.HasPrefix(k, "@") { // file - err = addFile(w, k[1:], iv) - if err != nil { - return nil, err - } - } else { // form value - w.WriteField(k, iv) - } - } - } - for _, formFile := range formFiles { - if len(formFile.fileBytes) > 0 && formFile.fileName != "" { - w.Boundary() - part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) - if err != nil { - return nil, err - } - _, err = part.Write(formFile.fileBytes) - if err != nil { - return nil, err - } - } - } - - // Set the Boundary in the Content-Type - headerParams["Content-Type"] = w.FormDataContentType() - - // Set Content-Length - headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) - w.Close() - } - - if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { - if body != nil { - return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") - } - body = &bytes.Buffer{} - body.WriteString(formParams.Encode()) - // Set Content-Length - headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) - } - - // Setup path and query parameters - url, err := url.Parse(path) - if err != nil { - return nil, err - } - - // Override request host, if applicable - if c.cfg.Host != "" { - url.Host = c.cfg.Host - } - - // Override request scheme, if applicable - if c.cfg.Scheme != "" { - url.Scheme = c.cfg.Scheme - } - - // Adding Query Param - query := url.Query() - for k, v := range queryParams { - for _, iv := range v { - query.Add(k, iv) - } - } - - // Encode the parameters. - url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { - pieces := strings.Split(s, "=") - pieces[0] = queryDescape.Replace(pieces[0]) - return strings.Join(pieces, "=") - }) - - // Generate a new request - if body != nil { - localVarRequest, err = http.NewRequest(method, url.String(), body) - } else { - localVarRequest, err = http.NewRequest(method, url.String(), nil) - } - if err != nil { - return nil, err - } - - // add header parameters, if any - if len(headerParams) > 0 { - headers := http.Header{} - for h, v := range headerParams { - headers[h] = []string{v} - } - localVarRequest.Header = headers - } - - // Add the user agent to the request. - localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) - - if ctx != nil { - // add context to the request - localVarRequest = localVarRequest.WithContext(ctx) - - // 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 { - localVarRequest.Header.Add(header, value) - } - return localVarRequest, nil -} - -func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { - if len(b) == 0 { - return nil - } - if s, ok := v.(*string); ok { - *s = string(b) - return nil - } - if f, ok := v.(*os.File); ok { - f, err = os.CreateTemp("", "HttpClientFile") - if err != nil { - return - } - _, err = f.Write(b) - if err != nil { - return - } - _, err = f.Seek(0, io.SeekStart) - err = os.Remove(f.Name()) - return - } - if f, ok := v.(**os.File); ok { - *f, err = os.CreateTemp("", "HttpClientFile") - if err != nil { - return - } - _, err = (*f).Write(b) - if err != nil { - return - } - _, err = (*f).Seek(0, io.SeekStart) - err = os.Remove((*f).Name()) - return - } - if xmlCheck.MatchString(contentType) { - if err = xml.Unmarshal(b, v); err != nil { - return err - } - return nil - } - if jsonCheck.MatchString(contentType) { - if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas - if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined - if err = unmarshalObj.UnmarshalJSON(b); err != nil { - return err - } - } else { - return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") - } - } else if err = json.Unmarshal(b, v); err != nil { // simple model - return err - } - return nil - } - return errors.New("undefined response type") -} - -// Add a file to the multipart request -func addFile(w *multipart.Writer, fieldName, path string) error { - file, err := os.Open(filepath.Clean(path)) - if err != nil { - return err - } - err = file.Close() - if err != nil { - return err - } - - part, err := w.CreateFormFile(fieldName, filepath.Base(path)) - if err != nil { - return err - } - _, err = io.Copy(part, file) - - return err -} - -// Prevent trying to import "fmt" -func reportError(format string, a ...interface{}) error { - return fmt.Errorf(format, a...) -} - -// A wrapper for strict JSON decoding -func newStrictDecoder(data []byte) *json.Decoder { - dec := json.NewDecoder(bytes.NewBuffer(data)) - dec.DisallowUnknownFields() - return dec -} - -// Set request body from an interface{} -func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { - if bodyBuf == nil { - bodyBuf = &bytes.Buffer{} - } - - if reader, ok := body.(io.Reader); ok { - _, err = bodyBuf.ReadFrom(reader) - } else if fp, ok := body.(*os.File); ok { - _, err = bodyBuf.ReadFrom(fp) - } else if b, ok := body.([]byte); ok { - _, err = bodyBuf.Write(b) - } else if s, ok := body.(string); ok { - _, err = bodyBuf.WriteString(s) - } else if s, ok := body.(*string); ok { - _, err = bodyBuf.WriteString(*s) - } else if jsonCheck.MatchString(contentType) { - err = json.NewEncoder(bodyBuf).Encode(body) - } else if xmlCheck.MatchString(contentType) { - var bs []byte - bs, err = xml.Marshal(body) - if err == nil { - bodyBuf.Write(bs) - } - } - - if err != nil { - return nil, err - } - - if bodyBuf.Len() == 0 { - err = fmt.Errorf("invalid body type %s\n", contentType) - return nil, err - } - return bodyBuf, nil -} - -// detectContentType method is used to figure out `Request.Body` content type for request header -func detectContentType(body interface{}) string { - contentType := "text/plain; charset=utf-8" - kind := reflect.TypeOf(body).Kind() - - switch kind { - case reflect.Struct, reflect.Map, reflect.Ptr: - contentType = "application/json; charset=utf-8" - case reflect.String: - contentType = "text/plain; charset=utf-8" - default: - if b, ok := body.([]byte); ok { - contentType = http.DetectContentType(b) - } else if kind == reflect.Slice { - contentType = "application/json; charset=utf-8" - } - } - - return contentType -} - -// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go -type cacheControl map[string]string - -func parseCacheControl(headers http.Header) cacheControl { - cc := cacheControl{} - ccHeader := headers.Get("Cache-Control") - for _, part := range strings.Split(ccHeader, ",") { - part = strings.Trim(part, " ") - if part == "" { - continue - } - if strings.ContainsRune(part, '=') { - keyval := strings.Split(part, "=") - cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") - } else { - cc[part] = "" - } - } - return cc -} - -// CacheExpires helper function to determine remaining time before repeating a request. -func CacheExpires(r *http.Response) time.Time { - // Figure out when the cache expires. - var expires time.Time - now, err := time.Parse(time.RFC1123, r.Header.Get("date")) - if err != nil { - return time.Now() - } - respCacheControl := parseCacheControl(r.Header) - - if maxAge, ok := respCacheControl["max-age"]; ok { - lifetime, err := time.ParseDuration(maxAge + "s") - if err != nil { - expires = now - } else { - expires = now.Add(lifetime) - } - } else { - expiresHeader := r.Header.Get("Expires") - if expiresHeader != "" { - expires, err = time.Parse(time.RFC1123, expiresHeader) - if err != nil { - expires = now - } - } - } - return expires -} - -func strlen(s string) int { - return utf8.RuneCountInString(s) -} - -// GenericOpenAPIError Provides access to the body, error and model on returned errors. -type GenericOpenAPIError struct { - body []byte - error string - model interface{} -} - -// Error returns non-empty string if there was an error. -func (e GenericOpenAPIError) Error() string { - return e.error -} - -// Body returns the raw bytes of the response -func (e GenericOpenAPIError) Body() []byte { - return e.body -} - -// Model returns the unpacked model of the error -func (e GenericOpenAPIError) Model() interface{} { - return e.model -} - -// format error message using title and detail when model implements rfc7807 -func formatErrorMessage(status string, v interface{}) string { - str := "" - metaValue := reflect.ValueOf(v).Elem() - - if metaValue.Kind() == reflect.Struct { - field := metaValue.FieldByName("Title") - if field != (reflect.Value{}) { - str = fmt.Sprintf("%s", field.Interface()) - } - - field = metaValue.FieldByName("Detail") - if field != (reflect.Value{}) { - str = fmt.Sprintf("%s (%s)", str, field.Interface()) - } - } - - return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) -} diff --git a/generated/data_views/configuration.go b/generated/data_views/configuration.go deleted file mode 100644 index 9e7e50bc6..000000000 --- a/generated/data_views/configuration.go +++ /dev/null @@ -1,220 +0,0 @@ -/* -Data views - -OpenAPI schema for data view endpoints - -API version: 0.1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package data_views - -import ( - "context" - "fmt" - "net/http" - "strings" -) - -// contextKeys are used to identify the type of value in the context. -// Since these are string, it is possible to get a short description of the -// context key for logging and debugging using key.String(). - -type contextKey string - -func (c contextKey) String() string { - return "auth " + string(c) -} - -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") - - // ContextOperationServerIndices uses a server configuration from the index mapping. - ContextOperationServerIndices = contextKey("serverOperationIndices") - - // ContextServerVariables overrides a server configuration variables. - ContextServerVariables = contextKey("serverVariables") - - // ContextOperationServerVariables overrides a server configuration variables using operation specific values. - ContextOperationServerVariables = contextKey("serverOperationVariables") -) - -// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth -type BasicAuth struct { - UserName string `json:"userName,omitempty"` - Password string `json:"password,omitempty"` -} - -// APIKey provides API key based authentication to a request passed via context using ContextAPIKey -type APIKey struct { - Key string - Prefix string -} - -// ServerVariable stores the information about a server variable -type ServerVariable struct { - Description string - DefaultValue string - EnumValues []string -} - -// ServerConfiguration stores the information about a server -type ServerConfiguration struct { - URL string - Description string - Variables map[string]ServerVariable -} - -// ServerConfigurations stores multiple ServerConfiguration items -type ServerConfigurations []ServerConfiguration - -// Configuration stores the configuration of the API client -type Configuration struct { - Host string `json:"host,omitempty"` - Scheme string `json:"scheme,omitempty"` - DefaultHeader map[string]string `json:"defaultHeader,omitempty"` - UserAgent string `json:"userAgent,omitempty"` - Debug bool `json:"debug,omitempty"` - Servers ServerConfigurations - OperationServers map[string]ServerConfigurations - HTTPClient *http.Client -} - -// NewConfiguration returns a new Configuration object -func NewConfiguration() *Configuration { - cfg := &Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Servers: ServerConfigurations{ - { - URL: "", - Description: "No description provided", - }, - }, - OperationServers: map[string]ServerConfigurations{}, - } - return cfg -} - -// AddDefaultHeader adds a new HTTP header to the default header in the request -func (c *Configuration) AddDefaultHeader(key string, value string) { - c.DefaultHeader[key] = value -} - -// URL formats template on a index using given variables -func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { - if index < 0 || len(sc) <= index { - return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) - } - server := sc[index] - url := server.URL - - // go through variables and replace placeholders - for name, variable := range server.Variables { - if value, ok := variables[name]; ok { - found := bool(len(variable.EnumValues) == 0) - for _, enumValue := range variable.EnumValues { - if value == enumValue { - found = true - } - } - if !found { - return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) - } - url = strings.Replace(url, "{"+name+"}", value, -1) - } else { - url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) - } - } - return url, nil -} - -// ServerURL returns URL based on server settings -func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { - return c.Servers.URL(index, variables) -} - -func getServerIndex(ctx context.Context) (int, error) { - si := ctx.Value(ContextServerIndex) - if si != nil { - if index, ok := si.(int); ok { - return index, nil - } - return 0, reportError("Invalid type %T should be int", si) - } - return 0, nil -} - -func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { - osi := ctx.Value(ContextOperationServerIndices) - if osi != nil { - if operationIndices, ok := osi.(map[string]int); !ok { - return 0, reportError("Invalid type %T should be map[string]int", osi) - } else { - index, ok := operationIndices[endpoint] - if ok { - return index, nil - } - } - } - return getServerIndex(ctx) -} - -func getServerVariables(ctx context.Context) (map[string]string, error) { - sv := ctx.Value(ContextServerVariables) - if sv != nil { - if variables, ok := sv.(map[string]string); ok { - return variables, nil - } - return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) - } - return nil, nil -} - -func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { - osv := ctx.Value(ContextOperationServerVariables) - if osv != nil { - if operationVariables, ok := osv.(map[string]map[string]string); !ok { - return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) - } else { - variables, ok := operationVariables[endpoint] - if ok { - return variables, nil - } - } - } - return getServerVariables(ctx) -} - -// ServerURLWithContext returns a new server URL given an endpoint -func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { - sc, ok := c.OperationServers[endpoint] - if !ok { - sc = c.Servers - } - - if ctx == nil { - return sc.URL(0, nil) - } - - index, err := getServerOperationIndex(ctx, endpoint) - if err != nil { - return "", err - } - - variables, err := getServerOperationVariables(ctx, endpoint) - if err != nil { - return "", err - } - - return sc.URL(index, variables) -} diff --git a/generated/data_views/docs/CreateDataViewRequestObject.md b/generated/data_views/docs/CreateDataViewRequestObject.md deleted file mode 100644 index added5a05..000000000 --- a/generated/data_views/docs/CreateDataViewRequestObject.md +++ /dev/null @@ -1,77 +0,0 @@ -# CreateDataViewRequestObject - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**DataView** | [**CreateDataViewRequestObjectDataView**](CreateDataViewRequestObjectDataView.md) | | -**Override** | Pointer to **bool** | Override an existing data view if a data view with the provided title already exists. | [optional] [default to false] - -## Methods - -### NewCreateDataViewRequestObject - -`func NewCreateDataViewRequestObject(dataView CreateDataViewRequestObjectDataView, ) *CreateDataViewRequestObject` - -NewCreateDataViewRequestObject instantiates a new CreateDataViewRequestObject 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 - -### NewCreateDataViewRequestObjectWithDefaults - -`func NewCreateDataViewRequestObjectWithDefaults() *CreateDataViewRequestObject` - -NewCreateDataViewRequestObjectWithDefaults instantiates a new CreateDataViewRequestObject 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 - -### GetDataView - -`func (o *CreateDataViewRequestObject) GetDataView() CreateDataViewRequestObjectDataView` - -GetDataView returns the DataView field if non-nil, zero value otherwise. - -### GetDataViewOk - -`func (o *CreateDataViewRequestObject) GetDataViewOk() (*CreateDataViewRequestObjectDataView, bool)` - -GetDataViewOk returns a tuple with the DataView field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDataView - -`func (o *CreateDataViewRequestObject) SetDataView(v CreateDataViewRequestObjectDataView)` - -SetDataView sets DataView field to given value. - - -### GetOverride - -`func (o *CreateDataViewRequestObject) GetOverride() bool` - -GetOverride returns the Override field if non-nil, zero value otherwise. - -### GetOverrideOk - -`func (o *CreateDataViewRequestObject) GetOverrideOk() (*bool, bool)` - -GetOverrideOk returns a tuple with the Override field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetOverride - -`func (o *CreateDataViewRequestObject) SetOverride(v bool)` - -SetOverride sets Override field to given value. - -### HasOverride - -`func (o *CreateDataViewRequestObject) HasOverride() bool` - -HasOverride 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/data_views/docs/CreateDataViewRequestObjectDataView.md b/generated/data_views/docs/CreateDataViewRequestObjectDataView.md deleted file mode 100644 index c248f2271..000000000 --- a/generated/data_views/docs/CreateDataViewRequestObjectDataView.md +++ /dev/null @@ -1,389 +0,0 @@ -# CreateDataViewRequestObjectDataView - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**AllowNoIndex** | Pointer to **bool** | Allows the data view saved object to exist before the data is available. | [optional] -**FieldAttrs** | Pointer to **map[string]interface{}** | A map of field attributes by field name. | [optional] -**FieldFormats** | Pointer to **map[string]interface{}** | A map of field formats by field name. | [optional] -**Fields** | Pointer to **map[string]interface{}** | | [optional] -**Id** | Pointer to **string** | | [optional] -**Name** | Pointer to **string** | The data view name. | [optional] -**Namespaces** | Pointer to **[]string** | An array of space identifiers for sharing the data view between multiple spaces. | [optional] -**RuntimeFieldMap** | Pointer to **map[string]interface{}** | A map of runtime field definitions by field name. | [optional] -**SourceFilters** | Pointer to [**[]SourcefiltersInner**](SourcefiltersInner.md) | The array of field names you want to filter out in Discover. | [optional] -**TimeFieldName** | Pointer to **string** | The timestamp field name, which you use for time-based data views. | [optional] -**Title** | **string** | Comma-separated list of data streams, indices, and aliases that you want to search. Supports wildcards (`*`). | -**Type** | Pointer to **string** | When set to `rollup`, identifies the rollup data views. | [optional] -**TypeMeta** | Pointer to **map[string]interface{}** | When you use rollup indices, contains the field list for the rollup data view API endpoints. | [optional] -**Version** | Pointer to **string** | | [optional] - -## Methods - -### NewCreateDataViewRequestObjectDataView - -`func NewCreateDataViewRequestObjectDataView(title string, ) *CreateDataViewRequestObjectDataView` - -NewCreateDataViewRequestObjectDataView instantiates a new CreateDataViewRequestObjectDataView 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 - -### NewCreateDataViewRequestObjectDataViewWithDefaults - -`func NewCreateDataViewRequestObjectDataViewWithDefaults() *CreateDataViewRequestObjectDataView` - -NewCreateDataViewRequestObjectDataViewWithDefaults instantiates a new CreateDataViewRequestObjectDataView 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 - -### GetAllowNoIndex - -`func (o *CreateDataViewRequestObjectDataView) GetAllowNoIndex() bool` - -GetAllowNoIndex returns the AllowNoIndex field if non-nil, zero value otherwise. - -### GetAllowNoIndexOk - -`func (o *CreateDataViewRequestObjectDataView) GetAllowNoIndexOk() (*bool, bool)` - -GetAllowNoIndexOk returns a tuple with the AllowNoIndex field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetAllowNoIndex - -`func (o *CreateDataViewRequestObjectDataView) SetAllowNoIndex(v bool)` - -SetAllowNoIndex sets AllowNoIndex field to given value. - -### HasAllowNoIndex - -`func (o *CreateDataViewRequestObjectDataView) HasAllowNoIndex() bool` - -HasAllowNoIndex returns a boolean if a field has been set. - -### GetFieldAttrs - -`func (o *CreateDataViewRequestObjectDataView) GetFieldAttrs() map[string]interface{}` - -GetFieldAttrs returns the FieldAttrs field if non-nil, zero value otherwise. - -### GetFieldAttrsOk - -`func (o *CreateDataViewRequestObjectDataView) GetFieldAttrsOk() (*map[string]interface{}, bool)` - -GetFieldAttrsOk returns a tuple with the FieldAttrs field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetFieldAttrs - -`func (o *CreateDataViewRequestObjectDataView) SetFieldAttrs(v map[string]interface{})` - -SetFieldAttrs sets FieldAttrs field to given value. - -### HasFieldAttrs - -`func (o *CreateDataViewRequestObjectDataView) HasFieldAttrs() bool` - -HasFieldAttrs returns a boolean if a field has been set. - -### GetFieldFormats - -`func (o *CreateDataViewRequestObjectDataView) GetFieldFormats() map[string]interface{}` - -GetFieldFormats returns the FieldFormats field if non-nil, zero value otherwise. - -### GetFieldFormatsOk - -`func (o *CreateDataViewRequestObjectDataView) GetFieldFormatsOk() (*map[string]interface{}, bool)` - -GetFieldFormatsOk returns a tuple with the FieldFormats field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetFieldFormats - -`func (o *CreateDataViewRequestObjectDataView) SetFieldFormats(v map[string]interface{})` - -SetFieldFormats sets FieldFormats field to given value. - -### HasFieldFormats - -`func (o *CreateDataViewRequestObjectDataView) HasFieldFormats() bool` - -HasFieldFormats returns a boolean if a field has been set. - -### GetFields - -`func (o *CreateDataViewRequestObjectDataView) GetFields() map[string]interface{}` - -GetFields returns the Fields field if non-nil, zero value otherwise. - -### GetFieldsOk - -`func (o *CreateDataViewRequestObjectDataView) GetFieldsOk() (*map[string]interface{}, bool)` - -GetFieldsOk returns a tuple with the Fields field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetFields - -`func (o *CreateDataViewRequestObjectDataView) SetFields(v map[string]interface{})` - -SetFields sets Fields field to given value. - -### HasFields - -`func (o *CreateDataViewRequestObjectDataView) HasFields() bool` - -HasFields returns a boolean if a field has been set. - -### GetId - -`func (o *CreateDataViewRequestObjectDataView) GetId() string` - -GetId returns the Id field if non-nil, zero value otherwise. - -### GetIdOk - -`func (o *CreateDataViewRequestObjectDataView) 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 *CreateDataViewRequestObjectDataView) SetId(v string)` - -SetId sets Id field to given value. - -### HasId - -`func (o *CreateDataViewRequestObjectDataView) HasId() bool` - -HasId returns a boolean if a field has been set. - -### GetName - -`func (o *CreateDataViewRequestObjectDataView) GetName() string` - -GetName returns the Name field if non-nil, zero value otherwise. - -### GetNameOk - -`func (o *CreateDataViewRequestObjectDataView) 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 *CreateDataViewRequestObjectDataView) SetName(v string)` - -SetName sets Name field to given value. - -### HasName - -`func (o *CreateDataViewRequestObjectDataView) HasName() bool` - -HasName returns a boolean if a field has been set. - -### GetNamespaces - -`func (o *CreateDataViewRequestObjectDataView) GetNamespaces() []string` - -GetNamespaces returns the Namespaces field if non-nil, zero value otherwise. - -### GetNamespacesOk - -`func (o *CreateDataViewRequestObjectDataView) GetNamespacesOk() (*[]string, bool)` - -GetNamespacesOk returns a tuple with the Namespaces field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetNamespaces - -`func (o *CreateDataViewRequestObjectDataView) SetNamespaces(v []string)` - -SetNamespaces sets Namespaces field to given value. - -### HasNamespaces - -`func (o *CreateDataViewRequestObjectDataView) HasNamespaces() bool` - -HasNamespaces returns a boolean if a field has been set. - -### GetRuntimeFieldMap - -`func (o *CreateDataViewRequestObjectDataView) GetRuntimeFieldMap() map[string]interface{}` - -GetRuntimeFieldMap returns the RuntimeFieldMap field if non-nil, zero value otherwise. - -### GetRuntimeFieldMapOk - -`func (o *CreateDataViewRequestObjectDataView) GetRuntimeFieldMapOk() (*map[string]interface{}, bool)` - -GetRuntimeFieldMapOk returns a tuple with the RuntimeFieldMap field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetRuntimeFieldMap - -`func (o *CreateDataViewRequestObjectDataView) SetRuntimeFieldMap(v map[string]interface{})` - -SetRuntimeFieldMap sets RuntimeFieldMap field to given value. - -### HasRuntimeFieldMap - -`func (o *CreateDataViewRequestObjectDataView) HasRuntimeFieldMap() bool` - -HasRuntimeFieldMap returns a boolean if a field has been set. - -### GetSourceFilters - -`func (o *CreateDataViewRequestObjectDataView) GetSourceFilters() []SourcefiltersInner` - -GetSourceFilters returns the SourceFilters field if non-nil, zero value otherwise. - -### GetSourceFiltersOk - -`func (o *CreateDataViewRequestObjectDataView) GetSourceFiltersOk() (*[]SourcefiltersInner, bool)` - -GetSourceFiltersOk returns a tuple with the SourceFilters field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetSourceFilters - -`func (o *CreateDataViewRequestObjectDataView) SetSourceFilters(v []SourcefiltersInner)` - -SetSourceFilters sets SourceFilters field to given value. - -### HasSourceFilters - -`func (o *CreateDataViewRequestObjectDataView) HasSourceFilters() bool` - -HasSourceFilters returns a boolean if a field has been set. - -### GetTimeFieldName - -`func (o *CreateDataViewRequestObjectDataView) GetTimeFieldName() string` - -GetTimeFieldName returns the TimeFieldName field if non-nil, zero value otherwise. - -### GetTimeFieldNameOk - -`func (o *CreateDataViewRequestObjectDataView) GetTimeFieldNameOk() (*string, bool)` - -GetTimeFieldNameOk returns a tuple with the TimeFieldName field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTimeFieldName - -`func (o *CreateDataViewRequestObjectDataView) SetTimeFieldName(v string)` - -SetTimeFieldName sets TimeFieldName field to given value. - -### HasTimeFieldName - -`func (o *CreateDataViewRequestObjectDataView) HasTimeFieldName() bool` - -HasTimeFieldName returns a boolean if a field has been set. - -### GetTitle - -`func (o *CreateDataViewRequestObjectDataView) GetTitle() string` - -GetTitle returns the Title field if non-nil, zero value otherwise. - -### GetTitleOk - -`func (o *CreateDataViewRequestObjectDataView) GetTitleOk() (*string, bool)` - -GetTitleOk returns a tuple with the Title field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTitle - -`func (o *CreateDataViewRequestObjectDataView) SetTitle(v string)` - -SetTitle sets Title field to given value. - - -### GetType - -`func (o *CreateDataViewRequestObjectDataView) GetType() string` - -GetType returns the Type field if non-nil, zero value otherwise. - -### GetTypeOk - -`func (o *CreateDataViewRequestObjectDataView) 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 *CreateDataViewRequestObjectDataView) SetType(v string)` - -SetType sets Type field to given value. - -### HasType - -`func (o *CreateDataViewRequestObjectDataView) HasType() bool` - -HasType returns a boolean if a field has been set. - -### GetTypeMeta - -`func (o *CreateDataViewRequestObjectDataView) GetTypeMeta() map[string]interface{}` - -GetTypeMeta returns the TypeMeta field if non-nil, zero value otherwise. - -### GetTypeMetaOk - -`func (o *CreateDataViewRequestObjectDataView) GetTypeMetaOk() (*map[string]interface{}, bool)` - -GetTypeMetaOk returns a tuple with the TypeMeta field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTypeMeta - -`func (o *CreateDataViewRequestObjectDataView) SetTypeMeta(v map[string]interface{})` - -SetTypeMeta sets TypeMeta field to given value. - -### HasTypeMeta - -`func (o *CreateDataViewRequestObjectDataView) HasTypeMeta() bool` - -HasTypeMeta returns a boolean if a field has been set. - -### GetVersion - -`func (o *CreateDataViewRequestObjectDataView) GetVersion() string` - -GetVersion returns the Version field if non-nil, zero value otherwise. - -### GetVersionOk - -`func (o *CreateDataViewRequestObjectDataView) GetVersionOk() (*string, 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 *CreateDataViewRequestObjectDataView) SetVersion(v string)` - -SetVersion sets Version field to given value. - -### HasVersion - -`func (o *CreateDataViewRequestObjectDataView) HasVersion() bool` - -HasVersion 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/data_views/docs/CreateRuntimeFieldRequest.md b/generated/data_views/docs/CreateRuntimeFieldRequest.md deleted file mode 100644 index 81b63b3fd..000000000 --- a/generated/data_views/docs/CreateRuntimeFieldRequest.md +++ /dev/null @@ -1,92 +0,0 @@ -# CreateRuntimeFieldRequest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Name** | **interface{}** | The name for a runtime field. | -**RuntimeField** | **interface{}** | The runtime field definition object. | - -## Methods - -### NewCreateRuntimeFieldRequest - -`func NewCreateRuntimeFieldRequest(name interface{}, runtimeField interface{}, ) *CreateRuntimeFieldRequest` - -NewCreateRuntimeFieldRequest instantiates a new CreateRuntimeFieldRequest 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 - -### NewCreateRuntimeFieldRequestWithDefaults - -`func NewCreateRuntimeFieldRequestWithDefaults() *CreateRuntimeFieldRequest` - -NewCreateRuntimeFieldRequestWithDefaults instantiates a new CreateRuntimeFieldRequest 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 *CreateRuntimeFieldRequest) GetName() interface{}` - -GetName returns the Name field if non-nil, zero value otherwise. - -### GetNameOk - -`func (o *CreateRuntimeFieldRequest) GetNameOk() (*interface{}, 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 *CreateRuntimeFieldRequest) SetName(v interface{})` - -SetName sets Name field to given value. - - -### SetNameNil - -`func (o *CreateRuntimeFieldRequest) SetNameNil(b bool)` - - SetNameNil sets the value for Name to be an explicit nil - -### UnsetName -`func (o *CreateRuntimeFieldRequest) UnsetName()` - -UnsetName ensures that no value is present for Name, not even an explicit nil -### GetRuntimeField - -`func (o *CreateRuntimeFieldRequest) GetRuntimeField() interface{}` - -GetRuntimeField returns the RuntimeField field if non-nil, zero value otherwise. - -### GetRuntimeFieldOk - -`func (o *CreateRuntimeFieldRequest) GetRuntimeFieldOk() (*interface{}, bool)` - -GetRuntimeFieldOk returns a tuple with the RuntimeField field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetRuntimeField - -`func (o *CreateRuntimeFieldRequest) SetRuntimeField(v interface{})` - -SetRuntimeField sets RuntimeField field to given value. - - -### SetRuntimeFieldNil - -`func (o *CreateRuntimeFieldRequest) SetRuntimeFieldNil(b bool)` - - SetRuntimeFieldNil sets the value for RuntimeField to be an explicit nil - -### UnsetRuntimeField -`func (o *CreateRuntimeFieldRequest) UnsetRuntimeField()` - -UnsetRuntimeField ensures that no value is present for RuntimeField, not even an explicit nil - -[[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/data_views/docs/CreateUpdateRuntimeField200Response.md b/generated/data_views/docs/CreateUpdateRuntimeField200Response.md deleted file mode 100644 index 51e6739e1..000000000 --- a/generated/data_views/docs/CreateUpdateRuntimeField200Response.md +++ /dev/null @@ -1,82 +0,0 @@ -# CreateUpdateRuntimeField200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**DataView** | Pointer to **map[string]interface{}** | | [optional] -**Fields** | Pointer to **[]map[string]interface{}** | | [optional] - -## Methods - -### NewCreateUpdateRuntimeField200Response - -`func NewCreateUpdateRuntimeField200Response() *CreateUpdateRuntimeField200Response` - -NewCreateUpdateRuntimeField200Response instantiates a new CreateUpdateRuntimeField200Response 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 - -### NewCreateUpdateRuntimeField200ResponseWithDefaults - -`func NewCreateUpdateRuntimeField200ResponseWithDefaults() *CreateUpdateRuntimeField200Response` - -NewCreateUpdateRuntimeField200ResponseWithDefaults instantiates a new CreateUpdateRuntimeField200Response 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 - -### GetDataView - -`func (o *CreateUpdateRuntimeField200Response) GetDataView() map[string]interface{}` - -GetDataView returns the DataView field if non-nil, zero value otherwise. - -### GetDataViewOk - -`func (o *CreateUpdateRuntimeField200Response) GetDataViewOk() (*map[string]interface{}, bool)` - -GetDataViewOk returns a tuple with the DataView field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDataView - -`func (o *CreateUpdateRuntimeField200Response) SetDataView(v map[string]interface{})` - -SetDataView sets DataView field to given value. - -### HasDataView - -`func (o *CreateUpdateRuntimeField200Response) HasDataView() bool` - -HasDataView returns a boolean if a field has been set. - -### GetFields - -`func (o *CreateUpdateRuntimeField200Response) GetFields() []map[string]interface{}` - -GetFields returns the Fields field if non-nil, zero value otherwise. - -### GetFieldsOk - -`func (o *CreateUpdateRuntimeField200Response) GetFieldsOk() (*[]map[string]interface{}, bool)` - -GetFieldsOk returns a tuple with the Fields field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetFields - -`func (o *CreateUpdateRuntimeField200Response) SetFields(v []map[string]interface{})` - -SetFields sets Fields field to given value. - -### HasFields - -`func (o *CreateUpdateRuntimeField200Response) HasFields() bool` - -HasFields 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/data_views/docs/CreateUpdateRuntimeFieldRequest.md b/generated/data_views/docs/CreateUpdateRuntimeFieldRequest.md deleted file mode 100644 index 61a7e189f..000000000 --- a/generated/data_views/docs/CreateUpdateRuntimeFieldRequest.md +++ /dev/null @@ -1,72 +0,0 @@ -# CreateUpdateRuntimeFieldRequest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Name** | **string** | The name for a runtime field. | -**RuntimeField** | **map[string]interface{}** | The runtime field definition object. | - -## Methods - -### NewCreateUpdateRuntimeFieldRequest - -`func NewCreateUpdateRuntimeFieldRequest(name string, runtimeField map[string]interface{}, ) *CreateUpdateRuntimeFieldRequest` - -NewCreateUpdateRuntimeFieldRequest instantiates a new CreateUpdateRuntimeFieldRequest 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 - -### NewCreateUpdateRuntimeFieldRequestWithDefaults - -`func NewCreateUpdateRuntimeFieldRequestWithDefaults() *CreateUpdateRuntimeFieldRequest` - -NewCreateUpdateRuntimeFieldRequestWithDefaults instantiates a new CreateUpdateRuntimeFieldRequest 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 *CreateUpdateRuntimeFieldRequest) GetName() string` - -GetName returns the Name field if non-nil, zero value otherwise. - -### GetNameOk - -`func (o *CreateUpdateRuntimeFieldRequest) 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 *CreateUpdateRuntimeFieldRequest) SetName(v string)` - -SetName sets Name field to given value. - - -### GetRuntimeField - -`func (o *CreateUpdateRuntimeFieldRequest) GetRuntimeField() map[string]interface{}` - -GetRuntimeField returns the RuntimeField field if non-nil, zero value otherwise. - -### GetRuntimeFieldOk - -`func (o *CreateUpdateRuntimeFieldRequest) GetRuntimeFieldOk() (*map[string]interface{}, bool)` - -GetRuntimeFieldOk returns a tuple with the RuntimeField field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetRuntimeField - -`func (o *CreateUpdateRuntimeFieldRequest) SetRuntimeField(v map[string]interface{})` - -SetRuntimeField sets RuntimeField 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/data_views/docs/DataViewResponseObject.md b/generated/data_views/docs/DataViewResponseObject.md deleted file mode 100644 index ae8ff0827..000000000 --- a/generated/data_views/docs/DataViewResponseObject.md +++ /dev/null @@ -1,56 +0,0 @@ -# DataViewResponseObject - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**DataView** | Pointer to [**DataViewResponseObjectDataView**](DataViewResponseObjectDataView.md) | | [optional] - -## Methods - -### NewDataViewResponseObject - -`func NewDataViewResponseObject() *DataViewResponseObject` - -NewDataViewResponseObject instantiates a new DataViewResponseObject 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 - -### NewDataViewResponseObjectWithDefaults - -`func NewDataViewResponseObjectWithDefaults() *DataViewResponseObject` - -NewDataViewResponseObjectWithDefaults instantiates a new DataViewResponseObject 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 - -### GetDataView - -`func (o *DataViewResponseObject) GetDataView() DataViewResponseObjectDataView` - -GetDataView returns the DataView field if non-nil, zero value otherwise. - -### GetDataViewOk - -`func (o *DataViewResponseObject) GetDataViewOk() (*DataViewResponseObjectDataView, bool)` - -GetDataViewOk returns a tuple with the DataView field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDataView - -`func (o *DataViewResponseObject) SetDataView(v DataViewResponseObjectDataView)` - -SetDataView sets DataView field to given value. - -### HasDataView - -`func (o *DataViewResponseObject) HasDataView() bool` - -HasDataView 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/data_views/docs/DataViewResponseObjectDataView.md b/generated/data_views/docs/DataViewResponseObjectDataView.md deleted file mode 100644 index 616140dee..000000000 --- a/generated/data_views/docs/DataViewResponseObjectDataView.md +++ /dev/null @@ -1,368 +0,0 @@ -# DataViewResponseObjectDataView - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**AllowNoIndex** | Pointer to **bool** | Allows the data view saved object to exist before the data is available. | [optional] -**FieldAttrs** | Pointer to **map[string]interface{}** | A map of field attributes by field name. | [optional] -**FieldFormats** | Pointer to **map[string]interface{}** | A map of field formats by field name. | [optional] -**Fields** | Pointer to **map[string]interface{}** | | [optional] -**Id** | Pointer to **string** | | [optional] -**Name** | Pointer to **string** | The data view name. | [optional] -**Namespaces** | Pointer to **[]string** | An array of space identifiers for sharing the data view between multiple spaces. | [optional] -**RuntimeFieldMap** | Pointer to **map[string]interface{}** | A map of runtime field definitions by field name. | [optional] -**SourceFilters** | Pointer to [**[]SourcefiltersInner**](SourcefiltersInner.md) | The array of field names you want to filter out in Discover. | [optional] -**TimeFieldName** | Pointer to **string** | The timestamp field name, which you use for time-based data views. | [optional] -**Title** | Pointer to **string** | Comma-separated list of data streams, indices, and aliases that you want to search. Supports wildcards (`*`). | [optional] -**TypeMeta** | Pointer to **map[string]interface{}** | When you use rollup indices, contains the field list for the rollup data view API endpoints. | [optional] -**Version** | Pointer to **string** | | [optional] - -## Methods - -### NewDataViewResponseObjectDataView - -`func NewDataViewResponseObjectDataView() *DataViewResponseObjectDataView` - -NewDataViewResponseObjectDataView instantiates a new DataViewResponseObjectDataView 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 - -### NewDataViewResponseObjectDataViewWithDefaults - -`func NewDataViewResponseObjectDataViewWithDefaults() *DataViewResponseObjectDataView` - -NewDataViewResponseObjectDataViewWithDefaults instantiates a new DataViewResponseObjectDataView 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 - -### GetAllowNoIndex - -`func (o *DataViewResponseObjectDataView) GetAllowNoIndex() bool` - -GetAllowNoIndex returns the AllowNoIndex field if non-nil, zero value otherwise. - -### GetAllowNoIndexOk - -`func (o *DataViewResponseObjectDataView) GetAllowNoIndexOk() (*bool, bool)` - -GetAllowNoIndexOk returns a tuple with the AllowNoIndex field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetAllowNoIndex - -`func (o *DataViewResponseObjectDataView) SetAllowNoIndex(v bool)` - -SetAllowNoIndex sets AllowNoIndex field to given value. - -### HasAllowNoIndex - -`func (o *DataViewResponseObjectDataView) HasAllowNoIndex() bool` - -HasAllowNoIndex returns a boolean if a field has been set. - -### GetFieldAttrs - -`func (o *DataViewResponseObjectDataView) GetFieldAttrs() map[string]interface{}` - -GetFieldAttrs returns the FieldAttrs field if non-nil, zero value otherwise. - -### GetFieldAttrsOk - -`func (o *DataViewResponseObjectDataView) GetFieldAttrsOk() (*map[string]interface{}, bool)` - -GetFieldAttrsOk returns a tuple with the FieldAttrs field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetFieldAttrs - -`func (o *DataViewResponseObjectDataView) SetFieldAttrs(v map[string]interface{})` - -SetFieldAttrs sets FieldAttrs field to given value. - -### HasFieldAttrs - -`func (o *DataViewResponseObjectDataView) HasFieldAttrs() bool` - -HasFieldAttrs returns a boolean if a field has been set. - -### GetFieldFormats - -`func (o *DataViewResponseObjectDataView) GetFieldFormats() map[string]interface{}` - -GetFieldFormats returns the FieldFormats field if non-nil, zero value otherwise. - -### GetFieldFormatsOk - -`func (o *DataViewResponseObjectDataView) GetFieldFormatsOk() (*map[string]interface{}, bool)` - -GetFieldFormatsOk returns a tuple with the FieldFormats field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetFieldFormats - -`func (o *DataViewResponseObjectDataView) SetFieldFormats(v map[string]interface{})` - -SetFieldFormats sets FieldFormats field to given value. - -### HasFieldFormats - -`func (o *DataViewResponseObjectDataView) HasFieldFormats() bool` - -HasFieldFormats returns a boolean if a field has been set. - -### GetFields - -`func (o *DataViewResponseObjectDataView) GetFields() map[string]interface{}` - -GetFields returns the Fields field if non-nil, zero value otherwise. - -### GetFieldsOk - -`func (o *DataViewResponseObjectDataView) GetFieldsOk() (*map[string]interface{}, bool)` - -GetFieldsOk returns a tuple with the Fields field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetFields - -`func (o *DataViewResponseObjectDataView) SetFields(v map[string]interface{})` - -SetFields sets Fields field to given value. - -### HasFields - -`func (o *DataViewResponseObjectDataView) HasFields() bool` - -HasFields returns a boolean if a field has been set. - -### GetId - -`func (o *DataViewResponseObjectDataView) GetId() string` - -GetId returns the Id field if non-nil, zero value otherwise. - -### GetIdOk - -`func (o *DataViewResponseObjectDataView) 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 *DataViewResponseObjectDataView) SetId(v string)` - -SetId sets Id field to given value. - -### HasId - -`func (o *DataViewResponseObjectDataView) HasId() bool` - -HasId returns a boolean if a field has been set. - -### GetName - -`func (o *DataViewResponseObjectDataView) GetName() string` - -GetName returns the Name field if non-nil, zero value otherwise. - -### GetNameOk - -`func (o *DataViewResponseObjectDataView) 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 *DataViewResponseObjectDataView) SetName(v string)` - -SetName sets Name field to given value. - -### HasName - -`func (o *DataViewResponseObjectDataView) HasName() bool` - -HasName returns a boolean if a field has been set. - -### GetNamespaces - -`func (o *DataViewResponseObjectDataView) GetNamespaces() []string` - -GetNamespaces returns the Namespaces field if non-nil, zero value otherwise. - -### GetNamespacesOk - -`func (o *DataViewResponseObjectDataView) GetNamespacesOk() (*[]string, bool)` - -GetNamespacesOk returns a tuple with the Namespaces field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetNamespaces - -`func (o *DataViewResponseObjectDataView) SetNamespaces(v []string)` - -SetNamespaces sets Namespaces field to given value. - -### HasNamespaces - -`func (o *DataViewResponseObjectDataView) HasNamespaces() bool` - -HasNamespaces returns a boolean if a field has been set. - -### GetRuntimeFieldMap - -`func (o *DataViewResponseObjectDataView) GetRuntimeFieldMap() map[string]interface{}` - -GetRuntimeFieldMap returns the RuntimeFieldMap field if non-nil, zero value otherwise. - -### GetRuntimeFieldMapOk - -`func (o *DataViewResponseObjectDataView) GetRuntimeFieldMapOk() (*map[string]interface{}, bool)` - -GetRuntimeFieldMapOk returns a tuple with the RuntimeFieldMap field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetRuntimeFieldMap - -`func (o *DataViewResponseObjectDataView) SetRuntimeFieldMap(v map[string]interface{})` - -SetRuntimeFieldMap sets RuntimeFieldMap field to given value. - -### HasRuntimeFieldMap - -`func (o *DataViewResponseObjectDataView) HasRuntimeFieldMap() bool` - -HasRuntimeFieldMap returns a boolean if a field has been set. - -### GetSourceFilters - -`func (o *DataViewResponseObjectDataView) GetSourceFilters() []SourcefiltersInner` - -GetSourceFilters returns the SourceFilters field if non-nil, zero value otherwise. - -### GetSourceFiltersOk - -`func (o *DataViewResponseObjectDataView) GetSourceFiltersOk() (*[]SourcefiltersInner, bool)` - -GetSourceFiltersOk returns a tuple with the SourceFilters field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetSourceFilters - -`func (o *DataViewResponseObjectDataView) SetSourceFilters(v []SourcefiltersInner)` - -SetSourceFilters sets SourceFilters field to given value. - -### HasSourceFilters - -`func (o *DataViewResponseObjectDataView) HasSourceFilters() bool` - -HasSourceFilters returns a boolean if a field has been set. - -### GetTimeFieldName - -`func (o *DataViewResponseObjectDataView) GetTimeFieldName() string` - -GetTimeFieldName returns the TimeFieldName field if non-nil, zero value otherwise. - -### GetTimeFieldNameOk - -`func (o *DataViewResponseObjectDataView) GetTimeFieldNameOk() (*string, bool)` - -GetTimeFieldNameOk returns a tuple with the TimeFieldName field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTimeFieldName - -`func (o *DataViewResponseObjectDataView) SetTimeFieldName(v string)` - -SetTimeFieldName sets TimeFieldName field to given value. - -### HasTimeFieldName - -`func (o *DataViewResponseObjectDataView) HasTimeFieldName() bool` - -HasTimeFieldName returns a boolean if a field has been set. - -### GetTitle - -`func (o *DataViewResponseObjectDataView) GetTitle() string` - -GetTitle returns the Title field if non-nil, zero value otherwise. - -### GetTitleOk - -`func (o *DataViewResponseObjectDataView) GetTitleOk() (*string, bool)` - -GetTitleOk returns a tuple with the Title field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTitle - -`func (o *DataViewResponseObjectDataView) SetTitle(v string)` - -SetTitle sets Title field to given value. - -### HasTitle - -`func (o *DataViewResponseObjectDataView) HasTitle() bool` - -HasTitle returns a boolean if a field has been set. - -### GetTypeMeta - -`func (o *DataViewResponseObjectDataView) GetTypeMeta() map[string]interface{}` - -GetTypeMeta returns the TypeMeta field if non-nil, zero value otherwise. - -### GetTypeMetaOk - -`func (o *DataViewResponseObjectDataView) GetTypeMetaOk() (*map[string]interface{}, bool)` - -GetTypeMetaOk returns a tuple with the TypeMeta field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTypeMeta - -`func (o *DataViewResponseObjectDataView) SetTypeMeta(v map[string]interface{})` - -SetTypeMeta sets TypeMeta field to given value. - -### HasTypeMeta - -`func (o *DataViewResponseObjectDataView) HasTypeMeta() bool` - -HasTypeMeta returns a boolean if a field has been set. - -### GetVersion - -`func (o *DataViewResponseObjectDataView) GetVersion() string` - -GetVersion returns the Version field if non-nil, zero value otherwise. - -### GetVersionOk - -`func (o *DataViewResponseObjectDataView) GetVersionOk() (*string, 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 *DataViewResponseObjectDataView) SetVersion(v string)` - -SetVersion sets Version field to given value. - -### HasVersion - -`func (o *DataViewResponseObjectDataView) HasVersion() bool` - -HasVersion 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/data_views/docs/DataViewsAPI.md b/generated/data_views/docs/DataViewsAPI.md deleted file mode 100644 index 4892fe8cd..000000000 --- a/generated/data_views/docs/DataViewsAPI.md +++ /dev/null @@ -1,987 +0,0 @@ -# \DataViewsAPI - -All URIs are relative to *http://localhost* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**CreateDataView**](DataViewsAPI.md#CreateDataView) | **Post** /s/{spaceId}/api/data_views/data_view | Creates a data view. -[**CreateRuntimeField**](DataViewsAPI.md#CreateRuntimeField) | **Post** /s/{spaceId}/api/data_views/data_view/{viewId}/runtime_field | Creates a runtime field. -[**CreateUpdateRuntimeField**](DataViewsAPI.md#CreateUpdateRuntimeField) | **Put** /s/{spaceId}/api/data_views/data_view/{viewId}/runtime_field | Create or update an existing runtime field. -[**DeleteDataView**](DataViewsAPI.md#DeleteDataView) | **Delete** /s/{spaceId}/api/data_views/data_view/{viewId} | Deletes a data view. -[**DeleteRuntimeField**](DataViewsAPI.md#DeleteRuntimeField) | **Delete** /s/{spaceId}/api/data_views/data_view/{viewId}/runtime_field/{fieldName} | Delete a runtime field from a data view. -[**GetAllDataViews**](DataViewsAPI.md#GetAllDataViews) | **Get** /s/{spaceId}/api/data_views | Retrieves a list of all data views. -[**GetDataView**](DataViewsAPI.md#GetDataView) | **Get** /s/{spaceId}/api/data_views/data_view/{viewId} | Retrieves a single data view by identifier. -[**GetDefaultDataView**](DataViewsAPI.md#GetDefaultDataView) | **Get** /s/{spaceId}/api/data_views/default | Retrieves the default data view identifier. -[**GetRuntimeField**](DataViewsAPI.md#GetRuntimeField) | **Get** /s/{spaceId}/api/data_views/data_view/{viewId}/runtime_field/{fieldName} | Retrieves a runtime field. -[**SetDefaultDatailView**](DataViewsAPI.md#SetDefaultDatailView) | **Post** /s/{spaceId}/api/data_views/default | Sets the default data view identifier. -[**UpdateDataView**](DataViewsAPI.md#UpdateDataView) | **Post** /s/{spaceId}/api/data_views/data_view/{viewId} | Updates a data view. -[**UpdateFieldsMetadata**](DataViewsAPI.md#UpdateFieldsMetadata) | **Post** /s/{spaceId}/api/data_views/data_view/{viewId}/fields | Update fields presentation metadata such as count, customLabel and format. -[**UpdateRuntimeField**](DataViewsAPI.md#UpdateRuntimeField) | **Post** /s/{spaceId}/api/data_views/data_view/{viewId}/runtime_field/{fieldName} | Update an existing runtime field. - - - -## CreateDataView - -> DataViewResponseObject CreateDataView(ctx, spaceId).KbnXsrf(kbnXsrf).CreateDataViewRequestObject(createDataViewRequestObject).Execute() - -Creates a data view. - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/elastic/terraform-provider-elasticstack/data_views" -) - -func main() { - kbnXsrf := "kbnXsrf_example" // string | Cross-site request forgery protection - spaceId := "spaceId_example" // string | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. - createDataViewRequestObject := *openapiclient.NewCreateDataViewRequestObject(*openapiclient.NewCreateDataViewRequestObjectDataView("Title_example")) // CreateDataViewRequestObject | - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.DataViewsAPI.CreateDataView(context.Background(), spaceId).KbnXsrf(kbnXsrf).CreateDataViewRequestObject(createDataViewRequestObject).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DataViewsAPI.CreateDataView``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `CreateDataView`: DataViewResponseObject - fmt.Fprintf(os.Stdout, "Response from `DataViewsAPI.CreateDataView`: %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 apiCreateDataViewRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **kbnXsrf** | **string** | Cross-site request forgery protection | - - **createDataViewRequestObject** | [**CreateDataViewRequestObject**](CreateDataViewRequestObject.md) | | - -### Return type - -[**DataViewResponseObject**](DataViewResponseObject.md) - -### Authorization - -[basicAuth](../README.md#basicAuth), [apiKeyAuth](../README.md#apiKeyAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **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) - - -## CreateRuntimeField - -> CreateRuntimeField(ctx, viewId, spaceId).KbnXsrf(kbnXsrf).CreateUpdateRuntimeFieldRequest(createUpdateRuntimeFieldRequest).Execute() - -Creates a runtime field. - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/elastic/terraform-provider-elasticstack/data_views" -) - -func main() { - kbnXsrf := "kbnXsrf_example" // string | Cross-site request forgery protection - viewId := "ff959d40-b880-11e8-a6d9-e546fe2bba5f" // string | An identifier for the data view. - spaceId := "spaceId_example" // string | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. - createUpdateRuntimeFieldRequest := *openapiclient.NewCreateUpdateRuntimeFieldRequest("Name_example", map[string]interface{}(123)) // CreateUpdateRuntimeFieldRequest | - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.DataViewsAPI.CreateRuntimeField(context.Background(), viewId, spaceId).KbnXsrf(kbnXsrf).CreateUpdateRuntimeFieldRequest(createUpdateRuntimeFieldRequest).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DataViewsAPI.CreateRuntimeField``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**viewId** | **string** | An identifier for the data view. | -**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 apiCreateRuntimeFieldRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **kbnXsrf** | **string** | Cross-site request forgery protection | - - - **createUpdateRuntimeFieldRequest** | [**CreateUpdateRuntimeFieldRequest**](CreateUpdateRuntimeFieldRequest.md) | | - -### Return type - - (empty response body) - -### Authorization - -[basicAuth](../README.md#basicAuth), [apiKeyAuth](../README.md#apiKeyAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: Not defined - -[[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) - - -## CreateUpdateRuntimeField - -> CreateUpdateRuntimeField200Response CreateUpdateRuntimeField(ctx, spaceId, viewId).KbnXsrf(kbnXsrf).CreateUpdateRuntimeFieldRequest(createUpdateRuntimeFieldRequest).Execute() - -Create or update an existing runtime field. - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/elastic/terraform-provider-elasticstack/data_views" -) - -func main() { - kbnXsrf := "kbnXsrf_example" // string | Cross-site request forgery protection - spaceId := "spaceId_example" // string | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. - viewId := "viewId_example" // string | The ID of the data view fields you want to update. - createUpdateRuntimeFieldRequest := *openapiclient.NewCreateUpdateRuntimeFieldRequest("Name_example", map[string]interface{}(123)) // CreateUpdateRuntimeFieldRequest | - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.DataViewsAPI.CreateUpdateRuntimeField(context.Background(), spaceId, viewId).KbnXsrf(kbnXsrf).CreateUpdateRuntimeFieldRequest(createUpdateRuntimeFieldRequest).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DataViewsAPI.CreateUpdateRuntimeField``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `CreateUpdateRuntimeField`: CreateUpdateRuntimeField200Response - fmt.Fprintf(os.Stdout, "Response from `DataViewsAPI.CreateUpdateRuntimeField`: %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. | -**viewId** | **string** | The ID of the data view fields you want to update. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiCreateUpdateRuntimeFieldRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **kbnXsrf** | **string** | Cross-site request forgery protection | - - - **createUpdateRuntimeFieldRequest** | [**CreateUpdateRuntimeFieldRequest**](CreateUpdateRuntimeFieldRequest.md) | | - -### Return type - -[**CreateUpdateRuntimeField200Response**](CreateUpdateRuntimeField200Response.md) - -### Authorization - -[basicAuth](../README.md#basicAuth), [apiKeyAuth](../README.md#apiKeyAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **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) - - -## DeleteDataView - -> DeleteDataView(ctx, viewId, spaceId).KbnXsrf(kbnXsrf).Execute() - -Deletes a data view. - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/elastic/terraform-provider-elasticstack/data_views" -) - -func main() { - kbnXsrf := "kbnXsrf_example" // string | Cross-site request forgery protection - viewId := "ff959d40-b880-11e8-a6d9-e546fe2bba5f" // string | An identifier for the data view. - spaceId := "spaceId_example" // string | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.DataViewsAPI.DeleteDataView(context.Background(), viewId, spaceId).KbnXsrf(kbnXsrf).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DataViewsAPI.DeleteDataView``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**viewId** | **string** | An identifier for the data view. | -**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 apiDeleteDataViewRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **kbnXsrf** | **string** | Cross-site request forgery protection | - - - -### Return type - - (empty response body) - -### Authorization - -[basicAuth](../README.md#basicAuth), [apiKeyAuth](../README.md#apiKeyAuth) - -### 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) - - -## DeleteRuntimeField - -> DeleteRuntimeField(ctx, fieldName, viewId, spaceId).Execute() - -Delete a runtime field from a data view. - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/elastic/terraform-provider-elasticstack/data_views" -) - -func main() { - fieldName := "hour_of_day" // string | The name of the runtime field. - viewId := "ff959d40-b880-11e8-a6d9-e546fe2bba5f" // string | An identifier for the data view. - spaceId := "spaceId_example" // string | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.DataViewsAPI.DeleteRuntimeField(context.Background(), fieldName, viewId, spaceId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DataViewsAPI.DeleteRuntimeField``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**fieldName** | **string** | The name of the runtime field. | -**viewId** | **string** | An identifier for the data view. | -**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 apiDeleteRuntimeFieldRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - - -### Return type - - (empty response body) - -### Authorization - -[basicAuth](../README.md#basicAuth), [apiKeyAuth](../README.md#apiKeyAuth) - -### 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) - - -## GetAllDataViews - -> GetAllDataViews200Response GetAllDataViews(ctx, spaceId).Execute() - -Retrieves a list of all data views. - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/elastic/terraform-provider-elasticstack/data_views" -) - -func main() { - spaceId := "spaceId_example" // string | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.DataViewsAPI.GetAllDataViews(context.Background(), spaceId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DataViewsAPI.GetAllDataViews``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetAllDataViews`: GetAllDataViews200Response - fmt.Fprintf(os.Stdout, "Response from `DataViewsAPI.GetAllDataViews`: %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 apiGetAllDataViewsRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - -### Return type - -[**GetAllDataViews200Response**](GetAllDataViews200Response.md) - -### Authorization - -[basicAuth](../README.md#basicAuth), [apiKeyAuth](../README.md#apiKeyAuth) - -### 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) - - -## GetDataView - -> DataViewResponseObject GetDataView(ctx, viewId, spaceId).Execute() - -Retrieves a single data view by identifier. - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/elastic/terraform-provider-elasticstack/data_views" -) - -func main() { - viewId := "ff959d40-b880-11e8-a6d9-e546fe2bba5f" // string | An identifier for the data view. - spaceId := "spaceId_example" // string | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.DataViewsAPI.GetDataView(context.Background(), viewId, spaceId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DataViewsAPI.GetDataView``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetDataView`: DataViewResponseObject - fmt.Fprintf(os.Stdout, "Response from `DataViewsAPI.GetDataView`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**viewId** | **string** | An identifier for the data view. | -**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 apiGetDataViewRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - -### Return type - -[**DataViewResponseObject**](DataViewResponseObject.md) - -### Authorization - -[basicAuth](../README.md#basicAuth), [apiKeyAuth](../README.md#apiKeyAuth) - -### 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) - - -## GetDefaultDataView - -> GetDefaultDataView200Response GetDefaultDataView(ctx, spaceId).Execute() - -Retrieves the default data view identifier. - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/elastic/terraform-provider-elasticstack/data_views" -) - -func main() { - spaceId := "spaceId_example" // string | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.DataViewsAPI.GetDefaultDataView(context.Background(), spaceId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DataViewsAPI.GetDefaultDataView``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetDefaultDataView`: GetDefaultDataView200Response - fmt.Fprintf(os.Stdout, "Response from `DataViewsAPI.GetDefaultDataView`: %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 apiGetDefaultDataViewRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - -### Return type - -[**GetDefaultDataView200Response**](GetDefaultDataView200Response.md) - -### Authorization - -[basicAuth](../README.md#basicAuth), [apiKeyAuth](../README.md#apiKeyAuth) - -### 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) - - -## GetRuntimeField - -> CreateUpdateRuntimeField200Response GetRuntimeField(ctx, fieldName, viewId, spaceId).Execute() - -Retrieves a runtime field. - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/elastic/terraform-provider-elasticstack/data_views" -) - -func main() { - fieldName := "hour_of_day" // string | The name of the runtime field. - viewId := "ff959d40-b880-11e8-a6d9-e546fe2bba5f" // string | An identifier for the data view. - spaceId := "spaceId_example" // string | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.DataViewsAPI.GetRuntimeField(context.Background(), fieldName, viewId, spaceId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DataViewsAPI.GetRuntimeField``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetRuntimeField`: CreateUpdateRuntimeField200Response - fmt.Fprintf(os.Stdout, "Response from `DataViewsAPI.GetRuntimeField`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**fieldName** | **string** | The name of the runtime field. | -**viewId** | **string** | An identifier for the data view. | -**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 apiGetRuntimeFieldRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - - -### Return type - -[**CreateUpdateRuntimeField200Response**](CreateUpdateRuntimeField200Response.md) - -### Authorization - -[basicAuth](../README.md#basicAuth), [apiKeyAuth](../README.md#apiKeyAuth) - -### 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) - - -## SetDefaultDatailView - -> SetDefaultDatailView200Response SetDefaultDatailView(ctx, spaceId).KbnXsrf(kbnXsrf).SetDefaultDatailViewRequest(setDefaultDatailViewRequest).Execute() - -Sets the default data view identifier. - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/elastic/terraform-provider-elasticstack/data_views" -) - -func main() { - kbnXsrf := "kbnXsrf_example" // string | Cross-site request forgery protection - spaceId := "spaceId_example" // string | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. - setDefaultDatailViewRequest := *openapiclient.NewSetDefaultDatailViewRequest(interface{}(123)) // SetDefaultDatailViewRequest | - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.DataViewsAPI.SetDefaultDatailView(context.Background(), spaceId).KbnXsrf(kbnXsrf).SetDefaultDatailViewRequest(setDefaultDatailViewRequest).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DataViewsAPI.SetDefaultDatailView``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `SetDefaultDatailView`: SetDefaultDatailView200Response - fmt.Fprintf(os.Stdout, "Response from `DataViewsAPI.SetDefaultDatailView`: %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 apiSetDefaultDatailViewRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **kbnXsrf** | **string** | Cross-site request forgery protection | - - **setDefaultDatailViewRequest** | [**SetDefaultDatailViewRequest**](SetDefaultDatailViewRequest.md) | | - -### Return type - -[**SetDefaultDatailView200Response**](SetDefaultDatailView200Response.md) - -### Authorization - -[basicAuth](../README.md#basicAuth), [apiKeyAuth](../README.md#apiKeyAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **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) - - -## UpdateDataView - -> DataViewResponseObject UpdateDataView(ctx, viewId, spaceId).KbnXsrf(kbnXsrf).UpdateDataViewRequestObject(updateDataViewRequestObject).Execute() - -Updates a data view. - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/elastic/terraform-provider-elasticstack/data_views" -) - -func main() { - kbnXsrf := "kbnXsrf_example" // string | Cross-site request forgery protection - viewId := "ff959d40-b880-11e8-a6d9-e546fe2bba5f" // string | An identifier for the data view. - spaceId := "spaceId_example" // string | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. - updateDataViewRequestObject := *openapiclient.NewUpdateDataViewRequestObject(*openapiclient.NewUpdateDataViewRequestObjectDataView()) // UpdateDataViewRequestObject | - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.DataViewsAPI.UpdateDataView(context.Background(), viewId, spaceId).KbnXsrf(kbnXsrf).UpdateDataViewRequestObject(updateDataViewRequestObject).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DataViewsAPI.UpdateDataView``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `UpdateDataView`: DataViewResponseObject - fmt.Fprintf(os.Stdout, "Response from `DataViewsAPI.UpdateDataView`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**viewId** | **string** | An identifier for the data view. | -**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 apiUpdateDataViewRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **kbnXsrf** | **string** | Cross-site request forgery protection | - - - **updateDataViewRequestObject** | [**UpdateDataViewRequestObject**](UpdateDataViewRequestObject.md) | | - -### Return type - -[**DataViewResponseObject**](DataViewResponseObject.md) - -### Authorization - -[basicAuth](../README.md#basicAuth), [apiKeyAuth](../README.md#apiKeyAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **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) - - -## UpdateFieldsMetadata - -> SetDefaultDatailView200Response UpdateFieldsMetadata(ctx, viewId, spaceId).KbnXsrf(kbnXsrf).UpdateFieldsMetadataRequest(updateFieldsMetadataRequest).Execute() - -Update fields presentation metadata such as count, customLabel and format. - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/elastic/terraform-provider-elasticstack/data_views" -) - -func main() { - kbnXsrf := "kbnXsrf_example" // string | Cross-site request forgery protection - viewId := "ff959d40-b880-11e8-a6d9-e546fe2bba5f" // string | An identifier for the data view. - spaceId := "spaceId_example" // string | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. - updateFieldsMetadataRequest := *openapiclient.NewUpdateFieldsMetadataRequest(map[string]interface{}(123)) // UpdateFieldsMetadataRequest | - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.DataViewsAPI.UpdateFieldsMetadata(context.Background(), viewId, spaceId).KbnXsrf(kbnXsrf).UpdateFieldsMetadataRequest(updateFieldsMetadataRequest).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DataViewsAPI.UpdateFieldsMetadata``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `UpdateFieldsMetadata`: SetDefaultDatailView200Response - fmt.Fprintf(os.Stdout, "Response from `DataViewsAPI.UpdateFieldsMetadata`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**viewId** | **string** | An identifier for the data view. | -**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 apiUpdateFieldsMetadataRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **kbnXsrf** | **string** | Cross-site request forgery protection | - - - **updateFieldsMetadataRequest** | [**UpdateFieldsMetadataRequest**](UpdateFieldsMetadataRequest.md) | | - -### Return type - -[**SetDefaultDatailView200Response**](SetDefaultDatailView200Response.md) - -### Authorization - -[basicAuth](../README.md#basicAuth), [apiKeyAuth](../README.md#apiKeyAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **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) - - -## UpdateRuntimeField - -> UpdateRuntimeField(ctx, fieldName, viewId, spaceId).UpdateRuntimeFieldRequest(updateRuntimeFieldRequest).Execute() - -Update an existing runtime field. - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/elastic/terraform-provider-elasticstack/data_views" -) - -func main() { - fieldName := "hour_of_day" // string | The name of the runtime field. - viewId := "ff959d40-b880-11e8-a6d9-e546fe2bba5f" // string | An identifier for the data view. - spaceId := "spaceId_example" // string | An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used. - updateRuntimeFieldRequest := *openapiclient.NewUpdateRuntimeFieldRequest(map[string]interface{}(123)) // UpdateRuntimeFieldRequest | - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.DataViewsAPI.UpdateRuntimeField(context.Background(), fieldName, viewId, spaceId).UpdateRuntimeFieldRequest(updateRuntimeFieldRequest).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DataViewsAPI.UpdateRuntimeField``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**fieldName** | **string** | The name of the runtime field. | -**viewId** | **string** | An identifier for the data view. | -**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 apiUpdateRuntimeFieldRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - - **updateRuntimeFieldRequest** | [**UpdateRuntimeFieldRequest**](UpdateRuntimeFieldRequest.md) | | - -### Return type - - (empty response body) - -### Authorization - -[basicAuth](../README.md#basicAuth), [apiKeyAuth](../README.md#apiKeyAuth) - -### HTTP request headers - -- **Content-Type**: application/json -- **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) - diff --git a/generated/data_views/docs/GetAllDataViews200Response.md b/generated/data_views/docs/GetAllDataViews200Response.md deleted file mode 100644 index 3120b686e..000000000 --- a/generated/data_views/docs/GetAllDataViews200Response.md +++ /dev/null @@ -1,56 +0,0 @@ -# GetAllDataViews200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**DataView** | Pointer to [**[]GetAllDataViews200ResponseDataViewInner**](GetAllDataViews200ResponseDataViewInner.md) | | [optional] - -## Methods - -### NewGetAllDataViews200Response - -`func NewGetAllDataViews200Response() *GetAllDataViews200Response` - -NewGetAllDataViews200Response instantiates a new GetAllDataViews200Response 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 - -### NewGetAllDataViews200ResponseWithDefaults - -`func NewGetAllDataViews200ResponseWithDefaults() *GetAllDataViews200Response` - -NewGetAllDataViews200ResponseWithDefaults instantiates a new GetAllDataViews200Response 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 - -### GetDataView - -`func (o *GetAllDataViews200Response) GetDataView() []GetAllDataViews200ResponseDataViewInner` - -GetDataView returns the DataView field if non-nil, zero value otherwise. - -### GetDataViewOk - -`func (o *GetAllDataViews200Response) GetDataViewOk() (*[]GetAllDataViews200ResponseDataViewInner, bool)` - -GetDataViewOk returns a tuple with the DataView field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDataView - -`func (o *GetAllDataViews200Response) SetDataView(v []GetAllDataViews200ResponseDataViewInner)` - -SetDataView sets DataView field to given value. - -### HasDataView - -`func (o *GetAllDataViews200Response) HasDataView() bool` - -HasDataView 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/data_views/docs/GetAllDataViews200ResponseDataViewInner.md b/generated/data_views/docs/GetAllDataViews200ResponseDataViewInner.md deleted file mode 100644 index 9f145f74c..000000000 --- a/generated/data_views/docs/GetAllDataViews200ResponseDataViewInner.md +++ /dev/null @@ -1,160 +0,0 @@ -# GetAllDataViews200ResponseDataViewInner - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | Pointer to **string** | | [optional] -**Name** | Pointer to **string** | | [optional] -**Namespaces** | Pointer to **[]string** | | [optional] -**Title** | Pointer to **string** | | [optional] -**TypeMeta** | Pointer to **map[string]interface{}** | | [optional] - -## Methods - -### NewGetAllDataViews200ResponseDataViewInner - -`func NewGetAllDataViews200ResponseDataViewInner() *GetAllDataViews200ResponseDataViewInner` - -NewGetAllDataViews200ResponseDataViewInner instantiates a new GetAllDataViews200ResponseDataViewInner 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 - -### NewGetAllDataViews200ResponseDataViewInnerWithDefaults - -`func NewGetAllDataViews200ResponseDataViewInnerWithDefaults() *GetAllDataViews200ResponseDataViewInner` - -NewGetAllDataViews200ResponseDataViewInnerWithDefaults instantiates a new GetAllDataViews200ResponseDataViewInner 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 *GetAllDataViews200ResponseDataViewInner) GetId() string` - -GetId returns the Id field if non-nil, zero value otherwise. - -### GetIdOk - -`func (o *GetAllDataViews200ResponseDataViewInner) 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 *GetAllDataViews200ResponseDataViewInner) SetId(v string)` - -SetId sets Id field to given value. - -### HasId - -`func (o *GetAllDataViews200ResponseDataViewInner) HasId() bool` - -HasId returns a boolean if a field has been set. - -### GetName - -`func (o *GetAllDataViews200ResponseDataViewInner) GetName() string` - -GetName returns the Name field if non-nil, zero value otherwise. - -### GetNameOk - -`func (o *GetAllDataViews200ResponseDataViewInner) 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 *GetAllDataViews200ResponseDataViewInner) SetName(v string)` - -SetName sets Name field to given value. - -### HasName - -`func (o *GetAllDataViews200ResponseDataViewInner) HasName() bool` - -HasName returns a boolean if a field has been set. - -### GetNamespaces - -`func (o *GetAllDataViews200ResponseDataViewInner) GetNamespaces() []string` - -GetNamespaces returns the Namespaces field if non-nil, zero value otherwise. - -### GetNamespacesOk - -`func (o *GetAllDataViews200ResponseDataViewInner) GetNamespacesOk() (*[]string, bool)` - -GetNamespacesOk returns a tuple with the Namespaces field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetNamespaces - -`func (o *GetAllDataViews200ResponseDataViewInner) SetNamespaces(v []string)` - -SetNamespaces sets Namespaces field to given value. - -### HasNamespaces - -`func (o *GetAllDataViews200ResponseDataViewInner) HasNamespaces() bool` - -HasNamespaces returns a boolean if a field has been set. - -### GetTitle - -`func (o *GetAllDataViews200ResponseDataViewInner) GetTitle() string` - -GetTitle returns the Title field if non-nil, zero value otherwise. - -### GetTitleOk - -`func (o *GetAllDataViews200ResponseDataViewInner) GetTitleOk() (*string, bool)` - -GetTitleOk returns a tuple with the Title field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTitle - -`func (o *GetAllDataViews200ResponseDataViewInner) SetTitle(v string)` - -SetTitle sets Title field to given value. - -### HasTitle - -`func (o *GetAllDataViews200ResponseDataViewInner) HasTitle() bool` - -HasTitle returns a boolean if a field has been set. - -### GetTypeMeta - -`func (o *GetAllDataViews200ResponseDataViewInner) GetTypeMeta() map[string]interface{}` - -GetTypeMeta returns the TypeMeta field if non-nil, zero value otherwise. - -### GetTypeMetaOk - -`func (o *GetAllDataViews200ResponseDataViewInner) GetTypeMetaOk() (*map[string]interface{}, bool)` - -GetTypeMetaOk returns a tuple with the TypeMeta field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTypeMeta - -`func (o *GetAllDataViews200ResponseDataViewInner) SetTypeMeta(v map[string]interface{})` - -SetTypeMeta sets TypeMeta field to given value. - -### HasTypeMeta - -`func (o *GetAllDataViews200ResponseDataViewInner) HasTypeMeta() bool` - -HasTypeMeta 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/data_views/docs/GetDefaultDataView200Response.md b/generated/data_views/docs/GetDefaultDataView200Response.md deleted file mode 100644 index d83f33709..000000000 --- a/generated/data_views/docs/GetDefaultDataView200Response.md +++ /dev/null @@ -1,56 +0,0 @@ -# GetDefaultDataView200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**DataViewId** | Pointer to **string** | | [optional] - -## Methods - -### NewGetDefaultDataView200Response - -`func NewGetDefaultDataView200Response() *GetDefaultDataView200Response` - -NewGetDefaultDataView200Response instantiates a new GetDefaultDataView200Response 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 - -### NewGetDefaultDataView200ResponseWithDefaults - -`func NewGetDefaultDataView200ResponseWithDefaults() *GetDefaultDataView200Response` - -NewGetDefaultDataView200ResponseWithDefaults instantiates a new GetDefaultDataView200Response 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 - -### GetDataViewId - -`func (o *GetDefaultDataView200Response) GetDataViewId() string` - -GetDataViewId returns the DataViewId field if non-nil, zero value otherwise. - -### GetDataViewIdOk - -`func (o *GetDefaultDataView200Response) 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 *GetDefaultDataView200Response) SetDataViewId(v string)` - -SetDataViewId sets DataViewId field to given value. - -### HasDataViewId - -`func (o *GetDefaultDataView200Response) HasDataViewId() bool` - -HasDataViewId 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/data_views/docs/GetRuntimeField200Response.md b/generated/data_views/docs/GetRuntimeField200Response.md deleted file mode 100644 index 0994054a3..000000000 --- a/generated/data_views/docs/GetRuntimeField200Response.md +++ /dev/null @@ -1,82 +0,0 @@ -# GetRuntimeField200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**DataView** | Pointer to **map[string]interface{}** | | [optional] -**Fields** | Pointer to **[]map[string]interface{}** | | [optional] - -## Methods - -### NewGetRuntimeField200Response - -`func NewGetRuntimeField200Response() *GetRuntimeField200Response` - -NewGetRuntimeField200Response instantiates a new GetRuntimeField200Response 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 - -### NewGetRuntimeField200ResponseWithDefaults - -`func NewGetRuntimeField200ResponseWithDefaults() *GetRuntimeField200Response` - -NewGetRuntimeField200ResponseWithDefaults instantiates a new GetRuntimeField200Response 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 - -### GetDataView - -`func (o *GetRuntimeField200Response) GetDataView() map[string]interface{}` - -GetDataView returns the DataView field if non-nil, zero value otherwise. - -### GetDataViewOk - -`func (o *GetRuntimeField200Response) GetDataViewOk() (*map[string]interface{}, bool)` - -GetDataViewOk returns a tuple with the DataView field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDataView - -`func (o *GetRuntimeField200Response) SetDataView(v map[string]interface{})` - -SetDataView sets DataView field to given value. - -### HasDataView - -`func (o *GetRuntimeField200Response) HasDataView() bool` - -HasDataView returns a boolean if a field has been set. - -### GetFields - -`func (o *GetRuntimeField200Response) GetFields() []map[string]interface{}` - -GetFields returns the Fields field if non-nil, zero value otherwise. - -### GetFieldsOk - -`func (o *GetRuntimeField200Response) GetFieldsOk() (*[]map[string]interface{}, bool)` - -GetFieldsOk returns a tuple with the Fields field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetFields - -`func (o *GetRuntimeField200Response) SetFields(v []map[string]interface{})` - -SetFields sets Fields field to given value. - -### HasFields - -`func (o *GetRuntimeField200Response) HasFields() bool` - -HasFields 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/data_views/docs/Model400Response.md b/generated/data_views/docs/Model400Response.md deleted file mode 100644 index 3ddd9fbe5..000000000 --- a/generated/data_views/docs/Model400Response.md +++ /dev/null @@ -1,93 +0,0 @@ -# Model400Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**StatusCode** | **float32** | | -**Error** | **string** | | -**Message** | **string** | | - -## Methods - -### NewModel400Response - -`func NewModel400Response(statusCode float32, error_ string, message string, ) *Model400Response` - -NewModel400Response instantiates a new Model400Response 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 - -### NewModel400ResponseWithDefaults - -`func NewModel400ResponseWithDefaults() *Model400Response` - -NewModel400ResponseWithDefaults instantiates a new Model400Response 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 - -### GetStatusCode - -`func (o *Model400Response) GetStatusCode() float32` - -GetStatusCode returns the StatusCode field if non-nil, zero value otherwise. - -### GetStatusCodeOk - -`func (o *Model400Response) GetStatusCodeOk() (*float32, bool)` - -GetStatusCodeOk returns a tuple with the StatusCode field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetStatusCode - -`func (o *Model400Response) SetStatusCode(v float32)` - -SetStatusCode sets StatusCode field to given value. - - -### GetError - -`func (o *Model400Response) GetError() string` - -GetError returns the Error field if non-nil, zero value otherwise. - -### GetErrorOk - -`func (o *Model400Response) GetErrorOk() (*string, bool)` - -GetErrorOk returns a tuple with the Error field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetError - -`func (o *Model400Response) SetError(v string)` - -SetError sets Error field to given value. - - -### GetMessage - -`func (o *Model400Response) GetMessage() string` - -GetMessage returns the Message field if non-nil, zero value otherwise. - -### GetMessageOk - -`func (o *Model400Response) GetMessageOk() (*string, bool)` - -GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMessage - -`func (o *Model400Response) SetMessage(v string)` - -SetMessage sets Message 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/data_views/docs/Model404Response.md b/generated/data_views/docs/Model404Response.md deleted file mode 100644 index 1bfd84837..000000000 --- a/generated/data_views/docs/Model404Response.md +++ /dev/null @@ -1,108 +0,0 @@ -# Model404Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Error** | Pointer to **string** | | [optional] -**Message** | Pointer to **string** | | [optional] -**StatusCode** | Pointer to **int32** | | [optional] - -## Methods - -### NewModel404Response - -`func NewModel404Response() *Model404Response` - -NewModel404Response instantiates a new Model404Response 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 - -### NewModel404ResponseWithDefaults - -`func NewModel404ResponseWithDefaults() *Model404Response` - -NewModel404ResponseWithDefaults instantiates a new Model404Response 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 - -### GetError - -`func (o *Model404Response) GetError() string` - -GetError returns the Error field if non-nil, zero value otherwise. - -### GetErrorOk - -`func (o *Model404Response) GetErrorOk() (*string, bool)` - -GetErrorOk returns a tuple with the Error field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetError - -`func (o *Model404Response) SetError(v string)` - -SetError sets Error field to given value. - -### HasError - -`func (o *Model404Response) HasError() bool` - -HasError returns a boolean if a field has been set. - -### GetMessage - -`func (o *Model404Response) GetMessage() string` - -GetMessage returns the Message field if non-nil, zero value otherwise. - -### GetMessageOk - -`func (o *Model404Response) GetMessageOk() (*string, bool)` - -GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMessage - -`func (o *Model404Response) SetMessage(v string)` - -SetMessage sets Message field to given value. - -### HasMessage - -`func (o *Model404Response) HasMessage() bool` - -HasMessage returns a boolean if a field has been set. - -### GetStatusCode - -`func (o *Model404Response) GetStatusCode() int32` - -GetStatusCode returns the StatusCode field if non-nil, zero value otherwise. - -### GetStatusCodeOk - -`func (o *Model404Response) GetStatusCodeOk() (*int32, bool)` - -GetStatusCodeOk returns a tuple with the StatusCode field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetStatusCode - -`func (o *Model404Response) SetStatusCode(v int32)` - -SetStatusCode sets StatusCode field to given value. - -### HasStatusCode - -`func (o *Model404Response) HasStatusCode() bool` - -HasStatusCode 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/data_views/docs/SetDefaultDatailView200Response.md b/generated/data_views/docs/SetDefaultDatailView200Response.md deleted file mode 100644 index 08ee3502a..000000000 --- a/generated/data_views/docs/SetDefaultDatailView200Response.md +++ /dev/null @@ -1,56 +0,0 @@ -# SetDefaultDatailView200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Acknowledged** | Pointer to **bool** | | [optional] - -## Methods - -### NewSetDefaultDatailView200Response - -`func NewSetDefaultDatailView200Response() *SetDefaultDatailView200Response` - -NewSetDefaultDatailView200Response instantiates a new SetDefaultDatailView200Response 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 - -### NewSetDefaultDatailView200ResponseWithDefaults - -`func NewSetDefaultDatailView200ResponseWithDefaults() *SetDefaultDatailView200Response` - -NewSetDefaultDatailView200ResponseWithDefaults instantiates a new SetDefaultDatailView200Response 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 - -### GetAcknowledged - -`func (o *SetDefaultDatailView200Response) GetAcknowledged() bool` - -GetAcknowledged returns the Acknowledged field if non-nil, zero value otherwise. - -### GetAcknowledgedOk - -`func (o *SetDefaultDatailView200Response) GetAcknowledgedOk() (*bool, bool)` - -GetAcknowledgedOk returns a tuple with the Acknowledged field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetAcknowledged - -`func (o *SetDefaultDatailView200Response) SetAcknowledged(v bool)` - -SetAcknowledged sets Acknowledged field to given value. - -### HasAcknowledged - -`func (o *SetDefaultDatailView200Response) HasAcknowledged() bool` - -HasAcknowledged 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/data_views/docs/SetDefaultDatailViewRequest.md b/generated/data_views/docs/SetDefaultDatailViewRequest.md deleted file mode 100644 index d33ef8986..000000000 --- a/generated/data_views/docs/SetDefaultDatailViewRequest.md +++ /dev/null @@ -1,87 +0,0 @@ -# SetDefaultDatailViewRequest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**DataViewId** | **interface{}** | The data view identifier. NOTE: The API does not validate whether it is a valid identifier. Use `null` to unset the default data view. | -**Force** | Pointer to **bool** | Update an existing default data view identifier. | [optional] [default to false] - -## Methods - -### NewSetDefaultDatailViewRequest - -`func NewSetDefaultDatailViewRequest(dataViewId interface{}, ) *SetDefaultDatailViewRequest` - -NewSetDefaultDatailViewRequest instantiates a new SetDefaultDatailViewRequest 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 - -### NewSetDefaultDatailViewRequestWithDefaults - -`func NewSetDefaultDatailViewRequestWithDefaults() *SetDefaultDatailViewRequest` - -NewSetDefaultDatailViewRequestWithDefaults instantiates a new SetDefaultDatailViewRequest 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 - -### GetDataViewId - -`func (o *SetDefaultDatailViewRequest) GetDataViewId() interface{}` - -GetDataViewId returns the DataViewId field if non-nil, zero value otherwise. - -### GetDataViewIdOk - -`func (o *SetDefaultDatailViewRequest) GetDataViewIdOk() (*interface{}, 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 *SetDefaultDatailViewRequest) SetDataViewId(v interface{})` - -SetDataViewId sets DataViewId field to given value. - - -### SetDataViewIdNil - -`func (o *SetDefaultDatailViewRequest) SetDataViewIdNil(b bool)` - - SetDataViewIdNil sets the value for DataViewId to be an explicit nil - -### UnsetDataViewId -`func (o *SetDefaultDatailViewRequest) UnsetDataViewId()` - -UnsetDataViewId ensures that no value is present for DataViewId, not even an explicit nil -### GetForce - -`func (o *SetDefaultDatailViewRequest) GetForce() bool` - -GetForce returns the Force field if non-nil, zero value otherwise. - -### GetForceOk - -`func (o *SetDefaultDatailViewRequest) GetForceOk() (*bool, bool)` - -GetForceOk returns a tuple with the Force field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetForce - -`func (o *SetDefaultDatailViewRequest) SetForce(v bool)` - -SetForce sets Force field to given value. - -### HasForce - -`func (o *SetDefaultDatailViewRequest) HasForce() bool` - -HasForce 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/data_views/docs/SourcefiltersInner.md b/generated/data_views/docs/SourcefiltersInner.md deleted file mode 100644 index 653e07a54..000000000 --- a/generated/data_views/docs/SourcefiltersInner.md +++ /dev/null @@ -1,51 +0,0 @@ -# SourcefiltersInner - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Value** | **string** | | - -## Methods - -### NewSourcefiltersInner - -`func NewSourcefiltersInner(value string, ) *SourcefiltersInner` - -NewSourcefiltersInner instantiates a new SourcefiltersInner 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 - -### NewSourcefiltersInnerWithDefaults - -`func NewSourcefiltersInnerWithDefaults() *SourcefiltersInner` - -NewSourcefiltersInnerWithDefaults instantiates a new SourcefiltersInner 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 - -### GetValue - -`func (o *SourcefiltersInner) GetValue() string` - -GetValue returns the Value field if non-nil, zero value otherwise. - -### GetValueOk - -`func (o *SourcefiltersInner) 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 *SourcefiltersInner) SetValue(v string)` - -SetValue sets Value 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/data_views/docs/UpdateDataViewRequestObject.md b/generated/data_views/docs/UpdateDataViewRequestObject.md deleted file mode 100644 index e94a1a3ed..000000000 --- a/generated/data_views/docs/UpdateDataViewRequestObject.md +++ /dev/null @@ -1,77 +0,0 @@ -# UpdateDataViewRequestObject - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**DataView** | [**UpdateDataViewRequestObjectDataView**](UpdateDataViewRequestObjectDataView.md) | | -**RefreshFields** | Pointer to **bool** | Reloads the data view fields after the data view is updated. | [optional] [default to false] - -## Methods - -### NewUpdateDataViewRequestObject - -`func NewUpdateDataViewRequestObject(dataView UpdateDataViewRequestObjectDataView, ) *UpdateDataViewRequestObject` - -NewUpdateDataViewRequestObject instantiates a new UpdateDataViewRequestObject 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 - -### NewUpdateDataViewRequestObjectWithDefaults - -`func NewUpdateDataViewRequestObjectWithDefaults() *UpdateDataViewRequestObject` - -NewUpdateDataViewRequestObjectWithDefaults instantiates a new UpdateDataViewRequestObject 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 - -### GetDataView - -`func (o *UpdateDataViewRequestObject) GetDataView() UpdateDataViewRequestObjectDataView` - -GetDataView returns the DataView field if non-nil, zero value otherwise. - -### GetDataViewOk - -`func (o *UpdateDataViewRequestObject) GetDataViewOk() (*UpdateDataViewRequestObjectDataView, bool)` - -GetDataViewOk returns a tuple with the DataView field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDataView - -`func (o *UpdateDataViewRequestObject) SetDataView(v UpdateDataViewRequestObjectDataView)` - -SetDataView sets DataView field to given value. - - -### GetRefreshFields - -`func (o *UpdateDataViewRequestObject) GetRefreshFields() bool` - -GetRefreshFields returns the RefreshFields field if non-nil, zero value otherwise. - -### GetRefreshFieldsOk - -`func (o *UpdateDataViewRequestObject) GetRefreshFieldsOk() (*bool, bool)` - -GetRefreshFieldsOk returns a tuple with the RefreshFields field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetRefreshFields - -`func (o *UpdateDataViewRequestObject) SetRefreshFields(v bool)` - -SetRefreshFields sets RefreshFields field to given value. - -### HasRefreshFields - -`func (o *UpdateDataViewRequestObject) HasRefreshFields() bool` - -HasRefreshFields 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/data_views/docs/UpdateDataViewRequestObjectDataView.md b/generated/data_views/docs/UpdateDataViewRequestObjectDataView.md deleted file mode 100644 index 6ca9e7c06..000000000 --- a/generated/data_views/docs/UpdateDataViewRequestObjectDataView.md +++ /dev/null @@ -1,290 +0,0 @@ -# UpdateDataViewRequestObjectDataView - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**AllowNoIndex** | Pointer to **bool** | Allows the data view saved object to exist before the data is available. | [optional] -**FieldFormats** | Pointer to **map[string]interface{}** | A map of field formats by field name. | [optional] -**Fields** | Pointer to **map[string]interface{}** | | [optional] -**Name** | Pointer to **string** | | [optional] -**RuntimeFieldMap** | Pointer to **map[string]interface{}** | A map of runtime field definitions by field name. | [optional] -**SourceFilters** | Pointer to [**[]SourcefiltersInner**](SourcefiltersInner.md) | The array of field names you want to filter out in Discover. | [optional] -**TimeFieldName** | Pointer to **string** | The timestamp field name, which you use for time-based data views. | [optional] -**Title** | Pointer to **string** | Comma-separated list of data streams, indices, and aliases that you want to search. Supports wildcards (`*`). | [optional] -**Type** | Pointer to **string** | When set to `rollup`, identifies the rollup data views. | [optional] -**TypeMeta** | Pointer to **map[string]interface{}** | When you use rollup indices, contains the field list for the rollup data view API endpoints. | [optional] - -## Methods - -### NewUpdateDataViewRequestObjectDataView - -`func NewUpdateDataViewRequestObjectDataView() *UpdateDataViewRequestObjectDataView` - -NewUpdateDataViewRequestObjectDataView instantiates a new UpdateDataViewRequestObjectDataView 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 - -### NewUpdateDataViewRequestObjectDataViewWithDefaults - -`func NewUpdateDataViewRequestObjectDataViewWithDefaults() *UpdateDataViewRequestObjectDataView` - -NewUpdateDataViewRequestObjectDataViewWithDefaults instantiates a new UpdateDataViewRequestObjectDataView 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 - -### GetAllowNoIndex - -`func (o *UpdateDataViewRequestObjectDataView) GetAllowNoIndex() bool` - -GetAllowNoIndex returns the AllowNoIndex field if non-nil, zero value otherwise. - -### GetAllowNoIndexOk - -`func (o *UpdateDataViewRequestObjectDataView) GetAllowNoIndexOk() (*bool, bool)` - -GetAllowNoIndexOk returns a tuple with the AllowNoIndex field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetAllowNoIndex - -`func (o *UpdateDataViewRequestObjectDataView) SetAllowNoIndex(v bool)` - -SetAllowNoIndex sets AllowNoIndex field to given value. - -### HasAllowNoIndex - -`func (o *UpdateDataViewRequestObjectDataView) HasAllowNoIndex() bool` - -HasAllowNoIndex returns a boolean if a field has been set. - -### GetFieldFormats - -`func (o *UpdateDataViewRequestObjectDataView) GetFieldFormats() map[string]interface{}` - -GetFieldFormats returns the FieldFormats field if non-nil, zero value otherwise. - -### GetFieldFormatsOk - -`func (o *UpdateDataViewRequestObjectDataView) GetFieldFormatsOk() (*map[string]interface{}, bool)` - -GetFieldFormatsOk returns a tuple with the FieldFormats field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetFieldFormats - -`func (o *UpdateDataViewRequestObjectDataView) SetFieldFormats(v map[string]interface{})` - -SetFieldFormats sets FieldFormats field to given value. - -### HasFieldFormats - -`func (o *UpdateDataViewRequestObjectDataView) HasFieldFormats() bool` - -HasFieldFormats returns a boolean if a field has been set. - -### GetFields - -`func (o *UpdateDataViewRequestObjectDataView) GetFields() map[string]interface{}` - -GetFields returns the Fields field if non-nil, zero value otherwise. - -### GetFieldsOk - -`func (o *UpdateDataViewRequestObjectDataView) GetFieldsOk() (*map[string]interface{}, bool)` - -GetFieldsOk returns a tuple with the Fields field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetFields - -`func (o *UpdateDataViewRequestObjectDataView) SetFields(v map[string]interface{})` - -SetFields sets Fields field to given value. - -### HasFields - -`func (o *UpdateDataViewRequestObjectDataView) HasFields() bool` - -HasFields returns a boolean if a field has been set. - -### GetName - -`func (o *UpdateDataViewRequestObjectDataView) GetName() string` - -GetName returns the Name field if non-nil, zero value otherwise. - -### GetNameOk - -`func (o *UpdateDataViewRequestObjectDataView) 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 *UpdateDataViewRequestObjectDataView) SetName(v string)` - -SetName sets Name field to given value. - -### HasName - -`func (o *UpdateDataViewRequestObjectDataView) HasName() bool` - -HasName returns a boolean if a field has been set. - -### GetRuntimeFieldMap - -`func (o *UpdateDataViewRequestObjectDataView) GetRuntimeFieldMap() map[string]interface{}` - -GetRuntimeFieldMap returns the RuntimeFieldMap field if non-nil, zero value otherwise. - -### GetRuntimeFieldMapOk - -`func (o *UpdateDataViewRequestObjectDataView) GetRuntimeFieldMapOk() (*map[string]interface{}, bool)` - -GetRuntimeFieldMapOk returns a tuple with the RuntimeFieldMap field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetRuntimeFieldMap - -`func (o *UpdateDataViewRequestObjectDataView) SetRuntimeFieldMap(v map[string]interface{})` - -SetRuntimeFieldMap sets RuntimeFieldMap field to given value. - -### HasRuntimeFieldMap - -`func (o *UpdateDataViewRequestObjectDataView) HasRuntimeFieldMap() bool` - -HasRuntimeFieldMap returns a boolean if a field has been set. - -### GetSourceFilters - -`func (o *UpdateDataViewRequestObjectDataView) GetSourceFilters() []SourcefiltersInner` - -GetSourceFilters returns the SourceFilters field if non-nil, zero value otherwise. - -### GetSourceFiltersOk - -`func (o *UpdateDataViewRequestObjectDataView) GetSourceFiltersOk() (*[]SourcefiltersInner, bool)` - -GetSourceFiltersOk returns a tuple with the SourceFilters field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetSourceFilters - -`func (o *UpdateDataViewRequestObjectDataView) SetSourceFilters(v []SourcefiltersInner)` - -SetSourceFilters sets SourceFilters field to given value. - -### HasSourceFilters - -`func (o *UpdateDataViewRequestObjectDataView) HasSourceFilters() bool` - -HasSourceFilters returns a boolean if a field has been set. - -### GetTimeFieldName - -`func (o *UpdateDataViewRequestObjectDataView) GetTimeFieldName() string` - -GetTimeFieldName returns the TimeFieldName field if non-nil, zero value otherwise. - -### GetTimeFieldNameOk - -`func (o *UpdateDataViewRequestObjectDataView) GetTimeFieldNameOk() (*string, bool)` - -GetTimeFieldNameOk returns a tuple with the TimeFieldName field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTimeFieldName - -`func (o *UpdateDataViewRequestObjectDataView) SetTimeFieldName(v string)` - -SetTimeFieldName sets TimeFieldName field to given value. - -### HasTimeFieldName - -`func (o *UpdateDataViewRequestObjectDataView) HasTimeFieldName() bool` - -HasTimeFieldName returns a boolean if a field has been set. - -### GetTitle - -`func (o *UpdateDataViewRequestObjectDataView) GetTitle() string` - -GetTitle returns the Title field if non-nil, zero value otherwise. - -### GetTitleOk - -`func (o *UpdateDataViewRequestObjectDataView) GetTitleOk() (*string, bool)` - -GetTitleOk returns a tuple with the Title field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTitle - -`func (o *UpdateDataViewRequestObjectDataView) SetTitle(v string)` - -SetTitle sets Title field to given value. - -### HasTitle - -`func (o *UpdateDataViewRequestObjectDataView) HasTitle() bool` - -HasTitle returns a boolean if a field has been set. - -### GetType - -`func (o *UpdateDataViewRequestObjectDataView) GetType() string` - -GetType returns the Type field if non-nil, zero value otherwise. - -### GetTypeOk - -`func (o *UpdateDataViewRequestObjectDataView) 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 *UpdateDataViewRequestObjectDataView) SetType(v string)` - -SetType sets Type field to given value. - -### HasType - -`func (o *UpdateDataViewRequestObjectDataView) HasType() bool` - -HasType returns a boolean if a field has been set. - -### GetTypeMeta - -`func (o *UpdateDataViewRequestObjectDataView) GetTypeMeta() map[string]interface{}` - -GetTypeMeta returns the TypeMeta field if non-nil, zero value otherwise. - -### GetTypeMetaOk - -`func (o *UpdateDataViewRequestObjectDataView) GetTypeMetaOk() (*map[string]interface{}, bool)` - -GetTypeMetaOk returns a tuple with the TypeMeta field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTypeMeta - -`func (o *UpdateDataViewRequestObjectDataView) SetTypeMeta(v map[string]interface{})` - -SetTypeMeta sets TypeMeta field to given value. - -### HasTypeMeta - -`func (o *UpdateDataViewRequestObjectDataView) HasTypeMeta() bool` - -HasTypeMeta 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/data_views/docs/UpdateFieldsMetadata200Response.md b/generated/data_views/docs/UpdateFieldsMetadata200Response.md deleted file mode 100644 index 03cfbe5cd..000000000 --- a/generated/data_views/docs/UpdateFieldsMetadata200Response.md +++ /dev/null @@ -1,56 +0,0 @@ -# UpdateFieldsMetadata200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Acknowledged** | Pointer to **bool** | | [optional] - -## Methods - -### NewUpdateFieldsMetadata200Response - -`func NewUpdateFieldsMetadata200Response() *UpdateFieldsMetadata200Response` - -NewUpdateFieldsMetadata200Response instantiates a new UpdateFieldsMetadata200Response 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 - -### NewUpdateFieldsMetadata200ResponseWithDefaults - -`func NewUpdateFieldsMetadata200ResponseWithDefaults() *UpdateFieldsMetadata200Response` - -NewUpdateFieldsMetadata200ResponseWithDefaults instantiates a new UpdateFieldsMetadata200Response 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 - -### GetAcknowledged - -`func (o *UpdateFieldsMetadata200Response) GetAcknowledged() bool` - -GetAcknowledged returns the Acknowledged field if non-nil, zero value otherwise. - -### GetAcknowledgedOk - -`func (o *UpdateFieldsMetadata200Response) GetAcknowledgedOk() (*bool, bool)` - -GetAcknowledgedOk returns a tuple with the Acknowledged field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetAcknowledged - -`func (o *UpdateFieldsMetadata200Response) SetAcknowledged(v bool)` - -SetAcknowledged sets Acknowledged field to given value. - -### HasAcknowledged - -`func (o *UpdateFieldsMetadata200Response) HasAcknowledged() bool` - -HasAcknowledged 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/data_views/docs/UpdateFieldsMetadataRequest.md b/generated/data_views/docs/UpdateFieldsMetadataRequest.md deleted file mode 100644 index a7635babc..000000000 --- a/generated/data_views/docs/UpdateFieldsMetadataRequest.md +++ /dev/null @@ -1,51 +0,0 @@ -# UpdateFieldsMetadataRequest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Fields** | **map[string]interface{}** | The field object. | - -## Methods - -### NewUpdateFieldsMetadataRequest - -`func NewUpdateFieldsMetadataRequest(fields map[string]interface{}, ) *UpdateFieldsMetadataRequest` - -NewUpdateFieldsMetadataRequest instantiates a new UpdateFieldsMetadataRequest 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 - -### NewUpdateFieldsMetadataRequestWithDefaults - -`func NewUpdateFieldsMetadataRequestWithDefaults() *UpdateFieldsMetadataRequest` - -NewUpdateFieldsMetadataRequestWithDefaults instantiates a new UpdateFieldsMetadataRequest 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 - -### GetFields - -`func (o *UpdateFieldsMetadataRequest) GetFields() map[string]interface{}` - -GetFields returns the Fields field if non-nil, zero value otherwise. - -### GetFieldsOk - -`func (o *UpdateFieldsMetadataRequest) GetFieldsOk() (*map[string]interface{}, bool)` - -GetFieldsOk returns a tuple with the Fields field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetFields - -`func (o *UpdateFieldsMetadataRequest) SetFields(v map[string]interface{})` - -SetFields sets Fields 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/data_views/docs/UpdateRuntimeFieldRequest.md b/generated/data_views/docs/UpdateRuntimeFieldRequest.md deleted file mode 100644 index 923fb29fb..000000000 --- a/generated/data_views/docs/UpdateRuntimeFieldRequest.md +++ /dev/null @@ -1,51 +0,0 @@ -# UpdateRuntimeFieldRequest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**RuntimeField** | **map[string]interface{}** | The runtime field definition object. You can update following fields: - `type` - `script` | - -## Methods - -### NewUpdateRuntimeFieldRequest - -`func NewUpdateRuntimeFieldRequest(runtimeField map[string]interface{}, ) *UpdateRuntimeFieldRequest` - -NewUpdateRuntimeFieldRequest instantiates a new UpdateRuntimeFieldRequest 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 - -### NewUpdateRuntimeFieldRequestWithDefaults - -`func NewUpdateRuntimeFieldRequestWithDefaults() *UpdateRuntimeFieldRequest` - -NewUpdateRuntimeFieldRequestWithDefaults instantiates a new UpdateRuntimeFieldRequest 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 - -### GetRuntimeField - -`func (o *UpdateRuntimeFieldRequest) GetRuntimeField() map[string]interface{}` - -GetRuntimeField returns the RuntimeField field if non-nil, zero value otherwise. - -### GetRuntimeFieldOk - -`func (o *UpdateRuntimeFieldRequest) GetRuntimeFieldOk() (*map[string]interface{}, bool)` - -GetRuntimeFieldOk returns a tuple with the RuntimeField field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetRuntimeField - -`func (o *UpdateRuntimeFieldRequest) SetRuntimeField(v map[string]interface{})` - -SetRuntimeField sets RuntimeField 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/data_views/git_push.sh b/generated/data_views/git_push.sh deleted file mode 100644 index 9c304b700..000000000 --- a/generated/data_views/git_push.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="elastic" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="terraform-provider-elasticstack" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' diff --git a/generated/data_views/model_400_response.go b/generated/data_views/model_400_response.go deleted file mode 100644 index fb5d91545..000000000 --- a/generated/data_views/model_400_response.go +++ /dev/null @@ -1,169 +0,0 @@ -/* -Data views - -OpenAPI schema for data view endpoints - -API version: 0.1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package data_views - -import ( - "encoding/json" -) - -// checks if the Model400Response type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &Model400Response{} - -// Model400Response struct for Model400Response -type Model400Response struct { - StatusCode float32 `json:"statusCode"` - Error string `json:"error"` - Message string `json:"message"` -} - -// NewModel400Response instantiates a new Model400Response 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 NewModel400Response(statusCode float32, error_ string, message string) *Model400Response { - this := Model400Response{} - this.StatusCode = statusCode - this.Error = error_ - this.Message = message - return &this -} - -// NewModel400ResponseWithDefaults instantiates a new Model400Response 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 NewModel400ResponseWithDefaults() *Model400Response { - this := Model400Response{} - return &this -} - -// GetStatusCode returns the StatusCode field value -func (o *Model400Response) GetStatusCode() float32 { - if o == nil { - var ret float32 - return ret - } - - return o.StatusCode -} - -// GetStatusCodeOk returns a tuple with the StatusCode field value -// and a boolean to check if the value has been set. -func (o *Model400Response) GetStatusCodeOk() (*float32, bool) { - if o == nil { - return nil, false - } - return &o.StatusCode, true -} - -// SetStatusCode sets field value -func (o *Model400Response) SetStatusCode(v float32) { - o.StatusCode = v -} - -// GetError returns the Error field value -func (o *Model400Response) GetError() string { - if o == nil { - var ret string - return ret - } - - return o.Error -} - -// GetErrorOk returns a tuple with the Error field value -// and a boolean to check if the value has been set. -func (o *Model400Response) GetErrorOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Error, true -} - -// SetError sets field value -func (o *Model400Response) SetError(v string) { - o.Error = v -} - -// GetMessage returns the Message field value -func (o *Model400Response) GetMessage() string { - if o == nil { - var ret string - return ret - } - - return o.Message -} - -// GetMessageOk returns a tuple with the Message field value -// and a boolean to check if the value has been set. -func (o *Model400Response) GetMessageOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Message, true -} - -// SetMessage sets field value -func (o *Model400Response) SetMessage(v string) { - o.Message = v -} - -func (o Model400Response) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o Model400Response) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["statusCode"] = o.StatusCode - toSerialize["error"] = o.Error - toSerialize["message"] = o.Message - return toSerialize, nil -} - -type NullableModel400Response struct { - value *Model400Response - isSet bool -} - -func (v NullableModel400Response) Get() *Model400Response { - return v.value -} - -func (v *NullableModel400Response) Set(val *Model400Response) { - v.value = val - v.isSet = true -} - -func (v NullableModel400Response) IsSet() bool { - return v.isSet -} - -func (v *NullableModel400Response) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableModel400Response(val *Model400Response) *NullableModel400Response { - return &NullableModel400Response{value: val, isSet: true} -} - -func (v NullableModel400Response) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableModel400Response) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/generated/data_views/model_404_response.go b/generated/data_views/model_404_response.go deleted file mode 100644 index d2d56e102..000000000 --- a/generated/data_views/model_404_response.go +++ /dev/null @@ -1,196 +0,0 @@ -/* -Data views - -OpenAPI schema for data view endpoints - -API version: 0.1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package data_views - -import ( - "encoding/json" -) - -// checks if the Model404Response type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &Model404Response{} - -// Model404Response struct for Model404Response -type Model404Response struct { - Error *string `json:"error,omitempty"` - Message *string `json:"message,omitempty"` - StatusCode *int32 `json:"statusCode,omitempty"` -} - -// NewModel404Response instantiates a new Model404Response 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 NewModel404Response() *Model404Response { - this := Model404Response{} - return &this -} - -// NewModel404ResponseWithDefaults instantiates a new Model404Response 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 NewModel404ResponseWithDefaults() *Model404Response { - this := Model404Response{} - return &this -} - -// GetError returns the Error field value if set, zero value otherwise. -func (o *Model404Response) GetError() string { - if o == nil || IsNil(o.Error) { - var ret string - return ret - } - return *o.Error -} - -// GetErrorOk returns a tuple with the Error field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Model404Response) GetErrorOk() (*string, bool) { - if o == nil || IsNil(o.Error) { - return nil, false - } - return o.Error, true -} - -// HasError returns a boolean if a field has been set. -func (o *Model404Response) HasError() bool { - if o != nil && !IsNil(o.Error) { - return true - } - - return false -} - -// SetError gets a reference to the given string and assigns it to the Error field. -func (o *Model404Response) SetError(v string) { - o.Error = &v -} - -// GetMessage returns the Message field value if set, zero value otherwise. -func (o *Model404Response) GetMessage() string { - if o == nil || IsNil(o.Message) { - var ret string - return ret - } - return *o.Message -} - -// GetMessageOk returns a tuple with the Message field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Model404Response) GetMessageOk() (*string, bool) { - if o == nil || IsNil(o.Message) { - return nil, false - } - return o.Message, true -} - -// HasMessage returns a boolean if a field has been set. -func (o *Model404Response) HasMessage() bool { - if o != nil && !IsNil(o.Message) { - return true - } - - return false -} - -// SetMessage gets a reference to the given string and assigns it to the Message field. -func (o *Model404Response) SetMessage(v string) { - o.Message = &v -} - -// GetStatusCode returns the StatusCode field value if set, zero value otherwise. -func (o *Model404Response) GetStatusCode() int32 { - if o == nil || IsNil(o.StatusCode) { - var ret int32 - return ret - } - return *o.StatusCode -} - -// GetStatusCodeOk returns a tuple with the StatusCode field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Model404Response) GetStatusCodeOk() (*int32, bool) { - if o == nil || IsNil(o.StatusCode) { - return nil, false - } - return o.StatusCode, true -} - -// HasStatusCode returns a boolean if a field has been set. -func (o *Model404Response) HasStatusCode() bool { - if o != nil && !IsNil(o.StatusCode) { - return true - } - - return false -} - -// SetStatusCode gets a reference to the given int32 and assigns it to the StatusCode field. -func (o *Model404Response) SetStatusCode(v int32) { - o.StatusCode = &v -} - -func (o Model404Response) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o Model404Response) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Error) { - toSerialize["error"] = o.Error - } - if !IsNil(o.Message) { - toSerialize["message"] = o.Message - } - if !IsNil(o.StatusCode) { - toSerialize["statusCode"] = o.StatusCode - } - return toSerialize, nil -} - -type NullableModel404Response struct { - value *Model404Response - isSet bool -} - -func (v NullableModel404Response) Get() *Model404Response { - return v.value -} - -func (v *NullableModel404Response) Set(val *Model404Response) { - v.value = val - v.isSet = true -} - -func (v NullableModel404Response) IsSet() bool { - return v.isSet -} - -func (v *NullableModel404Response) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableModel404Response(val *Model404Response) *NullableModel404Response { - return &NullableModel404Response{value: val, isSet: true} -} - -func (v NullableModel404Response) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableModel404Response) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/generated/data_views/model_create_data_view_request_object.go b/generated/data_views/model_create_data_view_request_object.go deleted file mode 100644 index d79756a45..000000000 --- a/generated/data_views/model_create_data_view_request_object.go +++ /dev/null @@ -1,156 +0,0 @@ -/* -Data views - -OpenAPI schema for data view endpoints - -API version: 0.1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package data_views - -import ( - "encoding/json" -) - -// checks if the CreateDataViewRequestObject type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &CreateDataViewRequestObject{} - -// CreateDataViewRequestObject struct for CreateDataViewRequestObject -type CreateDataViewRequestObject struct { - DataView CreateDataViewRequestObjectDataView `json:"data_view"` - // Override an existing data view if a data view with the provided title already exists. - Override *bool `json:"override,omitempty"` -} - -// NewCreateDataViewRequestObject instantiates a new CreateDataViewRequestObject 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 NewCreateDataViewRequestObject(dataView CreateDataViewRequestObjectDataView) *CreateDataViewRequestObject { - this := CreateDataViewRequestObject{} - this.DataView = dataView - var override bool = false - this.Override = &override - return &this -} - -// NewCreateDataViewRequestObjectWithDefaults instantiates a new CreateDataViewRequestObject 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 NewCreateDataViewRequestObjectWithDefaults() *CreateDataViewRequestObject { - this := CreateDataViewRequestObject{} - var override bool = false - this.Override = &override - return &this -} - -// GetDataView returns the DataView field value -func (o *CreateDataViewRequestObject) GetDataView() CreateDataViewRequestObjectDataView { - if o == nil { - var ret CreateDataViewRequestObjectDataView - return ret - } - - return o.DataView -} - -// GetDataViewOk returns a tuple with the DataView field value -// and a boolean to check if the value has been set. -func (o *CreateDataViewRequestObject) GetDataViewOk() (*CreateDataViewRequestObjectDataView, bool) { - if o == nil { - return nil, false - } - return &o.DataView, true -} - -// SetDataView sets field value -func (o *CreateDataViewRequestObject) SetDataView(v CreateDataViewRequestObjectDataView) { - o.DataView = v -} - -// GetOverride returns the Override field value if set, zero value otherwise. -func (o *CreateDataViewRequestObject) GetOverride() bool { - if o == nil || IsNil(o.Override) { - var ret bool - return ret - } - return *o.Override -} - -// GetOverrideOk returns a tuple with the Override field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateDataViewRequestObject) GetOverrideOk() (*bool, bool) { - if o == nil || IsNil(o.Override) { - return nil, false - } - return o.Override, true -} - -// HasOverride returns a boolean if a field has been set. -func (o *CreateDataViewRequestObject) HasOverride() bool { - if o != nil && !IsNil(o.Override) { - return true - } - - return false -} - -// SetOverride gets a reference to the given bool and assigns it to the Override field. -func (o *CreateDataViewRequestObject) SetOverride(v bool) { - o.Override = &v -} - -func (o CreateDataViewRequestObject) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o CreateDataViewRequestObject) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["data_view"] = o.DataView - if !IsNil(o.Override) { - toSerialize["override"] = o.Override - } - return toSerialize, nil -} - -type NullableCreateDataViewRequestObject struct { - value *CreateDataViewRequestObject - isSet bool -} - -func (v NullableCreateDataViewRequestObject) Get() *CreateDataViewRequestObject { - return v.value -} - -func (v *NullableCreateDataViewRequestObject) Set(val *CreateDataViewRequestObject) { - v.value = val - v.isSet = true -} - -func (v NullableCreateDataViewRequestObject) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateDataViewRequestObject) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateDataViewRequestObject(val *CreateDataViewRequestObject) *NullableCreateDataViewRequestObject { - return &NullableCreateDataViewRequestObject{value: val, isSet: true} -} - -func (v NullableCreateDataViewRequestObject) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateDataViewRequestObject) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/generated/data_views/model_create_data_view_request_object_data_view.go b/generated/data_views/model_create_data_view_request_object_data_view.go deleted file mode 100644 index a5b59e97d..000000000 --- a/generated/data_views/model_create_data_view_request_object_data_view.go +++ /dev/null @@ -1,594 +0,0 @@ -/* -Data views - -OpenAPI schema for data view endpoints - -API version: 0.1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package data_views - -import ( - "encoding/json" -) - -// checks if the CreateDataViewRequestObjectDataView type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &CreateDataViewRequestObjectDataView{} - -// CreateDataViewRequestObjectDataView The data view object. -type CreateDataViewRequestObjectDataView struct { - // Allows the data view saved object to exist before the data is available. - AllowNoIndex *bool `json:"allowNoIndex,omitempty"` - // A map of field attributes by field name. - FieldAttrs map[string]interface{} `json:"fieldAttrs,omitempty"` - // A map of field formats by field name. - FieldFormats map[string]interface{} `json:"fieldFormats,omitempty"` - Fields map[string]interface{} `json:"fields,omitempty"` - Id *string `json:"id,omitempty"` - // The data view name. - Name *string `json:"name,omitempty"` - // An array of space identifiers for sharing the data view between multiple spaces. - Namespaces []string `json:"namespaces,omitempty"` - // A map of runtime field definitions by field name. - RuntimeFieldMap map[string]interface{} `json:"runtimeFieldMap,omitempty"` - // The array of field names you want to filter out in Discover. - SourceFilters []SourcefiltersInner `json:"sourceFilters,omitempty"` - // The timestamp field name, which you use for time-based data views. - TimeFieldName *string `json:"timeFieldName,omitempty"` - // Comma-separated list of data streams, indices, and aliases that you want to search. Supports wildcards (`*`). - Title string `json:"title"` - // When set to `rollup`, identifies the rollup data views. - Type *string `json:"type,omitempty"` - // When you use rollup indices, contains the field list for the rollup data view API endpoints. - TypeMeta map[string]interface{} `json:"typeMeta,omitempty"` - Version *string `json:"version,omitempty"` -} - -// NewCreateDataViewRequestObjectDataView instantiates a new CreateDataViewRequestObjectDataView 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 NewCreateDataViewRequestObjectDataView(title string) *CreateDataViewRequestObjectDataView { - this := CreateDataViewRequestObjectDataView{} - this.Title = title - return &this -} - -// NewCreateDataViewRequestObjectDataViewWithDefaults instantiates a new CreateDataViewRequestObjectDataView 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 NewCreateDataViewRequestObjectDataViewWithDefaults() *CreateDataViewRequestObjectDataView { - this := CreateDataViewRequestObjectDataView{} - return &this -} - -// GetAllowNoIndex returns the AllowNoIndex field value if set, zero value otherwise. -func (o *CreateDataViewRequestObjectDataView) GetAllowNoIndex() bool { - if o == nil || IsNil(o.AllowNoIndex) { - var ret bool - return ret - } - return *o.AllowNoIndex -} - -// GetAllowNoIndexOk returns a tuple with the AllowNoIndex field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateDataViewRequestObjectDataView) GetAllowNoIndexOk() (*bool, bool) { - if o == nil || IsNil(o.AllowNoIndex) { - return nil, false - } - return o.AllowNoIndex, true -} - -// HasAllowNoIndex returns a boolean if a field has been set. -func (o *CreateDataViewRequestObjectDataView) HasAllowNoIndex() bool { - if o != nil && !IsNil(o.AllowNoIndex) { - return true - } - - return false -} - -// SetAllowNoIndex gets a reference to the given bool and assigns it to the AllowNoIndex field. -func (o *CreateDataViewRequestObjectDataView) SetAllowNoIndex(v bool) { - o.AllowNoIndex = &v -} - -// GetFieldAttrs returns the FieldAttrs field value if set, zero value otherwise. -func (o *CreateDataViewRequestObjectDataView) GetFieldAttrs() map[string]interface{} { - if o == nil || IsNil(o.FieldAttrs) { - var ret map[string]interface{} - return ret - } - return o.FieldAttrs -} - -// GetFieldAttrsOk returns a tuple with the FieldAttrs field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateDataViewRequestObjectDataView) GetFieldAttrsOk() (map[string]interface{}, bool) { - if o == nil || IsNil(o.FieldAttrs) { - return map[string]interface{}{}, false - } - return o.FieldAttrs, true -} - -// HasFieldAttrs returns a boolean if a field has been set. -func (o *CreateDataViewRequestObjectDataView) HasFieldAttrs() bool { - if o != nil && !IsNil(o.FieldAttrs) { - return true - } - - return false -} - -// SetFieldAttrs gets a reference to the given map[string]interface{} and assigns it to the FieldAttrs field. -func (o *CreateDataViewRequestObjectDataView) SetFieldAttrs(v map[string]interface{}) { - o.FieldAttrs = v -} - -// GetFieldFormats returns the FieldFormats field value if set, zero value otherwise. -func (o *CreateDataViewRequestObjectDataView) GetFieldFormats() map[string]interface{} { - if o == nil || IsNil(o.FieldFormats) { - var ret map[string]interface{} - return ret - } - return o.FieldFormats -} - -// GetFieldFormatsOk returns a tuple with the FieldFormats field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateDataViewRequestObjectDataView) GetFieldFormatsOk() (map[string]interface{}, bool) { - if o == nil || IsNil(o.FieldFormats) { - return map[string]interface{}{}, false - } - return o.FieldFormats, true -} - -// HasFieldFormats returns a boolean if a field has been set. -func (o *CreateDataViewRequestObjectDataView) HasFieldFormats() bool { - if o != nil && !IsNil(o.FieldFormats) { - return true - } - - return false -} - -// SetFieldFormats gets a reference to the given map[string]interface{} and assigns it to the FieldFormats field. -func (o *CreateDataViewRequestObjectDataView) SetFieldFormats(v map[string]interface{}) { - o.FieldFormats = v -} - -// GetFields returns the Fields field value if set, zero value otherwise. -func (o *CreateDataViewRequestObjectDataView) GetFields() map[string]interface{} { - if o == nil || IsNil(o.Fields) { - var ret map[string]interface{} - return ret - } - return o.Fields -} - -// GetFieldsOk returns a tuple with the Fields field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateDataViewRequestObjectDataView) GetFieldsOk() (map[string]interface{}, bool) { - if o == nil || IsNil(o.Fields) { - return map[string]interface{}{}, false - } - return o.Fields, true -} - -// HasFields returns a boolean if a field has been set. -func (o *CreateDataViewRequestObjectDataView) HasFields() bool { - if o != nil && !IsNil(o.Fields) { - return true - } - - return false -} - -// SetFields gets a reference to the given map[string]interface{} and assigns it to the Fields field. -func (o *CreateDataViewRequestObjectDataView) SetFields(v map[string]interface{}) { - o.Fields = v -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *CreateDataViewRequestObjectDataView) GetId() string { - if o == nil || IsNil(o.Id) { - var ret string - return ret - } - return *o.Id -} - -// GetIdOk returns a tuple with the Id field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateDataViewRequestObjectDataView) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true -} - -// HasId returns a boolean if a field has been set. -func (o *CreateDataViewRequestObjectDataView) HasId() bool { - if o != nil && !IsNil(o.Id) { - return true - } - - return false -} - -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *CreateDataViewRequestObjectDataView) SetId(v string) { - o.Id = &v -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *CreateDataViewRequestObjectDataView) GetName() string { - if o == nil || IsNil(o.Name) { - var ret string - return ret - } - return *o.Name -} - -// GetNameOk returns a tuple with the Name field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateDataViewRequestObjectDataView) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { - return nil, false - } - return o.Name, true -} - -// HasName returns a boolean if a field has been set. -func (o *CreateDataViewRequestObjectDataView) HasName() bool { - if o != nil && !IsNil(o.Name) { - return true - } - - return false -} - -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *CreateDataViewRequestObjectDataView) SetName(v string) { - o.Name = &v -} - -// GetNamespaces returns the Namespaces field value if set, zero value otherwise. -func (o *CreateDataViewRequestObjectDataView) GetNamespaces() []string { - if o == nil || IsNil(o.Namespaces) { - var ret []string - return ret - } - return o.Namespaces -} - -// GetNamespacesOk returns a tuple with the Namespaces field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateDataViewRequestObjectDataView) GetNamespacesOk() ([]string, bool) { - if o == nil || IsNil(o.Namespaces) { - return nil, false - } - return o.Namespaces, true -} - -// HasNamespaces returns a boolean if a field has been set. -func (o *CreateDataViewRequestObjectDataView) HasNamespaces() bool { - if o != nil && !IsNil(o.Namespaces) { - return true - } - - return false -} - -// SetNamespaces gets a reference to the given []string and assigns it to the Namespaces field. -func (o *CreateDataViewRequestObjectDataView) SetNamespaces(v []string) { - o.Namespaces = v -} - -// GetRuntimeFieldMap returns the RuntimeFieldMap field value if set, zero value otherwise. -func (o *CreateDataViewRequestObjectDataView) GetRuntimeFieldMap() map[string]interface{} { - if o == nil || IsNil(o.RuntimeFieldMap) { - var ret map[string]interface{} - return ret - } - return o.RuntimeFieldMap -} - -// GetRuntimeFieldMapOk returns a tuple with the RuntimeFieldMap field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateDataViewRequestObjectDataView) GetRuntimeFieldMapOk() (map[string]interface{}, bool) { - if o == nil || IsNil(o.RuntimeFieldMap) { - return map[string]interface{}{}, false - } - return o.RuntimeFieldMap, true -} - -// HasRuntimeFieldMap returns a boolean if a field has been set. -func (o *CreateDataViewRequestObjectDataView) HasRuntimeFieldMap() bool { - if o != nil && !IsNil(o.RuntimeFieldMap) { - return true - } - - return false -} - -// SetRuntimeFieldMap gets a reference to the given map[string]interface{} and assigns it to the RuntimeFieldMap field. -func (o *CreateDataViewRequestObjectDataView) SetRuntimeFieldMap(v map[string]interface{}) { - o.RuntimeFieldMap = v -} - -// GetSourceFilters returns the SourceFilters field value if set, zero value otherwise. -func (o *CreateDataViewRequestObjectDataView) GetSourceFilters() []SourcefiltersInner { - if o == nil || IsNil(o.SourceFilters) { - var ret []SourcefiltersInner - return ret - } - return o.SourceFilters -} - -// GetSourceFiltersOk returns a tuple with the SourceFilters field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateDataViewRequestObjectDataView) GetSourceFiltersOk() ([]SourcefiltersInner, bool) { - if o == nil || IsNil(o.SourceFilters) { - return nil, false - } - return o.SourceFilters, true -} - -// HasSourceFilters returns a boolean if a field has been set. -func (o *CreateDataViewRequestObjectDataView) HasSourceFilters() bool { - if o != nil && !IsNil(o.SourceFilters) { - return true - } - - return false -} - -// SetSourceFilters gets a reference to the given []SourcefiltersInner and assigns it to the SourceFilters field. -func (o *CreateDataViewRequestObjectDataView) SetSourceFilters(v []SourcefiltersInner) { - o.SourceFilters = v -} - -// GetTimeFieldName returns the TimeFieldName field value if set, zero value otherwise. -func (o *CreateDataViewRequestObjectDataView) GetTimeFieldName() string { - if o == nil || IsNil(o.TimeFieldName) { - var ret string - return ret - } - return *o.TimeFieldName -} - -// GetTimeFieldNameOk returns a tuple with the TimeFieldName field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateDataViewRequestObjectDataView) GetTimeFieldNameOk() (*string, bool) { - if o == nil || IsNil(o.TimeFieldName) { - return nil, false - } - return o.TimeFieldName, true -} - -// HasTimeFieldName returns a boolean if a field has been set. -func (o *CreateDataViewRequestObjectDataView) HasTimeFieldName() bool { - if o != nil && !IsNil(o.TimeFieldName) { - return true - } - - return false -} - -// SetTimeFieldName gets a reference to the given string and assigns it to the TimeFieldName field. -func (o *CreateDataViewRequestObjectDataView) SetTimeFieldName(v string) { - o.TimeFieldName = &v -} - -// GetTitle returns the Title field value -func (o *CreateDataViewRequestObjectDataView) GetTitle() string { - if o == nil { - var ret string - return ret - } - - return o.Title -} - -// GetTitleOk returns a tuple with the Title field value -// and a boolean to check if the value has been set. -func (o *CreateDataViewRequestObjectDataView) GetTitleOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Title, true -} - -// SetTitle sets field value -func (o *CreateDataViewRequestObjectDataView) SetTitle(v string) { - o.Title = v -} - -// GetType returns the Type field value if set, zero value otherwise. -func (o *CreateDataViewRequestObjectDataView) 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 *CreateDataViewRequestObjectDataView) 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 *CreateDataViewRequestObjectDataView) 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 *CreateDataViewRequestObjectDataView) SetType(v string) { - o.Type = &v -} - -// GetTypeMeta returns the TypeMeta field value if set, zero value otherwise. -func (o *CreateDataViewRequestObjectDataView) GetTypeMeta() map[string]interface{} { - if o == nil || IsNil(o.TypeMeta) { - var ret map[string]interface{} - return ret - } - return o.TypeMeta -} - -// GetTypeMetaOk returns a tuple with the TypeMeta field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateDataViewRequestObjectDataView) GetTypeMetaOk() (map[string]interface{}, bool) { - if o == nil || IsNil(o.TypeMeta) { - return map[string]interface{}{}, false - } - return o.TypeMeta, true -} - -// HasTypeMeta returns a boolean if a field has been set. -func (o *CreateDataViewRequestObjectDataView) HasTypeMeta() bool { - if o != nil && !IsNil(o.TypeMeta) { - return true - } - - return false -} - -// SetTypeMeta gets a reference to the given map[string]interface{} and assigns it to the TypeMeta field. -func (o *CreateDataViewRequestObjectDataView) SetTypeMeta(v map[string]interface{}) { - o.TypeMeta = v -} - -// GetVersion returns the Version field value if set, zero value otherwise. -func (o *CreateDataViewRequestObjectDataView) GetVersion() string { - if o == nil || IsNil(o.Version) { - var ret string - return ret - } - return *o.Version -} - -// GetVersionOk returns a tuple with the Version field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateDataViewRequestObjectDataView) GetVersionOk() (*string, bool) { - if o == nil || IsNil(o.Version) { - return nil, false - } - return o.Version, true -} - -// HasVersion returns a boolean if a field has been set. -func (o *CreateDataViewRequestObjectDataView) HasVersion() bool { - if o != nil && !IsNil(o.Version) { - return true - } - - return false -} - -// SetVersion gets a reference to the given string and assigns it to the Version field. -func (o *CreateDataViewRequestObjectDataView) SetVersion(v string) { - o.Version = &v -} - -func (o CreateDataViewRequestObjectDataView) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o CreateDataViewRequestObjectDataView) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.AllowNoIndex) { - toSerialize["allowNoIndex"] = o.AllowNoIndex - } - if !IsNil(o.FieldAttrs) { - toSerialize["fieldAttrs"] = o.FieldAttrs - } - if !IsNil(o.FieldFormats) { - toSerialize["fieldFormats"] = o.FieldFormats - } - if !IsNil(o.Fields) { - toSerialize["fields"] = o.Fields - } - if !IsNil(o.Id) { - toSerialize["id"] = o.Id - } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name - } - if !IsNil(o.Namespaces) { - toSerialize["namespaces"] = o.Namespaces - } - if !IsNil(o.RuntimeFieldMap) { - toSerialize["runtimeFieldMap"] = o.RuntimeFieldMap - } - if !IsNil(o.SourceFilters) { - toSerialize["sourceFilters"] = o.SourceFilters - } - if !IsNil(o.TimeFieldName) { - toSerialize["timeFieldName"] = o.TimeFieldName - } - toSerialize["title"] = o.Title - if !IsNil(o.Type) { - toSerialize["type"] = o.Type - } - if !IsNil(o.TypeMeta) { - toSerialize["typeMeta"] = o.TypeMeta - } - if !IsNil(o.Version) { - toSerialize["version"] = o.Version - } - return toSerialize, nil -} - -type NullableCreateDataViewRequestObjectDataView struct { - value *CreateDataViewRequestObjectDataView - isSet bool -} - -func (v NullableCreateDataViewRequestObjectDataView) Get() *CreateDataViewRequestObjectDataView { - return v.value -} - -func (v *NullableCreateDataViewRequestObjectDataView) Set(val *CreateDataViewRequestObjectDataView) { - v.value = val - v.isSet = true -} - -func (v NullableCreateDataViewRequestObjectDataView) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateDataViewRequestObjectDataView) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateDataViewRequestObjectDataView(val *CreateDataViewRequestObjectDataView) *NullableCreateDataViewRequestObjectDataView { - return &NullableCreateDataViewRequestObjectDataView{value: val, isSet: true} -} - -func (v NullableCreateDataViewRequestObjectDataView) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateDataViewRequestObjectDataView) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/generated/data_views/model_create_runtime_field_request.go b/generated/data_views/model_create_runtime_field_request.go deleted file mode 100644 index 6e717809a..000000000 --- a/generated/data_views/model_create_runtime_field_request.go +++ /dev/null @@ -1,152 +0,0 @@ -/* -Data views - -OpenAPI schema for data view endpoints - -API version: 0.1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package data_views - -import ( - "encoding/json" -) - -// checks if the CreateRuntimeFieldRequest type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &CreateRuntimeFieldRequest{} - -// CreateRuntimeFieldRequest struct for CreateRuntimeFieldRequest -type CreateRuntimeFieldRequest struct { - // The name for a runtime field. - Name interface{} `json:"name"` - // The runtime field definition object. - RuntimeField interface{} `json:"runtimeField"` -} - -// NewCreateRuntimeFieldRequest instantiates a new CreateRuntimeFieldRequest 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 NewCreateRuntimeFieldRequest(name interface{}, runtimeField interface{}) *CreateRuntimeFieldRequest { - this := CreateRuntimeFieldRequest{} - this.Name = name - this.RuntimeField = runtimeField - return &this -} - -// NewCreateRuntimeFieldRequestWithDefaults instantiates a new CreateRuntimeFieldRequest 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 NewCreateRuntimeFieldRequestWithDefaults() *CreateRuntimeFieldRequest { - this := CreateRuntimeFieldRequest{} - return &this -} - -// GetName returns the Name field value -// If the value is explicit nil, the zero value for interface{} will be returned -func (o *CreateRuntimeFieldRequest) GetName() interface{} { - if o == nil { - var ret interface{} - 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. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *CreateRuntimeFieldRequest) GetNameOk() (*interface{}, bool) { - if o == nil || IsNil(o.Name) { - return nil, false - } - return &o.Name, true -} - -// SetName sets field value -func (o *CreateRuntimeFieldRequest) SetName(v interface{}) { - o.Name = v -} - -// GetRuntimeField returns the RuntimeField field value -// If the value is explicit nil, the zero value for interface{} will be returned -func (o *CreateRuntimeFieldRequest) GetRuntimeField() interface{} { - if o == nil { - var ret interface{} - return ret - } - - return o.RuntimeField -} - -// GetRuntimeFieldOk returns a tuple with the RuntimeField field value -// 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 *CreateRuntimeFieldRequest) GetRuntimeFieldOk() (*interface{}, bool) { - if o == nil || IsNil(o.RuntimeField) { - return nil, false - } - return &o.RuntimeField, true -} - -// SetRuntimeField sets field value -func (o *CreateRuntimeFieldRequest) SetRuntimeField(v interface{}) { - o.RuntimeField = v -} - -func (o CreateRuntimeFieldRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o CreateRuntimeFieldRequest) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if o.Name != nil { - toSerialize["name"] = o.Name - } - if o.RuntimeField != nil { - toSerialize["runtimeField"] = o.RuntimeField - } - return toSerialize, nil -} - -type NullableCreateRuntimeFieldRequest struct { - value *CreateRuntimeFieldRequest - isSet bool -} - -func (v NullableCreateRuntimeFieldRequest) Get() *CreateRuntimeFieldRequest { - return v.value -} - -func (v *NullableCreateRuntimeFieldRequest) Set(val *CreateRuntimeFieldRequest) { - v.value = val - v.isSet = true -} - -func (v NullableCreateRuntimeFieldRequest) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateRuntimeFieldRequest) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateRuntimeFieldRequest(val *CreateRuntimeFieldRequest) *NullableCreateRuntimeFieldRequest { - return &NullableCreateRuntimeFieldRequest{value: val, isSet: true} -} - -func (v NullableCreateRuntimeFieldRequest) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateRuntimeFieldRequest) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/generated/data_views/model_create_update_runtime_field_200_response.go b/generated/data_views/model_create_update_runtime_field_200_response.go deleted file mode 100644 index d63611c19..000000000 --- a/generated/data_views/model_create_update_runtime_field_200_response.go +++ /dev/null @@ -1,160 +0,0 @@ -/* -Data views - -OpenAPI schema for data view endpoints - -API version: 0.1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package data_views - -import ( - "encoding/json" -) - -// checks if the CreateUpdateRuntimeField200Response type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &CreateUpdateRuntimeField200Response{} - -// CreateUpdateRuntimeField200Response struct for CreateUpdateRuntimeField200Response -type CreateUpdateRuntimeField200Response struct { - DataView map[string]interface{} `json:"data_view,omitempty"` - Fields []map[string]interface{} `json:"fields,omitempty"` -} - -// NewCreateUpdateRuntimeField200Response instantiates a new CreateUpdateRuntimeField200Response 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 NewCreateUpdateRuntimeField200Response() *CreateUpdateRuntimeField200Response { - this := CreateUpdateRuntimeField200Response{} - return &this -} - -// NewCreateUpdateRuntimeField200ResponseWithDefaults instantiates a new CreateUpdateRuntimeField200Response 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 NewCreateUpdateRuntimeField200ResponseWithDefaults() *CreateUpdateRuntimeField200Response { - this := CreateUpdateRuntimeField200Response{} - return &this -} - -// GetDataView returns the DataView field value if set, zero value otherwise. -func (o *CreateUpdateRuntimeField200Response) GetDataView() map[string]interface{} { - if o == nil || IsNil(o.DataView) { - var ret map[string]interface{} - return ret - } - return o.DataView -} - -// GetDataViewOk returns a tuple with the DataView field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateUpdateRuntimeField200Response) GetDataViewOk() (map[string]interface{}, bool) { - if o == nil || IsNil(o.DataView) { - return map[string]interface{}{}, false - } - return o.DataView, true -} - -// HasDataView returns a boolean if a field has been set. -func (o *CreateUpdateRuntimeField200Response) HasDataView() bool { - if o != nil && !IsNil(o.DataView) { - return true - } - - return false -} - -// SetDataView gets a reference to the given map[string]interface{} and assigns it to the DataView field. -func (o *CreateUpdateRuntimeField200Response) SetDataView(v map[string]interface{}) { - o.DataView = v -} - -// GetFields returns the Fields field value if set, zero value otherwise. -func (o *CreateUpdateRuntimeField200Response) GetFields() []map[string]interface{} { - if o == nil || IsNil(o.Fields) { - var ret []map[string]interface{} - return ret - } - return o.Fields -} - -// GetFieldsOk returns a tuple with the Fields field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CreateUpdateRuntimeField200Response) GetFieldsOk() ([]map[string]interface{}, bool) { - if o == nil || IsNil(o.Fields) { - return nil, false - } - return o.Fields, true -} - -// HasFields returns a boolean if a field has been set. -func (o *CreateUpdateRuntimeField200Response) HasFields() bool { - if o != nil && !IsNil(o.Fields) { - return true - } - - return false -} - -// SetFields gets a reference to the given []map[string]interface{} and assigns it to the Fields field. -func (o *CreateUpdateRuntimeField200Response) SetFields(v []map[string]interface{}) { - o.Fields = v -} - -func (o CreateUpdateRuntimeField200Response) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o CreateUpdateRuntimeField200Response) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.DataView) { - toSerialize["data_view"] = o.DataView - } - if !IsNil(o.Fields) { - toSerialize["fields"] = o.Fields - } - return toSerialize, nil -} - -type NullableCreateUpdateRuntimeField200Response struct { - value *CreateUpdateRuntimeField200Response - isSet bool -} - -func (v NullableCreateUpdateRuntimeField200Response) Get() *CreateUpdateRuntimeField200Response { - return v.value -} - -func (v *NullableCreateUpdateRuntimeField200Response) Set(val *CreateUpdateRuntimeField200Response) { - v.value = val - v.isSet = true -} - -func (v NullableCreateUpdateRuntimeField200Response) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateUpdateRuntimeField200Response) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateUpdateRuntimeField200Response(val *CreateUpdateRuntimeField200Response) *NullableCreateUpdateRuntimeField200Response { - return &NullableCreateUpdateRuntimeField200Response{value: val, isSet: true} -} - -func (v NullableCreateUpdateRuntimeField200Response) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateUpdateRuntimeField200Response) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/generated/data_views/model_create_update_runtime_field_request.go b/generated/data_views/model_create_update_runtime_field_request.go deleted file mode 100644 index 798fba607..000000000 --- a/generated/data_views/model_create_update_runtime_field_request.go +++ /dev/null @@ -1,144 +0,0 @@ -/* -Data views - -OpenAPI schema for data view endpoints - -API version: 0.1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package data_views - -import ( - "encoding/json" -) - -// checks if the CreateUpdateRuntimeFieldRequest type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &CreateUpdateRuntimeFieldRequest{} - -// CreateUpdateRuntimeFieldRequest struct for CreateUpdateRuntimeFieldRequest -type CreateUpdateRuntimeFieldRequest struct { - // The name for a runtime field. - Name string `json:"name"` - // The runtime field definition object. - RuntimeField map[string]interface{} `json:"runtimeField"` -} - -// NewCreateUpdateRuntimeFieldRequest instantiates a new CreateUpdateRuntimeFieldRequest 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 NewCreateUpdateRuntimeFieldRequest(name string, runtimeField map[string]interface{}) *CreateUpdateRuntimeFieldRequest { - this := CreateUpdateRuntimeFieldRequest{} - this.Name = name - this.RuntimeField = runtimeField - return &this -} - -// NewCreateUpdateRuntimeFieldRequestWithDefaults instantiates a new CreateUpdateRuntimeFieldRequest 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 NewCreateUpdateRuntimeFieldRequestWithDefaults() *CreateUpdateRuntimeFieldRequest { - this := CreateUpdateRuntimeFieldRequest{} - return &this -} - -// GetName returns the Name field value -func (o *CreateUpdateRuntimeFieldRequest) 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 *CreateUpdateRuntimeFieldRequest) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Name, true -} - -// SetName sets field value -func (o *CreateUpdateRuntimeFieldRequest) SetName(v string) { - o.Name = v -} - -// GetRuntimeField returns the RuntimeField field value -func (o *CreateUpdateRuntimeFieldRequest) GetRuntimeField() map[string]interface{} { - if o == nil { - var ret map[string]interface{} - return ret - } - - return o.RuntimeField -} - -// GetRuntimeFieldOk returns a tuple with the RuntimeField field value -// and a boolean to check if the value has been set. -func (o *CreateUpdateRuntimeFieldRequest) GetRuntimeFieldOk() (map[string]interface{}, bool) { - if o == nil { - return map[string]interface{}{}, false - } - return o.RuntimeField, true -} - -// SetRuntimeField sets field value -func (o *CreateUpdateRuntimeFieldRequest) SetRuntimeField(v map[string]interface{}) { - o.RuntimeField = v -} - -func (o CreateUpdateRuntimeFieldRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o CreateUpdateRuntimeFieldRequest) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["name"] = o.Name - toSerialize["runtimeField"] = o.RuntimeField - return toSerialize, nil -} - -type NullableCreateUpdateRuntimeFieldRequest struct { - value *CreateUpdateRuntimeFieldRequest - isSet bool -} - -func (v NullableCreateUpdateRuntimeFieldRequest) Get() *CreateUpdateRuntimeFieldRequest { - return v.value -} - -func (v *NullableCreateUpdateRuntimeFieldRequest) Set(val *CreateUpdateRuntimeFieldRequest) { - v.value = val - v.isSet = true -} - -func (v NullableCreateUpdateRuntimeFieldRequest) IsSet() bool { - return v.isSet -} - -func (v *NullableCreateUpdateRuntimeFieldRequest) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableCreateUpdateRuntimeFieldRequest(val *CreateUpdateRuntimeFieldRequest) *NullableCreateUpdateRuntimeFieldRequest { - return &NullableCreateUpdateRuntimeFieldRequest{value: val, isSet: true} -} - -func (v NullableCreateUpdateRuntimeFieldRequest) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableCreateUpdateRuntimeFieldRequest) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/generated/data_views/model_data_view_response_object.go b/generated/data_views/model_data_view_response_object.go deleted file mode 100644 index df6b81113..000000000 --- a/generated/data_views/model_data_view_response_object.go +++ /dev/null @@ -1,124 +0,0 @@ -/* -Data views - -OpenAPI schema for data view endpoints - -API version: 0.1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package data_views - -import ( - "encoding/json" -) - -// checks if the DataViewResponseObject type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &DataViewResponseObject{} - -// DataViewResponseObject struct for DataViewResponseObject -type DataViewResponseObject struct { - DataView *DataViewResponseObjectDataView `json:"data_view,omitempty"` -} - -// NewDataViewResponseObject instantiates a new DataViewResponseObject 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 NewDataViewResponseObject() *DataViewResponseObject { - this := DataViewResponseObject{} - return &this -} - -// NewDataViewResponseObjectWithDefaults instantiates a new DataViewResponseObject 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 NewDataViewResponseObjectWithDefaults() *DataViewResponseObject { - this := DataViewResponseObject{} - return &this -} - -// GetDataView returns the DataView field value if set, zero value otherwise. -func (o *DataViewResponseObject) GetDataView() DataViewResponseObjectDataView { - if o == nil || IsNil(o.DataView) { - var ret DataViewResponseObjectDataView - return ret - } - return *o.DataView -} - -// GetDataViewOk returns a tuple with the DataView field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DataViewResponseObject) GetDataViewOk() (*DataViewResponseObjectDataView, bool) { - if o == nil || IsNil(o.DataView) { - return nil, false - } - return o.DataView, true -} - -// HasDataView returns a boolean if a field has been set. -func (o *DataViewResponseObject) HasDataView() bool { - if o != nil && !IsNil(o.DataView) { - return true - } - - return false -} - -// SetDataView gets a reference to the given DataViewResponseObjectDataView and assigns it to the DataView field. -func (o *DataViewResponseObject) SetDataView(v DataViewResponseObjectDataView) { - o.DataView = &v -} - -func (o DataViewResponseObject) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o DataViewResponseObject) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.DataView) { - toSerialize["data_view"] = o.DataView - } - return toSerialize, nil -} - -type NullableDataViewResponseObject struct { - value *DataViewResponseObject - isSet bool -} - -func (v NullableDataViewResponseObject) Get() *DataViewResponseObject { - return v.value -} - -func (v *NullableDataViewResponseObject) Set(val *DataViewResponseObject) { - v.value = val - v.isSet = true -} - -func (v NullableDataViewResponseObject) IsSet() bool { - return v.isSet -} - -func (v *NullableDataViewResponseObject) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableDataViewResponseObject(val *DataViewResponseObject) *NullableDataViewResponseObject { - return &NullableDataViewResponseObject{value: val, isSet: true} -} - -func (v NullableDataViewResponseObject) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableDataViewResponseObject) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/generated/data_views/model_data_view_response_object_data_view.go b/generated/data_views/model_data_view_response_object_data_view.go deleted file mode 100644 index 177b3b495..000000000 --- a/generated/data_views/model_data_view_response_object_data_view.go +++ /dev/null @@ -1,566 +0,0 @@ -/* -Data views - -OpenAPI schema for data view endpoints - -API version: 0.1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package data_views - -import ( - "encoding/json" -) - -// checks if the DataViewResponseObjectDataView type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &DataViewResponseObjectDataView{} - -// DataViewResponseObjectDataView struct for DataViewResponseObjectDataView -type DataViewResponseObjectDataView struct { - // Allows the data view saved object to exist before the data is available. - AllowNoIndex *bool `json:"allowNoIndex,omitempty"` - // A map of field attributes by field name. - FieldAttrs map[string]interface{} `json:"fieldAttrs,omitempty"` - // A map of field formats by field name. - FieldFormats map[string]interface{} `json:"fieldFormats,omitempty"` - Fields map[string]interface{} `json:"fields,omitempty"` - Id *string `json:"id,omitempty"` - // The data view name. - Name *string `json:"name,omitempty"` - // An array of space identifiers for sharing the data view between multiple spaces. - Namespaces []string `json:"namespaces,omitempty"` - // A map of runtime field definitions by field name. - RuntimeFieldMap map[string]interface{} `json:"runtimeFieldMap,omitempty"` - // The array of field names you want to filter out in Discover. - SourceFilters []SourcefiltersInner `json:"sourceFilters,omitempty"` - // The timestamp field name, which you use for time-based data views. - TimeFieldName *string `json:"timeFieldName,omitempty"` - // Comma-separated list of data streams, indices, and aliases that you want to search. Supports wildcards (`*`). - Title *string `json:"title,omitempty"` - // When you use rollup indices, contains the field list for the rollup data view API endpoints. - TypeMeta map[string]interface{} `json:"typeMeta,omitempty"` - Version *string `json:"version,omitempty"` -} - -// NewDataViewResponseObjectDataView instantiates a new DataViewResponseObjectDataView 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 NewDataViewResponseObjectDataView() *DataViewResponseObjectDataView { - this := DataViewResponseObjectDataView{} - return &this -} - -// NewDataViewResponseObjectDataViewWithDefaults instantiates a new DataViewResponseObjectDataView 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 NewDataViewResponseObjectDataViewWithDefaults() *DataViewResponseObjectDataView { - this := DataViewResponseObjectDataView{} - return &this -} - -// GetAllowNoIndex returns the AllowNoIndex field value if set, zero value otherwise. -func (o *DataViewResponseObjectDataView) GetAllowNoIndex() bool { - if o == nil || IsNil(o.AllowNoIndex) { - var ret bool - return ret - } - return *o.AllowNoIndex -} - -// GetAllowNoIndexOk returns a tuple with the AllowNoIndex field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DataViewResponseObjectDataView) GetAllowNoIndexOk() (*bool, bool) { - if o == nil || IsNil(o.AllowNoIndex) { - return nil, false - } - return o.AllowNoIndex, true -} - -// HasAllowNoIndex returns a boolean if a field has been set. -func (o *DataViewResponseObjectDataView) HasAllowNoIndex() bool { - if o != nil && !IsNil(o.AllowNoIndex) { - return true - } - - return false -} - -// SetAllowNoIndex gets a reference to the given bool and assigns it to the AllowNoIndex field. -func (o *DataViewResponseObjectDataView) SetAllowNoIndex(v bool) { - o.AllowNoIndex = &v -} - -// GetFieldAttrs returns the FieldAttrs field value if set, zero value otherwise. -func (o *DataViewResponseObjectDataView) GetFieldAttrs() map[string]interface{} { - if o == nil || IsNil(o.FieldAttrs) { - var ret map[string]interface{} - return ret - } - return o.FieldAttrs -} - -// GetFieldAttrsOk returns a tuple with the FieldAttrs field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DataViewResponseObjectDataView) GetFieldAttrsOk() (map[string]interface{}, bool) { - if o == nil || IsNil(o.FieldAttrs) { - return map[string]interface{}{}, false - } - return o.FieldAttrs, true -} - -// HasFieldAttrs returns a boolean if a field has been set. -func (o *DataViewResponseObjectDataView) HasFieldAttrs() bool { - if o != nil && !IsNil(o.FieldAttrs) { - return true - } - - return false -} - -// SetFieldAttrs gets a reference to the given map[string]interface{} and assigns it to the FieldAttrs field. -func (o *DataViewResponseObjectDataView) SetFieldAttrs(v map[string]interface{}) { - o.FieldAttrs = v -} - -// GetFieldFormats returns the FieldFormats field value if set, zero value otherwise. -func (o *DataViewResponseObjectDataView) GetFieldFormats() map[string]interface{} { - if o == nil || IsNil(o.FieldFormats) { - var ret map[string]interface{} - return ret - } - return o.FieldFormats -} - -// GetFieldFormatsOk returns a tuple with the FieldFormats field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DataViewResponseObjectDataView) GetFieldFormatsOk() (map[string]interface{}, bool) { - if o == nil || IsNil(o.FieldFormats) { - return map[string]interface{}{}, false - } - return o.FieldFormats, true -} - -// HasFieldFormats returns a boolean if a field has been set. -func (o *DataViewResponseObjectDataView) HasFieldFormats() bool { - if o != nil && !IsNil(o.FieldFormats) { - return true - } - - return false -} - -// SetFieldFormats gets a reference to the given map[string]interface{} and assigns it to the FieldFormats field. -func (o *DataViewResponseObjectDataView) SetFieldFormats(v map[string]interface{}) { - o.FieldFormats = v -} - -// GetFields returns the Fields field value if set, zero value otherwise. -func (o *DataViewResponseObjectDataView) GetFields() map[string]interface{} { - if o == nil || IsNil(o.Fields) { - var ret map[string]interface{} - return ret - } - return o.Fields -} - -// GetFieldsOk returns a tuple with the Fields field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DataViewResponseObjectDataView) GetFieldsOk() (map[string]interface{}, bool) { - if o == nil || IsNil(o.Fields) { - return map[string]interface{}{}, false - } - return o.Fields, true -} - -// HasFields returns a boolean if a field has been set. -func (o *DataViewResponseObjectDataView) HasFields() bool { - if o != nil && !IsNil(o.Fields) { - return true - } - - return false -} - -// SetFields gets a reference to the given map[string]interface{} and assigns it to the Fields field. -func (o *DataViewResponseObjectDataView) SetFields(v map[string]interface{}) { - o.Fields = v -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *DataViewResponseObjectDataView) GetId() string { - if o == nil || IsNil(o.Id) { - var ret string - return ret - } - return *o.Id -} - -// GetIdOk returns a tuple with the Id field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DataViewResponseObjectDataView) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true -} - -// HasId returns a boolean if a field has been set. -func (o *DataViewResponseObjectDataView) HasId() bool { - if o != nil && !IsNil(o.Id) { - return true - } - - return false -} - -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *DataViewResponseObjectDataView) SetId(v string) { - o.Id = &v -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *DataViewResponseObjectDataView) GetName() string { - if o == nil || IsNil(o.Name) { - var ret string - return ret - } - return *o.Name -} - -// GetNameOk returns a tuple with the Name field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DataViewResponseObjectDataView) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { - return nil, false - } - return o.Name, true -} - -// HasName returns a boolean if a field has been set. -func (o *DataViewResponseObjectDataView) HasName() bool { - if o != nil && !IsNil(o.Name) { - return true - } - - return false -} - -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *DataViewResponseObjectDataView) SetName(v string) { - o.Name = &v -} - -// GetNamespaces returns the Namespaces field value if set, zero value otherwise. -func (o *DataViewResponseObjectDataView) GetNamespaces() []string { - if o == nil || IsNil(o.Namespaces) { - var ret []string - return ret - } - return o.Namespaces -} - -// GetNamespacesOk returns a tuple with the Namespaces field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DataViewResponseObjectDataView) GetNamespacesOk() ([]string, bool) { - if o == nil || IsNil(o.Namespaces) { - return nil, false - } - return o.Namespaces, true -} - -// HasNamespaces returns a boolean if a field has been set. -func (o *DataViewResponseObjectDataView) HasNamespaces() bool { - if o != nil && !IsNil(o.Namespaces) { - return true - } - - return false -} - -// SetNamespaces gets a reference to the given []string and assigns it to the Namespaces field. -func (o *DataViewResponseObjectDataView) SetNamespaces(v []string) { - o.Namespaces = v -} - -// GetRuntimeFieldMap returns the RuntimeFieldMap field value if set, zero value otherwise. -func (o *DataViewResponseObjectDataView) GetRuntimeFieldMap() map[string]interface{} { - if o == nil || IsNil(o.RuntimeFieldMap) { - var ret map[string]interface{} - return ret - } - return o.RuntimeFieldMap -} - -// GetRuntimeFieldMapOk returns a tuple with the RuntimeFieldMap field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DataViewResponseObjectDataView) GetRuntimeFieldMapOk() (map[string]interface{}, bool) { - if o == nil || IsNil(o.RuntimeFieldMap) { - return map[string]interface{}{}, false - } - return o.RuntimeFieldMap, true -} - -// HasRuntimeFieldMap returns a boolean if a field has been set. -func (o *DataViewResponseObjectDataView) HasRuntimeFieldMap() bool { - if o != nil && !IsNil(o.RuntimeFieldMap) { - return true - } - - return false -} - -// SetRuntimeFieldMap gets a reference to the given map[string]interface{} and assigns it to the RuntimeFieldMap field. -func (o *DataViewResponseObjectDataView) SetRuntimeFieldMap(v map[string]interface{}) { - o.RuntimeFieldMap = v -} - -// GetSourceFilters returns the SourceFilters field value if set, zero value otherwise. -func (o *DataViewResponseObjectDataView) GetSourceFilters() []SourcefiltersInner { - if o == nil || IsNil(o.SourceFilters) { - var ret []SourcefiltersInner - return ret - } - return o.SourceFilters -} - -// GetSourceFiltersOk returns a tuple with the SourceFilters field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DataViewResponseObjectDataView) GetSourceFiltersOk() ([]SourcefiltersInner, bool) { - if o == nil || IsNil(o.SourceFilters) { - return nil, false - } - return o.SourceFilters, true -} - -// HasSourceFilters returns a boolean if a field has been set. -func (o *DataViewResponseObjectDataView) HasSourceFilters() bool { - if o != nil && !IsNil(o.SourceFilters) { - return true - } - - return false -} - -// SetSourceFilters gets a reference to the given []SourcefiltersInner and assigns it to the SourceFilters field. -func (o *DataViewResponseObjectDataView) SetSourceFilters(v []SourcefiltersInner) { - o.SourceFilters = v -} - -// GetTimeFieldName returns the TimeFieldName field value if set, zero value otherwise. -func (o *DataViewResponseObjectDataView) GetTimeFieldName() string { - if o == nil || IsNil(o.TimeFieldName) { - var ret string - return ret - } - return *o.TimeFieldName -} - -// GetTimeFieldNameOk returns a tuple with the TimeFieldName field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DataViewResponseObjectDataView) GetTimeFieldNameOk() (*string, bool) { - if o == nil || IsNil(o.TimeFieldName) { - return nil, false - } - return o.TimeFieldName, true -} - -// HasTimeFieldName returns a boolean if a field has been set. -func (o *DataViewResponseObjectDataView) HasTimeFieldName() bool { - if o != nil && !IsNil(o.TimeFieldName) { - return true - } - - return false -} - -// SetTimeFieldName gets a reference to the given string and assigns it to the TimeFieldName field. -func (o *DataViewResponseObjectDataView) SetTimeFieldName(v string) { - o.TimeFieldName = &v -} - -// GetTitle returns the Title field value if set, zero value otherwise. -func (o *DataViewResponseObjectDataView) GetTitle() string { - if o == nil || IsNil(o.Title) { - var ret string - return ret - } - return *o.Title -} - -// GetTitleOk returns a tuple with the Title field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DataViewResponseObjectDataView) GetTitleOk() (*string, bool) { - if o == nil || IsNil(o.Title) { - return nil, false - } - return o.Title, true -} - -// HasTitle returns a boolean if a field has been set. -func (o *DataViewResponseObjectDataView) HasTitle() bool { - if o != nil && !IsNil(o.Title) { - return true - } - - return false -} - -// SetTitle gets a reference to the given string and assigns it to the Title field. -func (o *DataViewResponseObjectDataView) SetTitle(v string) { - o.Title = &v -} - -// GetTypeMeta returns the TypeMeta field value if set, zero value otherwise. -func (o *DataViewResponseObjectDataView) GetTypeMeta() map[string]interface{} { - if o == nil || IsNil(o.TypeMeta) { - var ret map[string]interface{} - return ret - } - return o.TypeMeta -} - -// GetTypeMetaOk returns a tuple with the TypeMeta field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DataViewResponseObjectDataView) GetTypeMetaOk() (map[string]interface{}, bool) { - if o == nil || IsNil(o.TypeMeta) { - return map[string]interface{}{}, false - } - return o.TypeMeta, true -} - -// HasTypeMeta returns a boolean if a field has been set. -func (o *DataViewResponseObjectDataView) HasTypeMeta() bool { - if o != nil && !IsNil(o.TypeMeta) { - return true - } - - return false -} - -// SetTypeMeta gets a reference to the given map[string]interface{} and assigns it to the TypeMeta field. -func (o *DataViewResponseObjectDataView) SetTypeMeta(v map[string]interface{}) { - o.TypeMeta = v -} - -// GetVersion returns the Version field value if set, zero value otherwise. -func (o *DataViewResponseObjectDataView) GetVersion() string { - if o == nil || IsNil(o.Version) { - var ret string - return ret - } - return *o.Version -} - -// GetVersionOk returns a tuple with the Version field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DataViewResponseObjectDataView) GetVersionOk() (*string, bool) { - if o == nil || IsNil(o.Version) { - return nil, false - } - return o.Version, true -} - -// HasVersion returns a boolean if a field has been set. -func (o *DataViewResponseObjectDataView) HasVersion() bool { - if o != nil && !IsNil(o.Version) { - return true - } - - return false -} - -// SetVersion gets a reference to the given string and assigns it to the Version field. -func (o *DataViewResponseObjectDataView) SetVersion(v string) { - o.Version = &v -} - -func (o DataViewResponseObjectDataView) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o DataViewResponseObjectDataView) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.AllowNoIndex) { - toSerialize["allowNoIndex"] = o.AllowNoIndex - } - if !IsNil(o.FieldAttrs) { - toSerialize["fieldAttrs"] = o.FieldAttrs - } - if !IsNil(o.FieldFormats) { - toSerialize["fieldFormats"] = o.FieldFormats - } - if !IsNil(o.Fields) { - toSerialize["fields"] = o.Fields - } - if !IsNil(o.Id) { - toSerialize["id"] = o.Id - } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name - } - if !IsNil(o.Namespaces) { - toSerialize["namespaces"] = o.Namespaces - } - if !IsNil(o.RuntimeFieldMap) { - toSerialize["runtimeFieldMap"] = o.RuntimeFieldMap - } - if !IsNil(o.SourceFilters) { - toSerialize["sourceFilters"] = o.SourceFilters - } - if !IsNil(o.TimeFieldName) { - toSerialize["timeFieldName"] = o.TimeFieldName - } - if !IsNil(o.Title) { - toSerialize["title"] = o.Title - } - if !IsNil(o.TypeMeta) { - toSerialize["typeMeta"] = o.TypeMeta - } - if !IsNil(o.Version) { - toSerialize["version"] = o.Version - } - return toSerialize, nil -} - -type NullableDataViewResponseObjectDataView struct { - value *DataViewResponseObjectDataView - isSet bool -} - -func (v NullableDataViewResponseObjectDataView) Get() *DataViewResponseObjectDataView { - return v.value -} - -func (v *NullableDataViewResponseObjectDataView) Set(val *DataViewResponseObjectDataView) { - v.value = val - v.isSet = true -} - -func (v NullableDataViewResponseObjectDataView) IsSet() bool { - return v.isSet -} - -func (v *NullableDataViewResponseObjectDataView) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableDataViewResponseObjectDataView(val *DataViewResponseObjectDataView) *NullableDataViewResponseObjectDataView { - return &NullableDataViewResponseObjectDataView{value: val, isSet: true} -} - -func (v NullableDataViewResponseObjectDataView) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableDataViewResponseObjectDataView) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/generated/data_views/model_get_all_data_views_200_response.go b/generated/data_views/model_get_all_data_views_200_response.go deleted file mode 100644 index f3fccd753..000000000 --- a/generated/data_views/model_get_all_data_views_200_response.go +++ /dev/null @@ -1,124 +0,0 @@ -/* -Data views - -OpenAPI schema for data view endpoints - -API version: 0.1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package data_views - -import ( - "encoding/json" -) - -// checks if the GetAllDataViews200Response type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &GetAllDataViews200Response{} - -// GetAllDataViews200Response struct for GetAllDataViews200Response -type GetAllDataViews200Response struct { - DataView []GetAllDataViews200ResponseDataViewInner `json:"data_view,omitempty"` -} - -// NewGetAllDataViews200Response instantiates a new GetAllDataViews200Response 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 NewGetAllDataViews200Response() *GetAllDataViews200Response { - this := GetAllDataViews200Response{} - return &this -} - -// NewGetAllDataViews200ResponseWithDefaults instantiates a new GetAllDataViews200Response 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 NewGetAllDataViews200ResponseWithDefaults() *GetAllDataViews200Response { - this := GetAllDataViews200Response{} - return &this -} - -// GetDataView returns the DataView field value if set, zero value otherwise. -func (o *GetAllDataViews200Response) GetDataView() []GetAllDataViews200ResponseDataViewInner { - if o == nil || IsNil(o.DataView) { - var ret []GetAllDataViews200ResponseDataViewInner - return ret - } - return o.DataView -} - -// GetDataViewOk returns a tuple with the DataView field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *GetAllDataViews200Response) GetDataViewOk() ([]GetAllDataViews200ResponseDataViewInner, bool) { - if o == nil || IsNil(o.DataView) { - return nil, false - } - return o.DataView, true -} - -// HasDataView returns a boolean if a field has been set. -func (o *GetAllDataViews200Response) HasDataView() bool { - if o != nil && !IsNil(o.DataView) { - return true - } - - return false -} - -// SetDataView gets a reference to the given []GetAllDataViews200ResponseDataViewInner and assigns it to the DataView field. -func (o *GetAllDataViews200Response) SetDataView(v []GetAllDataViews200ResponseDataViewInner) { - o.DataView = v -} - -func (o GetAllDataViews200Response) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o GetAllDataViews200Response) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.DataView) { - toSerialize["data_view"] = o.DataView - } - return toSerialize, nil -} - -type NullableGetAllDataViews200Response struct { - value *GetAllDataViews200Response - isSet bool -} - -func (v NullableGetAllDataViews200Response) Get() *GetAllDataViews200Response { - return v.value -} - -func (v *NullableGetAllDataViews200Response) Set(val *GetAllDataViews200Response) { - v.value = val - v.isSet = true -} - -func (v NullableGetAllDataViews200Response) IsSet() bool { - return v.isSet -} - -func (v *NullableGetAllDataViews200Response) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableGetAllDataViews200Response(val *GetAllDataViews200Response) *NullableGetAllDataViews200Response { - return &NullableGetAllDataViews200Response{value: val, isSet: true} -} - -func (v NullableGetAllDataViews200Response) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableGetAllDataViews200Response) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/generated/data_views/model_get_all_data_views_200_response_data_view_inner.go b/generated/data_views/model_get_all_data_views_200_response_data_view_inner.go deleted file mode 100644 index 73d4ded06..000000000 --- a/generated/data_views/model_get_all_data_views_200_response_data_view_inner.go +++ /dev/null @@ -1,268 +0,0 @@ -/* -Data views - -OpenAPI schema for data view endpoints - -API version: 0.1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package data_views - -import ( - "encoding/json" -) - -// checks if the GetAllDataViews200ResponseDataViewInner type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &GetAllDataViews200ResponseDataViewInner{} - -// GetAllDataViews200ResponseDataViewInner struct for GetAllDataViews200ResponseDataViewInner -type GetAllDataViews200ResponseDataViewInner struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Namespaces []string `json:"namespaces,omitempty"` - Title *string `json:"title,omitempty"` - TypeMeta map[string]interface{} `json:"typeMeta,omitempty"` -} - -// NewGetAllDataViews200ResponseDataViewInner instantiates a new GetAllDataViews200ResponseDataViewInner 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 NewGetAllDataViews200ResponseDataViewInner() *GetAllDataViews200ResponseDataViewInner { - this := GetAllDataViews200ResponseDataViewInner{} - return &this -} - -// NewGetAllDataViews200ResponseDataViewInnerWithDefaults instantiates a new GetAllDataViews200ResponseDataViewInner 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 NewGetAllDataViews200ResponseDataViewInnerWithDefaults() *GetAllDataViews200ResponseDataViewInner { - this := GetAllDataViews200ResponseDataViewInner{} - return &this -} - -// GetId returns the Id field value if set, zero value otherwise. -func (o *GetAllDataViews200ResponseDataViewInner) GetId() string { - if o == nil || IsNil(o.Id) { - var ret string - return ret - } - return *o.Id -} - -// GetIdOk returns a tuple with the Id field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *GetAllDataViews200ResponseDataViewInner) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true -} - -// HasId returns a boolean if a field has been set. -func (o *GetAllDataViews200ResponseDataViewInner) HasId() bool { - if o != nil && !IsNil(o.Id) { - return true - } - - return false -} - -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *GetAllDataViews200ResponseDataViewInner) SetId(v string) { - o.Id = &v -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *GetAllDataViews200ResponseDataViewInner) GetName() string { - if o == nil || IsNil(o.Name) { - var ret string - return ret - } - return *o.Name -} - -// GetNameOk returns a tuple with the Name field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *GetAllDataViews200ResponseDataViewInner) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { - return nil, false - } - return o.Name, true -} - -// HasName returns a boolean if a field has been set. -func (o *GetAllDataViews200ResponseDataViewInner) HasName() bool { - if o != nil && !IsNil(o.Name) { - return true - } - - return false -} - -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *GetAllDataViews200ResponseDataViewInner) SetName(v string) { - o.Name = &v -} - -// GetNamespaces returns the Namespaces field value if set, zero value otherwise. -func (o *GetAllDataViews200ResponseDataViewInner) GetNamespaces() []string { - if o == nil || IsNil(o.Namespaces) { - var ret []string - return ret - } - return o.Namespaces -} - -// GetNamespacesOk returns a tuple with the Namespaces field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *GetAllDataViews200ResponseDataViewInner) GetNamespacesOk() ([]string, bool) { - if o == nil || IsNil(o.Namespaces) { - return nil, false - } - return o.Namespaces, true -} - -// HasNamespaces returns a boolean if a field has been set. -func (o *GetAllDataViews200ResponseDataViewInner) HasNamespaces() bool { - if o != nil && !IsNil(o.Namespaces) { - return true - } - - return false -} - -// SetNamespaces gets a reference to the given []string and assigns it to the Namespaces field. -func (o *GetAllDataViews200ResponseDataViewInner) SetNamespaces(v []string) { - o.Namespaces = v -} - -// GetTitle returns the Title field value if set, zero value otherwise. -func (o *GetAllDataViews200ResponseDataViewInner) GetTitle() string { - if o == nil || IsNil(o.Title) { - var ret string - return ret - } - return *o.Title -} - -// GetTitleOk returns a tuple with the Title field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *GetAllDataViews200ResponseDataViewInner) GetTitleOk() (*string, bool) { - if o == nil || IsNil(o.Title) { - return nil, false - } - return o.Title, true -} - -// HasTitle returns a boolean if a field has been set. -func (o *GetAllDataViews200ResponseDataViewInner) HasTitle() bool { - if o != nil && !IsNil(o.Title) { - return true - } - - return false -} - -// SetTitle gets a reference to the given string and assigns it to the Title field. -func (o *GetAllDataViews200ResponseDataViewInner) SetTitle(v string) { - o.Title = &v -} - -// GetTypeMeta returns the TypeMeta field value if set, zero value otherwise. -func (o *GetAllDataViews200ResponseDataViewInner) GetTypeMeta() map[string]interface{} { - if o == nil || IsNil(o.TypeMeta) { - var ret map[string]interface{} - return ret - } - return o.TypeMeta -} - -// GetTypeMetaOk returns a tuple with the TypeMeta field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *GetAllDataViews200ResponseDataViewInner) GetTypeMetaOk() (map[string]interface{}, bool) { - if o == nil || IsNil(o.TypeMeta) { - return map[string]interface{}{}, false - } - return o.TypeMeta, true -} - -// HasTypeMeta returns a boolean if a field has been set. -func (o *GetAllDataViews200ResponseDataViewInner) HasTypeMeta() bool { - if o != nil && !IsNil(o.TypeMeta) { - return true - } - - return false -} - -// SetTypeMeta gets a reference to the given map[string]interface{} and assigns it to the TypeMeta field. -func (o *GetAllDataViews200ResponseDataViewInner) SetTypeMeta(v map[string]interface{}) { - o.TypeMeta = v -} - -func (o GetAllDataViews200ResponseDataViewInner) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o GetAllDataViews200ResponseDataViewInner) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Id) { - toSerialize["id"] = o.Id - } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name - } - if !IsNil(o.Namespaces) { - toSerialize["namespaces"] = o.Namespaces - } - if !IsNil(o.Title) { - toSerialize["title"] = o.Title - } - if !IsNil(o.TypeMeta) { - toSerialize["typeMeta"] = o.TypeMeta - } - return toSerialize, nil -} - -type NullableGetAllDataViews200ResponseDataViewInner struct { - value *GetAllDataViews200ResponseDataViewInner - isSet bool -} - -func (v NullableGetAllDataViews200ResponseDataViewInner) Get() *GetAllDataViews200ResponseDataViewInner { - return v.value -} - -func (v *NullableGetAllDataViews200ResponseDataViewInner) Set(val *GetAllDataViews200ResponseDataViewInner) { - v.value = val - v.isSet = true -} - -func (v NullableGetAllDataViews200ResponseDataViewInner) IsSet() bool { - return v.isSet -} - -func (v *NullableGetAllDataViews200ResponseDataViewInner) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableGetAllDataViews200ResponseDataViewInner(val *GetAllDataViews200ResponseDataViewInner) *NullableGetAllDataViews200ResponseDataViewInner { - return &NullableGetAllDataViews200ResponseDataViewInner{value: val, isSet: true} -} - -func (v NullableGetAllDataViews200ResponseDataViewInner) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableGetAllDataViews200ResponseDataViewInner) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/generated/data_views/model_get_default_data_view_200_response.go b/generated/data_views/model_get_default_data_view_200_response.go deleted file mode 100644 index 209c591f3..000000000 --- a/generated/data_views/model_get_default_data_view_200_response.go +++ /dev/null @@ -1,124 +0,0 @@ -/* -Data views - -OpenAPI schema for data view endpoints - -API version: 0.1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package data_views - -import ( - "encoding/json" -) - -// checks if the GetDefaultDataView200Response type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &GetDefaultDataView200Response{} - -// GetDefaultDataView200Response struct for GetDefaultDataView200Response -type GetDefaultDataView200Response struct { - DataViewId *string `json:"data_view_id,omitempty"` -} - -// NewGetDefaultDataView200Response instantiates a new GetDefaultDataView200Response 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 NewGetDefaultDataView200Response() *GetDefaultDataView200Response { - this := GetDefaultDataView200Response{} - return &this -} - -// NewGetDefaultDataView200ResponseWithDefaults instantiates a new GetDefaultDataView200Response 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 NewGetDefaultDataView200ResponseWithDefaults() *GetDefaultDataView200Response { - this := GetDefaultDataView200Response{} - return &this -} - -// GetDataViewId returns the DataViewId field value if set, zero value otherwise. -func (o *GetDefaultDataView200Response) 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 *GetDefaultDataView200Response) 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 *GetDefaultDataView200Response) 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 *GetDefaultDataView200Response) SetDataViewId(v string) { - o.DataViewId = &v -} - -func (o GetDefaultDataView200Response) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o GetDefaultDataView200Response) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.DataViewId) { - toSerialize["data_view_id"] = o.DataViewId - } - return toSerialize, nil -} - -type NullableGetDefaultDataView200Response struct { - value *GetDefaultDataView200Response - isSet bool -} - -func (v NullableGetDefaultDataView200Response) Get() *GetDefaultDataView200Response { - return v.value -} - -func (v *NullableGetDefaultDataView200Response) Set(val *GetDefaultDataView200Response) { - v.value = val - v.isSet = true -} - -func (v NullableGetDefaultDataView200Response) IsSet() bool { - return v.isSet -} - -func (v *NullableGetDefaultDataView200Response) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableGetDefaultDataView200Response(val *GetDefaultDataView200Response) *NullableGetDefaultDataView200Response { - return &NullableGetDefaultDataView200Response{value: val, isSet: true} -} - -func (v NullableGetDefaultDataView200Response) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableGetDefaultDataView200Response) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/generated/data_views/model_get_runtime_field_200_response.go b/generated/data_views/model_get_runtime_field_200_response.go deleted file mode 100644 index b32af8fef..000000000 --- a/generated/data_views/model_get_runtime_field_200_response.go +++ /dev/null @@ -1,160 +0,0 @@ -/* -Data views - -OpenAPI schema for data view endpoints - -API version: 0.1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package data_views - -import ( - "encoding/json" -) - -// checks if the GetRuntimeField200Response type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &GetRuntimeField200Response{} - -// GetRuntimeField200Response struct for GetRuntimeField200Response -type GetRuntimeField200Response struct { - DataView map[string]interface{} `json:"data_view,omitempty"` - Fields []map[string]interface{} `json:"fields,omitempty"` -} - -// NewGetRuntimeField200Response instantiates a new GetRuntimeField200Response 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 NewGetRuntimeField200Response() *GetRuntimeField200Response { - this := GetRuntimeField200Response{} - return &this -} - -// NewGetRuntimeField200ResponseWithDefaults instantiates a new GetRuntimeField200Response 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 NewGetRuntimeField200ResponseWithDefaults() *GetRuntimeField200Response { - this := GetRuntimeField200Response{} - return &this -} - -// GetDataView returns the DataView field value if set, zero value otherwise. -func (o *GetRuntimeField200Response) GetDataView() map[string]interface{} { - if o == nil || IsNil(o.DataView) { - var ret map[string]interface{} - return ret - } - return o.DataView -} - -// GetDataViewOk returns a tuple with the DataView field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *GetRuntimeField200Response) GetDataViewOk() (map[string]interface{}, bool) { - if o == nil || IsNil(o.DataView) { - return map[string]interface{}{}, false - } - return o.DataView, true -} - -// HasDataView returns a boolean if a field has been set. -func (o *GetRuntimeField200Response) HasDataView() bool { - if o != nil && !IsNil(o.DataView) { - return true - } - - return false -} - -// SetDataView gets a reference to the given map[string]interface{} and assigns it to the DataView field. -func (o *GetRuntimeField200Response) SetDataView(v map[string]interface{}) { - o.DataView = v -} - -// GetFields returns the Fields field value if set, zero value otherwise. -func (o *GetRuntimeField200Response) GetFields() []map[string]interface{} { - if o == nil || IsNil(o.Fields) { - var ret []map[string]interface{} - return ret - } - return o.Fields -} - -// GetFieldsOk returns a tuple with the Fields field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *GetRuntimeField200Response) GetFieldsOk() ([]map[string]interface{}, bool) { - if o == nil || IsNil(o.Fields) { - return nil, false - } - return o.Fields, true -} - -// HasFields returns a boolean if a field has been set. -func (o *GetRuntimeField200Response) HasFields() bool { - if o != nil && !IsNil(o.Fields) { - return true - } - - return false -} - -// SetFields gets a reference to the given []map[string]interface{} and assigns it to the Fields field. -func (o *GetRuntimeField200Response) SetFields(v []map[string]interface{}) { - o.Fields = v -} - -func (o GetRuntimeField200Response) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o GetRuntimeField200Response) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.DataView) { - toSerialize["data_view"] = o.DataView - } - if !IsNil(o.Fields) { - toSerialize["fields"] = o.Fields - } - return toSerialize, nil -} - -type NullableGetRuntimeField200Response struct { - value *GetRuntimeField200Response - isSet bool -} - -func (v NullableGetRuntimeField200Response) Get() *GetRuntimeField200Response { - return v.value -} - -func (v *NullableGetRuntimeField200Response) Set(val *GetRuntimeField200Response) { - v.value = val - v.isSet = true -} - -func (v NullableGetRuntimeField200Response) IsSet() bool { - return v.isSet -} - -func (v *NullableGetRuntimeField200Response) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableGetRuntimeField200Response(val *GetRuntimeField200Response) *NullableGetRuntimeField200Response { - return &NullableGetRuntimeField200Response{value: val, isSet: true} -} - -func (v NullableGetRuntimeField200Response) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableGetRuntimeField200Response) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/generated/data_views/model_set_default_datail_view_200_response.go b/generated/data_views/model_set_default_datail_view_200_response.go deleted file mode 100644 index bfd589c8d..000000000 --- a/generated/data_views/model_set_default_datail_view_200_response.go +++ /dev/null @@ -1,124 +0,0 @@ -/* -Data views - -OpenAPI schema for data view endpoints - -API version: 0.1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package data_views - -import ( - "encoding/json" -) - -// checks if the SetDefaultDatailView200Response type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &SetDefaultDatailView200Response{} - -// SetDefaultDatailView200Response struct for SetDefaultDatailView200Response -type SetDefaultDatailView200Response struct { - Acknowledged *bool `json:"acknowledged,omitempty"` -} - -// NewSetDefaultDatailView200Response instantiates a new SetDefaultDatailView200Response 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 NewSetDefaultDatailView200Response() *SetDefaultDatailView200Response { - this := SetDefaultDatailView200Response{} - return &this -} - -// NewSetDefaultDatailView200ResponseWithDefaults instantiates a new SetDefaultDatailView200Response 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 NewSetDefaultDatailView200ResponseWithDefaults() *SetDefaultDatailView200Response { - this := SetDefaultDatailView200Response{} - return &this -} - -// GetAcknowledged returns the Acknowledged field value if set, zero value otherwise. -func (o *SetDefaultDatailView200Response) GetAcknowledged() bool { - if o == nil || IsNil(o.Acknowledged) { - var ret bool - return ret - } - return *o.Acknowledged -} - -// GetAcknowledgedOk returns a tuple with the Acknowledged field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *SetDefaultDatailView200Response) GetAcknowledgedOk() (*bool, bool) { - if o == nil || IsNil(o.Acknowledged) { - return nil, false - } - return o.Acknowledged, true -} - -// HasAcknowledged returns a boolean if a field has been set. -func (o *SetDefaultDatailView200Response) HasAcknowledged() bool { - if o != nil && !IsNil(o.Acknowledged) { - return true - } - - return false -} - -// SetAcknowledged gets a reference to the given bool and assigns it to the Acknowledged field. -func (o *SetDefaultDatailView200Response) SetAcknowledged(v bool) { - o.Acknowledged = &v -} - -func (o SetDefaultDatailView200Response) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o SetDefaultDatailView200Response) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Acknowledged) { - toSerialize["acknowledged"] = o.Acknowledged - } - return toSerialize, nil -} - -type NullableSetDefaultDatailView200Response struct { - value *SetDefaultDatailView200Response - isSet bool -} - -func (v NullableSetDefaultDatailView200Response) Get() *SetDefaultDatailView200Response { - return v.value -} - -func (v *NullableSetDefaultDatailView200Response) Set(val *SetDefaultDatailView200Response) { - v.value = val - v.isSet = true -} - -func (v NullableSetDefaultDatailView200Response) IsSet() bool { - return v.isSet -} - -func (v *NullableSetDefaultDatailView200Response) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableSetDefaultDatailView200Response(val *SetDefaultDatailView200Response) *NullableSetDefaultDatailView200Response { - return &NullableSetDefaultDatailView200Response{value: val, isSet: true} -} - -func (v NullableSetDefaultDatailView200Response) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableSetDefaultDatailView200Response) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/generated/data_views/model_set_default_datail_view_request.go b/generated/data_views/model_set_default_datail_view_request.go deleted file mode 100644 index 82997ba59..000000000 --- a/generated/data_views/model_set_default_datail_view_request.go +++ /dev/null @@ -1,161 +0,0 @@ -/* -Data views - -OpenAPI schema for data view endpoints - -API version: 0.1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package data_views - -import ( - "encoding/json" -) - -// checks if the SetDefaultDatailViewRequest type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &SetDefaultDatailViewRequest{} - -// SetDefaultDatailViewRequest struct for SetDefaultDatailViewRequest -type SetDefaultDatailViewRequest struct { - // The data view identifier. NOTE: The API does not validate whether it is a valid identifier. Use `null` to unset the default data view. - DataViewId interface{} `json:"data_view_id"` - // Update an existing default data view identifier. - Force *bool `json:"force,omitempty"` -} - -// NewSetDefaultDatailViewRequest instantiates a new SetDefaultDatailViewRequest 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 NewSetDefaultDatailViewRequest(dataViewId interface{}) *SetDefaultDatailViewRequest { - this := SetDefaultDatailViewRequest{} - this.DataViewId = dataViewId - var force bool = false - this.Force = &force - return &this -} - -// NewSetDefaultDatailViewRequestWithDefaults instantiates a new SetDefaultDatailViewRequest 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 NewSetDefaultDatailViewRequestWithDefaults() *SetDefaultDatailViewRequest { - this := SetDefaultDatailViewRequest{} - var force bool = false - this.Force = &force - return &this -} - -// GetDataViewId returns the DataViewId field value -// If the value is explicit nil, the zero value for interface{} will be returned -func (o *SetDefaultDatailViewRequest) GetDataViewId() interface{} { - if o == nil { - var ret interface{} - return ret - } - - return o.DataViewId -} - -// GetDataViewIdOk returns a tuple with the DataViewId field value -// 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 *SetDefaultDatailViewRequest) GetDataViewIdOk() (*interface{}, bool) { - if o == nil || IsNil(o.DataViewId) { - return nil, false - } - return &o.DataViewId, true -} - -// SetDataViewId sets field value -func (o *SetDefaultDatailViewRequest) SetDataViewId(v interface{}) { - o.DataViewId = v -} - -// GetForce returns the Force field value if set, zero value otherwise. -func (o *SetDefaultDatailViewRequest) GetForce() bool { - if o == nil || IsNil(o.Force) { - var ret bool - return ret - } - return *o.Force -} - -// GetForceOk returns a tuple with the Force field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *SetDefaultDatailViewRequest) GetForceOk() (*bool, bool) { - if o == nil || IsNil(o.Force) { - return nil, false - } - return o.Force, true -} - -// HasForce returns a boolean if a field has been set. -func (o *SetDefaultDatailViewRequest) HasForce() bool { - if o != nil && !IsNil(o.Force) { - return true - } - - return false -} - -// SetForce gets a reference to the given bool and assigns it to the Force field. -func (o *SetDefaultDatailViewRequest) SetForce(v bool) { - o.Force = &v -} - -func (o SetDefaultDatailViewRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o SetDefaultDatailViewRequest) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if o.DataViewId != nil { - toSerialize["data_view_id"] = o.DataViewId - } - if !IsNil(o.Force) { - toSerialize["force"] = o.Force - } - return toSerialize, nil -} - -type NullableSetDefaultDatailViewRequest struct { - value *SetDefaultDatailViewRequest - isSet bool -} - -func (v NullableSetDefaultDatailViewRequest) Get() *SetDefaultDatailViewRequest { - return v.value -} - -func (v *NullableSetDefaultDatailViewRequest) Set(val *SetDefaultDatailViewRequest) { - v.value = val - v.isSet = true -} - -func (v NullableSetDefaultDatailViewRequest) IsSet() bool { - return v.isSet -} - -func (v *NullableSetDefaultDatailViewRequest) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableSetDefaultDatailViewRequest(val *SetDefaultDatailViewRequest) *NullableSetDefaultDatailViewRequest { - return &NullableSetDefaultDatailViewRequest{value: val, isSet: true} -} - -func (v NullableSetDefaultDatailViewRequest) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableSetDefaultDatailViewRequest) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/generated/data_views/model_sourcefilters_inner.go b/generated/data_views/model_sourcefilters_inner.go deleted file mode 100644 index e15ce7277..000000000 --- a/generated/data_views/model_sourcefilters_inner.go +++ /dev/null @@ -1,115 +0,0 @@ -/* -Data views - -OpenAPI schema for data view endpoints - -API version: 0.1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package data_views - -import ( - "encoding/json" -) - -// checks if the SourcefiltersInner type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &SourcefiltersInner{} - -// SourcefiltersInner struct for SourcefiltersInner -type SourcefiltersInner struct { - Value string `json:"value"` -} - -// NewSourcefiltersInner instantiates a new SourcefiltersInner 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 NewSourcefiltersInner(value string) *SourcefiltersInner { - this := SourcefiltersInner{} - this.Value = value - return &this -} - -// NewSourcefiltersInnerWithDefaults instantiates a new SourcefiltersInner 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 NewSourcefiltersInnerWithDefaults() *SourcefiltersInner { - this := SourcefiltersInner{} - return &this -} - -// GetValue returns the Value field value -func (o *SourcefiltersInner) GetValue() string { - if o == nil { - var ret string - return ret - } - - return o.Value -} - -// GetValueOk returns a tuple with the Value field value -// and a boolean to check if the value has been set. -func (o *SourcefiltersInner) GetValueOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Value, true -} - -// SetValue sets field value -func (o *SourcefiltersInner) SetValue(v string) { - o.Value = v -} - -func (o SourcefiltersInner) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o SourcefiltersInner) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["value"] = o.Value - return toSerialize, nil -} - -type NullableSourcefiltersInner struct { - value *SourcefiltersInner - isSet bool -} - -func (v NullableSourcefiltersInner) Get() *SourcefiltersInner { - return v.value -} - -func (v *NullableSourcefiltersInner) Set(val *SourcefiltersInner) { - v.value = val - v.isSet = true -} - -func (v NullableSourcefiltersInner) IsSet() bool { - return v.isSet -} - -func (v *NullableSourcefiltersInner) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableSourcefiltersInner(val *SourcefiltersInner) *NullableSourcefiltersInner { - return &NullableSourcefiltersInner{value: val, isSet: true} -} - -func (v NullableSourcefiltersInner) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableSourcefiltersInner) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/generated/data_views/model_update_data_view_request_object.go b/generated/data_views/model_update_data_view_request_object.go deleted file mode 100644 index 0ebbb5223..000000000 --- a/generated/data_views/model_update_data_view_request_object.go +++ /dev/null @@ -1,156 +0,0 @@ -/* -Data views - -OpenAPI schema for data view endpoints - -API version: 0.1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package data_views - -import ( - "encoding/json" -) - -// checks if the UpdateDataViewRequestObject type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &UpdateDataViewRequestObject{} - -// UpdateDataViewRequestObject struct for UpdateDataViewRequestObject -type UpdateDataViewRequestObject struct { - DataView UpdateDataViewRequestObjectDataView `json:"data_view"` - // Reloads the data view fields after the data view is updated. - RefreshFields *bool `json:"refresh_fields,omitempty"` -} - -// NewUpdateDataViewRequestObject instantiates a new UpdateDataViewRequestObject 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 NewUpdateDataViewRequestObject(dataView UpdateDataViewRequestObjectDataView) *UpdateDataViewRequestObject { - this := UpdateDataViewRequestObject{} - this.DataView = dataView - var refreshFields bool = false - this.RefreshFields = &refreshFields - return &this -} - -// NewUpdateDataViewRequestObjectWithDefaults instantiates a new UpdateDataViewRequestObject 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 NewUpdateDataViewRequestObjectWithDefaults() *UpdateDataViewRequestObject { - this := UpdateDataViewRequestObject{} - var refreshFields bool = false - this.RefreshFields = &refreshFields - return &this -} - -// GetDataView returns the DataView field value -func (o *UpdateDataViewRequestObject) GetDataView() UpdateDataViewRequestObjectDataView { - if o == nil { - var ret UpdateDataViewRequestObjectDataView - return ret - } - - return o.DataView -} - -// GetDataViewOk returns a tuple with the DataView field value -// and a boolean to check if the value has been set. -func (o *UpdateDataViewRequestObject) GetDataViewOk() (*UpdateDataViewRequestObjectDataView, bool) { - if o == nil { - return nil, false - } - return &o.DataView, true -} - -// SetDataView sets field value -func (o *UpdateDataViewRequestObject) SetDataView(v UpdateDataViewRequestObjectDataView) { - o.DataView = v -} - -// GetRefreshFields returns the RefreshFields field value if set, zero value otherwise. -func (o *UpdateDataViewRequestObject) GetRefreshFields() bool { - if o == nil || IsNil(o.RefreshFields) { - var ret bool - return ret - } - return *o.RefreshFields -} - -// GetRefreshFieldsOk returns a tuple with the RefreshFields field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateDataViewRequestObject) GetRefreshFieldsOk() (*bool, bool) { - if o == nil || IsNil(o.RefreshFields) { - return nil, false - } - return o.RefreshFields, true -} - -// HasRefreshFields returns a boolean if a field has been set. -func (o *UpdateDataViewRequestObject) HasRefreshFields() bool { - if o != nil && !IsNil(o.RefreshFields) { - return true - } - - return false -} - -// SetRefreshFields gets a reference to the given bool and assigns it to the RefreshFields field. -func (o *UpdateDataViewRequestObject) SetRefreshFields(v bool) { - o.RefreshFields = &v -} - -func (o UpdateDataViewRequestObject) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o UpdateDataViewRequestObject) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["data_view"] = o.DataView - if !IsNil(o.RefreshFields) { - toSerialize["refresh_fields"] = o.RefreshFields - } - return toSerialize, nil -} - -type NullableUpdateDataViewRequestObject struct { - value *UpdateDataViewRequestObject - isSet bool -} - -func (v NullableUpdateDataViewRequestObject) Get() *UpdateDataViewRequestObject { - return v.value -} - -func (v *NullableUpdateDataViewRequestObject) Set(val *UpdateDataViewRequestObject) { - v.value = val - v.isSet = true -} - -func (v NullableUpdateDataViewRequestObject) IsSet() bool { - return v.isSet -} - -func (v *NullableUpdateDataViewRequestObject) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableUpdateDataViewRequestObject(val *UpdateDataViewRequestObject) *NullableUpdateDataViewRequestObject { - return &NullableUpdateDataViewRequestObject{value: val, isSet: true} -} - -func (v NullableUpdateDataViewRequestObject) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableUpdateDataViewRequestObject) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/generated/data_views/model_update_data_view_request_object_data_view.go b/generated/data_views/model_update_data_view_request_object_data_view.go deleted file mode 100644 index 04a11b149..000000000 --- a/generated/data_views/model_update_data_view_request_object_data_view.go +++ /dev/null @@ -1,456 +0,0 @@ -/* -Data views - -OpenAPI schema for data view endpoints - -API version: 0.1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package data_views - -import ( - "encoding/json" -) - -// checks if the UpdateDataViewRequestObjectDataView type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &UpdateDataViewRequestObjectDataView{} - -// UpdateDataViewRequestObjectDataView The data view properties you want to update. Only the specified properties are updated in the data view. Unspecified fields stay as they are persisted. -type UpdateDataViewRequestObjectDataView struct { - // Allows the data view saved object to exist before the data is available. - AllowNoIndex *bool `json:"allowNoIndex,omitempty"` - // A map of field formats by field name. - FieldFormats map[string]interface{} `json:"fieldFormats,omitempty"` - Fields map[string]interface{} `json:"fields,omitempty"` - Name *string `json:"name,omitempty"` - // A map of runtime field definitions by field name. - RuntimeFieldMap map[string]interface{} `json:"runtimeFieldMap,omitempty"` - // The array of field names you want to filter out in Discover. - SourceFilters []SourcefiltersInner `json:"sourceFilters,omitempty"` - // The timestamp field name, which you use for time-based data views. - TimeFieldName *string `json:"timeFieldName,omitempty"` - // Comma-separated list of data streams, indices, and aliases that you want to search. Supports wildcards (`*`). - Title *string `json:"title,omitempty"` - // When set to `rollup`, identifies the rollup data views. - Type *string `json:"type,omitempty"` - // When you use rollup indices, contains the field list for the rollup data view API endpoints. - TypeMeta map[string]interface{} `json:"typeMeta,omitempty"` -} - -// NewUpdateDataViewRequestObjectDataView instantiates a new UpdateDataViewRequestObjectDataView 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 NewUpdateDataViewRequestObjectDataView() *UpdateDataViewRequestObjectDataView { - this := UpdateDataViewRequestObjectDataView{} - return &this -} - -// NewUpdateDataViewRequestObjectDataViewWithDefaults instantiates a new UpdateDataViewRequestObjectDataView 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 NewUpdateDataViewRequestObjectDataViewWithDefaults() *UpdateDataViewRequestObjectDataView { - this := UpdateDataViewRequestObjectDataView{} - return &this -} - -// GetAllowNoIndex returns the AllowNoIndex field value if set, zero value otherwise. -func (o *UpdateDataViewRequestObjectDataView) GetAllowNoIndex() bool { - if o == nil || IsNil(o.AllowNoIndex) { - var ret bool - return ret - } - return *o.AllowNoIndex -} - -// GetAllowNoIndexOk returns a tuple with the AllowNoIndex field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateDataViewRequestObjectDataView) GetAllowNoIndexOk() (*bool, bool) { - if o == nil || IsNil(o.AllowNoIndex) { - return nil, false - } - return o.AllowNoIndex, true -} - -// HasAllowNoIndex returns a boolean if a field has been set. -func (o *UpdateDataViewRequestObjectDataView) HasAllowNoIndex() bool { - if o != nil && !IsNil(o.AllowNoIndex) { - return true - } - - return false -} - -// SetAllowNoIndex gets a reference to the given bool and assigns it to the AllowNoIndex field. -func (o *UpdateDataViewRequestObjectDataView) SetAllowNoIndex(v bool) { - o.AllowNoIndex = &v -} - -// GetFieldFormats returns the FieldFormats field value if set, zero value otherwise. -func (o *UpdateDataViewRequestObjectDataView) GetFieldFormats() map[string]interface{} { - if o == nil || IsNil(o.FieldFormats) { - var ret map[string]interface{} - return ret - } - return o.FieldFormats -} - -// GetFieldFormatsOk returns a tuple with the FieldFormats field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateDataViewRequestObjectDataView) GetFieldFormatsOk() (map[string]interface{}, bool) { - if o == nil || IsNil(o.FieldFormats) { - return map[string]interface{}{}, false - } - return o.FieldFormats, true -} - -// HasFieldFormats returns a boolean if a field has been set. -func (o *UpdateDataViewRequestObjectDataView) HasFieldFormats() bool { - if o != nil && !IsNil(o.FieldFormats) { - return true - } - - return false -} - -// SetFieldFormats gets a reference to the given map[string]interface{} and assigns it to the FieldFormats field. -func (o *UpdateDataViewRequestObjectDataView) SetFieldFormats(v map[string]interface{}) { - o.FieldFormats = v -} - -// GetFields returns the Fields field value if set, zero value otherwise. -func (o *UpdateDataViewRequestObjectDataView) GetFields() map[string]interface{} { - if o == nil || IsNil(o.Fields) { - var ret map[string]interface{} - return ret - } - return o.Fields -} - -// GetFieldsOk returns a tuple with the Fields field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateDataViewRequestObjectDataView) GetFieldsOk() (map[string]interface{}, bool) { - if o == nil || IsNil(o.Fields) { - return map[string]interface{}{}, false - } - return o.Fields, true -} - -// HasFields returns a boolean if a field has been set. -func (o *UpdateDataViewRequestObjectDataView) HasFields() bool { - if o != nil && !IsNil(o.Fields) { - return true - } - - return false -} - -// SetFields gets a reference to the given map[string]interface{} and assigns it to the Fields field. -func (o *UpdateDataViewRequestObjectDataView) SetFields(v map[string]interface{}) { - o.Fields = v -} - -// GetName returns the Name field value if set, zero value otherwise. -func (o *UpdateDataViewRequestObjectDataView) GetName() string { - if o == nil || IsNil(o.Name) { - var ret string - return ret - } - return *o.Name -} - -// GetNameOk returns a tuple with the Name field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateDataViewRequestObjectDataView) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { - return nil, false - } - return o.Name, true -} - -// HasName returns a boolean if a field has been set. -func (o *UpdateDataViewRequestObjectDataView) HasName() bool { - if o != nil && !IsNil(o.Name) { - return true - } - - return false -} - -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *UpdateDataViewRequestObjectDataView) SetName(v string) { - o.Name = &v -} - -// GetRuntimeFieldMap returns the RuntimeFieldMap field value if set, zero value otherwise. -func (o *UpdateDataViewRequestObjectDataView) GetRuntimeFieldMap() map[string]interface{} { - if o == nil || IsNil(o.RuntimeFieldMap) { - var ret map[string]interface{} - return ret - } - return o.RuntimeFieldMap -} - -// GetRuntimeFieldMapOk returns a tuple with the RuntimeFieldMap field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateDataViewRequestObjectDataView) GetRuntimeFieldMapOk() (map[string]interface{}, bool) { - if o == nil || IsNil(o.RuntimeFieldMap) { - return map[string]interface{}{}, false - } - return o.RuntimeFieldMap, true -} - -// HasRuntimeFieldMap returns a boolean if a field has been set. -func (o *UpdateDataViewRequestObjectDataView) HasRuntimeFieldMap() bool { - if o != nil && !IsNil(o.RuntimeFieldMap) { - return true - } - - return false -} - -// SetRuntimeFieldMap gets a reference to the given map[string]interface{} and assigns it to the RuntimeFieldMap field. -func (o *UpdateDataViewRequestObjectDataView) SetRuntimeFieldMap(v map[string]interface{}) { - o.RuntimeFieldMap = v -} - -// GetSourceFilters returns the SourceFilters field value if set, zero value otherwise. -func (o *UpdateDataViewRequestObjectDataView) GetSourceFilters() []SourcefiltersInner { - if o == nil || IsNil(o.SourceFilters) { - var ret []SourcefiltersInner - return ret - } - return o.SourceFilters -} - -// GetSourceFiltersOk returns a tuple with the SourceFilters field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateDataViewRequestObjectDataView) GetSourceFiltersOk() ([]SourcefiltersInner, bool) { - if o == nil || IsNil(o.SourceFilters) { - return nil, false - } - return o.SourceFilters, true -} - -// HasSourceFilters returns a boolean if a field has been set. -func (o *UpdateDataViewRequestObjectDataView) HasSourceFilters() bool { - if o != nil && !IsNil(o.SourceFilters) { - return true - } - - return false -} - -// SetSourceFilters gets a reference to the given []SourcefiltersInner and assigns it to the SourceFilters field. -func (o *UpdateDataViewRequestObjectDataView) SetSourceFilters(v []SourcefiltersInner) { - o.SourceFilters = v -} - -// GetTimeFieldName returns the TimeFieldName field value if set, zero value otherwise. -func (o *UpdateDataViewRequestObjectDataView) GetTimeFieldName() string { - if o == nil || IsNil(o.TimeFieldName) { - var ret string - return ret - } - return *o.TimeFieldName -} - -// GetTimeFieldNameOk returns a tuple with the TimeFieldName field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateDataViewRequestObjectDataView) GetTimeFieldNameOk() (*string, bool) { - if o == nil || IsNil(o.TimeFieldName) { - return nil, false - } - return o.TimeFieldName, true -} - -// HasTimeFieldName returns a boolean if a field has been set. -func (o *UpdateDataViewRequestObjectDataView) HasTimeFieldName() bool { - if o != nil && !IsNil(o.TimeFieldName) { - return true - } - - return false -} - -// SetTimeFieldName gets a reference to the given string and assigns it to the TimeFieldName field. -func (o *UpdateDataViewRequestObjectDataView) SetTimeFieldName(v string) { - o.TimeFieldName = &v -} - -// GetTitle returns the Title field value if set, zero value otherwise. -func (o *UpdateDataViewRequestObjectDataView) GetTitle() string { - if o == nil || IsNil(o.Title) { - var ret string - return ret - } - return *o.Title -} - -// GetTitleOk returns a tuple with the Title field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateDataViewRequestObjectDataView) GetTitleOk() (*string, bool) { - if o == nil || IsNil(o.Title) { - return nil, false - } - return o.Title, true -} - -// HasTitle returns a boolean if a field has been set. -func (o *UpdateDataViewRequestObjectDataView) HasTitle() bool { - if o != nil && !IsNil(o.Title) { - return true - } - - return false -} - -// SetTitle gets a reference to the given string and assigns it to the Title field. -func (o *UpdateDataViewRequestObjectDataView) SetTitle(v string) { - o.Title = &v -} - -// GetType returns the Type field value if set, zero value otherwise. -func (o *UpdateDataViewRequestObjectDataView) 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 *UpdateDataViewRequestObjectDataView) 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 *UpdateDataViewRequestObjectDataView) 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 *UpdateDataViewRequestObjectDataView) SetType(v string) { - o.Type = &v -} - -// GetTypeMeta returns the TypeMeta field value if set, zero value otherwise. -func (o *UpdateDataViewRequestObjectDataView) GetTypeMeta() map[string]interface{} { - if o == nil || IsNil(o.TypeMeta) { - var ret map[string]interface{} - return ret - } - return o.TypeMeta -} - -// GetTypeMetaOk returns a tuple with the TypeMeta field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateDataViewRequestObjectDataView) GetTypeMetaOk() (map[string]interface{}, bool) { - if o == nil || IsNil(o.TypeMeta) { - return map[string]interface{}{}, false - } - return o.TypeMeta, true -} - -// HasTypeMeta returns a boolean if a field has been set. -func (o *UpdateDataViewRequestObjectDataView) HasTypeMeta() bool { - if o != nil && !IsNil(o.TypeMeta) { - return true - } - - return false -} - -// SetTypeMeta gets a reference to the given map[string]interface{} and assigns it to the TypeMeta field. -func (o *UpdateDataViewRequestObjectDataView) SetTypeMeta(v map[string]interface{}) { - o.TypeMeta = v -} - -func (o UpdateDataViewRequestObjectDataView) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o UpdateDataViewRequestObjectDataView) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.AllowNoIndex) { - toSerialize["allowNoIndex"] = o.AllowNoIndex - } - if !IsNil(o.FieldFormats) { - toSerialize["fieldFormats"] = o.FieldFormats - } - if !IsNil(o.Fields) { - toSerialize["fields"] = o.Fields - } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name - } - if !IsNil(o.RuntimeFieldMap) { - toSerialize["runtimeFieldMap"] = o.RuntimeFieldMap - } - if !IsNil(o.SourceFilters) { - toSerialize["sourceFilters"] = o.SourceFilters - } - if !IsNil(o.TimeFieldName) { - toSerialize["timeFieldName"] = o.TimeFieldName - } - if !IsNil(o.Title) { - toSerialize["title"] = o.Title - } - if !IsNil(o.Type) { - toSerialize["type"] = o.Type - } - if !IsNil(o.TypeMeta) { - toSerialize["typeMeta"] = o.TypeMeta - } - return toSerialize, nil -} - -type NullableUpdateDataViewRequestObjectDataView struct { - value *UpdateDataViewRequestObjectDataView - isSet bool -} - -func (v NullableUpdateDataViewRequestObjectDataView) Get() *UpdateDataViewRequestObjectDataView { - return v.value -} - -func (v *NullableUpdateDataViewRequestObjectDataView) Set(val *UpdateDataViewRequestObjectDataView) { - v.value = val - v.isSet = true -} - -func (v NullableUpdateDataViewRequestObjectDataView) IsSet() bool { - return v.isSet -} - -func (v *NullableUpdateDataViewRequestObjectDataView) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableUpdateDataViewRequestObjectDataView(val *UpdateDataViewRequestObjectDataView) *NullableUpdateDataViewRequestObjectDataView { - return &NullableUpdateDataViewRequestObjectDataView{value: val, isSet: true} -} - -func (v NullableUpdateDataViewRequestObjectDataView) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableUpdateDataViewRequestObjectDataView) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/generated/data_views/model_update_fields_metadata_200_response.go b/generated/data_views/model_update_fields_metadata_200_response.go deleted file mode 100644 index a1252dba6..000000000 --- a/generated/data_views/model_update_fields_metadata_200_response.go +++ /dev/null @@ -1,124 +0,0 @@ -/* -Data views - -OpenAPI schema for data view endpoints - -API version: 0.1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package data_views - -import ( - "encoding/json" -) - -// checks if the UpdateFieldsMetadata200Response type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &UpdateFieldsMetadata200Response{} - -// UpdateFieldsMetadata200Response struct for UpdateFieldsMetadata200Response -type UpdateFieldsMetadata200Response struct { - Acknowledged *bool `json:"acknowledged,omitempty"` -} - -// NewUpdateFieldsMetadata200Response instantiates a new UpdateFieldsMetadata200Response 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 NewUpdateFieldsMetadata200Response() *UpdateFieldsMetadata200Response { - this := UpdateFieldsMetadata200Response{} - return &this -} - -// NewUpdateFieldsMetadata200ResponseWithDefaults instantiates a new UpdateFieldsMetadata200Response 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 NewUpdateFieldsMetadata200ResponseWithDefaults() *UpdateFieldsMetadata200Response { - this := UpdateFieldsMetadata200Response{} - return &this -} - -// GetAcknowledged returns the Acknowledged field value if set, zero value otherwise. -func (o *UpdateFieldsMetadata200Response) GetAcknowledged() bool { - if o == nil || IsNil(o.Acknowledged) { - var ret bool - return ret - } - return *o.Acknowledged -} - -// GetAcknowledgedOk returns a tuple with the Acknowledged field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateFieldsMetadata200Response) GetAcknowledgedOk() (*bool, bool) { - if o == nil || IsNil(o.Acknowledged) { - return nil, false - } - return o.Acknowledged, true -} - -// HasAcknowledged returns a boolean if a field has been set. -func (o *UpdateFieldsMetadata200Response) HasAcknowledged() bool { - if o != nil && !IsNil(o.Acknowledged) { - return true - } - - return false -} - -// SetAcknowledged gets a reference to the given bool and assigns it to the Acknowledged field. -func (o *UpdateFieldsMetadata200Response) SetAcknowledged(v bool) { - o.Acknowledged = &v -} - -func (o UpdateFieldsMetadata200Response) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o UpdateFieldsMetadata200Response) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if !IsNil(o.Acknowledged) { - toSerialize["acknowledged"] = o.Acknowledged - } - return toSerialize, nil -} - -type NullableUpdateFieldsMetadata200Response struct { - value *UpdateFieldsMetadata200Response - isSet bool -} - -func (v NullableUpdateFieldsMetadata200Response) Get() *UpdateFieldsMetadata200Response { - return v.value -} - -func (v *NullableUpdateFieldsMetadata200Response) Set(val *UpdateFieldsMetadata200Response) { - v.value = val - v.isSet = true -} - -func (v NullableUpdateFieldsMetadata200Response) IsSet() bool { - return v.isSet -} - -func (v *NullableUpdateFieldsMetadata200Response) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableUpdateFieldsMetadata200Response(val *UpdateFieldsMetadata200Response) *NullableUpdateFieldsMetadata200Response { - return &NullableUpdateFieldsMetadata200Response{value: val, isSet: true} -} - -func (v NullableUpdateFieldsMetadata200Response) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableUpdateFieldsMetadata200Response) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/generated/data_views/model_update_fields_metadata_request.go b/generated/data_views/model_update_fields_metadata_request.go deleted file mode 100644 index 79afbd099..000000000 --- a/generated/data_views/model_update_fields_metadata_request.go +++ /dev/null @@ -1,116 +0,0 @@ -/* -Data views - -OpenAPI schema for data view endpoints - -API version: 0.1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package data_views - -import ( - "encoding/json" -) - -// checks if the UpdateFieldsMetadataRequest type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &UpdateFieldsMetadataRequest{} - -// UpdateFieldsMetadataRequest struct for UpdateFieldsMetadataRequest -type UpdateFieldsMetadataRequest struct { - // The field object. - Fields map[string]interface{} `json:"fields"` -} - -// NewUpdateFieldsMetadataRequest instantiates a new UpdateFieldsMetadataRequest 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 NewUpdateFieldsMetadataRequest(fields map[string]interface{}) *UpdateFieldsMetadataRequest { - this := UpdateFieldsMetadataRequest{} - this.Fields = fields - return &this -} - -// NewUpdateFieldsMetadataRequestWithDefaults instantiates a new UpdateFieldsMetadataRequest 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 NewUpdateFieldsMetadataRequestWithDefaults() *UpdateFieldsMetadataRequest { - this := UpdateFieldsMetadataRequest{} - return &this -} - -// GetFields returns the Fields field value -func (o *UpdateFieldsMetadataRequest) GetFields() map[string]interface{} { - if o == nil { - var ret map[string]interface{} - return ret - } - - return o.Fields -} - -// GetFieldsOk returns a tuple with the Fields field value -// and a boolean to check if the value has been set. -func (o *UpdateFieldsMetadataRequest) GetFieldsOk() (map[string]interface{}, bool) { - if o == nil { - return map[string]interface{}{}, false - } - return o.Fields, true -} - -// SetFields sets field value -func (o *UpdateFieldsMetadataRequest) SetFields(v map[string]interface{}) { - o.Fields = v -} - -func (o UpdateFieldsMetadataRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o UpdateFieldsMetadataRequest) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["fields"] = o.Fields - return toSerialize, nil -} - -type NullableUpdateFieldsMetadataRequest struct { - value *UpdateFieldsMetadataRequest - isSet bool -} - -func (v NullableUpdateFieldsMetadataRequest) Get() *UpdateFieldsMetadataRequest { - return v.value -} - -func (v *NullableUpdateFieldsMetadataRequest) Set(val *UpdateFieldsMetadataRequest) { - v.value = val - v.isSet = true -} - -func (v NullableUpdateFieldsMetadataRequest) IsSet() bool { - return v.isSet -} - -func (v *NullableUpdateFieldsMetadataRequest) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableUpdateFieldsMetadataRequest(val *UpdateFieldsMetadataRequest) *NullableUpdateFieldsMetadataRequest { - return &NullableUpdateFieldsMetadataRequest{value: val, isSet: true} -} - -func (v NullableUpdateFieldsMetadataRequest) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableUpdateFieldsMetadataRequest) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/generated/data_views/model_update_runtime_field_request.go b/generated/data_views/model_update_runtime_field_request.go deleted file mode 100644 index dba0beb5d..000000000 --- a/generated/data_views/model_update_runtime_field_request.go +++ /dev/null @@ -1,116 +0,0 @@ -/* -Data views - -OpenAPI schema for data view endpoints - -API version: 0.1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package data_views - -import ( - "encoding/json" -) - -// checks if the UpdateRuntimeFieldRequest type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &UpdateRuntimeFieldRequest{} - -// UpdateRuntimeFieldRequest struct for UpdateRuntimeFieldRequest -type UpdateRuntimeFieldRequest struct { - // The runtime field definition object. You can update following fields: - `type` - `script` - RuntimeField map[string]interface{} `json:"runtimeField"` -} - -// NewUpdateRuntimeFieldRequest instantiates a new UpdateRuntimeFieldRequest 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 NewUpdateRuntimeFieldRequest(runtimeField map[string]interface{}) *UpdateRuntimeFieldRequest { - this := UpdateRuntimeFieldRequest{} - this.RuntimeField = runtimeField - return &this -} - -// NewUpdateRuntimeFieldRequestWithDefaults instantiates a new UpdateRuntimeFieldRequest 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 NewUpdateRuntimeFieldRequestWithDefaults() *UpdateRuntimeFieldRequest { - this := UpdateRuntimeFieldRequest{} - return &this -} - -// GetRuntimeField returns the RuntimeField field value -func (o *UpdateRuntimeFieldRequest) GetRuntimeField() map[string]interface{} { - if o == nil { - var ret map[string]interface{} - return ret - } - - return o.RuntimeField -} - -// GetRuntimeFieldOk returns a tuple with the RuntimeField field value -// and a boolean to check if the value has been set. -func (o *UpdateRuntimeFieldRequest) GetRuntimeFieldOk() (map[string]interface{}, bool) { - if o == nil { - return map[string]interface{}{}, false - } - return o.RuntimeField, true -} - -// SetRuntimeField sets field value -func (o *UpdateRuntimeFieldRequest) SetRuntimeField(v map[string]interface{}) { - o.RuntimeField = v -} - -func (o UpdateRuntimeFieldRequest) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o UpdateRuntimeFieldRequest) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["runtimeField"] = o.RuntimeField - return toSerialize, nil -} - -type NullableUpdateRuntimeFieldRequest struct { - value *UpdateRuntimeFieldRequest - isSet bool -} - -func (v NullableUpdateRuntimeFieldRequest) Get() *UpdateRuntimeFieldRequest { - return v.value -} - -func (v *NullableUpdateRuntimeFieldRequest) Set(val *UpdateRuntimeFieldRequest) { - v.value = val - v.isSet = true -} - -func (v NullableUpdateRuntimeFieldRequest) IsSet() bool { - return v.isSet -} - -func (v *NullableUpdateRuntimeFieldRequest) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableUpdateRuntimeFieldRequest(val *UpdateRuntimeFieldRequest) *NullableUpdateRuntimeFieldRequest { - return &NullableUpdateRuntimeFieldRequest{value: val, isSet: true} -} - -func (v NullableUpdateRuntimeFieldRequest) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableUpdateRuntimeFieldRequest) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/generated/data_views/response.go b/generated/data_views/response.go deleted file mode 100644 index e6cf63ca8..000000000 --- a/generated/data_views/response.go +++ /dev/null @@ -1,47 +0,0 @@ -/* -Data views - -OpenAPI schema for data view endpoints - -API version: 0.1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package data_views - -import ( - "net/http" -) - -// APIResponse stores the API response returned by the server. -type APIResponse struct { - *http.Response `json:"-"` - Message string `json:"message,omitempty"` - // Operation is the name of the OpenAPI operation. - Operation string `json:"operation,omitempty"` - // RequestURL is the request URL. This value is always available, even if the - // embedded *http.Response is nil. - RequestURL string `json:"url,omitempty"` - // Method is the HTTP method used for the request. This value is always - // available, even if the embedded *http.Response is nil. - Method string `json:"method,omitempty"` - // Payload holds the contents of the response body (which may be nil or empty). - // This is provided here as the raw response.Body() reader will have already - // been drained. - Payload []byte `json:"-"` -} - -// NewAPIResponse returns a new APIResponse object. -func NewAPIResponse(r *http.Response) *APIResponse { - - response := &APIResponse{Response: r} - return response -} - -// NewAPIResponseWithError returns a new APIResponse object with the provided error message. -func NewAPIResponseWithError(errorMessage string) *APIResponse { - - response := &APIResponse{Message: errorMessage} - return response -} diff --git a/generated/data_views/utils.go b/generated/data_views/utils.go deleted file mode 100644 index d628c9d25..000000000 --- a/generated/data_views/utils.go +++ /dev/null @@ -1,347 +0,0 @@ -/* -Data views - -OpenAPI schema for data view endpoints - -API version: 0.1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package data_views - -import ( - "encoding/json" - "reflect" - "time" -) - -// PtrBool is a helper routine that returns a pointer to given boolean value. -func PtrBool(v bool) *bool { return &v } - -// PtrInt is a helper routine that returns a pointer to given integer value. -func PtrInt(v int) *int { return &v } - -// PtrInt32 is a helper routine that returns a pointer to given integer value. -func PtrInt32(v int32) *int32 { return &v } - -// PtrInt64 is a helper routine that returns a pointer to given integer value. -func PtrInt64(v int64) *int64 { return &v } - -// PtrFloat32 is a helper routine that returns a pointer to given float value. -func PtrFloat32(v float32) *float32 { return &v } - -// PtrFloat64 is a helper routine that returns a pointer to given float value. -func PtrFloat64(v float64) *float64 { return &v } - -// PtrString is a helper routine that returns a pointer to given string value. -func PtrString(v string) *string { return &v } - -// PtrTime is helper routine that returns a pointer to given Time value. -func PtrTime(v time.Time) *time.Time { return &v } - -type NullableBool struct { - value *bool - isSet bool -} - -func (v NullableBool) Get() *bool { - return v.value -} - -func (v *NullableBool) Set(val *bool) { - v.value = val - v.isSet = true -} - -func (v NullableBool) IsSet() bool { - return v.isSet -} - -func (v *NullableBool) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableBool(val *bool) *NullableBool { - return &NullableBool{value: val, isSet: true} -} - -func (v NullableBool) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableBool) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -type NullableInt struct { - value *int - isSet bool -} - -func (v NullableInt) Get() *int { - return v.value -} - -func (v *NullableInt) Set(val *int) { - v.value = val - v.isSet = true -} - -func (v NullableInt) IsSet() bool { - return v.isSet -} - -func (v *NullableInt) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableInt(val *int) *NullableInt { - return &NullableInt{value: val, isSet: true} -} - -func (v NullableInt) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableInt) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -type NullableInt32 struct { - value *int32 - isSet bool -} - -func (v NullableInt32) Get() *int32 { - return v.value -} - -func (v *NullableInt32) Set(val *int32) { - v.value = val - v.isSet = true -} - -func (v NullableInt32) IsSet() bool { - return v.isSet -} - -func (v *NullableInt32) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableInt32(val *int32) *NullableInt32 { - return &NullableInt32{value: val, isSet: true} -} - -func (v NullableInt32) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableInt32) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -type NullableInt64 struct { - value *int64 - isSet bool -} - -func (v NullableInt64) Get() *int64 { - return v.value -} - -func (v *NullableInt64) Set(val *int64) { - v.value = val - v.isSet = true -} - -func (v NullableInt64) IsSet() bool { - return v.isSet -} - -func (v *NullableInt64) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableInt64(val *int64) *NullableInt64 { - return &NullableInt64{value: val, isSet: true} -} - -func (v NullableInt64) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableInt64) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -type NullableFloat32 struct { - value *float32 - isSet bool -} - -func (v NullableFloat32) Get() *float32 { - return v.value -} - -func (v *NullableFloat32) Set(val *float32) { - v.value = val - v.isSet = true -} - -func (v NullableFloat32) IsSet() bool { - return v.isSet -} - -func (v *NullableFloat32) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableFloat32(val *float32) *NullableFloat32 { - return &NullableFloat32{value: val, isSet: true} -} - -func (v NullableFloat32) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableFloat32) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -type NullableFloat64 struct { - value *float64 - isSet bool -} - -func (v NullableFloat64) Get() *float64 { - return v.value -} - -func (v *NullableFloat64) Set(val *float64) { - v.value = val - v.isSet = true -} - -func (v NullableFloat64) IsSet() bool { - return v.isSet -} - -func (v *NullableFloat64) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableFloat64(val *float64) *NullableFloat64 { - return &NullableFloat64{value: val, isSet: true} -} - -func (v NullableFloat64) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableFloat64) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -type NullableString struct { - value *string - isSet bool -} - -func (v NullableString) Get() *string { - return v.value -} - -func (v *NullableString) Set(val *string) { - v.value = val - v.isSet = true -} - -func (v NullableString) IsSet() bool { - return v.isSet -} - -func (v *NullableString) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableString(val *string) *NullableString { - return &NullableString{value: val, isSet: true} -} - -func (v NullableString) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableString) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -type NullableTime struct { - value *time.Time - isSet bool -} - -func (v NullableTime) Get() *time.Time { - return v.value -} - -func (v *NullableTime) Set(val *time.Time) { - v.value = val - v.isSet = true -} - -func (v NullableTime) IsSet() bool { - return v.isSet -} - -func (v *NullableTime) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableTime(val *time.Time) *NullableTime { - return &NullableTime{value: val, isSet: true} -} - -func (v NullableTime) MarshalJSON() ([]byte, error) { - return v.value.MarshalJSON() -} - -func (v *NullableTime) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -// IsNil checks if an input is nil -func IsNil(i interface{}) bool { - if i == nil { - return true - } - switch reflect.TypeOf(i).Kind() { - case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: - return reflect.ValueOf(i).IsNil() - case reflect.Array: - return reflect.ValueOf(i).IsZero() - } - return false -} - -type MappedNullable interface { - ToMap() (map[string]interface{}, error) -} diff --git a/generated/kibana/.gitignore b/generated/kibana/.gitignore new file mode 100644 index 000000000..1ec8ffcc0 --- /dev/null +++ b/generated/kibana/.gitignore @@ -0,0 +1,2 @@ +oas.yaml +oas-filtered.yaml diff --git a/generated/kibana/Makefile b/generated/kibana/Makefile new file mode 100644 index 000000000..70a7690e7 --- /dev/null +++ b/generated/kibana/Makefile @@ -0,0 +1,34 @@ +.DEFAULT_GOAL = help +SHELL := /bin/bash +ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) + +github_ref := refs/heads/main +oas_url := https://raw.githubusercontent.com/elastic/kibana/$(github_ref)/oas_docs/output/kibana.yaml + +.PHONY: all +all: download transform generate ## Fetch, bundle, transform, and generate the API + + +.PHONY: download +download: oas.yaml ## Download the remote schema + +oas.yaml: + curl -sSo oas.yaml "$(oas_url)" + +.PHONY: transform +transform: download ## Transform and filter the schema + go run $(ROOT_DIR)/transform_schema.go -i ./oas.yaml -o ./oas-filtered.yaml + +.PHONY: generate +generate: ## Generate the API + go run github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen@v2.4.1 -config oapi-config.yaml ./oas-filtered.yaml + + +.PHONY: clean +clean: ## Remove any downloaded files + rm -rf oas.yaml oas-filtered.yaml + + +.PHONY: help +help: ## Show this help + @ awk 'BEGIN {FS = ":.*##"; printf "Usage: make \033[36m\033[0m\n\nTargets:\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-10s\033[0m\t%s\n", $$1, $$2 }' $(MAKEFILE_LIST) | column -s$$'\t' -t diff --git a/generated/kibana/kibana.gen.go b/generated/kibana/kibana.gen.go new file mode 100644 index 000000000..b2e22c872 --- /dev/null +++ b/generated/kibana/kibana.gen.go @@ -0,0 +1,1067 @@ +// Package kbapi provides primitives to interact with the openapi HTTP API. +// +// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.4.1 DO NOT EDIT. +package kbapi + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "io" + "net/http" + "net/url" + "strings" + + "github.com/oapi-codegen/runtime" +) + +const ( + ApiKeyAuthScopes = "apiKeyAuth.Scopes" + BasicAuthScopes = "basicAuth.Scopes" +) + +// Defines values for DataViews404ResponseError. +const ( + NotFound DataViews404ResponseError = "Not Found" +) + +// Defines values for DataViews404ResponseStatusCode. +const ( + N404 DataViews404ResponseStatusCode = 404 +) + +// DataViews400Response defines model for Data_views_400_response. +type DataViews400Response struct { + Error string `json:"error"` + Message string `json:"message"` + StatusCode float32 `json:"statusCode"` +} + +// DataViews404Response defines model for Data_views_404_response. +type DataViews404Response struct { + Error *DataViews404ResponseError `json:"error,omitempty"` + Message *string `json:"message,omitempty"` + StatusCode *DataViews404ResponseStatusCode `json:"statusCode,omitempty"` +} + +// DataViews404ResponseError defines model for DataViews404Response.Error. +type DataViews404ResponseError string + +// DataViews404ResponseStatusCode defines model for DataViews404Response.StatusCode. +type DataViews404ResponseStatusCode int + +// DataViewsAllownoindex Allows the data view saved object to exist before the data is available. +type DataViewsAllownoindex = bool + +// DataViewsCreateDataViewRequestObject defines model for Data_views_create_data_view_request_object. +type DataViewsCreateDataViewRequestObject struct { + // DataView The data view object. + DataView DataViewsCreateDataViewRequestObjectInner `json:"data_view"` + + // Override Override an existing data view if a data view with the provided title already exists. + Override *bool `json:"override,omitempty"` +} + +// DataViewsCreateDataViewRequestObjectInner The data view object. +type DataViewsCreateDataViewRequestObjectInner struct { + // AllowNoIndex Allows the data view saved object to exist before the data is available. + AllowNoIndex *DataViewsAllownoindex `json:"allowNoIndex,omitempty"` + FieldAttrs *map[string]DataViewsFieldattrs `json:"fieldAttrs,omitempty"` + + // FieldFormats A map of field formats by field name. + FieldFormats *DataViewsFieldformats `json:"fieldFormats,omitempty"` + Fields *map[string]interface{} `json:"fields,omitempty"` + Id *string `json:"id,omitempty"` + + // Name The data view name. + Name *string `json:"name,omitempty"` + + // Namespaces An array of space identifiers for sharing the data view between multiple spaces. + Namespaces *DataViewsNamespaces `json:"namespaces,omitempty"` + RuntimeFieldMap *map[string]DataViewsRuntimefieldmap `json:"runtimeFieldMap,omitempty"` + + // SourceFilters The array of field names you want to filter out in Discover. + SourceFilters *DataViewsSourcefilters `json:"sourceFilters,omitempty"` + + // TimeFieldName The timestamp field name, which you use for time-based data views. + TimeFieldName *DataViewsTimefieldname `json:"timeFieldName,omitempty"` + + // Title Comma-separated list of data streams, indices, and aliases that you want to search. Supports wildcards (`*`). + Title DataViewsTitle `json:"title"` + + // Type When set to `rollup`, identifies the rollup data views. + Type *DataViewsType `json:"type,omitempty"` + + // TypeMeta When you use rollup indices, contains the field list for the rollup data view API endpoints. + TypeMeta *DataViewsTypemeta `json:"typeMeta,omitempty"` + Version *string `json:"version,omitempty"` +} + +// DataViewsDataViewResponseObject defines model for Data_views_data_view_response_object. +type DataViewsDataViewResponseObject struct { + DataView *DataViewsDataViewResponseObjectInner `json:"data_view,omitempty"` +} + +// DataViewsDataViewResponseObjectInner defines model for Data_views_data_view_response_object_inner. +type DataViewsDataViewResponseObjectInner struct { + // AllowNoIndex Allows the data view saved object to exist before the data is available. + AllowNoIndex *DataViewsAllownoindex `json:"allowNoIndex,omitempty"` + FieldAttrs *map[string]DataViewsFieldattrs `json:"fieldAttrs,omitempty"` + + // FieldFormats A map of field formats by field name. + FieldFormats *DataViewsFieldformats `json:"fieldFormats,omitempty"` + Fields *map[string]interface{} `json:"fields,omitempty"` + Id *string `json:"id,omitempty"` + + // Name The data view name. + Name *string `json:"name,omitempty"` + + // Namespaces An array of space identifiers for sharing the data view between multiple spaces. + Namespaces *DataViewsNamespaces `json:"namespaces,omitempty"` + RuntimeFieldMap *map[string]DataViewsRuntimefieldmap `json:"runtimeFieldMap,omitempty"` + + // SourceFilters The array of field names you want to filter out in Discover. + SourceFilters *DataViewsSourcefilters `json:"sourceFilters,omitempty"` + + // TimeFieldName The timestamp field name, which you use for time-based data views. + TimeFieldName *DataViewsTimefieldname `json:"timeFieldName,omitempty"` + + // Title Comma-separated list of data streams, indices, and aliases that you want to search. Supports wildcards (`*`). + Title *DataViewsTitle `json:"title,omitempty"` + + // TypeMeta When you use rollup indices, contains the field list for the rollup data view API endpoints. + TypeMeta *DataViewsTypemetaResponse `json:"typeMeta"` + Version *string `json:"version,omitempty"` +} + +// DataViewsFieldattrs A map of field attributes by field name. +type DataViewsFieldattrs struct { + // Count Popularity count for the field. + Count *int `json:"count,omitempty"` + + // CustomDescription Custom description for the field. + CustomDescription *string `json:"customDescription,omitempty"` + + // CustomLabel Custom label for the field. + CustomLabel *string `json:"customLabel,omitempty"` +} + +// DataViewsFieldformat defines model for Data_views_fieldformat. +type DataViewsFieldformat struct { + Id *string `json:"id,omitempty"` + Params *DataViewsFieldformatParams `json:"params,omitempty"` +} + +// DataViewsFieldformatParams defines model for Data_views_fieldformat_params. +type DataViewsFieldformatParams struct { + LabelTemplate *string `json:"labelTemplate,omitempty"` + Pattern *string `json:"pattern,omitempty"` + UrlTemplate *string `json:"urlTemplate,omitempty"` +} + +// DataViewsFieldformats A map of field formats by field name. +type DataViewsFieldformats map[string]DataViewsFieldformat + +// DataViewsNamespaces An array of space identifiers for sharing the data view between multiple spaces. +type DataViewsNamespaces = []string + +// DataViewsRuntimefieldmap A map of runtime field definitions by field name. +type DataViewsRuntimefieldmap struct { + Script DataViewsRuntimefieldmapScript `json:"script"` + + // Type Mapping type of the runtime field. + Type string `json:"type"` +} + +// DataViewsRuntimefieldmapScript defines model for Data_views_runtimefieldmap_script. +type DataViewsRuntimefieldmapScript struct { + // Source Script for the runtime field. + Source *string `json:"source,omitempty"` +} + +// DataViewsSourcefilterItem defines model for Data_views_sourcefilter_item. +type DataViewsSourcefilterItem struct { + Value string `json:"value"` +} + +// DataViewsSourcefilters The array of field names you want to filter out in Discover. +type DataViewsSourcefilters = []DataViewsSourcefilterItem + +// DataViewsTimefieldname The timestamp field name, which you use for time-based data views. +type DataViewsTimefieldname = string + +// DataViewsTitle Comma-separated list of data streams, indices, and aliases that you want to search. Supports wildcards (`*`). +type DataViewsTitle = string + +// DataViewsType When set to `rollup`, identifies the rollup data views. +type DataViewsType = string + +// DataViewsTypemeta When you use rollup indices, contains the field list for the rollup data view API endpoints. +type DataViewsTypemeta struct { + // Aggs A map of rollup restrictions by aggregation type and field name. + Aggs map[string]interface{} `json:"aggs"` + + // Params Properties for retrieving rollup fields. + Params map[string]interface{} `json:"params"` +} + +// DataViewsTypemetaResponse When you use rollup indices, contains the field list for the rollup data view API endpoints. +type DataViewsTypemetaResponse struct { + // Aggs A map of rollup restrictions by aggregation type and field name. + Aggs *map[string]interface{} `json:"aggs,omitempty"` + + // Params Properties for retrieving rollup fields. + Params *map[string]interface{} `json:"params,omitempty"` +} + +// DataViewsUpdateDataViewRequestObject defines model for Data_views_update_data_view_request_object. +type DataViewsUpdateDataViewRequestObject struct { + // DataView The data view properties you want to update. Only the specified properties are updated in the data view. Unspecified fields stay as they are persisted. + DataView DataViewsUpdateDataViewRequestObjectInner `json:"data_view"` + + // RefreshFields Reloads the data view fields after the data view is updated. + RefreshFields *bool `json:"refresh_fields,omitempty"` +} + +// DataViewsUpdateDataViewRequestObjectInner The data view properties you want to update. Only the specified properties are updated in the data view. Unspecified fields stay as they are persisted. +type DataViewsUpdateDataViewRequestObjectInner struct { + // AllowNoIndex Allows the data view saved object to exist before the data is available. + AllowNoIndex *DataViewsAllownoindex `json:"allowNoIndex,omitempty"` + + // FieldFormats A map of field formats by field name. + FieldFormats *DataViewsFieldformats `json:"fieldFormats,omitempty"` + Fields *map[string]interface{} `json:"fields,omitempty"` + Name *string `json:"name,omitempty"` + RuntimeFieldMap *map[string]DataViewsRuntimefieldmap `json:"runtimeFieldMap,omitempty"` + + // SourceFilters The array of field names you want to filter out in Discover. + SourceFilters *DataViewsSourcefilters `json:"sourceFilters,omitempty"` + + // TimeFieldName The timestamp field name, which you use for time-based data views. + TimeFieldName *DataViewsTimefieldname `json:"timeFieldName,omitempty"` + + // Title Comma-separated list of data streams, indices, and aliases that you want to search. Supports wildcards (`*`). + Title *DataViewsTitle `json:"title,omitempty"` + + // Type When set to `rollup`, identifies the rollup data views. + Type *DataViewsType `json:"type,omitempty"` + + // TypeMeta When you use rollup indices, contains the field list for the rollup data view API endpoints. + TypeMeta *DataViewsTypemeta `json:"typeMeta,omitempty"` +} + +// GetDataViewsResponseItem defines model for get_data_views_response_item. +type GetDataViewsResponseItem struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Namespaces *[]string `json:"namespaces,omitempty"` + Title *string `json:"title,omitempty"` + TypeMeta *map[string]interface{} `json:"typeMeta,omitempty"` +} + +// DataViewsViewId defines model for Data_views_view_id. +type DataViewsViewId = string + +// SpaceId defines model for spaceId. +type SpaceId = string + +// CreateDataViewJSONRequestBody defines body for CreateDataView for application/json ContentType. +type CreateDataViewJSONRequestBody = DataViewsCreateDataViewRequestObject + +// UpdateDataViewJSONRequestBody defines body for UpdateDataView for application/json ContentType. +type UpdateDataViewJSONRequestBody = DataViewsUpdateDataViewRequestObject + +// RequestEditorFn is the function signature for the RequestEditor callback function +type RequestEditorFn func(ctx context.Context, req *http.Request) error + +// Doer performs HTTP requests. +// +// The standard http.Client implements this interface. +type HttpRequestDoer interface { + Do(req *http.Request) (*http.Response, error) +} + +// Client which conforms to the OpenAPI3 specification for this service. +type Client struct { + // The endpoint of the server conforming to this interface, with scheme, + // https://api.deepmap.com for example. This can contain a path relative + // to the server, such as https://api.deepmap.com/dev-test, and all the + // paths in the swagger spec will be appended to the server. + Server string + + // Doer for performing requests, typically a *http.Client with any + // customized settings, such as certificate chains. + Client HttpRequestDoer + + // A list of callbacks for modifying requests which are generated before sending over + // the network. + RequestEditors []RequestEditorFn +} + +// ClientOption allows setting custom parameters during construction +type ClientOption func(*Client) error + +// Creates a new Client, with reasonable defaults +func NewClient(server string, opts ...ClientOption) (*Client, error) { + // create a client with sane default values + client := Client{ + Server: server, + } + // mutate client and add all optional params + for _, o := range opts { + if err := o(&client); err != nil { + return nil, err + } + } + // ensure the server URL always has a trailing slash + if !strings.HasSuffix(client.Server, "/") { + client.Server += "/" + } + // create httpClient, if not already present + if client.Client == nil { + client.Client = &http.Client{} + } + return &client, nil +} + +// WithHTTPClient allows overriding the default Doer, which is +// automatically created using http.Client. This is useful for tests. +func WithHTTPClient(doer HttpRequestDoer) ClientOption { + return func(c *Client) error { + c.Client = doer + return nil + } +} + +// WithRequestEditorFn allows setting up a callback function, which will be +// called right before sending the request. This can be used to mutate the request. +func WithRequestEditorFn(fn RequestEditorFn) ClientOption { + return func(c *Client) error { + c.RequestEditors = append(c.RequestEditors, fn) + return nil + } +} + +// The interface specification for the client above. +type ClientInterface interface { + // GetDataViews request + GetDataViews(ctx context.Context, spaceId SpaceId, reqEditors ...RequestEditorFn) (*http.Response, error) + + // CreateDataViewWithBody request with any body + CreateDataViewWithBody(ctx context.Context, spaceId SpaceId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + CreateDataView(ctx context.Context, spaceId SpaceId, body CreateDataViewJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeleteDataView request + DeleteDataView(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetDataView request + GetDataView(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, reqEditors ...RequestEditorFn) (*http.Response, error) + + // UpdateDataViewWithBody request with any body + UpdateDataViewWithBody(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + UpdateDataView(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, body UpdateDataViewJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) +} + +func (c *Client) GetDataViews(ctx context.Context, spaceId SpaceId, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetDataViewsRequest(c.Server, spaceId) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) CreateDataViewWithBody(ctx context.Context, spaceId SpaceId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateDataViewRequestWithBody(c.Server, spaceId, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) CreateDataView(ctx context.Context, spaceId SpaceId, body CreateDataViewJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateDataViewRequest(c.Server, spaceId, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) DeleteDataView(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteDataViewRequest(c.Server, spaceId, viewId) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) GetDataView(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetDataViewRequest(c.Server, spaceId, viewId) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) UpdateDataViewWithBody(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateDataViewRequestWithBody(c.Server, spaceId, viewId, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) UpdateDataView(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, body UpdateDataViewJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateDataViewRequest(c.Server, spaceId, viewId, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// NewGetDataViewsRequest generates requests for GetDataViews +func NewGetDataViewsRequest(server string, spaceId SpaceId) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "spaceId", runtime.ParamLocationPath, spaceId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/s/%s/api/data_views", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewCreateDataViewRequest calls the generic CreateDataView builder with application/json body +func NewCreateDataViewRequest(server string, spaceId SpaceId, body CreateDataViewJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewCreateDataViewRequestWithBody(server, spaceId, "application/json", bodyReader) +} + +// NewCreateDataViewRequestWithBody generates requests for CreateDataView with any type of body +func NewCreateDataViewRequestWithBody(server string, spaceId SpaceId, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "spaceId", runtime.ParamLocationPath, spaceId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/s/%s/api/data_views/data_view", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewDeleteDataViewRequest generates requests for DeleteDataView +func NewDeleteDataViewRequest(server string, spaceId SpaceId, viewId DataViewsViewId) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "spaceId", runtime.ParamLocationPath, spaceId) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "viewId", runtime.ParamLocationPath, viewId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/s/%s/api/data_views/data_view/%s", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetDataViewRequest generates requests for GetDataView +func NewGetDataViewRequest(server string, spaceId SpaceId, viewId DataViewsViewId) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "spaceId", runtime.ParamLocationPath, spaceId) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "viewId", runtime.ParamLocationPath, viewId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/s/%s/api/data_views/data_view/%s", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewUpdateDataViewRequest calls the generic UpdateDataView builder with application/json body +func NewUpdateDataViewRequest(server string, spaceId SpaceId, viewId DataViewsViewId, body UpdateDataViewJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewUpdateDataViewRequestWithBody(server, spaceId, viewId, "application/json", bodyReader) +} + +// NewUpdateDataViewRequestWithBody generates requests for UpdateDataView with any type of body +func NewUpdateDataViewRequestWithBody(server string, spaceId SpaceId, viewId DataViewsViewId, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "spaceId", runtime.ParamLocationPath, spaceId) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "viewId", runtime.ParamLocationPath, viewId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/s/%s/api/data_views/data_view/%s", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +func (c *Client) applyEditors(ctx context.Context, req *http.Request, additionalEditors []RequestEditorFn) error { + for _, r := range c.RequestEditors { + if err := r(ctx, req); err != nil { + return err + } + } + for _, r := range additionalEditors { + if err := r(ctx, req); err != nil { + return err + } + } + return nil +} + +// ClientWithResponses builds on ClientInterface to offer response payloads +type ClientWithResponses struct { + ClientInterface +} + +// NewClientWithResponses creates a new ClientWithResponses, which wraps +// Client with return type handling +func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error) { + client, err := NewClient(server, opts...) + if err != nil { + return nil, err + } + return &ClientWithResponses{client}, nil +} + +// WithBaseURL overrides the baseURL. +func WithBaseURL(baseURL string) ClientOption { + return func(c *Client) error { + newBaseURL, err := url.Parse(baseURL) + if err != nil { + return err + } + c.Server = newBaseURL.String() + return nil + } +} + +// ClientWithResponsesInterface is the interface specification for the client with responses above. +type ClientWithResponsesInterface interface { + // GetDataViewsWithResponse request + GetDataViewsWithResponse(ctx context.Context, spaceId SpaceId, reqEditors ...RequestEditorFn) (*GetDataViewsResponse, error) + + // CreateDataViewWithBodyWithResponse request with any body + CreateDataViewWithBodyWithResponse(ctx context.Context, spaceId SpaceId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateDataViewResponse, error) + + CreateDataViewWithResponse(ctx context.Context, spaceId SpaceId, body CreateDataViewJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateDataViewResponse, error) + + // DeleteDataViewWithResponse request + DeleteDataViewWithResponse(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, reqEditors ...RequestEditorFn) (*DeleteDataViewResponse, error) + + // GetDataViewWithResponse request + GetDataViewWithResponse(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, reqEditors ...RequestEditorFn) (*GetDataViewResponse, error) + + // UpdateDataViewWithBodyWithResponse request with any body + UpdateDataViewWithBodyWithResponse(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateDataViewResponse, error) + + UpdateDataViewWithResponse(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, body UpdateDataViewJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateDataViewResponse, error) +} + +type GetDataViewsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + DataView *[]GetDataViewsResponseItem `json:"data_view,omitempty"` + } + JSON400 *DataViews400Response +} + +// Status returns HTTPResponse.Status +func (r GetDataViewsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetDataViewsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type CreateDataViewResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *DataViewsDataViewResponseObject + JSON400 *DataViews400Response +} + +// Status returns HTTPResponse.Status +func (r CreateDataViewResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r CreateDataViewResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type DeleteDataViewResponse struct { + Body []byte + HTTPResponse *http.Response + JSON404 *DataViews404Response +} + +// Status returns HTTPResponse.Status +func (r DeleteDataViewResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteDataViewResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetDataViewResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *DataViewsDataViewResponseObject + JSON404 *DataViews404Response +} + +// Status returns HTTPResponse.Status +func (r GetDataViewResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetDataViewResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type UpdateDataViewResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *DataViewsDataViewResponseObject + JSON400 *DataViews400Response +} + +// Status returns HTTPResponse.Status +func (r UpdateDataViewResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r UpdateDataViewResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// GetDataViewsWithResponse request returning *GetDataViewsResponse +func (c *ClientWithResponses) GetDataViewsWithResponse(ctx context.Context, spaceId SpaceId, reqEditors ...RequestEditorFn) (*GetDataViewsResponse, error) { + rsp, err := c.GetDataViews(ctx, spaceId, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetDataViewsResponse(rsp) +} + +// CreateDataViewWithBodyWithResponse request with arbitrary body returning *CreateDataViewResponse +func (c *ClientWithResponses) CreateDataViewWithBodyWithResponse(ctx context.Context, spaceId SpaceId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateDataViewResponse, error) { + rsp, err := c.CreateDataViewWithBody(ctx, spaceId, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateDataViewResponse(rsp) +} + +func (c *ClientWithResponses) CreateDataViewWithResponse(ctx context.Context, spaceId SpaceId, body CreateDataViewJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateDataViewResponse, error) { + rsp, err := c.CreateDataView(ctx, spaceId, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateDataViewResponse(rsp) +} + +// DeleteDataViewWithResponse request returning *DeleteDataViewResponse +func (c *ClientWithResponses) DeleteDataViewWithResponse(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, reqEditors ...RequestEditorFn) (*DeleteDataViewResponse, error) { + rsp, err := c.DeleteDataView(ctx, spaceId, viewId, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteDataViewResponse(rsp) +} + +// GetDataViewWithResponse request returning *GetDataViewResponse +func (c *ClientWithResponses) GetDataViewWithResponse(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, reqEditors ...RequestEditorFn) (*GetDataViewResponse, error) { + rsp, err := c.GetDataView(ctx, spaceId, viewId, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetDataViewResponse(rsp) +} + +// UpdateDataViewWithBodyWithResponse request with arbitrary body returning *UpdateDataViewResponse +func (c *ClientWithResponses) UpdateDataViewWithBodyWithResponse(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateDataViewResponse, error) { + rsp, err := c.UpdateDataViewWithBody(ctx, spaceId, viewId, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdateDataViewResponse(rsp) +} + +func (c *ClientWithResponses) UpdateDataViewWithResponse(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, body UpdateDataViewJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateDataViewResponse, error) { + rsp, err := c.UpdateDataView(ctx, spaceId, viewId, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdateDataViewResponse(rsp) +} + +// ParseGetDataViewsResponse parses an HTTP response from a GetDataViewsWithResponse call +func ParseGetDataViewsResponse(rsp *http.Response) (*GetDataViewsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetDataViewsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + DataView *[]GetDataViewsResponseItem `json:"data_view,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest DataViews400Response + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + } + + return response, nil +} + +// ParseCreateDataViewResponse parses an HTTP response from a CreateDataViewWithResponse call +func ParseCreateDataViewResponse(rsp *http.Response) (*CreateDataViewResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &CreateDataViewResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest DataViewsDataViewResponseObject + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest DataViews400Response + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + } + + return response, nil +} + +// ParseDeleteDataViewResponse parses an HTTP response from a DeleteDataViewWithResponse call +func ParseDeleteDataViewResponse(rsp *http.Response) (*DeleteDataViewResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &DeleteDataViewResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest DataViews404Response + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + } + + return response, nil +} + +// ParseGetDataViewResponse parses an HTTP response from a GetDataViewWithResponse call +func ParseGetDataViewResponse(rsp *http.Response) (*GetDataViewResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetDataViewResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest DataViewsDataViewResponseObject + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest DataViews404Response + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + } + + return response, nil +} + +// ParseUpdateDataViewResponse parses an HTTP response from a UpdateDataViewWithResponse call +func ParseUpdateDataViewResponse(rsp *http.Response) (*UpdateDataViewResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &UpdateDataViewResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest DataViewsDataViewResponseObject + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest DataViews400Response + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + } + + return response, nil +} diff --git a/generated/kibana/oapi-config.yaml b/generated/kibana/oapi-config.yaml new file mode 100644 index 000000000..bfff3d2c8 --- /dev/null +++ b/generated/kibana/oapi-config.yaml @@ -0,0 +1,9 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/oapi-codegen/oapi-codegen/HEAD/configuration-schema.json + +package: kbapi +output: kibana.gen.go +generate: + client: true + models: true +# output-options: +# nullable-type: true diff --git a/generated/kibana/transform_schema.go b/generated/kibana/transform_schema.go new file mode 100644 index 000000000..46fb59604 --- /dev/null +++ b/generated/kibana/transform_schema.go @@ -0,0 +1,885 @@ +//go:build ignore +// +build ignore + +package main + +import ( + "bytes" + "errors" + "flag" + "fmt" + "log" + "maps" + "os" + "path" + "reflect" + "slices" + "strconv" + "strings" + + "gopkg.in/yaml.v3" +) + +func main() { + _inFile := flag.String("i", "", "input file") + _outFile := flag.String("o", "", "output file") + flag.Parse() + + inFile := *_inFile + outFile := *_outFile + + if inFile == "" || outFile == "" { + flag.Usage() + os.Exit(1) + } + + outDir, _ := path.Split(outFile) + if !pathExists(outDir) { + if err := os.MkdirAll(outDir, 0755); err != nil { + log.Fatalf("failed to create directory %q: %v", outDir, err) + } + } + + bytes, err := os.ReadFile(inFile) + if err != nil { + log.Fatalf("failed to read file %q: %v", inFile, err) + } + + var schema Schema + err = yaml.Unmarshal(bytes, &schema) + if err != nil { + log.Fatalf("failed to unmarshal schema from %q: %v", inFile, err) + } + + // Run each transform + for _, fn := range transformers { + fn(&schema) + } + + saveFile(schema, outFile) +} + +// pathExists checks if path exists. +func pathExists(path string) bool { + _, err := os.Stat(path) + return !errors.Is(err, os.ErrNotExist) +} + +// saveFile marshal and writes obj to path. +func saveFile(obj any, path string) { + var buf bytes.Buffer + enc := yaml.NewEncoder(&buf) + enc.SetIndent(2) + if err := enc.Encode(obj); err != nil { + log.Fatalf("failed to marshal to file %q: %v", path, err) + } + + if err := os.WriteFile(path, buf.Bytes(), 0664); err != nil { + log.Fatalf("failed to write file %q: %v", path, err) + } +} + +// ============================================================================ + +type Schema struct { + Paths map[string]*Path `yaml:"paths"` + Version string `yaml:"openapi"` + Tags []Map `yaml:"tags,omitempty"` + Servers []Map `yaml:"servers,omitempty"` + Components Map `yaml:"components,omitempty"` + Security []Map `yaml:"security,omitempty"` + Info Map `yaml:"info"` +} + +func (s Schema) GetPath(path string) *Path { + return s.Paths[path] +} + +func (s Schema) MustGetPath(path string) *Path { + p := s.GetPath(path) + if p == nil { + log.Panicf("Path not found: %q", path) + } + return p +} + +// ============================================================================ + +type Path struct { + Parameters []Map `yaml:"parameters,omitempty"` + Get Map `yaml:"get,omitempty"` + Post Map `yaml:"post,omitempty"` + Put Map `yaml:"put,omitempty"` + Delete Map `yaml:"delete,omitempty"` +} + +func (p Path) Endpoints(yield func(key string, endpoint Map) bool) { + if p.Get != nil { + yield("get", p.Get) + } + if p.Post != nil { + yield("post", p.Post) + } + if p.Put != nil { + yield("put", p.Put) + } + if p.Delete != nil { + yield("delete", p.Delete) + } +} + +func (p Path) GetEndpoint(method string) Map { + switch method { + case "get": + return p.Get + case "post": + return p.Post + case "put": + return p.Put + case "delete": + return p.Delete + default: + log.Panicf("Unhandled method: %q", method) + } + return nil +} + +func (p Path) MustGetEndpoint(method string) Map { + endpoint := p.GetEndpoint(method) + if endpoint == nil { + log.Panicf("Method not found: %q", method) + } + return endpoint +} + +func (p *Path) SetEndpoint(method string, endpoint Map) { + switch method { + case "get": + p.Get = endpoint + case "post": + p.Post = endpoint + case "put": + p.Put = endpoint + case "delete": + p.Delete = endpoint + default: + log.Panicf("Invalid method %q", method) + } +} + +// ============================================================================ + +type Map map[string]any + +func (m Map) Keys() []string { + keys := slices.Collect(maps.Keys(m)) + slices.Sort(keys) + return keys +} + +func (m Map) Has(key string) bool { + _, ok := m.Get(key) + return ok +} + +func (m Map) Get(key string) (any, bool) { + rootKey, subKeys, found := strings.Cut(key, ".") + if found { + switch t := m[rootKey].(type) { + case Map: + return t.Get(subKeys) + case map[string]any: + return Map(t).Get(subKeys) + case Slice: + return t.Get(subKeys) + case []any: + return Slice(t).Get(subKeys) + default: + rootKey = key + } + } + + value, ok := m[rootKey] + return value, ok +} + +func (m Map) MustGet(key string) any { + v, ok := m.Get(key) + if !ok { + log.Panicf("%q not found", key) + } + return v +} + +func (m Map) GetSlice(key string) (Slice, bool) { + value, ok := m.Get(key) + if !ok { + return nil, false + } + + switch t := value.(type) { + case Slice: + return t, true + case []any: + return t, true + } + + log.Panicf("%q is not a slice", key) + return nil, false +} + +func (m Map) MustGetSlice(key string) Slice { + v, ok := m.GetSlice(key) + if !ok { + log.Panicf("%q not found", key) + } + return v +} + +func (m Map) GetMap(key string) (Map, bool) { + value, ok := m.Get(key) + if !ok { + return nil, false + } + + switch t := value.(type) { + case Map: + return t, true + case map[string]any: + return t, true + } + + log.Panicf("%q is not a map", key) + return nil, false +} + +func (m Map) MustGetMap(key string) Map { + v, ok := m.GetMap(key) + if !ok { + log.Panicf("%q not found", key) + } + return v +} + +func (m Map) Set(key string, value any) { + rootKey, subKeys, found := strings.Cut(key, ".") + if found { + if v, ok := m[rootKey]; ok { + switch t := v.(type) { + case Slice: + t.Set(subKeys, value) + case []any: + Slice(t).Set(subKeys, value) + case Map: + t.Set(subKeys, value) + case map[string]any: + Map(t).Set(subKeys, value) + } + } else { + subMap := Map{} + subMap.Set(subKeys, value) + m[rootKey] = subMap + } + } else { + m[rootKey] = value + } +} + +func (m Map) Move(src string, dst string) { + value := m.MustGet(src) + m.Set(dst, value) + m.Delete(src) +} + +func (m Map) Delete(key string) bool { + rootKey, subKeys, found := strings.Cut(key, ".") + if found { + if v, ok := m[rootKey]; ok { + switch t := v.(type) { + case Slice: + return t.Delete(subKeys) + case []any: + return Slice(t).Delete(subKeys) + case Map: + return t.Delete(subKeys) + case map[string]any: + return Map(t).Delete(subKeys) + } + } + } else { + delete(m, rootKey) + return true + } + return false +} + +func (m Map) MustDelete(key string) { + if !m.Delete(key) { + log.Panicf("%q not found", key) + } +} + +func (m Map) CreateRef(schema *Schema, name string, key string) Map { + refTarget := m.MustGet(key) // Check the full path + refPath := fmt.Sprintf("schemas.%s", name) + refValue := Map{"$ref": fmt.Sprintf("#/components/schemas/%s", name)} + + // If the component schema already exists and is not the same, panic + writeComponent := true + if existing, ok := schema.Components.Get(refPath); ok { + if reflect.DeepEqual(refTarget, existing) { + writeComponent = false + } else { + log.Panicf("Component schema key already in use and not an exact duplicate: %q", refPath) + return nil + } + } + + var parent any + var childKey string + // Get the parent of the refTarget + i := strings.LastIndex(key, ".") + if i == -1 { + parent = m + childKey = key + } else { + parent = m.MustGet(key[:i]) + childKey = key[i+1:] + } + + doMap := func(target Map, key string) { + if writeComponent { + schema.Components.Set(refPath, target.MustGet(key)) + } + target.Set(key, refValue) + } + + doSlice := func(target Slice, key string) { + index := target.atoi(key) + if writeComponent { + schema.Components.Set(refPath, target[index]) + } + target[index] = refValue + } + + switch t := parent.(type) { + case map[string]any: + doMap(Map(t), childKey) + case Map: + doMap(t, childKey) + case []any: + doSlice(Slice(t), childKey) + case Slice: + doSlice(t, childKey) + default: + log.Panicf("Cannot create a ref of target type %T at %q", parent, key) + } + + return refValue +} + +func (m Map) Iterate(iteratee func(key string, node Map)) { + joinPath := func(existing string, next string) string { + if existing == "" { + return next + } else { + return fmt.Sprintf("%s.%s", existing, next) + } + } + joinIndex := func(existing string, next int) string { + if existing == "" { + return fmt.Sprintf("%d", next) + } else { + return fmt.Sprintf("%s.%d", existing, next) + } + } + + var iterate func(key string, val any) + iterate = func(key string, val any) { + switch tval := val.(type) { + case []any: + iterate(key, Slice(tval)) + case Slice: + for i, v := range tval { + iterate(joinIndex(key, i), v) + } + case map[string]any: + iterate(key, Map(tval)) + case Map: + for _, k := range tval.Keys() { + iterate(joinPath(key, k), tval[k]) + } + iteratee(key, tval) + } + } + + iterate("", m) +} + +// ============================================================================ + +type Slice []any + +func (s Slice) Get(key string) (any, bool) { + rootKey, subKeys, found := strings.Cut(key, ".") + index := s.atoi(rootKey) + + if found { + switch t := s[index].(type) { + case Slice: + return t.Get(subKeys) + case []any: + return Slice(t).Get(subKeys) + case Map: + return t.Get(subKeys) + case map[string]any: + return Map(t).Get(subKeys) + } + } + + value := s[index] + return value, true +} + +func (s Slice) GetMap(key string) (Map, bool) { + value, ok := s.Get(key) + if !ok { + return nil, false + } + + switch t := value.(type) { + case Map: + return t, true + case map[string]any: + return t, true + } + + log.Panicf("%q is not a map", key) + return nil, false +} + +func (s Slice) MustGetMap(key string) Map { + v, ok := s.GetMap(key) + if !ok { + log.Panicf("%q not found", key) + } + return v +} + +func (s Slice) Set(key string, value any) { + rootKey, subKeys, found := strings.Cut(key, ".") + index := s.atoi(rootKey) + if found { + v := s[index] + switch t := v.(type) { + case Slice: + t.Set(subKeys, value) + case []any: + Slice(t).Set(subKeys, value) + case Map: + t.Set(subKeys, value) + case map[string]any: + Map(t).Set(subKeys, value) + } + } else { + s[index] = value + } +} + +func (s Slice) Delete(key string) bool { + rootKey, subKeys, found := strings.Cut(key, ".") + index := s.atoi(rootKey) + if found { + item := (s)[index] + switch t := item.(type) { + case Slice: + return t.Delete(subKeys) + case []any: + return Slice(t).Delete(subKeys) + case Map: + return t.Delete(subKeys) + case map[string]any: + return Map(t).Delete(subKeys) + } + } else { + log.Panicf("Unable to delete from slice directly") + return true + } + return false +} + +func (s Slice) Contains(value string) bool { + for _, v := range s { + s, ok := v.(string) + if !ok { + continue + } + if value == s { + return true + } + } + + return false +} + +func (s Slice) atoi(key string) int { + index, err := strconv.Atoi(key) + if err != nil { + log.Panicf("Failed to parse slice index key %q: %v", key, err) + } + if index < 0 || index >= len(s) { + log.Panicf("Slice index is out of bounds (%d, target slice len: %d)", index, len(s)) + } + return index +} + +// ============================================================================ + +type TransformFunc func(schema *Schema) + +var transformers = []TransformFunc{ + transformFilterPaths, + transformRemoveKbnXsrf, + transformRemoveApiVersionParam, + transformSimplifyContentType, + transformKibanaPaths, + // transformRemoveEnums, + // transformAddGoPointersFlag, + transformRemoveExamples, + transformRemoveUnusedComponents, +} + +// transformFilterPaths filters the paths in a schema down to a specified list +// of endpoints and methods. +func transformFilterPaths(schema *Schema) { + var includePaths = map[string][]string{ + "/api/data_views": {"get"}, + "/api/data_views/data_view": {"post"}, + "/api/data_views/data_view/{viewId}": {"get", "post", "delete"}, + } + + for path, pathInfo := range schema.Paths { + if allowedMethods, ok := includePaths[path]; ok { + // Filter out endpoints not if filter list + for method := range pathInfo.Endpoints { + if !slices.Contains(allowedMethods, method) { + pathInfo.SetEndpoint(method, nil) + } + } + } else { + // Remove paths not in filter list. + delete(schema.Paths, path) + } + } + + // Go through again, verify each entry exists + for path, methods := range includePaths { + pathInfo := schema.GetPath(path) + if pathInfo == nil { + log.Panicf("Missing path %q", path) + } + + for _, method := range methods { + endpoint := pathInfo.GetEndpoint(method) + if endpoint == nil { + log.Panicf("Missing method %q of %q", method, path) + } + } + } +} + +// transformRemoveKbnXsrf removes the kbn-xsrf header as it is already applied +// in the client. +func transformRemoveKbnXsrf(schema *Schema) { + removeKbnXsrf := func(node any) bool { + param := node.(Map) + if v, ok := param["name"]; ok { + name := v.(string) + if strings.HasSuffix(name, "kbn_xsrf") || strings.HasSuffix(name, "kbn-xsrf") { + return true + } + } + // Data_views_kbn_xsrf, Saved_objects_kbn_xsrf, etc + if v, ok := param["$ref"]; ok { + ref := v.(string) + if strings.HasSuffix(ref, "kbn_xsrf") || strings.HasSuffix(ref, "kbn-xsrf") { + return true + } + } + return false + } + + for _, pathInfo := range schema.Paths { + for _, endpoint := range pathInfo.Endpoints { + if params, ok := endpoint.GetSlice("parameters"); ok { + params = slices.DeleteFunc(params, removeKbnXsrf) + endpoint["parameters"] = params + } + } + } +} + +// transformRemoveApiVersionParam removes the Elastic API Version query +// parameter header. +func transformRemoveApiVersionParam(schema *Schema) { + removeApiVersion := func(node any) bool { + param := node.(Map) + if name, ok := param["name"]; ok && name == "elastic-api-version" { + return true + } + return false + } + + for _, pathInfo := range schema.Paths { + for _, endpoint := range pathInfo.Endpoints { + if params, ok := endpoint.GetSlice("parameters"); ok { + params = slices.DeleteFunc(params, removeApiVersion) + endpoint["parameters"] = params + } + } + } +} + +// transformSimplifyContentType simplifies Content-Type headers such as +// 'application/json; Elastic-Api-Version=2023-10-31' by stripping everything +// after the ';'. +func transformSimplifyContentType(schema *Schema) { + simplifyContentType := func(fields Map) { + if content, ok := fields.GetMap("content"); ok { + for key := range content { + newKey, _, found := strings.Cut(key, ";") + if found { + content.Move(key, newKey) + } + } + } + } + + for _, pathInfo := range schema.Paths { + for _, endpoint := range pathInfo.Endpoints { + if req, ok := endpoint.GetMap("requestBody"); ok { + simplifyContentType(req) + } + if resp, ok := endpoint.GetMap("responses"); ok { + for code := range resp { + simplifyContentType(resp.MustGetMap(code)) + } + } + } + } + + if responses, ok := schema.Components.GetMap("responses"); ok { + for key := range responses { + resp := responses.MustGetMap(key) + simplifyContentType(resp) + } + } +} + +// transformKibanaPaths fixes the Kibana paths. +func transformKibanaPaths(schema *Schema) { + operationIds := map[string]map[string]string{ + "/api/data_views": { + "get": "get_data_views", + }, + "/api/data_views/data_view": { + "post": "create_data_view", + }, + "/api/data_views/data_view/{viewId}": { + "get": "get_data_view", + "post": "update_data_view", + "delete": "delete_data_view", + }, + } + + // Set each missing operationId + for path, methods := range operationIds { + pathInfo := schema.MustGetPath(path) + for method, operationId := range methods { + endpoint := pathInfo.GetEndpoint(method) + endpoint.Set("operationId", operationId) + } + } + + // Fix OpenAPI error: set each missing description + for _, pathInfo := range schema.Paths { + for _, endpoint := range pathInfo.Endpoints { + responses := endpoint.MustGetMap("responses") + for code := range responses { + response := responses.MustGetMap(code) + if _, ok := response["description"]; !ok { + response["description"] = "" + } + } + } + } + + // Convert any paths needing it to /s/{spaceId} variants + spaceIdPaths := []string{ + "/api/data_views", + "/api/data_views/data_view", + "/api/data_views/data_view/{viewId}", + } + + // Add a spaceId parameter if not already present + if _, ok := schema.Components.Get("parameters.spaceId"); !ok { + schema.Components.Set("parameters.spaceId", Map{ + "in": "path", + "name": "spaceId", + "description": "An identifier for the space. If `/s/` and the identifier are omitted from the path, the default space is used.", + "required": true, + "schema": Map{"type": "string", "example": "default"}, + }) + } + + for _, path := range spaceIdPaths { + pathInfo := schema.Paths[path] + schema.Paths[fmt.Sprintf("/s/{spaceId}%s", path)] = pathInfo + delete(schema.Paths, path) + + // Add the spaceId parameter + param := Map{"$ref": "#/components/parameters/spaceId"} + for _, endpoint := range pathInfo.Endpoints { + if params, ok := endpoint.GetSlice("parameters"); ok { + params = append(params, param) + endpoint.Set("parameters", params) + } else { + params = Slice{param} + endpoint.Set("parameters", params) + } + } + } + + // Data views + // https://github.com/elastic/kibana/blob/main/src/plugins/data_views/server/rest_api_routes/schema.ts + + dataViewsPath := schema.MustGetPath("/s/{spaceId}/api/data_views") + + dataViewsPath.Get.CreateRef(schema, "get_data_views_response_item", "responses.200.content.application/json.schema.properties.data_view.items") + + schema.Components.CreateRef(schema, "Data_views_data_view_response_object_inner", "schemas.Data_views_data_view_response_object.properties.data_view") + schema.Components.CreateRef(schema, "Data_views_sourcefilter_item", "schemas.Data_views_sourcefilters.items") + schema.Components.CreateRef(schema, "Data_views_runtimefieldmap_script", "schemas.Data_views_runtimefieldmap.properties.script") + + schema.Components.Set("schemas.Data_views_fieldformats.additionalProperties", Map{ + "$ref": "#/components/schemas/Data_views_fieldformat", + }) + schema.Components.Set("schemas.Data_views_fieldformat", Map{ + "type": "object", + "properties": Map{ + "id": Map{"type": "string"}, + "params": Map{"$ref": "#/components/schemas/Data_views_fieldformat_params"}, + }, + }) + schema.Components.Set("schemas.Data_views_fieldformat_params", Map{ + "type": "object", + "properties": Map{ + "pattern": Map{"type": "string"}, + "urlTemplate": Map{"type": "string"}, + "labelTemplate": Map{"type": "string"}, + }, + }) + + schema.Components.CreateRef(schema, "Data_views_create_data_view_request_object_inner", "schemas.Data_views_create_data_view_request_object.properties.data_view") + schema.Components.CreateRef(schema, "Data_views_update_data_view_request_object_inner", "schemas.Data_views_update_data_view_request_object.properties.data_view") +} + +// transformRemoveEnums remove all enums. +func transformRemoveEnums(schema *Schema) { + deleteEnumFn := func(key string, node Map) { + if node.Has("enum") { + delete(node, "enum") + } + } + + for _, pathInfo := range schema.Paths { + for _, methInfo := range pathInfo.Endpoints { + methInfo.Iterate(deleteEnumFn) + } + } + schema.Components.Iterate(deleteEnumFn) +} + +// transformRemoveExamples removes all examples. +func transformRemoveExamples(schema *Schema) { + deleteExampleFn := func(key string, node Map) { + if node.Has("example") { + delete(node, "example") + } + if node.Has("examples") { + delete(node, "examples") + } + } + + for _, pathInfo := range schema.Paths { + for _, methInfo := range pathInfo.Endpoints { + methInfo.Iterate(deleteExampleFn) + } + } + schema.Components.Iterate(deleteExampleFn) + schema.Components.Set("examples", Map{}) +} + +// transformAddOptionalPointersFlag adds a x-go-type-skip-optional-pointer +// flag to maps and arrays, since they are already nullable types. +func transformAddOptionalPointersFlag(schema *Schema) { + addFlagFn := func(key string, node Map) { + if node["type"] == "array" { + node["x-go-type-skip-optional-pointer"] = true + } else if node["type"] == "object" { + if _, ok := node["properties"]; !ok { + node["x-go-type-skip-optional-pointer"] = true + } + } + } + + for _, pathInfo := range schema.Paths { + for _, methInfo := range pathInfo.Endpoints { + methInfo.Iterate(addFlagFn) + } + } + schema.Components.Iterate(addFlagFn) +} + +// transformRemoveUnusedComponents removes all unused schema components. +func transformRemoveUnusedComponents(schema *Schema) { + var refs map[string]any + collectRefsFn := func(key string, node Map) { + if ref, ok := node["$ref"].(string); ok { + i := strings.LastIndex(ref, "/") + ref = ref[i+1:] + refs[ref] = nil + } + } + + componentParams := schema.Components.MustGetMap("parameters") + componentSchemas := schema.Components.MustGetMap("schemas") + + for { + // Collect refs + refs = make(map[string]any) + for _, pathInfo := range schema.Paths { + for _, methInfo := range pathInfo.Endpoints { + methInfo.Iterate(collectRefsFn) + } + } + schema.Components.Iterate(collectRefsFn) + + loop := false + for key := range componentSchemas { + if _, ok := refs[key]; !ok { + delete(componentSchemas, key) + loop = true + } + } + for key := range componentParams { + if _, ok := refs[key]; !ok { + delete(componentParams, key) + loop = true + } + } + if !loop { + break + } + } +} diff --git a/internal/clients/api_client.go b/internal/clients/api_client.go index 6c16802d9..3cd5c9f3c 100644 --- a/internal/clients/api_client.go +++ b/internal/clients/api_client.go @@ -12,10 +12,10 @@ import ( "github.com/elastic/go-elasticsearch/v8" "github.com/elastic/terraform-provider-elasticstack/generated/alerting" "github.com/elastic/terraform-provider-elasticstack/generated/connectors" - "github.com/elastic/terraform-provider-elasticstack/generated/data_views" "github.com/elastic/terraform-provider-elasticstack/generated/slo" "github.com/elastic/terraform-provider-elasticstack/internal/clients/config" "github.com/elastic/terraform-provider-elasticstack/internal/clients/fleet" + "github.com/elastic/terraform-provider-elasticstack/internal/clients/kibana2" "github.com/elastic/terraform-provider-elasticstack/internal/models" "github.com/elastic/terraform-provider-elasticstack/internal/utils" "github.com/hashicorp/go-version" @@ -51,6 +51,11 @@ func CompositeIdFromStr(id string) (*CompositeId, diag.Diagnostics) { diags } +func CompositeIdFromStrFw(id string) (*CompositeId, fwdiags.Diagnostics) { + composite, diags := CompositeIdFromStr(id) + return composite, utils.ConvertSDKDiagnosticsToFramework(diags) +} + func ResourceIDFromStr(id string) (string, diag.Diagnostics) { compID, diags := CompositeIdFromStr(id) if diags.HasError() { @@ -67,8 +72,8 @@ type ApiClient struct { elasticsearch *elasticsearch.Client elasticsearchClusterInfo *models.ClusterInfo kibana *kibana.Client + kibana2 *kibana2.Client alerting alerting.AlertingAPI - dataViews data_views.DataViewsAPI connectors *connectors.Client slo slo.SloAPI kibanaConfig kibana.Config @@ -103,6 +108,11 @@ func NewAcceptanceTestingClient() (*ApiClient, error) { return nil, fmt.Errorf("cannot create Kibana action connectors client: [%w]", err) } + kibana2Client, err := kibana2.NewClient(*cfg.Kibana2) + if err != nil { + return nil, err + } + fleetClient, err := fleet.NewClient(*cfg.Fleet) if err != nil { return nil, err @@ -111,8 +121,8 @@ func NewAcceptanceTestingClient() (*ApiClient, error) { return &ApiClient{ elasticsearch: es, kibana: kib, + kibana2: kibana2Client, alerting: buildAlertingClient(cfg, kibanaHttpClient).AlertingAPI, - dataViews: buildDataViewsClient(cfg, kibanaHttpClient).DataViewsAPI, slo: buildSloClient(cfg, kibanaHttpClient).SloAPI, connectors: actionConnectors, kibanaConfig: *cfg.Kibana, @@ -234,20 +244,20 @@ func (a *ApiClient) GetKibanaClient() (*kibana.Client, error) { return a.kibana, nil } -func (a *ApiClient) GetAlertingClient() (alerting.AlertingAPI, error) { - if a.alerting == nil { - return nil, errors.New("alerting client not found") +func (a *ApiClient) GetKibana2Client() (*kibana2.Client, error) { + if a.kibana2 == nil { + return nil, errors.New("kibana2 client not found") } - return a.alerting, nil + return a.kibana2, nil } -func (a *ApiClient) GetDataViewsClient() (data_views.DataViewsAPI, error) { - if a.dataViews == nil { - return nil, errors.New("data views client not found") +func (a *ApiClient) GetAlertingClient() (alerting.AlertingAPI, error) { + if a.alerting == nil { + return nil, errors.New("alerting client not found") } - return a.dataViews, nil + return a.alerting, nil } func (a *ApiClient) GetKibanaConnectorsClient(ctx context.Context) (*connectors.Client, error) { @@ -304,21 +314,6 @@ func (a *ApiClient) SetAlertingAuthContext(ctx context.Context) context.Context } } -func (a *ApiClient) SetDataviewAuthContext(ctx context.Context) context.Context { - if a.kibanaConfig.ApiKey != "" { - return context.WithValue(ctx, data_views.ContextAPIKeys, map[string]data_views.APIKey{ - "apiKeyAuth": { - Prefix: "ApiKey", - Key: a.kibanaConfig.ApiKey, - }}) - } else { - return context.WithValue(ctx, data_views.ContextBasicAuth, data_views.BasicAuth{ - UserName: a.kibanaConfig.Username, - Password: a.kibanaConfig.Password, - }) - } -} - func (a *ApiClient) ID(ctx context.Context, resourceId string) (*CompositeId, diag.Diagnostics) { var diags diag.Diagnostics clusterId, diags := a.ClusterID(ctx) @@ -475,6 +470,15 @@ func buildKibanaClient(cfg config.Client) (*kibana.Client, error) { return kib, nil } +func buildKibana2Client(cfg config.Client) (*kibana2.Client, error) { + client, err := kibana2.NewClient(*cfg.Kibana2) + if err != nil { + return nil, fmt.Errorf("Unable to create Kibana2 client: %w", err) + } + + return client, nil +} + func buildAlertingClient(cfg config.Client, httpClient *http.Client) *alerting.APIClient { alertingConfig := alerting.Configuration{ UserAgent: cfg.UserAgent, @@ -488,19 +492,6 @@ func buildAlertingClient(cfg config.Client, httpClient *http.Client) *alerting.A return alerting.NewAPIClient(&alertingConfig) } -func buildDataViewsClient(cfg config.Client, httpClient *http.Client) *data_views.APIClient { - dvConfig := data_views.Configuration{ - UserAgent: cfg.UserAgent, - Servers: data_views.ServerConfigurations{ - { - URL: cfg.Kibana.Address, - }, - }, - HTTPClient: httpClient, - } - return data_views.NewAPIClient(&dvConfig) -} - func buildConnectorsClient(cfg config.Client, httpClient *http.Client) (*connectors.Client, error) { var authInterceptor connectors.ClientOption if cfg.Kibana.ApiKey != "" { @@ -583,6 +574,13 @@ func newApiClientFromConfig(cfg config.Client, version string) (*ApiClient, erro if err != nil { return nil, err } + client.kibana = kibanaClient + + kibana2Client, err := buildKibana2Client(cfg) + if err != nil { + return nil, err + } + client.kibana2 = kibana2Client kibanaHttpClient := kibanaClient.Client.GetClient() connectorsClient, err := buildConnectorsClient(cfg, kibanaHttpClient) @@ -590,9 +588,7 @@ func newApiClientFromConfig(cfg config.Client, version string) (*ApiClient, erro return nil, fmt.Errorf("cannot create Kibana connectors client: [%w]", err) } - client.kibana = kibanaClient client.alerting = buildAlertingClient(cfg, kibanaHttpClient).AlertingAPI - client.dataViews = buildDataViewsClient(cfg, kibanaHttpClient).DataViewsAPI client.slo = buildSloClient(cfg, kibanaHttpClient).SloAPI client.connectors = connectorsClient } diff --git a/internal/clients/config/base.go b/internal/clients/config/base.go index 9751b7c10..aa4b195f3 100644 --- a/internal/clients/config/base.go +++ b/internal/clients/config/base.go @@ -77,6 +77,14 @@ func (b baseConfig) toKibanaConfig() kibanaConfig { } } +func (b baseConfig) toKibana2Config() kibana2Config { + return kibana2Config{ + Username: b.Username, + Password: b.Password, + APIKey: b.ApiKey, + } +} + func (b baseConfig) toElasticsearchConfig() elasticsearchConfig { return elasticsearchConfig{ config: elasticsearch.Config{ diff --git a/internal/clients/config/client.go b/internal/clients/config/client.go index 6e93010c1..5e80c5504 100644 --- a/internal/clients/config/client.go +++ b/internal/clients/config/client.go @@ -4,11 +4,13 @@ import ( "github.com/disaster37/go-kibana-rest/v8" "github.com/elastic/go-elasticsearch/v8" "github.com/elastic/terraform-provider-elasticstack/internal/clients/fleet" + "github.com/elastic/terraform-provider-elasticstack/internal/clients/kibana2" ) type Client struct { UserAgent string Kibana *kibana.Config + Kibana2 *kibana2.Config Elasticsearch *elasticsearch.Config Fleet *fleet.Config } diff --git a/internal/clients/config/env.go b/internal/clients/config/env.go index 7c4844414..eb6cc48b6 100644 --- a/internal/clients/config/env.go +++ b/internal/clients/config/env.go @@ -5,6 +5,7 @@ import ( "github.com/disaster37/go-kibana-rest/v8" "github.com/elastic/terraform-provider-elasticstack/internal/clients/fleet" + "github.com/elastic/terraform-provider-elasticstack/internal/clients/kibana2" "github.com/elastic/terraform-provider-elasticstack/internal/utils" ) @@ -25,7 +26,10 @@ func NewFromEnv(version string) Client { kibanaCfg := base.toKibanaConfig().withEnvironmentOverrides() client.Kibana = (*kibana.Config)(&kibanaCfg) - fleetCfg := kibanaCfg.toFleetConfig().withEnvironmentOverrides() + kibana2Cfg := base.toKibana2Config().withEnvironmentOverrides() + client.Kibana2 = (*kibana2.Config)(&kibana2Cfg) + + fleetCfg := kibana2Cfg.toFleetConfig().withEnvironmentOverrides() client.Fleet = (*fleet.Config)(&fleetCfg) return client diff --git a/internal/clients/config/fleet.go b/internal/clients/config/fleet.go index 58b46fc51..4f4144351 100644 --- a/internal/clients/config/fleet.go +++ b/internal/clients/config/fleet.go @@ -13,7 +13,7 @@ import ( type fleetConfig fleet.Config -func newFleetConfigFromSDK(d *schema.ResourceData, kibanaCfg kibanaConfig) (fleetConfig, sdkdiags.Diagnostics) { +func newFleetConfigFromSDK(d *schema.ResourceData, kibanaCfg kibana2Config) (fleetConfig, sdkdiags.Diagnostics) { config := kibanaCfg.toFleetConfig() // Set variables from resource config. @@ -56,7 +56,7 @@ func newFleetConfigFromSDK(d *schema.ResourceData, kibanaCfg kibanaConfig) (flee return config.withEnvironmentOverrides(), nil } -func newFleetConfigFromFramework(ctx context.Context, cfg ProviderConfiguration, kibanaCfg kibanaConfig) (fleetConfig, fwdiags.Diagnostics) { +func newFleetConfigFromFramework(ctx context.Context, cfg ProviderConfiguration, kibanaCfg kibana2Config) (fleetConfig, fwdiags.Diagnostics) { config := kibanaCfg.toFleetConfig() if len(cfg.Fleet) > 0 { diff --git a/internal/clients/config/fleet_test.go b/internal/clients/config/fleet_test.go index 914801714..06c1bf8d8 100644 --- a/internal/clients/config/fleet_test.go +++ b/internal/clients/config/fleet_test.go @@ -16,7 +16,7 @@ import ( func Test_newFleetConfigFromSDK(t *testing.T) { type args struct { - kibanaCfg kibanaConfig + kibanaCfg kibana2Config resourceData map[string]interface{} expectedConfig fleetConfig expectedDiags sdkdiags.Diagnostics @@ -29,11 +29,11 @@ func Test_newFleetConfigFromSDK(t *testing.T) { { name: "should return kibana config if no fleet config defined", args: func() args { - kibanaCfg := kibanaConfig{ - Address: "example.com/kibana", - Username: "elastic", - Password: "changeme", - DisableVerifySSL: true, + kibanaCfg := kibana2Config{ + URL: "example.com/kibana", + Username: "elastic", + Password: "changeme", + Insecure: true, } return args{ @@ -46,11 +46,11 @@ func Test_newFleetConfigFromSDK(t *testing.T) { { name: "should use the provided config optios", args: func() args { - kibanaCfg := kibanaConfig{ - Address: "example.com/kibana", - Username: "elastic", - Password: "changeme", - DisableVerifySSL: true, + kibanaCfg := kibana2Config{ + URL: "example.com/kibana", + Username: "elastic", + Password: "changeme", + Insecure: true, } return args{ @@ -81,11 +81,11 @@ func Test_newFleetConfigFromSDK(t *testing.T) { { name: "should prefer environment variables", args: func() args { - kibanaCfg := kibanaConfig{ - Address: "example.com/kibana", - Username: "elastic", - Password: "changeme", - DisableVerifySSL: true, + kibanaCfg := kibana2Config{ + URL: "example.com/kibana", + Username: "elastic", + Password: "changeme", + Insecure: true, } return args{ @@ -149,7 +149,7 @@ func Test_newFleetConfigFromSDK(t *testing.T) { func Test_newFleetConfigFromFramework(t *testing.T) { type args struct { - kibanaCfg kibanaConfig + kibanaCfg kibana2Config providerConfig ProviderConfiguration expectedConfig fleetConfig expectedDiags fwdiags.Diagnostics @@ -162,11 +162,11 @@ func Test_newFleetConfigFromFramework(t *testing.T) { { name: "should return kibana config if no fleet config defined", args: func() args { - kibanaCfg := kibanaConfig{ - Address: "example.com/kibana", - Username: "elastic", - Password: "changeme", - DisableVerifySSL: true, + kibanaCfg := kibana2Config{ + URL: "example.com/kibana", + Username: "elastic", + Password: "changeme", + Insecure: true, } return args{ @@ -179,11 +179,11 @@ func Test_newFleetConfigFromFramework(t *testing.T) { { name: "should use the provided config options", args: func() args { - kibanaCfg := kibanaConfig{ - Address: "example.com/kibana", - Username: "elastic", - Password: "changeme", - DisableVerifySSL: true, + kibanaCfg := kibana2Config{ + URL: "example.com/kibana", + Username: "elastic", + Password: "changeme", + Insecure: true, } return args{ @@ -217,11 +217,11 @@ func Test_newFleetConfigFromFramework(t *testing.T) { { name: "should prefer environment variables", args: func() args { - kibanaCfg := kibanaConfig{ - Address: "example.com/kibana", - Username: "elastic", - Password: "changeme", - DisableVerifySSL: true, + kibanaCfg := kibana2Config{ + URL: "example.com/kibana", + Username: "elastic", + Password: "changeme", + Insecure: true, } return args{ diff --git a/internal/clients/config/framework.go b/internal/clients/config/framework.go index 45fffdc63..2670682ee 100644 --- a/internal/clients/config/framework.go +++ b/internal/clients/config/framework.go @@ -5,6 +5,7 @@ import ( "github.com/disaster37/go-kibana-rest/v8" "github.com/elastic/terraform-provider-elasticstack/internal/clients/fleet" + "github.com/elastic/terraform-provider-elasticstack/internal/clients/kibana2" "github.com/elastic/terraform-provider-elasticstack/internal/utils" "github.com/hashicorp/terraform-plugin-framework/diag" ) @@ -31,7 +32,14 @@ func NewFromFramework(ctx context.Context, cfg ProviderConfiguration, version st client.Kibana = (*kibana.Config)(&kibanaCfg) - fleetCfg, diags := newFleetConfigFromFramework(ctx, cfg, kibanaCfg) + kibana2Cfg, diags := newKibana2ConfigFromFramework(ctx, cfg, base) + if diags.HasError() { + return Client{}, diags + } + + client.Kibana2 = (*kibana2.Config)(&kibana2Cfg) + + fleetCfg, diags := newFleetConfigFromFramework(ctx, cfg, kibana2Cfg) if diags.HasError() { return Client{}, diags } diff --git a/internal/clients/config/kibana.go b/internal/clients/config/kibana.go index 9fc532cd9..e7a8529f7 100644 --- a/internal/clients/config/kibana.go +++ b/internal/clients/config/kibana.go @@ -116,14 +116,3 @@ func (k kibanaConfig) withEnvironmentOverrides() kibanaConfig { return k } - -func (k kibanaConfig) toFleetConfig() fleetConfig { - return fleetConfig{ - URL: k.Address, - Username: k.Username, - Password: k.Password, - APIKey: k.ApiKey, - CACerts: k.CAs, - Insecure: k.DisableVerifySSL, - } -} diff --git a/internal/clients/config/kibana2.go b/internal/clients/config/kibana2.go new file mode 100644 index 000000000..0268ed177 --- /dev/null +++ b/internal/clients/config/kibana2.go @@ -0,0 +1,122 @@ +package config + +import ( + "context" + "os" + "strconv" + "strings" + + "github.com/elastic/terraform-provider-elasticstack/internal/clients/kibana2" + fwdiags "github.com/hashicorp/terraform-plugin-framework/diag" + sdkdiags "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +type kibana2Config kibana2.Config + +func newKibana2ConfigFromSDK(d *schema.ResourceData, base baseConfig) (kibana2Config, sdkdiags.Diagnostics) { + var diags sdkdiags.Diagnostics + + // Use ES details by default + config := base.toKibana2Config() + kibConn, ok := d.GetOk("kibana") + if !ok { + return config, diags + } + + // if defined, then we only have a single entry + if kib := kibConn.([]interface{})[0]; kib != nil { + kibConfig := kib.(map[string]interface{}) + + if username, ok := kibConfig["username"]; ok && username != "" { + config.Username = username.(string) + } + if password, ok := kibConfig["password"]; ok && password != "" { + config.Password = password.(string) + } + + if apiKey, ok := kibConfig["api_key"]; ok && apiKey != "" { + config.APIKey = apiKey.(string) + } + + if endpoints, ok := kibConfig["endpoints"]; ok && len(endpoints.([]interface{})) > 0 { + // We're curently limited by the API to a single endpoint + if endpoint := endpoints.([]interface{})[0]; endpoint != nil { + config.URL = endpoint.(string) + } + } + + if caCerts, ok := kibConfig["ca_certs"].([]interface{}); ok && len(caCerts) > 0 { + for _, elem := range caCerts { + if vStr, elemOk := elem.(string); elemOk { + config.CACerts = append(config.CACerts, vStr) + } + } + } + + if insecure, ok := kibConfig["insecure"]; ok && insecure.(bool) { + config.Insecure = true + } + } + + return config.withEnvironmentOverrides(), nil +} + +func newKibana2ConfigFromFramework(ctx context.Context, cfg ProviderConfiguration, base baseConfig) (kibana2Config, fwdiags.Diagnostics) { + config := base.toKibana2Config() + + if len(cfg.Kibana) > 0 { + kibConfig := cfg.Kibana[0] + if kibConfig.Username.ValueString() != "" { + config.Username = kibConfig.Username.ValueString() + } + if kibConfig.Password.ValueString() != "" { + config.Password = kibConfig.Password.ValueString() + } + if kibConfig.ApiKey.ValueString() != "" { + config.APIKey = kibConfig.ApiKey.ValueString() + } + var endpoints []string + diags := kibConfig.Endpoints.ElementsAs(ctx, &endpoints, true) + + var cas []string + diags.Append(kibConfig.CACerts.ElementsAs(ctx, &cas, true)...) + if diags.HasError() { + return kibana2Config{}, diags + } + + if len(endpoints) > 0 { + config.URL = endpoints[0] + } + + if len(cas) > 0 { + config.CACerts = cas + } + + config.Insecure = kibConfig.Insecure.ValueBool() + } + + return config.withEnvironmentOverrides(), nil +} + +func (k kibana2Config) withEnvironmentOverrides() kibana2Config { + k.Username = withEnvironmentOverride(k.Username, "KIBANA_USERNAME") + k.Password = withEnvironmentOverride(k.Password, "KIBANA_PASSWORD") + k.APIKey = withEnvironmentOverride(k.APIKey, "KIBANA_API_KEY") + k.URL = withEnvironmentOverride(k.URL, "KIBANA_ENDPOINT") + if caCerts, ok := os.LookupEnv("KIBANA_CA_CERTS"); ok { + k.CACerts = strings.Split(caCerts, ",") + } + + if insecure, ok := os.LookupEnv("KIBANA_INSECURE"); ok { + if insecureValue, err := strconv.ParseBool(insecure); err == nil { + k.Insecure = insecureValue + } + } + + return k +} + +func (k kibana2Config) toFleetConfig() fleetConfig { + return fleetConfig(k) +} diff --git a/internal/clients/config/kibana2_test.go b/internal/clients/config/kibana2_test.go new file mode 100644 index 000000000..3716439b1 --- /dev/null +++ b/internal/clients/config/kibana2_test.go @@ -0,0 +1,299 @@ +package config + +import ( + "context" + "os" + "testing" + + providerSchema "github.com/elastic/terraform-provider-elasticstack/internal/schema" + "github.com/hashicorp/terraform-plugin-framework/attr" + fwdiags "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/types" + sdkdiags "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/stretchr/testify/require" +) + +func Test_newKibana2ConfigFromSDK(t *testing.T) { + type args struct { + baseCfg baseConfig + resourceData map[string]interface{} + expectedConfig kibana2Config + expectedDiags sdkdiags.Diagnostics + env map[string]string + } + tests := []struct { + name string + args func() args + }{ + { + name: "should return kibana config if no fleet config defined", + args: func() args { + baseCfg := baseConfig{ + Username: "elastic", + Password: "changeme", + } + + return args{ + baseCfg: baseCfg, + resourceData: map[string]interface{}{}, + expectedConfig: baseCfg.toKibana2Config(), + } + }, + }, + { + name: "should use the provided config options", + args: func() args { + baseCfg := baseConfig{ + Username: "elastic", + Password: "changeme", + } + + return args{ + baseCfg: baseCfg, + resourceData: map[string]interface{}{ + "kibana": []interface{}{ + map[string]interface{}{ + "endpoints": []interface{}{"example.com/kibana"}, + "username": "kibana", + "password": "baltic", + "ca_certs": []interface{}{"internal", "lets_decrypt"}, + "insecure": false, + }, + }, + }, + expectedConfig: kibana2Config{ + URL: "example.com/kibana", + Username: "kibana", + Password: "baltic", + CACerts: []string{"internal", "lets_decrypt"}, + Insecure: false, + }, + } + }, + }, + { + name: "should prefer environment variables", + args: func() args { + baseCfg := baseConfig{ + Username: "elastic", + Password: "changeme", + } + + return args{ + baseCfg: baseCfg, + resourceData: map[string]interface{}{ + "kibana": []interface{}{ + map[string]interface{}{ + "endpoints": []interface{}{"example.com/kibana"}, + "username": "kibana", + "password": "baltic", + "ca_certs": []interface{}{"internal", "lets_decrypt"}, + "insecure": true, + }, + }, + }, + env: map[string]string{ + "KIBANA_ENDPOINT": "example.com/cabana", + "KIBANA_USERNAME": "elastic", + "KIBANA_PASSWORD": "thin-lines", + "KIBANA_INSECURE": "false", + "KIBANA_CA_CERTS": "black,sea", + }, + expectedConfig: kibana2Config{ + URL: "example.com/cabana", + Username: "elastic", + Password: "thin-lines", + Insecure: false, + CACerts: []string{"black", "sea"}, + }, + } + }, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + os.Unsetenv("KIBANA_USERNAME") + os.Unsetenv("KIBANA_PASSWORD") + os.Unsetenv("KIBANA_ENDPOINT") + os.Unsetenv("KIBANA_INSECURE") + os.Unsetenv("KIBANA_API_KEY") + os.Unsetenv("KIBANA_CA_CERTS") + + args := tt.args() + rd := schema.TestResourceDataRaw(t, map[string]*schema.Schema{ + "kibana": providerSchema.GetKibanaConnectionSchema(), + }, args.resourceData) + + for key, val := range args.env { + os.Setenv(key, val) + } + + kibanaCfg, diags := newKibana2ConfigFromSDK(rd, args.baseCfg) + + require.Equal(t, args.expectedConfig, kibanaCfg) + require.Equal(t, args.expectedDiags, diags) + }) + } +} + +func Test_newkibana2ConfigFromFramework(t *testing.T) { + type args struct { + baseCfg baseConfig + providerConfig ProviderConfiguration + expectedConfig kibana2Config + expectedDiags fwdiags.Diagnostics + env map[string]string + } + tests := []struct { + name string + args func() args + }{ + { + name: "should return kibana config if no fleet config defined", + args: func() args { + baseCfg := baseConfig{ + Username: "elastic", + Password: "changeme", + } + + return args{ + baseCfg: baseCfg, + providerConfig: ProviderConfiguration{}, + expectedConfig: baseCfg.toKibana2Config(), + } + }, + }, + { + name: "should use the provided config options", + args: func() args { + baseCfg := baseConfig{ + Username: "elastic", + Password: "changeme", + } + + return args{ + baseCfg: baseCfg, + providerConfig: ProviderConfiguration{ + Kibana: []KibanaConnection{ + { + Username: types.StringValue("kibana"), + Password: types.StringValue("baltic"), + Endpoints: types.ListValueMust(types.StringType, []attr.Value{ + types.StringValue("example.com/kibana"), + }), + CACerts: types.ListValueMust(types.StringType, []attr.Value{ + types.StringValue("internal"), + types.StringValue("lets_decrypt"), + }), + Insecure: types.BoolValue(false), + }, + }, + }, + expectedConfig: kibana2Config{ + URL: "example.com/kibana", + Username: "kibana", + Password: "baltic", + CACerts: []string{"internal", "lets_decrypt"}, + Insecure: false, + }, + } + }, + }, + { + name: "should use api_key when provided in config options", + args: func() args { + baseCfg := baseConfig{ + ApiKey: "test", + } + + return args{ + baseCfg: baseCfg, + providerConfig: ProviderConfiguration{ + Kibana: []KibanaConnection{ + { + ApiKey: types.StringValue("test"), + Endpoints: types.ListValueMust(types.StringType, []attr.Value{ + types.StringValue("example.com/kibana"), + }), + CACerts: types.ListValueMust(types.StringType, []attr.Value{}), + Insecure: types.BoolValue(true), + }, + }, + }, + expectedConfig: kibana2Config{ + URL: "example.com/kibana", + APIKey: "test", + Insecure: true, + }, + } + }, + }, + { + name: "should prefer environment variables", + args: func() args { + baseCfg := baseConfig{ + Username: "elastic", + Password: "changeme", + } + + return args{ + baseCfg: baseCfg, + providerConfig: ProviderConfiguration{ + Kibana: []KibanaConnection{ + { + Username: types.StringValue("kibana"), + Password: types.StringValue("baltic"), + Endpoints: types.ListValueMust(types.StringType, []attr.Value{ + types.StringValue("example.com/kibana"), + }), + CACerts: types.ListValueMust(types.StringType, []attr.Value{ + types.StringValue("internal"), + types.StringValue("lets_decrypt"), + }), + Insecure: types.BoolValue(true), + }, + }, + }, + env: map[string]string{ + "KIBANA_ENDPOINT": "example.com/cabana", + "KIBANA_USERNAME": "elastic", + "KIBANA_PASSWORD": "thin-lines", + "KIBANA_INSECURE": "false", + "KIBANA_CA_CERTS": "black,sea", + }, + expectedConfig: kibana2Config{ + URL: "example.com/cabana", + Username: "elastic", + Password: "thin-lines", + CACerts: []string{"black", "sea"}, + Insecure: false, + }, + } + }, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + os.Unsetenv("KIBANA_USERNAME") + os.Unsetenv("KIBANA_PASSWORD") + os.Unsetenv("KIBANA_API_KEY") + os.Unsetenv("KIBANA_ENDPOINT") + os.Unsetenv("KIBANA_CA_CERTS") + os.Unsetenv("KIBANA_INSECURE") + + args := tt.args() + + for key, val := range args.env { + os.Setenv(key, val) + } + + kibanaCfg, diags := newKibana2ConfigFromFramework(context.Background(), args.providerConfig, args.baseCfg) + + require.Equal(t, args.expectedConfig, kibanaCfg) + require.Equal(t, args.expectedDiags, diags) + }) + } +} diff --git a/internal/clients/config/sdk.go b/internal/clients/config/sdk.go index f1b879cdc..d4d107360 100644 --- a/internal/clients/config/sdk.go +++ b/internal/clients/config/sdk.go @@ -3,6 +3,7 @@ package config import ( "github.com/disaster37/go-kibana-rest/v8" "github.com/elastic/terraform-provider-elasticstack/internal/clients/fleet" + "github.com/elastic/terraform-provider-elasticstack/internal/clients/kibana2" "github.com/elastic/terraform-provider-elasticstack/internal/utils" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -48,7 +49,14 @@ func newFromSDK(d *schema.ResourceData, version, esConfigKey string) (Client, di client.Kibana = (*kibana.Config)(&kibanaCfg) - fleetCfg, diags := newFleetConfigFromSDK(d, kibanaCfg) + kibana2Cfg, diags := newKibana2ConfigFromSDK(d, base) + if diags.HasError() { + return Client{}, diags + } + + client.Kibana2 = (*kibana2.Config)(&kibana2Cfg) + + fleetCfg, diags := newFleetConfigFromSDK(d, kibana2Cfg) if diags.HasError() { return Client{}, diags } diff --git a/internal/clients/fleet/fleet.go b/internal/clients/fleet/fleet.go index c9fbdd2f8..a8bb5197d 100644 --- a/internal/clients/fleet/fleet.go +++ b/internal/clients/fleet/fleet.go @@ -30,7 +30,7 @@ func GetEnrollmentTokens(ctx context.Context, client *Client) ([]fleetapi.Enroll } } -// GetEnrollmentTokensByPolicy Get enrollment tokens by given policy ID +// GetEnrollmentTokensByPolicy Get enrollment tokens by given policy ID. func GetEnrollmentTokensByPolicy(ctx context.Context, client *Client, policyID string) ([]fleetapi.EnrollmentApiKey, diag.Diagnostics) { params := fleetapi.GetEnrollmentApiKeysParams{ Kuery: utils.Pointer("policy_id:" + policyID), @@ -100,7 +100,7 @@ func UpdateAgentPolicy(ctx context.Context, client *Client, id string, req fleet } } -// DeleteAgentPolicy deletes an existing agent policy +// DeleteAgentPolicy deletes an existing agent policy. func DeleteAgentPolicy(ctx context.Context, client *Client, id string) diag.Diagnostics { body := fleetapi.DeleteAgentPolicyJSONRequestBody{ AgentPolicyId: id, @@ -168,7 +168,7 @@ func UpdateOutput(ctx context.Context, client *Client, id string, req fleetapi.U } } -// DeleteOutput deletes an existing output +// DeleteOutput deletes an existing output. func DeleteOutput(ctx context.Context, client *Client, id string) diag.Diagnostics { resp, err := client.API.DeleteOutputWithResponse(ctx, id) if err != nil { diff --git a/internal/clients/kibana2/client.go b/internal/clients/kibana2/client.go new file mode 100644 index 000000000..8b478a854 --- /dev/null +++ b/internal/clients/kibana2/client.go @@ -0,0 +1,105 @@ +package kibana2 + +import ( + "crypto/tls" + "crypto/x509" + "fmt" + "net/http" + "os" + "strings" + + kbapi "github.com/elastic/terraform-provider-elasticstack/generated/kibana" + "github.com/elastic/terraform-provider-elasticstack/internal/utils" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/logging" +) + +// Config is the configuration for the fleet client. +type Config struct { + URL string + Username string + Password string + APIKey string + Insecure bool + CACerts []string +} + +// Client provides an API client for Elastic Fleet. +type Client struct { + URL string + HTTP *http.Client + API *kbapi.ClientWithResponses +} + +// NewClient creates a new Elastic Fleet API client. +func NewClient(cfg Config) (*Client, error) { + var caCertPool *x509.CertPool + if len(cfg.CACerts) > 0 { + caCertPool = x509.NewCertPool() + for _, certFile := range cfg.CACerts { + certData, err := os.ReadFile(certFile) + if err != nil { + return nil, fmt.Errorf("unable to open CA certificate file %q: %w", certFile, err) + } + _ = caCertPool.AppendCertsFromPEM(certData) + } + } + + var roundTripper http.RoundTripper = &http.Transport{ + Proxy: http.ProxyFromEnvironment, + TLSClientConfig: &tls.Config{ + InsecureSkipVerify: cfg.Insecure, + RootCAs: caCertPool, + }, + } + + if logging.IsDebugOrHigher() { + roundTripper = utils.NewDebugTransport("Kibana", roundTripper) + } + + httpClient := &http.Client{ + Transport: &transport{ + Config: cfg, + next: roundTripper, + }, + } + + endpoint := cfg.URL + if !strings.HasSuffix(endpoint, "/") { + endpoint += "/" + } + + fleetAPIClient, err := kbapi.NewClientWithResponses(endpoint, kbapi.WithHTTPClient(httpClient)) + if err != nil { + return nil, fmt.Errorf("unable to create Kibana API client: %w", err) + } + + return &Client{ + URL: cfg.URL, + HTTP: httpClient, + API: fleetAPIClient, + }, nil +} + +type transport struct { + Config + next http.RoundTripper +} + +func (t *transport) RoundTrip(req *http.Request) (*http.Response, error) { + switch req.Method { + case "GET", "HEAD": + default: + // https://www.elastic.co/guide/en/kibana/current/api.html#api-request-headers + req.Header.Add("kbn-xsrf", "true") + } + + if t.Username != "" { + req.SetBasicAuth(t.Username, t.Password) + } + + if t.APIKey != "" { + req.Header.Add("Authorization", "ApiKey "+t.APIKey) + } + + return t.next.RoundTrip(req) +} diff --git a/internal/clients/kibana2/data_views.go b/internal/clients/kibana2/data_views.go new file mode 100644 index 000000000..c81ac68e9 --- /dev/null +++ b/internal/clients/kibana2/data_views.go @@ -0,0 +1,89 @@ +package kibana2 + +import ( + "context" + "net/http" + + kbapi "github.com/elastic/terraform-provider-elasticstack/generated/kibana" + "github.com/elastic/terraform-provider-elasticstack/internal/utils" + "github.com/hashicorp/terraform-plugin-framework/diag" +) + +// GetDataViews reads all data views from the API. +func GetDataViews(ctx context.Context, client *Client, spaceID string) ([]kbapi.GetDataViewsResponseItem, diag.Diagnostics) { + resp, err := client.API.GetDataViewsWithResponse(ctx, spaceID) + if err != nil { + return nil, utils.FrameworkDiagFromError(err) + } + + switch resp.StatusCode() { + case http.StatusOK: + return *resp.JSON200.DataView, nil + default: + return nil, reportUnknownError(resp.StatusCode(), resp.Body) + } +} + +// GetDataView reads a specific data view from the API. +func GetDataView(ctx context.Context, client *Client, spaceID string, viewID string) (*kbapi.DataViewsDataViewResponseObject, diag.Diagnostics) { + resp, err := client.API.GetDataViewWithResponse(ctx, spaceID, viewID) + if err != nil { + return nil, utils.FrameworkDiagFromError(err) + } + + switch resp.StatusCode() { + case http.StatusOK: + return resp.JSON200, nil + case http.StatusNotFound: + return nil, nil + default: + return nil, reportUnknownError(resp.StatusCode(), resp.Body) + } +} + +// CreateDataView creates a new data view. +func CreateDataView(ctx context.Context, client *Client, spaceID string, req kbapi.CreateDataViewJSONRequestBody) (*kbapi.DataViewsDataViewResponseObject, diag.Diagnostics) { + resp, err := client.API.CreateDataViewWithResponse(ctx, spaceID, req) + if err != nil { + return nil, utils.FrameworkDiagFromError(err) + } + + switch resp.StatusCode() { + case http.StatusOK: + return resp.JSON200, nil + default: + return nil, reportUnknownError(resp.StatusCode(), resp.Body) + } +} + +// UpdateDataView updates an existing data view. +func UpdateDataView(ctx context.Context, client *Client, spaceID string, viewID string, req kbapi.UpdateDataViewJSONRequestBody) (*kbapi.DataViewsDataViewResponseObject, diag.Diagnostics) { + resp, err := client.API.UpdateDataViewWithResponse(ctx, spaceID, viewID, req) + if err != nil { + return nil, utils.FrameworkDiagFromError(err) + } + + switch resp.StatusCode() { + case http.StatusOK: + return resp.JSON200, nil + default: + return nil, reportUnknownError(resp.StatusCode(), resp.Body) + } +} + +// DeleteDataView deletes an existing data view. +func DeleteDataView(ctx context.Context, client *Client, spaceID string, viewID string) diag.Diagnostics { + resp, err := client.API.DeleteDataViewWithResponse(ctx, spaceID, viewID) + if err != nil { + return utils.FrameworkDiagFromError(err) + } + + switch resp.StatusCode() { + case http.StatusOK: + return nil + case http.StatusNotFound: + return nil + default: + return reportUnknownError(resp.StatusCode(), resp.Body) + } +} diff --git a/internal/clients/kibana2/errors.go b/internal/clients/kibana2/errors.go new file mode 100644 index 000000000..9dcfe607f --- /dev/null +++ b/internal/clients/kibana2/errors.go @@ -0,0 +1,16 @@ +package kibana2 + +import ( + "fmt" + + "github.com/hashicorp/terraform-plugin-framework/diag" +) + +func reportUnknownError(statusCode int, body []byte) diag.Diagnostics { + return diag.Diagnostics{ + diag.NewErrorDiagnostic( + fmt.Sprintf("Unexpected status code from server: got HTTP %d", statusCode), + string(body), + ), + } +} diff --git a/internal/fleet/integration_policy/models.go b/internal/fleet/integration_policy/models.go index 082c329e7..8f15bb160 100644 --- a/internal/fleet/integration_policy/models.go +++ b/internal/fleet/integration_policy/models.go @@ -58,7 +58,7 @@ func (model *integrationPolicyModel) populateFromAPI(ctx context.Context, data * } func (model *integrationPolicyModel) populateInputFromAPI(ctx context.Context, inputs map[string]fleetapi.PackagePolicyInput, diags *diag.Diagnostics) { - newInputs := utils.TransformMapToSlice(inputs, path.Root("input"), diags, + newInputs := utils.TransformMapToSlice(ctx, inputs, path.Root("input"), diags, func(inputData fleetapi.PackagePolicyInput, meta utils.MapMeta) integrationPolicyInputModel { return integrationPolicyInputModel{ InputID: types.StringValue(meta.Key), diff --git a/internal/kibana/data_view/create.go b/internal/kibana/data_view/create.go index 27e715797..c90200069 100644 --- a/internal/kibana/data_view/create.go +++ b/internal/kibana/data_view/create.go @@ -3,51 +3,44 @@ package data_view import ( "context" - "github.com/elastic/terraform-provider-elasticstack/internal/clients" - "github.com/elastic/terraform-provider-elasticstack/internal/utils" + "github.com/elastic/terraform-provider-elasticstack/internal/clients/kibana2" "github.com/hashicorp/terraform-plugin-framework/resource" - "github.com/hashicorp/terraform-plugin-framework/types" ) -func (r *Resource) Create(ctx context.Context, request resource.CreateRequest, response *resource.CreateResponse) { - dataviewClient, err := r.client.GetDataViewsClient() - if err != nil { - response.Diagnostics.AddError("unable to get data view client", err.Error()) - return - } +func (r *DataViewResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { + var planModel dataViewModel - var model tfModelV0 - response.Diagnostics.Append(request.Plan.Get(ctx, &model)...) - if response.Diagnostics.HasError() { + diags := req.Plan.Get(ctx, &planModel) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { return } - apiModel, diags := model.ToCreateRequest(ctx) - response.Diagnostics.Append(diags...) - authCtx := r.client.SetDataviewAuthContext(ctx) - respModel, res, err := dataviewClient.CreateDataView(authCtx, model.SpaceID.ValueString()).CreateDataViewRequestObject(apiModel).KbnXsrf("true").Execute() - if err != nil && res == nil { - response.Diagnostics.AddError("Failed to create data view", err.Error()) + body, diags := planModel.toAPICreateModel(ctx) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { return } - defer res.Body.Close() - response.Diagnostics.Append(utils.CheckHttpErrorFromFW(res, "Unable to create data view")...) - if response.Diagnostics.HasError() { + client, err := r.client.GetKibana2Client() + if err != nil { + resp.Diagnostics.AddError(err.Error(), "") return } - resourceID := clients.CompositeId{ - ClusterId: model.SpaceID.ValueString(), - ResourceId: *respModel.DataView.Id, + spaceID := planModel.SpaceID.ValueString() + dataView, diags := kibana2.CreateDataView(ctx, client, spaceID, body) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return } - model.ID = types.StringValue(resourceID.String()) - readModel, diags := r.read(ctx, model) - response.Diagnostics = append(response.Diagnostics, diags...) - if response.Diagnostics.HasError() { + diags = planModel.populateFromAPI(ctx, dataView) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { return } - response.Diagnostics.Append(response.State.Set(ctx, readModel)...) + diags = resp.State.Set(ctx, planModel) + resp.Diagnostics.Append(diags...) } diff --git a/internal/kibana/data_view/delete.go b/internal/kibana/data_view/delete.go index 445bb917e..e6ec07d4b 100644 --- a/internal/kibana/data_view/delete.go +++ b/internal/kibana/data_view/delete.go @@ -3,30 +3,26 @@ package data_view import ( "context" - "github.com/elastic/terraform-provider-elasticstack/internal/utils" + "github.com/elastic/terraform-provider-elasticstack/internal/clients/kibana2" "github.com/hashicorp/terraform-plugin-framework/resource" ) -func (r *Resource) Delete(ctx context.Context, request resource.DeleteRequest, response *resource.DeleteResponse) { - dataviewClient, err := r.client.GetDataViewsClient() - if err != nil { - response.Diagnostics.AddError("unable to get data view client", err.Error()) - return - } +func (r *DataViewResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { + var stateModel dataViewModel - var model tfModelV0 - response.Diagnostics.Append(request.State.Get(ctx, &model)...) - if response.Diagnostics.HasError() { + diags := req.State.Get(ctx, &stateModel) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { return } - id, spaceID := model.getIDAndSpaceID() - authCtx := r.client.SetDataviewAuthContext(ctx) - res, err := dataviewClient.DeleteDataView(authCtx, id, spaceID).KbnXsrf("true").Execute() - if err != nil && res == nil { - response.Diagnostics.AddError("Failed to delete data view", err.Error()) + client, err := r.client.GetKibana2Client() + if err != nil { + resp.Diagnostics.AddError(err.Error(), "") + return } - defer res.Body.Close() - response.Diagnostics.Append(utils.CheckHttpErrorFromFW(res, "Unable to delete data view")...) + viewID, spaceID := stateModel.getViewIDAndSpaceID() + diags = kibana2.DeleteDataView(ctx, client, spaceID, viewID) + resp.Diagnostics.Append(diags...) } diff --git a/internal/kibana/data_view/import.go b/internal/kibana/data_view/import.go deleted file mode 100644 index 38f9e5727..000000000 --- a/internal/kibana/data_view/import.go +++ /dev/null @@ -1,13 +0,0 @@ -package data_view - -import ( - "context" - - "github.com/hashicorp/terraform-plugin-framework/path" - "github.com/hashicorp/terraform-plugin-framework/resource" -) - -func (r *Resource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { - // Retrieve import ID and save to id attribute - resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) -} diff --git a/internal/kibana/data_view/models.go b/internal/kibana/data_view/models.go new file mode 100644 index 000000000..8e3fcffd3 --- /dev/null +++ b/internal/kibana/data_view/models.go @@ -0,0 +1,281 @@ +package data_view + +import ( + "context" + "slices" + + kbapi "github.com/elastic/terraform-provider-elasticstack/generated/kibana" + "github.com/elastic/terraform-provider-elasticstack/internal/clients" + "github.com/elastic/terraform-provider-elasticstack/internal/utils" + "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/path" + "github.com/hashicorp/terraform-plugin-framework/types" +) + +func (model *dataViewModel) populateFromAPI(ctx context.Context, data *kbapi.DataViewsDataViewResponseObject) diag.Diagnostics { + if data == nil { + return nil + } + + var diags diag.Diagnostics + + resourceID := clients.CompositeId{ + ClusterId: model.SpaceID.ValueString(), + ResourceId: *data.DataView.Id, + } + + // An existing null map should should be semantically equal to an empty map. + semanticEqualEmptyMap := func(existing types.Map, incoming types.Map) types.Map { + if !utils.IsKnown(existing) && len(incoming.Elements()) == 0 { + return types.MapNull(incoming.ElementType(ctx)) + } + return incoming + } + + // An existing null slice should be semantically equal to an empty slice. + semanticEqualEmptySlice := func(existing types.List, incoming types.List) types.List { + if !utils.IsKnown(existing) && len(incoming.Elements()) == 0 { + return types.ListNull(incoming.ElementType(ctx)) + } + return incoming + } + + handleNamespaces := func(existingList types.List, incoming []string) types.List { + p := path.Root("data_view").AtName("namespaces") + existing := utils.ListTypeToSlice_String(ctx, existingList, p, &diags) + + // incoming is typically [] except in <= v8.8.2 where it is omitted + if incoming == nil { + if existing == nil { + return types.ListNull(types.StringType) + } else { + return existingList + } + } + + // An existing null slice should be semantically equal to a slice only containing the current space ID. + if existing == nil && len(incoming) == 1 && incoming[0] == model.SpaceID.ValueString() { + return types.ListNull(types.StringType) + } + + // Keep the original ordering if equal but unordered + // The API response is ordered by name. + if len(existing) == len(incoming) { + useExisting := true + for _, ns := range existing { + if !slices.Contains(incoming, ns) { + useExisting = false + break + } + } + if useExisting { + return existingList + } + } + + return utils.SliceToListType_String(ctx, incoming, p, &diags) + } + + model.ID = types.StringValue(resourceID.String()) + model.DataView = utils.StructToObjectType(ctx, data.DataView, getDataViewAttrTypes(), path.Root("data_view"), &diags, + func(item kbapi.DataViewsDataViewResponseObjectInner, meta utils.ObjectMeta) innerModel { + dvInner := utils.ObjectTypeAs[innerModel](ctx, model.DataView, meta.Path, &diags) + if dvInner == nil { + dvInner = &innerModel{} + } + + return innerModel{ + Title: types.StringPointerValue(item.Title), + Name: types.StringPointerValue(item.Name), + ID: types.StringPointerValue(item.Id), + TimeFieldName: types.StringPointerValue(item.TimeFieldName), + SourceFilters: semanticEqualEmptySlice(dvInner.SourceFilters, + utils.SliceToListType(ctx, utils.Deref(item.SourceFilters), types.StringType, meta.Path.AtName("source_filters"), &diags, + func(item kbapi.DataViewsSourcefilterItem, meta utils.ListMeta) string { + return item.Value + })), + FieldAttributes: semanticEqualEmptyMap(dvInner.FieldAttributes, + utils.MapToMapType(ctx, utils.Deref(item.FieldAttrs), getFieldAttrElemType(), meta.Path.AtName("field_attrs"), &diags, + func(item kbapi.DataViewsFieldattrs, meta utils.MapMeta) fieldAttrModel { + return fieldAttrModel{ + CustomLabel: types.StringPointerValue(item.CustomLabel), + Count: types.Int64PointerValue(utils.Itol(item.Count)), + } + })), + RuntimeFieldMap: semanticEqualEmptyMap(dvInner.RuntimeFieldMap, + utils.MapToMapType(ctx, utils.Deref(item.RuntimeFieldMap), getRuntimeFieldMapElemType(), meta.Path.AtName("runtime_field_map"), &diags, + func(item kbapi.DataViewsRuntimefieldmap, meta utils.MapMeta) runtimeFieldModel { + return runtimeFieldModel{ + Type: types.StringValue(item.Type), + ScriptSource: types.StringPointerValue(item.Script.Source), + } + })), + FieldFormats: semanticEqualEmptyMap(dvInner.FieldFormats, + utils.MapToMapType(ctx, utils.Deref(item.FieldFormats), getFieldFormatElemType(), meta.Path.AtName("field_formats"), &diags, + func(item kbapi.DataViewsFieldformat, meta utils.MapMeta) fieldFormatModel { + return fieldFormatModel{ + ID: types.StringPointerValue(item.Id), + Params: utils.StructToObjectType(ctx, item.Params, getFieldFormatParamsAttrTypes(), meta.Path.AtName("params"), &diags, + func(item kbapi.DataViewsFieldformatParams, meta utils.ObjectMeta) fieldFormatParamsModel { + return fieldFormatParamsModel{ + Pattern: types.StringPointerValue(item.Pattern), + UrlTemplate: types.StringPointerValue(item.UrlTemplate), + LabelTemplate: types.StringPointerValue(item.LabelTemplate), + } + }), + } + })), + AllowNoIndex: types.BoolPointerValue(item.AllowNoIndex), + Namespaces: handleNamespaces(dvInner.Namespaces, utils.Deref(item.Namespaces)), + } + }) + + return diags +} + +func (model dataViewModel) toAPICreateModel(ctx context.Context) (kbapi.DataViewsCreateDataViewRequestObject, diag.Diagnostics) { + var diags diag.Diagnostics + + body := kbapi.DataViewsCreateDataViewRequestObject{ + DataView: *utils.ObjectTypeToStruct(ctx, model.DataView, path.Root("data_view"), &diags, + func(item innerModel, meta utils.ObjectMeta) kbapi.DataViewsCreateDataViewRequestObjectInner { + // Add spaceID to namespaces if missing + spaceID := model.SpaceID.ValueString() + namespaces := utils.ListTypeToSlice_String(ctx, item.Namespaces, meta.Path.AtName("namespaces"), &diags) + if namespaces != nil && !slices.Contains(namespaces, spaceID) { + namespaces = append(namespaces, spaceID) + } + + return kbapi.DataViewsCreateDataViewRequestObjectInner{ + AllowNoIndex: item.AllowNoIndex.ValueBoolPointer(), + FieldAttrs: utils.MapRef(utils.MapTypeToMap(ctx, item.FieldAttributes, meta.Path.AtName("field_attrs"), &diags, + func(item fieldAttrModel, meta utils.MapMeta) kbapi.DataViewsFieldattrs { + return kbapi.DataViewsFieldattrs{ + Count: utils.Ltoi(item.Count.ValueInt64Pointer()), + CustomLabel: item.CustomLabel.ValueStringPointer(), + } + })), + FieldFormats: utils.MapRef(convertFieldFormats(utils.MapTypeToMap(ctx, item.FieldFormats, meta.Path.AtName("field_formats"), &diags, convertFieldFormat))), + Id: utils.ValueStringPointer(item.ID), + Name: utils.ValueStringPointer(item.Name), + Namespaces: utils.SliceRef(namespaces), + RuntimeFieldMap: utils.MapRef(utils.MapTypeToMap(ctx, item.RuntimeFieldMap, meta.Path.AtName("runtime_field_map"), &diags, convertRuntimeFieldMap)), + SourceFilters: utils.SliceRef(utils.ListTypeToSlice(ctx, item.SourceFilters, meta.Path.AtName("source_filters"), &diags, convertSourceFilter)), + TimeFieldName: utils.ValueStringPointer(item.TimeFieldName), + Title: item.Title.ValueString(), + } + }), + Override: model.Override.ValueBoolPointer(), + } + + return body, diags +} + +func (model dataViewModel) toAPIUpdateModel(ctx context.Context) (kbapi.DataViewsUpdateDataViewRequestObject, diag.Diagnostics) { + var diags diag.Diagnostics + + body := kbapi.DataViewsUpdateDataViewRequestObject{ + DataView: utils.Deref(utils.ObjectTypeToStruct(ctx, model.DataView, path.Root("data_view"), &diags, + func(item innerModel, meta utils.ObjectMeta) kbapi.DataViewsUpdateDataViewRequestObjectInner { + return kbapi.DataViewsUpdateDataViewRequestObjectInner{ + AllowNoIndex: item.AllowNoIndex.ValueBoolPointer(), + FieldFormats: utils.MapRef(convertFieldFormats(utils.MapTypeToMap(ctx, item.FieldFormats, meta.Path.AtName("field_formats"), &diags, convertFieldFormat))), + Name: utils.ValueStringPointer(item.Name), + RuntimeFieldMap: utils.MapRef(utils.MapTypeToMap(ctx, item.RuntimeFieldMap, meta.Path.AtName("runtime_field_map"), &diags, convertRuntimeFieldMap)), + SourceFilters: utils.SliceRef(utils.ListTypeToSlice(ctx, item.SourceFilters, meta.Path.AtName("source_filters"), &diags, convertSourceFilter)), + TimeFieldName: utils.ValueStringPointer(item.TimeFieldName), + Title: item.Title.ValueStringPointer(), + } + })), + } + + return body, diags +} + +func convertFieldFormats(src map[string]kbapi.DataViewsFieldformat) kbapi.DataViewsFieldformats { + if src == nil { + return nil + } + + dst := make(kbapi.DataViewsFieldformats, len(src)) + for k, v := range src { + dst[k] = v + } + return dst +} + +func convertFieldFormat(item fieldFormatModel, meta utils.MapMeta) kbapi.DataViewsFieldformat { + return kbapi.DataViewsFieldformat{ + Id: item.ID.ValueStringPointer(), + Params: utils.ObjectTypeToStruct(meta.Context, item.Params, meta.Path.AtName("params"), meta.Diags, + func(item fieldFormatParamsModel, meta utils.ObjectMeta) kbapi.DataViewsFieldformatParams { + return kbapi.DataViewsFieldformatParams{ + LabelTemplate: item.LabelTemplate.ValueStringPointer(), + Pattern: item.Pattern.ValueStringPointer(), + UrlTemplate: item.UrlTemplate.ValueStringPointer(), + } + }), + } +} + +func convertRuntimeFieldMap(item runtimeFieldModel, meta utils.MapMeta) kbapi.DataViewsRuntimefieldmap { + return kbapi.DataViewsRuntimefieldmap{ + Type: item.Type.ValueString(), + Script: kbapi.DataViewsRuntimefieldmapScript{ + Source: item.ScriptSource.ValueStringPointer(), + }, + } +} + +func convertSourceFilter(item string, meta utils.ListMeta) kbapi.DataViewsSourcefilterItem { + return kbapi.DataViewsSourcefilterItem{Value: item} +} + +func (model dataViewModel) getViewIDAndSpaceID() (viewID string, spaceID string) { + resourceID := model.ID.ValueString() + composite, _ := clients.CompositeIdFromStr(resourceID) + viewID = composite.ResourceId + spaceID = composite.ClusterId + return +} + +type dataViewModel struct { + ID types.String `tfsdk:"id"` + SpaceID types.String `tfsdk:"space_id"` + Override types.Bool `tfsdk:"override"` + DataView types.Object `tfsdk:"data_view"` //> innerModel +} + +type innerModel struct { + Title types.String `tfsdk:"title"` + Name types.String `tfsdk:"name"` + ID types.String `tfsdk:"id"` + TimeFieldName types.String `tfsdk:"time_field_name"` + SourceFilters types.List `tfsdk:"source_filters"` //> string + FieldAttributes types.Map `tfsdk:"field_attrs"` //> fieldAttrModel + RuntimeFieldMap types.Map `tfsdk:"runtime_field_map"` //> runtimeFieldModel + FieldFormats types.Map `tfsdk:"field_formats"` //> fieldFormatModel + AllowNoIndex types.Bool `tfsdk:"allow_no_index"` + Namespaces types.List `tfsdk:"namespaces"` //> string +} + +type fieldAttrModel struct { + CustomLabel types.String `tfsdk:"custom_label"` + Count types.Int64 `tfsdk:"count"` +} + +type runtimeFieldModel struct { + Type types.String `tfsdk:"type"` + ScriptSource types.String `tfsdk:"script_source"` +} + +type fieldFormatModel struct { + ID types.String `tfsdk:"id"` + Params types.Object `tfsdk:"params"` //> fieldFormatParamsModel +} + +type fieldFormatParamsModel struct { + Pattern types.String `tfsdk:"pattern"` + UrlTemplate types.String `tfsdk:"urltemplate"` + LabelTemplate types.String `tfsdk:"labeltemplate"` +} diff --git a/internal/kibana/data_view/models_test.go b/internal/kibana/data_view/models_test.go new file mode 100644 index 000000000..35a37419e --- /dev/null +++ b/internal/kibana/data_view/models_test.go @@ -0,0 +1,354 @@ +package data_view + +import ( + "context" + "testing" + + kbapi "github.com/elastic/terraform-provider-elasticstack/generated/kibana" + "github.com/elastic/terraform-provider-elasticstack/internal/utils" + "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/path" + "github.com/hashicorp/terraform-plugin-framework/types" + "github.com/stretchr/testify/require" +) + +func TestPopulateFromAPI(t *testing.T) { + ctx := context.Background() + var diags diag.Diagnostics + + tests := []struct { + name string + response kbapi.DataViewsDataViewResponseObject + existingModel dataViewModel + expectedModel dataViewModel + }{ + { + name: "all fields", + existingModel: dataViewModel{ + ID: types.StringValue("existing-space-id/existing-id"), + SpaceID: types.StringValue("existing-space-id"), + DataView: utils.ObjectValueFrom(ctx, &innerModel{ + SourceFilters: types.ListNull(types.StringType), + FieldAttributes: types.MapNull(getFieldAttrElemType()), + RuntimeFieldMap: types.MapNull(getRuntimeFieldMapElemType()), + FieldFormats: types.MapNull(getFieldFormatElemType()), + Namespaces: utils.ListValueFrom(ctx, []string{"existing-namespace"}, types.StringType, path.Root("data_view").AtName("namespaces"), &diags), + }, getDataViewAttrTypes(), path.Root("data_view"), &diags), + }, + response: kbapi.DataViewsDataViewResponseObject{ + DataView: &kbapi.DataViewsDataViewResponseObjectInner{ + Title: utils.Pointer("title"), + Name: utils.Pointer("name"), + Id: utils.Pointer("id"), + TimeFieldName: utils.Pointer("time_field_name"), + AllowNoIndex: utils.Pointer(true), + SourceFilters: &kbapi.DataViewsSourcefilters{ + {Value: "field1"}, + {Value: "field2"}, + }, + FieldAttrs: &map[string]kbapi.DataViewsFieldattrs{ + "field1": { + CustomLabel: utils.Pointer("custom_label"), + Count: utils.Pointer(10), + }, + }, + FieldFormats: &kbapi.DataViewsFieldformats{ + "field1": kbapi.DataViewsFieldformat{ + Id: utils.Pointer("field1"), + }, + }, + RuntimeFieldMap: &map[string]kbapi.DataViewsRuntimefieldmap{ + "runtime_field": { + Type: "keyword", + Script: kbapi.DataViewsRuntimefieldmapScript{ + Source: utils.Pointer("emit('hello')"), + }, + }, + }, + }, + }, + expectedModel: dataViewModel{ + ID: types.StringValue("existing-space-id/id"), + SpaceID: types.StringValue("existing-space-id"), + DataView: utils.ObjectValueFrom(ctx, &innerModel{ + Title: types.StringValue("title"), + Name: types.StringValue("name"), + ID: types.StringValue("id"), + TimeFieldName: types.StringValue("time_field_name"), + SourceFilters: utils.ListValueFrom(ctx, []string{"field1", "field2"}, types.StringType, path.Root("data_view").AtName("source_filters"), &diags), + FieldAttributes: utils.MapValueFrom(ctx, map[string]fieldAttrModel{ + "field1": { + CustomLabel: types.StringValue("custom_label"), + Count: types.Int64Value(10), + }, + }, getFieldAttrElemType(), path.Root("data_view").AtName("field_attrs"), &diags), + RuntimeFieldMap: utils.MapValueFrom(ctx, map[string]runtimeFieldModel{ + "runtime_field": { + Type: types.StringValue("keyword"), + ScriptSource: types.StringValue("emit('hello')"), + }, + }, getRuntimeFieldMapElemType(), path.Root("data_view").AtName("runtime_field_map"), &diags), + FieldFormats: utils.MapValueFrom(ctx, map[string]fieldFormatModel{ + "field1": { + ID: types.StringValue("field1"), + Params: types.ObjectNull(getFieldFormatParamsAttrTypes()), + }, + }, getFieldFormatElemType(), path.Root("data_view").AtName("field_formats"), &diags), + AllowNoIndex: types.BoolValue(true), + Namespaces: utils.ListValueFrom(ctx, []string{"existing-namespace"}, types.StringType, path.Root("data_view").AtName("namespaces"), &diags), + }, getDataViewAttrTypes(), path.Root("data_view"), &diags), + }, + }, + } + + require.Empty(t, diags) + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + diags := tt.existingModel.populateFromAPI(ctx, &tt.response) + + require.Equal(t, tt.expectedModel, tt.existingModel) + require.Empty(t, diags) + }) + } +} + +func TestToAPICreateModel(t *testing.T) { + ctx := context.Background() + var diags diag.Diagnostics + + tests := []struct { + name string + model dataViewModel + expectedRequest kbapi.DataViewsCreateDataViewRequestObject + }{ + { + name: "all fields", + model: dataViewModel{ + SpaceID: types.StringValue("default"), + DataView: utils.ObjectValueFrom(ctx, &innerModel{ + Title: types.StringValue("title"), + Name: types.StringValue("name"), + ID: types.StringValue("id"), + TimeFieldName: types.StringValue("time_field_name"), + SourceFilters: utils.ListValueFrom(ctx, []string{"field1", "field2"}, types.StringType, path.Root("data_view").AtName("source_filters"), &diags), + FieldAttributes: utils.MapValueFrom(ctx, map[string]fieldAttrModel{ + "field1": { + CustomLabel: types.StringValue("custom_label"), + Count: types.Int64Value(10), + }, + }, getFieldAttrElemType(), path.Root("data_view").AtName("field_attrs"), &diags), + RuntimeFieldMap: utils.MapValueFrom(ctx, map[string]runtimeFieldModel{ + "runtime_field": { + Type: types.StringValue("keyword"), + ScriptSource: types.StringValue("emit(\"hello\")"), + }, + }, getRuntimeFieldMapElemType(), path.Root("data_view").AtName("runtime_field_map"), &diags), + FieldFormats: utils.MapValueFrom(ctx, map[string]fieldFormatModel{ + "field1": { + ID: types.StringValue("field1"), + Params: utils.ObjectValueFrom(ctx, &fieldFormatParamsModel{ + Pattern: types.StringValue("0.00"), + UrlTemplate: types.StringValue("https://test.com/{{value}}"), + LabelTemplate: types.StringValue("{{value}}"), + }, getFieldFormatParamsAttrTypes(), path.Root("data_view").AtName("field_formats").AtMapKey("field1").AtName("params"), &diags), + }, + }, getFieldFormatElemType(), path.Root("data_view").AtName("field_formats"), &diags), + AllowNoIndex: types.BoolValue(true), + Namespaces: utils.ListValueFrom(ctx, []string{"backend", "o11y"}, types.StringType, path.Root("data_view").AtName("namespaces"), &diags), + }, getDataViewAttrTypes(), path.Root("data_view"), &diags), + Override: types.BoolValue(true), + }, + expectedRequest: kbapi.DataViewsCreateDataViewRequestObject{ + DataView: kbapi.DataViewsCreateDataViewRequestObjectInner{ + AllowNoIndex: utils.Pointer(true), + FieldAttrs: &map[string]kbapi.DataViewsFieldattrs{ + "field1": { + CustomLabel: utils.Pointer("custom_label"), + Count: utils.Pointer(10), + }, + }, + FieldFormats: &kbapi.DataViewsFieldformats{ + "field1": kbapi.DataViewsFieldformat{ + Id: utils.Pointer("field1"), + Params: &kbapi.DataViewsFieldformatParams{ + Pattern: utils.Pointer("0.00"), + UrlTemplate: utils.Pointer("https://test.com/{{value}}"), + LabelTemplate: utils.Pointer("{{value}}"), + }, + }, + }, + Id: utils.Pointer("id"), + Name: utils.Pointer("name"), + Namespaces: &[]string{"backend", "o11y", "default"}, + RuntimeFieldMap: &map[string]kbapi.DataViewsRuntimefieldmap{ + "runtime_field": { + Type: "keyword", + Script: kbapi.DataViewsRuntimefieldmapScript{ + Source: utils.Pointer("emit(\"hello\")"), + }, + }, + }, + SourceFilters: &[]kbapi.DataViewsSourcefilterItem{ + {Value: "field1"}, + {Value: "field2"}, + }, + TimeFieldName: utils.Pointer("time_field_name"), + Title: "title", + }, + Override: utils.Pointer(true), + }, + }, + { + name: "nil collections", + model: dataViewModel{ + SpaceID: types.StringValue("default"), + DataView: utils.ObjectValueFrom(ctx, &innerModel{ + Title: types.StringValue("title"), + Name: types.StringValue("name"), + ID: types.StringValue("id"), + TimeFieldName: types.StringValue("time_field_name"), + SourceFilters: types.ListNull(types.StringType), + FieldAttributes: types.MapNull(getFieldAttrElemType()), + RuntimeFieldMap: types.MapNull(getRuntimeFieldMapElemType()), + FieldFormats: types.MapNull(getFieldFormatElemType()), + AllowNoIndex: types.BoolValue(true), + Namespaces: types.ListNull(types.StringType), + }, getDataViewAttrTypes(), path.Root("data_view"), &diags), + }, + expectedRequest: kbapi.DataViewsCreateDataViewRequestObject{ + Override: nil, + DataView: kbapi.DataViewsCreateDataViewRequestObjectInner{ + AllowNoIndex: utils.Pointer(true), + Id: utils.Pointer("id"), + Name: utils.Pointer("name"), + TimeFieldName: utils.Pointer("time_field_name"), + Title: "title", + }, + }, + }, + } + + require.Empty(t, diags) + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + request, diags := tt.model.toAPICreateModel(ctx) + require.Equal(t, tt.expectedRequest, request) + require.Empty(t, diags) + }) + } +} + +func TestToAPIUpdateModel(t *testing.T) { + ctx := context.Background() + var diags diag.Diagnostics + + tests := []struct { + name string + model dataViewModel + expectedRequest kbapi.DataViewsUpdateDataViewRequestObject + }{ + { + name: "all fields", + model: dataViewModel{ + DataView: utils.ObjectValueFrom(ctx, &innerModel{ + Title: types.StringValue("title"), + Name: types.StringValue("name"), + ID: types.StringValue("id"), + TimeFieldName: types.StringValue("time_field_name"), + SourceFilters: utils.ListValueFrom(ctx, []string{"field1", "field2"}, types.StringType, path.Root("data_view").AtName("source_filters"), &diags), + FieldAttributes: utils.MapValueFrom(ctx, map[string]fieldAttrModel{ + "field1": { + CustomLabel: types.StringValue("custom_label"), + Count: types.Int64Value(10), + }, + }, getFieldAttrElemType(), path.Root("data_view").AtName("field_attrs"), &diags), + RuntimeFieldMap: utils.MapValueFrom(ctx, map[string]runtimeFieldModel{ + "runtime_field": { + Type: types.StringValue("keyword"), + ScriptSource: types.StringValue("emit(\"hello\")"), + }, + }, getRuntimeFieldMapElemType(), path.Root("data_view").AtName("runtime_field_map"), &diags), + FieldFormats: utils.MapValueFrom(ctx, map[string]fieldFormatModel{ + "field1": { + ID: types.StringValue("field1"), + Params: utils.ObjectValueFrom(ctx, &fieldFormatParamsModel{ + Pattern: types.StringValue("0.00"), + UrlTemplate: types.StringValue("https://test.com/{{value}}"), + LabelTemplate: types.StringValue("{{value}}"), + }, getFieldFormatParamsAttrTypes(), path.Root("data_view").AtMapKey("field1").AtName("params"), &diags), + }, + }, getFieldFormatElemType(), path.Root("data_view").AtName("field_formats"), &diags), + AllowNoIndex: types.BoolValue(true), + Namespaces: utils.ListValueFrom(ctx, []string{"default", "o11y"}, types.StringType, path.Root("data_view").AtName("namespaces"), &diags), + }, getDataViewAttrTypes(), path.Root("data_view"), &diags), + }, + expectedRequest: kbapi.DataViewsUpdateDataViewRequestObject{ + DataView: kbapi.DataViewsUpdateDataViewRequestObjectInner{ + AllowNoIndex: utils.Pointer(true), + FieldFormats: &kbapi.DataViewsFieldformats{ + "field1": { + Id: utils.Pointer("field1"), + Params: &kbapi.DataViewsFieldformatParams{ + Pattern: utils.Pointer("0.00"), + UrlTemplate: utils.Pointer("https://test.com/{{value}}"), + LabelTemplate: utils.Pointer("{{value}}"), + }, + }, + }, + Name: utils.Pointer("name"), + RuntimeFieldMap: &map[string]kbapi.DataViewsRuntimefieldmap{ + "runtime_field": { + Type: "keyword", + Script: kbapi.DataViewsRuntimefieldmapScript{ + Source: utils.Pointer("emit(\"hello\")"), + }, + }, + }, + SourceFilters: &[]kbapi.DataViewsSourcefilterItem{ + {Value: "field1"}, + {Value: "field2"}, + }, + TimeFieldName: utils.Pointer("time_field_name"), + Title: utils.Pointer("title"), + }, + }, + }, + { + name: "nil collections", + model: dataViewModel{ + DataView: utils.ObjectValueFrom(ctx, &innerModel{ + Title: types.StringValue("title"), + Name: types.StringValue("name"), + ID: types.StringValue("id"), + TimeFieldName: types.StringValue("time_field_name"), + AllowNoIndex: types.BoolValue(true), + SourceFilters: types.ListNull(types.StringType), + FieldAttributes: types.MapNull(getFieldAttrElemType()), + RuntimeFieldMap: types.MapNull(getRuntimeFieldMapElemType()), + FieldFormats: types.MapNull(getFieldFormatElemType()), + Namespaces: types.ListNull(types.StringType), + }, getDataViewAttrTypes(), path.Root("data_view"), &diags), + }, + expectedRequest: kbapi.DataViewsUpdateDataViewRequestObject{ + DataView: kbapi.DataViewsUpdateDataViewRequestObjectInner{ + AllowNoIndex: utils.Pointer(true), + Name: utils.Pointer("name"), + TimeFieldName: utils.Pointer("time_field_name"), + Title: utils.Pointer("title"), + }, + }, + }, + } + + require.Empty(t, diags) + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + request, diags := tt.model.toAPIUpdateModel(ctx) + require.Equal(t, tt.expectedRequest, request) + require.Empty(t, diags) + }) + } +} diff --git a/internal/kibana/data_view/read.go b/internal/kibana/data_view/read.go index d94d5ad3c..7f91a3f61 100644 --- a/internal/kibana/data_view/read.go +++ b/internal/kibana/data_view/read.go @@ -3,61 +3,43 @@ package data_view import ( "context" - "github.com/elastic/terraform-provider-elasticstack/internal/utils" - "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/elastic/terraform-provider-elasticstack/internal/clients/kibana2" "github.com/hashicorp/terraform-plugin-framework/resource" ) -func (r *Resource) Read(ctx context.Context, request resource.ReadRequest, response *resource.ReadResponse) { - var model tfModelV0 - response.Diagnostics.Append(request.State.Get(ctx, &model)...) - if response.Diagnostics.HasError() { - return - } - - apiModel, diags := r.read(ctx, model) - response.Diagnostics = append(response.Diagnostics, diags...) - if response.Diagnostics.HasError() { - return - } +func (r *DataViewResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { + var stateModel dataViewModel - if apiModel == nil { - response.State.RemoveResource(ctx) + diags := req.State.Get(ctx, &stateModel) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { return } - response.Diagnostics.Append(response.State.Set(ctx, apiModel)...) -} - -func (r *Resource) read(ctx context.Context, model tfModelV0) (*apiModelV0, diag.Diagnostics) { - dataviewClient, err := r.client.GetDataViewsClient() + client, err := r.client.GetKibana2Client() if err != nil { - return nil, diag.Diagnostics{ - diag.NewErrorDiagnostic("unable to get data view client", err.Error()), - } - } - id, spaceID := model.getIDAndSpaceID() - authCtx := r.client.SetDataviewAuthContext(ctx) - respModel, res, err := dataviewClient.GetDataView(authCtx, id, spaceID).Execute() - if err != nil && res == nil { - return nil, diag.Diagnostics{ - diag.NewErrorDiagnostic("failed to read data view", err.Error()), - } + resp.Diagnostics.AddError(err.Error(), "") + return } - defer res.Body.Close() - if res.StatusCode == 404 { - return nil, nil + viewID, spaceID := stateModel.getViewIDAndSpaceID() + dataView, diags := kibana2.GetDataView(ctx, client, spaceID, viewID) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return } - if diags := utils.CheckHttpErrorFromFW(res, "Unable to read data view"); diags.HasError() { - return nil, diags + if dataView == nil { + resp.State.RemoveResource(ctx) + return } - apiModel, diags := model.FromResponse(ctx, respModel) - if diags.HasError() { - return nil, diags + diags = stateModel.populateFromAPI(ctx, dataView) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return } - return &apiModel, nil + diags = resp.State.Set(ctx, stateModel) + resp.Diagnostics.Append(diags...) } diff --git a/internal/kibana/data_view/resource.go b/internal/kibana/data_view/resource.go new file mode 100644 index 000000000..cd8d1f8df --- /dev/null +++ b/internal/kibana/data_view/resource.go @@ -0,0 +1,52 @@ +package data_view + +import ( + "context" + "fmt" + + "github.com/elastic/terraform-provider-elasticstack/internal/clients" + "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-framework/types" +) + +var ( + _ resource.Resource = &DataViewResource{} + _ resource.ResourceWithConfigure = &DataViewResource{} + _ resource.ResourceWithImportState = &DataViewResource{} +) + +// NewResource is a helper function to simplify the provider implementation. +func NewResource() resource.Resource { + return &DataViewResource{} +} + +type DataViewResource struct { + client *clients.ApiClient +} + +func (r *DataViewResource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse) { + client, diags := clients.ConvertProviderData(req.ProviderData) + resp.Diagnostics.Append(diags...) + r.client = client +} + +func (r *DataViewResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { + resp.TypeName = fmt.Sprintf("%s_%s", req.ProviderTypeName, "kibana_data_view") +} + +func (r *DataViewResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { + composite, diags := clients.CompositeIdFromStrFw(req.ID) + resp.Diagnostics.Append(diags...) + if diags.HasError() { + return + } + + stateModel := dataViewModel{ + ID: types.StringValue(req.ID), + SpaceID: types.StringValue(composite.ClusterId), + Override: types.BoolValue(false), + DataView: types.ObjectUnknown(getDataViewAttrTypes()), + } + + resp.State.Set(ctx, stateModel) +} diff --git a/internal/kibana/data_view/schema.go b/internal/kibana/data_view/schema.go index 20199b3d3..6f13b985e 100644 --- a/internal/kibana/data_view/schema.go +++ b/internal/kibana/data_view/schema.go @@ -3,11 +3,8 @@ package data_view import ( "context" - "github.com/elastic/terraform-provider-elasticstack/generated/data_views" - "github.com/elastic/terraform-provider-elasticstack/internal/clients" - "github.com/elastic/terraform-provider-elasticstack/internal/utils" "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" - "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/attr" "github.com/hashicorp/terraform-plugin-framework/resource" "github.com/hashicorp/terraform-plugin-framework/resource/schema" "github.com/hashicorp/terraform-plugin-framework/resource/schema/booldefault" @@ -18,17 +15,10 @@ import ( "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringdefault" "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" "github.com/hashicorp/terraform-plugin-framework/schema/validator" - "github.com/hashicorp/terraform-plugin-framework/tfsdk" "github.com/hashicorp/terraform-plugin-framework/types" - "github.com/hashicorp/terraform-plugin-framework/types/basetypes" ) -// Ensure provider defined types fully satisfy framework interfaces -var _ resource.Resource = &Resource{} -var _ resource.ResourceWithConfigure = &Resource{} -var _ resource.ResourceWithImportState = &Resource{} - -func (r *Resource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) { +func (r *DataViewResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) { resp.Schema = getSchema() } @@ -181,505 +171,26 @@ func getSchema() schema.Schema { } } -type Resource struct { - client *clients.ApiClient -} - -func (r *Resource) Configure(ctx context.Context, request resource.ConfigureRequest, response *resource.ConfigureResponse) { - client, diags := clients.ConvertProviderData(request.ProviderData) - response.Diagnostics.Append(diags...) - r.client = client -} - -func (r *Resource) Metadata(ctx context.Context, request resource.MetadataRequest, response *resource.MetadataResponse) { - response.TypeName = request.ProviderTypeName + "_kibana_data_view" -} - -type tfModelV0 struct { - ID types.String `tfsdk:"id"` - SpaceID types.String `tfsdk:"space_id"` - Override types.Bool `tfsdk:"override"` - DataView types.Object `tfsdk:"data_view"` //> dataViewV0 -} - -type apiModelV0 struct { - ID string `tfsdk:"id"` - SpaceID string `tfsdk:"space_id"` - Override bool `tfsdk:"override"` - DataView apiDataViewV0 `tfsdk:"data_view"` -} - -func (m tfModelV0) ToCreateRequest(ctx context.Context) (data_views.CreateDataViewRequestObject, diag.Diagnostics) { - apiModel := data_views.CreateDataViewRequestObject{ - Override: m.Override.ValueBoolPointer(), - } - - var dataView tfDataViewV0 - if diags := m.DataView.As(ctx, &dataView, basetypes.ObjectAsOptions{}); diags.HasError() { - return data_views.CreateDataViewRequestObject{}, diags - } - - dv, diags := dataView.ToCreateRequest(ctx, m.SpaceID.ValueString()) - if diags.HasError() { - return data_views.CreateDataViewRequestObject{}, diags - } - - apiModel.DataView = dv - return apiModel, nil -} - -func (m tfModelV0) ToUpdateRequest(ctx context.Context) (data_views.UpdateDataViewRequestObject, diag.Diagnostics) { - apiModel := data_views.UpdateDataViewRequestObject{} - - var dataView tfDataViewV0 - if diags := m.DataView.As(ctx, &dataView, basetypes.ObjectAsOptions{}); diags.HasError() { - return data_views.UpdateDataViewRequestObject{}, diags - } - - dv, diags := dataView.ToUpdateRequest(ctx) - if diags.HasError() { - return data_views.UpdateDataViewRequestObject{}, diags - } - - apiModel.DataView = dv - return apiModel, nil -} - -func (m tfModelV0) FromResponse(ctx context.Context, resp *data_views.DataViewResponseObject) (apiModelV0, diag.Diagnostics) { - dv := apiDataViewV0{} - if resp.HasDataView() { - dv = dataViewFromResponse(resp.GetDataView()) - } - - var dataView tfDataViewV0 - if !m.DataView.IsNull() && !m.DataView.IsUnknown() { - if diags := m.DataView.As(ctx, &dataView, basetypes.ObjectAsOptions{}); diags.HasError() { - return apiModelV0{}, diags - } - - namespaces, diags := dataView.getNamespaces(ctx, nil) - if diags.HasError() { - return apiModelV0{}, diags - } - - dv.Namespaces = namespaces - } - - _, spaceID := m.getIDAndSpaceID() - model := apiModelV0{ - ID: m.ID.ValueString(), - SpaceID: spaceID, - DataView: dv, - Override: m.Override.ValueBool(), - } - return model, nil -} - -func (model tfModelV0) getIDAndSpaceID() (string, string) { - id := model.ID.ValueString() - spaceID := model.SpaceID.ValueString() - maybeCompositeID, _ := clients.CompositeIdFromStr(id) - if maybeCompositeID != nil { - id = maybeCompositeID.ResourceId - spaceID = maybeCompositeID.ClusterId - } - - return id, spaceID -} - -type tfDataViewV0 struct { - Title types.String `tfsdk:"title"` - Name types.String `tfsdk:"name"` - ID types.String `tfsdk:"id"` - TimeFieldName types.String `tfsdk:"time_field_name"` - SourceFilters types.List `tfsdk:"source_filters"` //> string - FieldAttributes types.Map `tfsdk:"field_attrs"` //> fieldAttrsV0 - RuntimeFieldMap types.Map `tfsdk:"runtime_field_map"` //> runtimeFieldV0 - FieldFormats types.Map `tfsdk:"field_formats"` //> fieldFormatV0 - AllowNoIndex types.Bool `tfsdk:"allow_no_index"` - Namespaces types.List `tfsdk:"namespaces"` -} - -type apiDataViewV0 struct { - Title *string `tfsdk:"title"` - Name *string `tfsdk:"name"` - ID string `tfsdk:"id"` - TimeFieldName *string `tfsdk:"time_field_name"` - SourceFilters []string `tfsdk:"source_filters"` - FieldAttributes map[string]apiFieldAttrsV0 `tfsdk:"field_attrs"` - RuntimeFieldMap map[string]apiRuntimeFieldV0 `tfsdk:"runtime_field_map"` - FieldFormats map[string]apiFieldFormat `tfsdk:"field_formats"` - AllowNoIndex bool `tfsdk:"allow_no_index"` - Namespaces []string `tfsdk:"namespaces"` -} - -func dataViewFromResponse(resp data_views.DataViewResponseObjectDataView) apiDataViewV0 { - dv := apiDataViewV0{ - Title: resp.Title, - Name: resp.Name, - ID: resp.GetId(), - TimeFieldName: resp.TimeFieldName, - AllowNoIndex: resp.GetAllowNoIndex(), - } - - if sourceFilters := resp.GetSourceFilters(); len(sourceFilters) > 0 { - tfFilters := []string{} - for _, filter := range sourceFilters { - tfFilters = append(tfFilters, filter.GetValue()) - } - - dv.SourceFilters = tfFilters - } - - fieldFormats := map[string]apiFieldFormat{} - for field, format := range resp.GetFieldFormats() { - formatMap := format.(map[string]interface{}) - apiFormat := apiFieldFormat{ - ID: formatMap["id"].(string), - } - - if params, ok := formatMap["params"]; ok { - if paramsMap, ok := params.(map[string]interface{}); ok { - apiFormat.Params = &apiFieldFormatParams{} - if pattern, ok := paramsMap["pattern"]; ok { - apiFormat.Params.Pattern = utils.Pointer(pattern.(string)) - } - if urltemplate, ok := paramsMap["urlTemplate"]; ok { - apiFormat.Params.UrlTemplate = utils.Pointer(urltemplate.(string)) - } - if labeltemplate, ok := paramsMap["labelTemplate"]; ok { - apiFormat.Params.LabelTemplate = utils.Pointer(labeltemplate.(string)) - } - } - } - - fieldFormats[field] = apiFormat - } - - if len(fieldFormats) > 0 { - dv.FieldFormats = fieldFormats - } - - fieldAttrs := map[string]apiFieldAttrsV0{} - for field, attrs := range resp.GetFieldAttrs() { - attrsMap := attrs.(map[string]interface{}) - apiAttrs := apiFieldAttrsV0{} - if label, ok := attrsMap["customLabel"].(string); ok { - apiAttrs.CustomLabel = &label - } - - if count, ok := attrsMap["count"]; ok { - var count64 int64 - switch c := count.(type) { - case float64: - count64 = int64(c) - case int64: - count64 = c - } - apiAttrs.Count = &count64 - } - - fieldAttrs[field] = apiAttrs - } - - if len(fieldAttrs) > 0 { - dv.FieldAttributes = fieldAttrs - } - - runtimeFields := map[string]apiRuntimeFieldV0{} - for field, runtimeDefn := range resp.GetRuntimeFieldMap() { - runtimeMap := runtimeDefn.(map[string]interface{}) - apiField := apiRuntimeFieldV0{} - if t, ok := runtimeMap["type"].(string); ok { - apiField.Type = t - } - if script, ok := runtimeMap["script"].(map[string]interface{}); ok { - apiField.ScriptSource = script["source"].(string) - } - - runtimeFields[field] = apiField - } - - if len(runtimeFields) > 0 { - dv.RuntimeFieldMap = runtimeFields - } - - return dv -} - -func (m tfDataViewV0) ToCreateRequest(ctx context.Context, spaceID string) (data_views.CreateDataViewRequestObjectDataView, diag.Diagnostics) { - apiModel := data_views.CreateDataViewRequestObjectDataView{ - Title: m.Title.ValueString(), - } - - if utils.IsKnown(m.ID) { - apiModel.Id = m.ID.ValueStringPointer() - } - - if utils.IsKnown(m.Name) { - apiModel.Name = m.Name.ValueStringPointer() - } - - if utils.IsKnown(m.TimeFieldName) { - apiModel.TimeFieldName = m.TimeFieldName.ValueStringPointer() - } - - if utils.IsKnown(m.AllowNoIndex) { - apiModel.AllowNoIndex = m.AllowNoIndex.ValueBoolPointer() - } - - var sourceFilters []string - if diags := m.SourceFilters.ElementsAs(ctx, &sourceFilters, true); diags.HasError() { - return data_views.CreateDataViewRequestObjectDataView{}, diags - } - if sourceFilters != nil { - apiFilters := []data_views.SourcefiltersInner{} - for _, filter := range sourceFilters { - apiFilters = append(apiFilters, data_views.SourcefiltersInner{ - Value: filter, - }) - } - apiModel.SourceFilters = apiFilters - } - - fieldFormats, diags := tfFieldFormatsToAPI(ctx, m.FieldFormats) - if diags.HasError() { - return data_views.CreateDataViewRequestObjectDataView{}, diags - } - - if fieldFormats != nil { - apiModel.FieldFormats = fieldFormats - } - - var tfFieldAttrs map[string]tfFieldAttrsV0 - if diags := m.FieldAttributes.ElementsAs(ctx, &tfFieldAttrs, true); diags.HasError() { - return data_views.CreateDataViewRequestObjectDataView{}, diags - } - - apiFieldAttrs := map[string]interface{}{} - for field, attrs := range tfFieldAttrs { - apiAttrs := fieldAttr{} - if !attrs.CustomLabel.IsUnknown() { - apiAttrs.CustomLabel = attrs.CustomLabel.ValueStringPointer() - } - - if !attrs.Count.IsUnknown() { - apiAttrs.Count = attrs.Count.ValueInt64Pointer() - } - - apiFieldAttrs[field] = apiAttrs - } - - if len(apiFieldAttrs) > 0 { - apiModel.FieldAttrs = apiFieldAttrs - } - - var runtimeFields map[string]tfRuntimeFieldV0 - if diags := m.RuntimeFieldMap.ElementsAs(ctx, &runtimeFields, true); diags.HasError() { - return data_views.CreateDataViewRequestObjectDataView{}, diags - } - - apiRuntimeFields := map[string]interface{}{} - for field, defn := range runtimeFields { - apiRuntimeFields[field] = runtimeField{ - Type: defn.Type.ValueString(), - Script: runtimeFieldSource{ - Source: defn.ScriptSource.ValueString(), - }, - } - } - if len(apiRuntimeFields) > 0 { - apiModel.RuntimeFieldMap = apiRuntimeFields - } - - namespaces, diags := m.getNamespaces(ctx, &spaceID) - if diags.HasError() { - return data_views.CreateDataViewRequestObjectDataView{}, diags - } - - if len(namespaces) > 0 { - apiModel.Namespaces = namespaces - } - - return apiModel, nil -} - -func (m tfDataViewV0) getNamespaces(ctx context.Context, spaceID *string) ([]string, diag.Diagnostics) { - var namespaces []string - if diags := m.Namespaces.ElementsAs(ctx, &namespaces, true); diags.HasError() { - return nil, diags - } - - if len(namespaces) == 0 || spaceID == nil { - return namespaces, nil - } - - includesSpaceID := false - for _, namespace := range namespaces { - if namespace == *spaceID { - includesSpaceID = true - } - } - - if !includesSpaceID { - namespaces = append(namespaces, *spaceID) - } - - return namespaces, nil -} - -func (m tfDataViewV0) ToUpdateRequest(ctx context.Context) (data_views.UpdateDataViewRequestObjectDataView, diag.Diagnostics) { - apiModel := data_views.UpdateDataViewRequestObjectDataView{ - Title: m.Title.ValueStringPointer(), - Name: m.Name.ValueStringPointer(), - TimeFieldName: m.TimeFieldName.ValueStringPointer(), - AllowNoIndex: m.AllowNoIndex.ValueBoolPointer(), - } - - var sourceFilters []string - if diags := m.SourceFilters.ElementsAs(ctx, &sourceFilters, true); diags.HasError() { - return data_views.UpdateDataViewRequestObjectDataView{}, diags - } - - if len(sourceFilters) > 0 { - apiFilters := []data_views.SourcefiltersInner{} - for _, filter := range sourceFilters { - apiFilters = append(apiFilters, data_views.SourcefiltersInner{ - Value: filter, - }) - } - apiModel.SourceFilters = apiFilters - } - - fieldFormats, diags := tfFieldFormatsToAPI(ctx, m.FieldFormats) - if diags.HasError() { - return data_views.UpdateDataViewRequestObjectDataView{}, diags - } - if fieldFormats != nil { - apiModel.FieldFormats = fieldFormats - } - - var tfFieldAttrs map[string]tfFieldAttrsV0 - if diags := m.FieldAttributes.ElementsAs(ctx, &tfFieldAttrs, true); diags.HasError() { - return data_views.UpdateDataViewRequestObjectDataView{}, diags - } - - var runtimeFields map[string]tfRuntimeFieldV0 - if diags := m.RuntimeFieldMap.ElementsAs(ctx, &runtimeFields, true); diags.HasError() { - return data_views.UpdateDataViewRequestObjectDataView{}, diags - } - - apiRuntimeFields := map[string]interface{}{} - for field, defn := range runtimeFields { - apiRuntimeFields[field] = runtimeField{ - Type: defn.Type.ValueString(), - Script: runtimeFieldSource{ - Source: defn.ScriptSource.ValueString(), - }, - } - } - if len(apiRuntimeFields) > 0 { - apiModel.RuntimeFieldMap = apiRuntimeFields - } - - return apiModel, nil -} - -func tfFieldFormatsToAPI(ctx context.Context, fieldFormats types.Map) (map[string]interface{}, diag.Diagnostics) { - if fieldFormats.IsNull() || fieldFormats.IsUnknown() { - return nil, nil - } - var tfFieldFormats map[string]types.Object - if diags := fieldFormats.ElementsAs(ctx, &tfFieldFormats, true); diags.HasError() { - return nil, diags - } - if len(tfFieldFormats) == 0 { - return nil, nil - } - - result := map[string]interface{}{} - for field, format := range tfFieldFormats { - var tfFormat tfFieldFormatV0 - if diags := tfsdk.ValueAs(ctx, format, &tfFormat); diags.HasError() { - return nil, diags - } - - var apiParams *apiFieldFormatParams - if !tfFormat.Params.IsNull() && !tfFormat.Params.IsUnknown() { - var tfParams tfFieldFormatParamsV0 - - if diags := tfsdk.ValueAs(ctx, tfFormat.Params, &tfParams); diags.HasError() { - return nil, diags - } - - apiParams = &apiFieldFormatParams{ - Pattern: tfParams.Pattern.ValueStringPointer(), - UrlTemplate: tfParams.UrlTemplate.ValueStringPointer(), - LabelTemplate: tfParams.LabelTemplate.ValueStringPointer(), - } - } - - result[field] = apiFieldFormat{ - ID: tfFormat.ID.ValueString(), - Params: apiParams, - } - } - - return result, nil -} - -type tfFieldAttrsV0 struct { - CustomLabel types.String `tfsdk:"custom_label"` - Count types.Int64 `tfsdk:"count"` -} - -type apiFieldAttrsV0 struct { - CustomLabel *string `tfsdk:"custom_label"` - Count *int64 `tfsdk:"count"` -} - -type tfRuntimeFieldV0 struct { - Type types.String `tfsdk:"type"` - ScriptSource types.String `tfsdk:"script_source"` -} - -type apiRuntimeFieldV0 struct { - Type string `tfsdk:"type"` - ScriptSource string `tfsdk:"script_source"` -} - -type fieldAttr struct { - CustomLabel *string `json:"customLabel"` - Count *int64 `json:"count"` -} - -type runtimeField struct { - Type string `tfsdk:"type" json:"type"` - Script runtimeFieldSource `tfsdk:"script" json:"script"` +func getDataViewAttrTypes() map[string]attr.Type { + return getSchema().Attributes["data_view"].GetType().(attr.TypeWithAttributeTypes).AttributeTypes() } -type runtimeFieldSource struct { - Source string `tfsdk:"source" json:"source"` +func getFieldAttrElemType() attr.Type { + return getDataViewAttrTypes()["field_attrs"].(attr.TypeWithElementType).ElementType() } -type tfFieldFormatV0 struct { - ID types.String `tfsdk:"id"` - Params types.Object `tfsdk:"params"` +func getRuntimeFieldMapElemType() attr.Type { + return getDataViewAttrTypes()["runtime_field_map"].(attr.TypeWithElementType).ElementType() } -type apiFieldFormat struct { - ID string `tfsdk:"id" json:"id"` - Params *apiFieldFormatParams `tfsdk:"params" json:"params"` +func getFieldFormatElemType() attr.Type { + return getDataViewAttrTypes()["field_formats"].(attr.TypeWithElementType).ElementType() } -type tfFieldFormatParamsV0 struct { - Pattern types.String `tfsdk:"pattern"` - UrlTemplate types.String `tfsdk:"urltemplate"` - LabelTemplate types.String `tfsdk:"labeltemplate"` +func getFieldFormatAttrTypes() map[string]attr.Type { + return getFieldFormatElemType().(attr.TypeWithAttributeTypes).AttributeTypes() } -type apiFieldFormatParams struct { - Pattern *string `tfsdk:"pattern" json:"pattern,omitempty"` - UrlTemplate *string `tfsdk:"urltemplate" json:"urlTemplate,omitempty"` - LabelTemplate *string `tfsdk:"labeltemplate" json:"labelTemplate,omitempty"` +func getFieldFormatParamsAttrTypes() map[string]attr.Type { + return getFieldFormatAttrTypes()["params"].(attr.TypeWithAttributeTypes).AttributeTypes() } diff --git a/internal/kibana/data_view/schema_test.go b/internal/kibana/data_view/schema_test.go deleted file mode 100644 index d88862025..000000000 --- a/internal/kibana/data_view/schema_test.go +++ /dev/null @@ -1,339 +0,0 @@ -package data_view - -import ( - "context" - "testing" - - "github.com/elastic/terraform-provider-elasticstack/generated/data_views" - "github.com/elastic/terraform-provider-elasticstack/internal/utils" - "github.com/hashicorp/terraform-plugin-framework/diag" - "github.com/hashicorp/terraform-plugin-framework/tfsdk" - "github.com/stretchr/testify/require" -) - -func Test_tfModelV0_ToCreateRequest(t *testing.T) { - tests := []struct { - name string - model apiModelV0 - expectedRequest data_views.CreateDataViewRequestObject - expectedDiags diag.Diagnostics - }{ - { - name: "all fields", - model: apiModelV0{ - SpaceID: "default", - DataView: apiDataViewV0{ - Title: utils.Pointer("title"), - Name: utils.Pointer("name"), - ID: "id", - TimeFieldName: utils.Pointer("time_field_name"), - SourceFilters: []string{"field1", "field2"}, - FieldAttributes: map[string]apiFieldAttrsV0{ - "field1": { - CustomLabel: utils.Pointer("custom_label"), - Count: utils.Pointer[int64](10), - }, - }, - RuntimeFieldMap: map[string]apiRuntimeFieldV0{ - "runtime_field": { - Type: "keyword", - ScriptSource: "emit(\"hello\")", - }, - }, - FieldFormats: map[string]apiFieldFormat{ - "field1": { - ID: "field1", - Params: &apiFieldFormatParams{ - Pattern: utils.Pointer("0.00"), - UrlTemplate: utils.Pointer("https://test.com/{{value}}"), - LabelTemplate: utils.Pointer("{{value}}"), - }, - }, - }, - AllowNoIndex: true, - Namespaces: []string{"backend", "o11y"}, - }, - }, - expectedRequest: data_views.CreateDataViewRequestObject{ - Override: utils.Pointer(false), - DataView: data_views.CreateDataViewRequestObjectDataView{ - AllowNoIndex: utils.Pointer(true), - FieldAttrs: map[string]interface{}{ - "field1": fieldAttr{ - CustomLabel: utils.Pointer("custom_label"), - Count: utils.Pointer[int64](10), - }, - }, - FieldFormats: map[string]interface{}{ - "field1": apiFieldFormat{ - ID: "field1", - Params: &apiFieldFormatParams{ - Pattern: utils.Pointer("0.00"), - UrlTemplate: utils.Pointer("https://test.com/{{value}}"), - LabelTemplate: utils.Pointer("{{value}}"), - }, - }, - }, - Id: utils.Pointer("id"), - Name: utils.Pointer("name"), - Namespaces: []string{"backend", "o11y", "default"}, - RuntimeFieldMap: map[string]interface{}{ - "runtime_field": runtimeField{ - Type: "keyword", - Script: runtimeFieldSource{ - Source: "emit(\"hello\")", - }, - }, - }, - SourceFilters: []data_views.SourcefiltersInner{ - {Value: "field1"}, - {Value: "field2"}, - }, - TimeFieldName: utils.Pointer("time_field_name"), - Title: "title", - }, - }, - }, - { - name: "nil collections", - model: apiModelV0{ - SpaceID: "default", - DataView: apiDataViewV0{ - Title: utils.Pointer("title"), - Name: utils.Pointer("name"), - ID: "id", - TimeFieldName: utils.Pointer("time_field_name"), - AllowNoIndex: true, - }, - }, - expectedRequest: data_views.CreateDataViewRequestObject{ - Override: utils.Pointer(false), - DataView: data_views.CreateDataViewRequestObjectDataView{ - AllowNoIndex: utils.Pointer(true), - Id: utils.Pointer("id"), - Name: utils.Pointer("name"), - TimeFieldName: utils.Pointer("time_field_name"), - Title: "title", - }, - }, - }, - } - - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - var tfModel tfModelV0 - diags := tfsdk.ValueFrom(context.Background(), tt.model, getSchema().Type(), &tfModel) - require.Nil(t, diags) - - req, diags := tfModel.ToCreateRequest(context.Background()) - - require.Equal(t, tt.expectedRequest, req) - require.Equal(t, tt.expectedDiags, diags) - }) - } -} - -func Test_tfModelV0_ToUpdateRequest(t *testing.T) { - tests := []struct { - name string - model apiModelV0 - expectedRequest data_views.UpdateDataViewRequestObject - expectedDiags diag.Diagnostics - }{ - { - name: "all fields", - model: apiModelV0{ - DataView: apiDataViewV0{ - Title: utils.Pointer("title"), - Name: utils.Pointer("name"), - ID: "id", - TimeFieldName: utils.Pointer("time_field_name"), - SourceFilters: []string{"field1", "field2"}, - FieldAttributes: map[string]apiFieldAttrsV0{ - "field1": { - CustomLabel: utils.Pointer("custom_label"), - Count: utils.Pointer[int64](10), - }, - }, - RuntimeFieldMap: map[string]apiRuntimeFieldV0{ - "runtime_field": { - Type: "keyword", - ScriptSource: "emit(\"hello\")", - }, - }, - FieldFormats: map[string]apiFieldFormat{ - "field1": { - ID: "field1", - Params: &apiFieldFormatParams{ - Pattern: utils.Pointer("0.00"), - UrlTemplate: utils.Pointer("https://test.com/{{value}}"), - LabelTemplate: utils.Pointer("{{value}}"), - }, - }, - }, - AllowNoIndex: true, - Namespaces: []string{"default", "o11y"}, - }, - }, - expectedRequest: data_views.UpdateDataViewRequestObject{ - DataView: data_views.UpdateDataViewRequestObjectDataView{ - AllowNoIndex: utils.Pointer(true), - FieldFormats: map[string]interface{}{ - "field1": apiFieldFormat{ - ID: "field1", - Params: &apiFieldFormatParams{ - Pattern: utils.Pointer("0.00"), - UrlTemplate: utils.Pointer("https://test.com/{{value}}"), - LabelTemplate: utils.Pointer("{{value}}"), - }, - }, - }, - Name: utils.Pointer("name"), - RuntimeFieldMap: map[string]interface{}{ - "runtime_field": runtimeField{ - Type: "keyword", - Script: runtimeFieldSource{ - Source: "emit(\"hello\")", - }, - }, - }, - SourceFilters: []data_views.SourcefiltersInner{ - {Value: "field1"}, - {Value: "field2"}, - }, - TimeFieldName: utils.Pointer("time_field_name"), - Title: utils.Pointer("title"), - }, - }, - }, - { - name: "nil collections", - model: apiModelV0{ - DataView: apiDataViewV0{ - Title: utils.Pointer("title"), - Name: utils.Pointer("name"), - ID: "id", - TimeFieldName: utils.Pointer("time_field_name"), - AllowNoIndex: true, - }, - }, - expectedRequest: data_views.UpdateDataViewRequestObject{ - DataView: data_views.UpdateDataViewRequestObjectDataView{ - AllowNoIndex: utils.Pointer(true), - Name: utils.Pointer("name"), - TimeFieldName: utils.Pointer("time_field_name"), - Title: utils.Pointer("title"), - }, - }, - }, - } - - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - var tfModel tfModelV0 - diags := tfsdk.ValueFrom(context.Background(), tt.model, getSchema().Type(), &tfModel) - require.Nil(t, diags) - - req, diags := tfModel.ToUpdateRequest(context.Background()) - - require.Equal(t, tt.expectedRequest, req) - require.Equal(t, tt.expectedDiags, diags) - }) - } -} - -func Test_tfModelV0_FromResponse(t *testing.T) { - tests := []struct { - name string - response data_views.DataViewResponseObject - existingModel apiModelV0 - expectedModel apiModelV0 - expectedDiags diag.Diagnostics - }{ - { - name: "all fields", - existingModel: apiModelV0{ - ID: "existing-id", - SpaceID: "existing-space-id", - DataView: apiDataViewV0{ - Namespaces: []string{"existing-namespace"}, - }, - }, - response: data_views.DataViewResponseObject{ - DataView: &data_views.DataViewResponseObjectDataView{ - Title: utils.Pointer("title"), - Name: utils.Pointer("name"), - Id: utils.Pointer("id"), - TimeFieldName: utils.Pointer("time_field_name"), - AllowNoIndex: utils.Pointer(true), - SourceFilters: []data_views.SourcefiltersInner{ - {Value: "field1"}, - {Value: "field2"}, - }, - FieldAttrs: map[string]interface{}{ - "field1": map[string]interface{}{ - "customLabel": "custom_label", - "count": 10.0, - }, - }, - FieldFormats: map[string]interface{}{ - "field1": map[string]interface{}{ - "id": "field1", - }, - }, - RuntimeFieldMap: map[string]interface{}{ - "runtime_field": map[string]interface{}{ - "type": "keyword", - "script": map[string]interface{}{ - "source": "emit('hello')", - }, - }, - }, - }, - }, - expectedModel: apiModelV0{ - ID: "existing-id", - SpaceID: "existing-space-id", - DataView: apiDataViewV0{ - Title: utils.Pointer("title"), - Name: utils.Pointer("name"), - ID: "id", - TimeFieldName: utils.Pointer("time_field_name"), - SourceFilters: []string{"field1", "field2"}, - FieldAttributes: map[string]apiFieldAttrsV0{ - "field1": { - CustomLabel: utils.Pointer("custom_label"), - Count: utils.Pointer[int64](10), - }, - }, - RuntimeFieldMap: map[string]apiRuntimeFieldV0{ - "runtime_field": { - Type: "keyword", - ScriptSource: "emit('hello')", - }, - }, - FieldFormats: map[string]apiFieldFormat{ - "field1": { - ID: "field1", - }, - }, - AllowNoIndex: true, - Namespaces: []string{"existing-namespace"}, - }, - }, - }, - } - - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - var tfModel tfModelV0 - diags := tfsdk.ValueFrom(context.Background(), tt.existingModel, getSchema().Type(), &tfModel) - require.Nil(t, diags) - - finalModel, diags := tfModel.FromResponse(context.Background(), &tt.response) - - require.Equal(t, tt.expectedModel, finalModel) - require.Equal(t, tt.expectedDiags, diags) - }) - } -} diff --git a/internal/kibana/data_view/update.go b/internal/kibana/data_view/update.go index 311a4c805..b8d4b5525 100644 --- a/internal/kibana/data_view/update.go +++ b/internal/kibana/data_view/update.go @@ -3,48 +3,44 @@ package data_view import ( "context" - "github.com/elastic/terraform-provider-elasticstack/internal/utils" + "github.com/elastic/terraform-provider-elasticstack/internal/clients/kibana2" "github.com/hashicorp/terraform-plugin-framework/resource" ) -func (r *Resource) Update(ctx context.Context, request resource.UpdateRequest, response *resource.UpdateResponse) { - dataviewClient, err := r.client.GetDataViewsClient() - if err != nil { - response.Diagnostics.AddError("unable to get data view client", err.Error()) - return - } +func (r *DataViewResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { + var planModel dataViewModel - var model tfModelV0 - response.Diagnostics.Append(request.Plan.Get(ctx, &model)...) - if response.Diagnostics.HasError() { + diags := req.Plan.Get(ctx, &planModel) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { return } - apiModel, diags := model.ToUpdateRequest(ctx) - response.Diagnostics.Append(diags...) - if response.Diagnostics.HasError() { + client, err := r.client.GetKibana2Client() + if err != nil { + resp.Diagnostics.AddError(err.Error(), "") return } - id, spaceID := model.getIDAndSpaceID() - authCtx := r.client.SetDataviewAuthContext(ctx) - _, res, err := dataviewClient.UpdateDataView(authCtx, id, spaceID).UpdateDataViewRequestObject(apiModel).KbnXsrf("true").Execute() - if err != nil && res == nil { - response.Diagnostics.AddError("Failed to update data view", err.Error()) + body, diags := planModel.toAPIUpdateModel(ctx) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { return } - defer res.Body.Close() - response.Diagnostics.Append(utils.CheckHttpErrorFromFW(res, "Unable to update data view")...) - if response.Diagnostics.HasError() { + viewID, spaceID := planModel.getViewIDAndSpaceID() + dataView, diags := kibana2.UpdateDataView(ctx, client, spaceID, viewID, body) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { return } - readModel, diags := r.read(ctx, model) - response.Diagnostics = append(response.Diagnostics, diags...) - if response.Diagnostics.HasError() { + diags = planModel.populateFromAPI(ctx, dataView) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { return } - response.Diagnostics.Append(response.State.Set(ctx, readModel)...) + diags = resp.State.Set(ctx, planModel) + resp.Diagnostics.Append(diags...) } diff --git a/internal/utils/tfsdk.go b/internal/utils/tfsdk.go index 18c3e4586..5f14b90d2 100644 --- a/internal/utils/tfsdk.go +++ b/internal/utils/tfsdk.go @@ -9,20 +9,47 @@ import ( "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/types" + "github.com/hashicorp/terraform-plugin-framework/types/basetypes" ) type ListMeta struct { - Index int - Path path.Path - Diags *diag.Diagnostics + Context context.Context + Index int + Path path.Path + Diags *diag.Diagnostics } type MapMeta struct { - Key string - Path path.Path - Diags *diag.Diagnostics + Context context.Context + Key string + Path path.Path + Diags *diag.Diagnostics } +type ObjectMeta struct { + Context context.Context + Path path.Path + Diags *diag.Diagnostics +} + +// ====================== +// ===== Primitives ===== +// ====================== + +// ValueStringPointer returns nil if unknown, otherwise the same as value.ValueStringPointer(). +// Useful for computed optional fields without a default value, as these unknown values +// return a pointer to an empty string. +func ValueStringPointer(value types.String) *string { + if value.IsUnknown() { + return nil + } + return value.ValueStringPointer() +} + +// ================ +// ===== Maps ===== +// ================ + // MapToNormalizedType marshals a map into a jsontypes.Normalized. func MapToNormalizedType[T any](value map[string]T, p path.Path, diags *diag.Diagnostics) jsontypes.Normalized { if value == nil { @@ -37,6 +64,70 @@ func MapToNormalizedType[T any](value map[string]T, p path.Path, diags *diag.Dia return jsontypes.NewNormalizedValue(string(bytes)) } +// NormalizedTypeToMap unmarshals a jsontypes.Normalized to a map[string]T. +func NormalizedTypeToMap[T any](value jsontypes.Normalized, p path.Path, diags *diag.Diagnostics) map[string]T { + if !IsKnown(value) { + return nil + } + + var dest map[string]T + d := value.Unmarshal(&dest) + diags.Append(ConvertToAttrDiags(d, p)...) + return dest +} + +// MapToMapType converts a tfsdk naive map[string]T1 into an types.Map of map[string]T2. +// This handles both structs and simple types to attr.Values. +func MapToMapType[T1 any, T2 any](ctx context.Context, value map[string]T1, elemType attr.Type, p path.Path, diags *diag.Diagnostics, iteratee func(item T1, meta MapMeta) T2) types.Map { + if value == nil { + return types.MapNull(elemType) + } + + elems := TransformMap(ctx, value, p, diags, iteratee) + mapping, d := types.MapValueFrom(ctx, elemType, elems) + diags.Append(ConvertToAttrDiags(d, p)...) + + return mapping +} + +// MapTypeToMap converts a types.Map first into a tfsdk aware map[string]T1 and transforms +// the result into a map[string]T2. +func MapTypeToMap[T1 any, T2 any](ctx context.Context, value types.Map, p path.Path, diags *diag.Diagnostics, iteratee func(item T1, meta MapMeta) T2) map[string]T2 { + if !IsKnown(value) { + return nil + } + + elems := MapTypeAs[T1](ctx, value, p, diags) + if diags.HasError() { + return nil + } + + return TransformMap(ctx, elems, p, diags, iteratee) +} + +// MapTypeAs converts a types.Map into a tfsdk aware map[string]T. +func MapTypeAs[T any](ctx context.Context, value types.Map, p path.Path, diags *diag.Diagnostics) map[string]T { + if !IsKnown(value) { + return nil + } + + var items map[string]T + d := value.ElementsAs(ctx, &items, false) + diags.Append(ConvertToAttrDiags(d, p)...) + return items +} + +// MapValueFrom converts a tfsdk aware []T to a types.List. +func MapValueFrom[T any](ctx context.Context, value map[string]T, elemType attr.Type, p path.Path, diags *diag.Diagnostics) types.Map { + mapping, d := types.MapValueFrom(ctx, elemType, value) + diags.Append(ConvertToAttrDiags(d, p)...) + return mapping +} + +// ================= +// ===== Lists ===== +// ================= + // SliceToListType converts a tfsdk naive []T1 into an types.List of []T2. // This handles both structs and simple types to attr.Values. func SliceToListType[T1 any, T2 any](ctx context.Context, value []T1, elemType attr.Type, p path.Path, diags *diag.Diagnostics, iteratee func(item T1, meta ListMeta) T2) types.List { @@ -44,7 +135,7 @@ func SliceToListType[T1 any, T2 any](ctx context.Context, value []T1, elemType a return types.ListNull(elemType) } - elems := TransformSlice(value, p, diags, iteratee) + elems := TransformSlice(ctx, value, p, diags, iteratee) list, nd := types.ListValueFrom(ctx, elemType, elems) diags.Append(ConvertToAttrDiags(nd, p)...) @@ -72,7 +163,7 @@ func ListTypeToMap[T1 any, T2 any](ctx context.Context, value types.List, p path return nil } - return TransformSliceToMap(items, p, diags, iteratee) + return TransformSliceToMap(ctx, items, p, diags, iteratee) } // ListTypeToSlice converts a types.List first into a tfsdk aware []T1 and transforms @@ -87,7 +178,7 @@ func ListTypeToSlice[T1 any, T2 any](ctx context.Context, value types.List, p pa return nil } - return TransformSlice(elems, p, diags, iteratee) + return TransformSlice(ctx, elems, p, diags, iteratee) } // ListTypeToSlice_String converts a types.List into a []string. @@ -117,41 +208,108 @@ func ListValueFrom[T any](ctx context.Context, value []T, elemType attr.Type, p return list } -// NormalizedTypeToMap unmarshals a jsontypes.Normalized to a map[string]T. -func NormalizedTypeToMap[T any](value jsontypes.Normalized, p path.Path, diags *diag.Diagnostics) map[string]T { +// =================== +// ===== Objects ===== +// =================== + +// StructToObjectType converts a tfsdk naive T1 into an types.Object of T2. +func StructToObjectType[T1 any, T2 any](ctx context.Context, value *T1, attrTypes map[string]attr.Type, p path.Path, diags *diag.Diagnostics, transformee func(item T1, meta ObjectMeta) T2) types.Object { + if value == nil { + return types.ObjectNull(attrTypes) + } + + item := TransformObject(ctx, value, p, diags, transformee) + obj, d := types.ObjectValueFrom(ctx, attrTypes, item) + diags.Append(ConvertToAttrDiags(d, p)...) + + return obj +} + +// ListTypeToSlice converts a types.List first into a tfsdk aware []T1 and transforms +// the result into a []T2. +func ObjectTypeToStruct[T1 any, T2 any](ctx context.Context, value types.Object, p path.Path, diags *diag.Diagnostics, transformee func(item T1, meta ObjectMeta) T2) *T2 { if !IsKnown(value) { return nil } - var dest map[string]T - d := value.Unmarshal(&dest) + item := ObjectTypeAs[T1](ctx, value, p, diags) + if diags.HasError() { + return nil + } + + return TransformObject(ctx, item, p, diags, transformee) +} + +// ObjectTypeAs converts a types.Object into a tfsdk aware T. +func ObjectTypeAs[T any](ctx context.Context, value types.Object, p path.Path, diags *diag.Diagnostics) *T { + if !IsKnown(value) { + return nil + } + + var item T + d := value.As(ctx, &item, basetypes.ObjectAsOptions{}) diags.Append(ConvertToAttrDiags(d, p)...) - return dest + return &item +} + +// ObjectValueFrom converts a tfsdk aware T to a types.Object. +func ObjectValueFrom[T any](ctx context.Context, value *T, attrTypes map[string]attr.Type, p path.Path, diags *diag.Diagnostics) types.Object { + obj, d := types.ObjectValueFrom(ctx, attrTypes, value) + diags.Append(ConvertToAttrDiags(d, p)...) + return obj +} + +// ====================== +// ===== Transforms ===== +// ====================== + +// TransformSlice converts T1 to T2 via the iteratee. +func TransformObject[T1 any, T2 any](ctx context.Context, value *T1, p path.Path, diags *diag.Diagnostics, transformee func(item T1, meta ObjectMeta) T2) *T2 { + if value == nil { + return nil + } + + result := transformee(*value, ObjectMeta{Context: ctx, Path: p, Diags: diags}) + return &result +} + +// TransformMap converts map[string]T1 to map[string]T2 via the iteratee. +func TransformMap[T1 any, T2 any](ctx context.Context, value map[string]T1, p path.Path, diags *diag.Diagnostics, iteratee func(item T1, meta MapMeta) T2) map[string]T2 { + if value == nil { + return nil + } + + elems := make(map[string]T2, len(value)) + for k, v := range value { + elems[k] = iteratee(v, MapMeta{Context: ctx, Key: k, Path: p.AtMapKey(k), Diags: diags}) + } + + return elems } // TransformSlice converts []T1 to []T2 via the iteratee. -func TransformSlice[T1 any, T2 any](value []T1, p path.Path, diags *diag.Diagnostics, iteratee func(item T1, meta ListMeta) T2) []T2 { +func TransformSlice[T1 any, T2 any](ctx context.Context, value []T1, p path.Path, diags *diag.Diagnostics, iteratee func(item T1, meta ListMeta) T2) []T2 { if value == nil { return nil } elems := make([]T2, len(value)) for i, v := range value { - elems[i] = iteratee(v, ListMeta{Index: i, Path: p.AtListIndex(i), Diags: diags}) + elems[i] = iteratee(v, ListMeta{Context: ctx, Index: i, Path: p.AtListIndex(i), Diags: diags}) } return elems } // TransformSliceToMap converts []T1 to map[string]]T2 via the iteratee. -func TransformSliceToMap[T1 any, T2 any](value []T1, p path.Path, diags *diag.Diagnostics, iteratee func(item T1, meta ListMeta) (key string, elem T2)) map[string]T2 { +func TransformSliceToMap[T1 any, T2 any](ctx context.Context, value []T1, p path.Path, diags *diag.Diagnostics, iteratee func(item T1, meta ListMeta) (key string, elem T2)) map[string]T2 { if value == nil { return nil } elems := make(map[string]T2, len(value)) for i, v := range value { - k, v := iteratee(v, ListMeta{Index: i, Path: p.AtListIndex(i), Diags: diags}) + k, v := iteratee(v, ListMeta{Context: ctx, Index: i, Path: p.AtListIndex(i), Diags: diags}) elems[k] = v } @@ -159,14 +317,14 @@ func TransformSliceToMap[T1 any, T2 any](value []T1, p path.Path, diags *diag.Di } // TransformSliceToMap converts []T1 to map[string]]T2 via the iteratee. -func TransformMapToSlice[T1 any, T2 any](value map[string]T1, p path.Path, diags *diag.Diagnostics, iteratee func(item T1, meta MapMeta) T2) []T2 { +func TransformMapToSlice[T1 any, T2 any](ctx context.Context, value map[string]T1, p path.Path, diags *diag.Diagnostics, iteratee func(item T1, meta MapMeta) T2) []T2 { if value == nil { return nil } elems := make([]T2, 0, len(value)) for k, v := range value { - v := iteratee(v, MapMeta{Key: k, Path: p.AtMapKey(k), Diags: diags}) + v := iteratee(v, MapMeta{Context: ctx, Key: k, Path: p.AtMapKey(k), Diags: diags}) elems = append(elems, v) } diff --git a/internal/utils/tfsdk_test.go b/internal/utils/tfsdk_test.go index 5d7d59b4b..349cc8f8a 100644 --- a/internal/utils/tfsdk_test.go +++ b/internal/utils/tfsdk_test.go @@ -2,7 +2,6 @@ package utils_test import ( "context" - "reflect" "sort" "testing" @@ -12,6 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/types" + "github.com/stretchr/testify/require" ) type naive struct { @@ -23,22 +23,44 @@ type aware struct { } var ( - naiveNil = ([]naive)(nil) - naiveEmpty = []naive{} - naiveFull = []naive{ + naiveSliceNil = ([]naive)(nil) + naiveSliceEmpty = []naive{} + naiveSliceFull = []naive{ {ID: "id1"}, {ID: "id2"}, {ID: "id3"}, } - awareNil = ([]aware)(nil) - awareEmpty = []aware{} - awareFull = []aware{ + naiveMapNil = (map[string]naive)(nil) + naiveMapEmpty = map[string]naive{} + naiveMapFull = map[string]naive{ + "k1": {ID: "id1"}, + "k2": {ID: "id2"}, + "k3": {ID: "id3"}, + } + + naiveStructNil = (*naive)(nil) + naiveStructFull = &naive{ID: "val"} + + awareSliceNil = ([]aware)(nil) + awareSliceEmpty = []aware{} + awareSliceFull = []aware{ {ID: types.StringValue("id1")}, {ID: types.StringValue("id2")}, {ID: types.StringValue("id3")}, } + awareMapNil = (map[string]aware)(nil) + awareMapEmpty = map[string]aware{} + awareMapFull = map[string]aware{ + "k1": {ID: types.StringValue("id1")}, + "k2": {ID: types.StringValue("id2")}, + "k3": {ID: types.StringValue("id3")}, + } + + awareStructNil = (*aware)(nil) + awareStructFull = &aware{ID: types.StringValue("val")} + awareType = types.ObjectType{AttrTypes: map[string]attr.Type{"id": types.StringType}} awareListUnk = types.ListUnknown(awareType) awareListNil = types.ListNull(awareType) @@ -49,12 +71,25 @@ var ( types.ObjectValueMust(awareType.AttrTypes, map[string]attr.Value{"id": types.StringValue("id3")}), }) + awareMapTypeUnk = types.MapUnknown(awareType) + awareMapTypeNil = types.MapNull(awareType) + awareMapTypeEmpty = types.MapValueMust(awareType, map[string]attr.Value{}) + awareMapTypeFull = types.MapValueMust(awareType, map[string]attr.Value{ + "k1": types.ObjectValueMust(awareType.AttrTypes, map[string]attr.Value{"id": types.StringValue("id1")}), + "k2": types.ObjectValueMust(awareType.AttrTypes, map[string]attr.Value{"id": types.StringValue("id2")}), + "k3": types.ObjectValueMust(awareType.AttrTypes, map[string]attr.Value{"id": types.StringValue("id3")}), + }) + + awareObjectUnk = types.ObjectUnknown(awareType.AttrTypes) + awareObjectNil = types.ObjectNull(awareType.AttrTypes) + awareObjectFull = types.ObjectValueMust(awareType.AttrTypes, map[string]attr.Value{"id": types.StringValue("val")}) + toNaive = func(item aware) naive { return naive{ID: item.ID.ValueString()} } toAware = func(item naive) aware { return aware{ID: types.StringValue(item.ID)} } - stringNil = ([]string)(nil) - stringEmpty = []string{} - stringFull = []string{"v1", "v2", "v3"} + stringSliceNil = ([]string)(nil) + stringSliceEmpty = []string{} + stringSliceFull = []string{"v1", "v2", "v3"} stringListUnk = types.ListUnknown(types.StringType) stringListNil = types.ListNull(types.StringType) @@ -65,20 +100,40 @@ var ( types.StringValue("v3"), }) - mapNil = (map[string]naive)(nil) - mapEmpty = map[string]naive{} - mapFull = map[string]naive{ - "k1": {ID: "id1"}, - "k2": {ID: "id2"}, - "k3": {ID: "id3"}, - } - normUnk = jsontypes.NewNormalizedUnknown() normNil = jsontypes.NewNormalizedNull() normEmpty = jsontypes.NewNormalizedValue(`{}`) normFull = jsontypes.NewNormalizedValue(`{"k1":{"id":"id1"},"k2":{"id":"id2"},"k3":{"id":"id3"}}`) ) +// Primitives + +func TestValueStringPointer(t *testing.T) { + t.Parallel() + + tests := []struct { + name string + input types.String + want *string + }{ + {name: "converts unknown", input: types.StringUnknown(), want: nil}, + {name: "converts nil", input: types.StringNull(), want: nil}, + {name: "converts empty", input: types.StringValue(""), want: utils.Pointer("")}, + {name: "converts value", input: types.StringValue("value"), want: utils.Pointer("value")}, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + var diags diag.Diagnostics + got := utils.ValueStringPointer(tt.input) + require.Equal(t, tt.want, got) + require.Empty(t, diags) + }) + } +} + +// Maps + func TestMapToNormalizedType(t *testing.T) { t.Parallel() @@ -87,25 +142,149 @@ func TestMapToNormalizedType(t *testing.T) { input map[string]naive want jsontypes.Normalized }{ - {name: "converts nil", input: mapNil, want: normNil}, - {name: "converts empty", input: mapEmpty, want: normEmpty}, - {name: "converts struct", input: mapFull, want: normFull}, + {name: "converts nil", input: naiveMapNil, want: normNil}, + {name: "converts empty", input: naiveMapEmpty, want: normEmpty}, + {name: "converts struct", input: naiveMapFull, want: normFull}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { var diags diag.Diagnostics got := utils.MapToNormalizedType(tt.input, path.Empty(), &diags) - if !got.Equal(tt.want) { - t.Errorf("MapToNormalizedType() = %v, want %v", got, tt.want) - } - for _, d := range diags.Errors() { - t.Errorf("MapToNormalizedType() diagnostic: %s: %s", d.Summary(), d.Detail()) - } + require.Equal(t, tt.want, got) + require.Empty(t, diags) + }) + } +} + +func TestNormalizedTypeToMap(t *testing.T) { + t.Parallel() + + tests := []struct { + name string + input jsontypes.Normalized + want map[string]naive + }{ + {name: "converts unknown", input: normUnk, want: naiveMapNil}, + {name: "converts nil", input: normNil, want: naiveMapNil}, + {name: "converts empty", input: normEmpty, want: naiveMapEmpty}, + {name: "converts struct", input: normFull, want: naiveMapFull}, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + var diags diag.Diagnostics + got := utils.NormalizedTypeToMap[naive](tt.input, path.Empty(), &diags) + require.Equal(t, tt.want, got) + require.Empty(t, diags) }) } } +func TestMapToMapType(t *testing.T) { + t.Parallel() + + tests := []struct { + name string + input map[string]naive + want types.Map + }{ + {name: "converts nil", input: naiveMapNil, want: awareMapTypeNil}, + {name: "converts empty", input: naiveMapEmpty, want: awareMapTypeEmpty}, + {name: "converts struct", input: naiveMapFull, want: awareMapTypeFull}, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + var diags diag.Diagnostics + got := utils.MapToMapType(context.Background(), tt.input, awareType, path.Empty(), &diags, + func(item naive, meta utils.MapMeta) aware { + return aware{ID: types.StringValue(item.ID)} + }, + ) + require.Equal(t, tt.want, got) + require.Empty(t, diags) + }) + } +} + +func TestMapTypeToMap(t *testing.T) { + t.Parallel() + + tests := []struct { + name string + input types.Map + want map[string]naive + }{ + {name: "converts unknown", input: awareMapTypeUnk, want: naiveMapNil}, + {name: "converts nil", input: awareMapTypeNil, want: naiveMapNil}, + {name: "converts empty", input: awareMapTypeEmpty, want: naiveMapEmpty}, + {name: "converts struct", input: awareMapTypeFull, want: naiveMapFull}, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + var diags diag.Diagnostics + got := utils.MapTypeToMap(context.Background(), tt.input, path.Empty(), &diags, + func(item aware, meta utils.MapMeta) naive { + return toNaive(item) + }) + require.Equal(t, tt.want, got) + require.Empty(t, diags) + }) + } + +} + +func TestMapTypeAs(t *testing.T) { + t.Parallel() + + tests := []struct { + name string + input types.Map + want map[string]aware + }{ + {name: "converts unknown", input: awareMapTypeUnk, want: awareMapNil}, + {name: "converts nil", input: awareMapTypeNil, want: awareMapNil}, + {name: "converts empty", input: awareMapTypeEmpty, want: awareMapEmpty}, + {name: "converts struct", input: awareMapTypeFull, want: awareMapFull}, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + var diags diag.Diagnostics + got := utils.MapTypeAs[aware](context.Background(), tt.input, path.Empty(), &diags) + require.Equal(t, tt.want, got) + require.Empty(t, diags) + }) + } +} + +func TestMapValueFrom(t *testing.T) { + t.Parallel() + + tests := []struct { + name string + input map[string]aware + want types.Map + }{ + {name: "converts nil", input: awareMapNil, want: awareMapTypeNil}, + {name: "converts empty", input: awareMapEmpty, want: awareMapTypeEmpty}, + {name: "converts struct", input: awareMapFull, want: awareMapTypeFull}, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + var diags diag.Diagnostics + got := utils.MapValueFrom(context.Background(), tt.input, awareType, path.Empty(), &diags) + require.Equal(t, tt.want, got) + require.Empty(t, diags) + }) + } +} + +// Lists + func TestSliceToListType(t *testing.T) { t.Parallel() @@ -114,27 +293,21 @@ func TestSliceToListType(t *testing.T) { input []naive want types.List }{ - {name: "converts nil", input: naiveNil, want: awareListNil}, - {name: "converts empty", input: naiveEmpty, want: awareListEmpty}, - {name: "converts struct", input: naiveFull, want: awareListFull}, + {name: "converts nil", input: naiveSliceNil, want: awareListNil}, + {name: "converts empty", input: naiveSliceEmpty, want: awareListEmpty}, + {name: "converts struct", input: naiveSliceFull, want: awareListFull}, } - ctx := context.Background() - for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { var diags diag.Diagnostics - got := utils.SliceToListType(ctx, tt.input, awareType, path.Empty(), &diags, + got := utils.SliceToListType(context.Background(), tt.input, awareType, path.Empty(), &diags, func(item naive, meta utils.ListMeta) aware { return aware{ID: types.StringValue(item.ID)} }, ) - if !got.Equal(tt.want) { - t.Errorf("SliceToListType() = %v, want %v", got, tt.want) - } - for _, d := range diags.Errors() { - t.Errorf("SlicetoListType() diagnostic: %s: %s", d.Summary(), d.Detail()) - } + require.Equal(t, tt.want, got) + require.Empty(t, diags) }) } } @@ -147,23 +320,17 @@ func TestSliceToListType_String(t *testing.T) { input []string want types.List }{ - {name: "converts nil", input: stringNil, want: stringListNil}, - {name: "converts empty", input: stringEmpty, want: stringListEmpty}, - {name: "converts strings", input: stringFull, want: stringListFull}, + {name: "converts nil", input: stringSliceNil, want: stringListNil}, + {name: "converts empty", input: stringSliceEmpty, want: stringListEmpty}, + {name: "converts strings", input: stringSliceFull, want: stringListFull}, } - ctx := context.Background() - for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { var diags diag.Diagnostics - got := utils.SliceToListType_String(ctx, tt.input, path.Empty(), &diags) - if !got.Equal(tt.want) { - t.Errorf("SliceToListType_String() = %v, want %v", got, tt.want) - } - for _, d := range diags.Errors() { - t.Errorf("SliceToListType_String() diagnostic: %s: %s", d.Summary(), d.Detail()) - } + got := utils.SliceToListType_String(context.Background(), tt.input, path.Empty(), &diags) + require.Equal(t, tt.want, got) + require.Empty(t, diags) }) } } @@ -176,27 +343,21 @@ func TestListTypeToMap(t *testing.T) { input types.List want map[string]naive }{ - {name: "converts unknown", input: awareListUnk, want: mapNil}, - {name: "converts nil", input: awareListNil, want: mapNil}, - {name: "converts empty", input: awareListEmpty, want: mapEmpty}, - {name: "converts struct", input: awareListFull, want: mapFull}, + {name: "converts unknown", input: awareListUnk, want: naiveMapNil}, + {name: "converts nil", input: awareListNil, want: naiveMapNil}, + {name: "converts empty", input: awareListEmpty, want: naiveMapEmpty}, + {name: "converts struct", input: awareListFull, want: naiveMapFull}, } - ctx := context.Background() - for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { var diags diag.Diagnostics - got := utils.ListTypeToMap(ctx, tt.input, path.Empty(), &diags, + got := utils.ListTypeToMap(context.Background(), tt.input, path.Empty(), &diags, func(item aware, meta utils.ListMeta) (string, naive) { return "k" + item.ID.ValueString()[2:], toNaive(item) }) - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("ListTypeToMap() = %v, want %v", got, tt.want) - } - for _, d := range diags.Errors() { - t.Errorf("ListTypeToMap() diagnostic: %s: %s", d.Summary(), d.Detail()) - } + require.Equal(t, tt.want, got) + require.Empty(t, diags) }) } } @@ -209,27 +370,21 @@ func TestListTypeToSlice(t *testing.T) { input types.List want []naive }{ - {name: "converts unknown", input: awareListUnk, want: naiveNil}, - {name: "converts nil", input: awareListNil, want: naiveNil}, - {name: "converts empty", input: awareListEmpty, want: naiveEmpty}, - {name: "converts struct", input: awareListFull, want: naiveFull}, + {name: "converts unknown", input: awareListUnk, want: naiveSliceNil}, + {name: "converts nil", input: awareListNil, want: naiveSliceNil}, + {name: "converts empty", input: awareListEmpty, want: naiveSliceEmpty}, + {name: "converts struct", input: awareListFull, want: naiveSliceFull}, } - ctx := context.Background() - for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { var diags diag.Diagnostics - got := utils.ListTypeToSlice(ctx, tt.input, path.Empty(), &diags, + got := utils.ListTypeToSlice(context.Background(), tt.input, path.Empty(), &diags, func(item aware, meta utils.ListMeta) naive { return toNaive(item) }) - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("ListTypeToSlice() = %v, want %v", got, tt.want) - } - for _, d := range diags.Errors() { - t.Errorf("ListTypeToSlice() diagnostic: %s: %s", d.Summary(), d.Detail()) - } + require.Equal(t, tt.want, got) + require.Empty(t, diags) }) } } @@ -242,24 +397,18 @@ func TestListTypeToSlice_String(t *testing.T) { input types.List want []string }{ - {name: "converts unknown", input: stringListUnk, want: stringNil}, - {name: "converts nil", input: stringListNil, want: stringNil}, - {name: "converts empty", input: stringListEmpty, want: stringEmpty}, - {name: "converts strings", input: stringListFull, want: stringFull}, + {name: "converts unknown", input: stringListUnk, want: stringSliceNil}, + {name: "converts nil", input: stringListNil, want: stringSliceNil}, + {name: "converts empty", input: stringListEmpty, want: stringSliceEmpty}, + {name: "converts strings", input: stringListFull, want: stringSliceFull}, } - ctx := context.Background() - for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { var diags diag.Diagnostics - got := utils.ListTypeToSlice_String(ctx, tt.input, path.Empty(), &diags) - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("ListTypeToSlice_String() = %v, want %v", got, tt.want) - } - for _, d := range diags.Errors() { - t.Errorf("ListTypeToSlice_String() diagnostic: %s: %s", d.Summary(), d.Detail()) - } + got := utils.ListTypeToSlice_String(context.Background(), tt.input, path.Empty(), &diags) + require.Equal(t, tt.want, got) + require.Empty(t, diags) }) } } @@ -269,27 +418,21 @@ func TestListTypeAs(t *testing.T) { tests := []struct { name string - want []aware input types.List + want []aware }{ - {name: "converts unknown", input: awareListUnk, want: awareNil}, - {name: "converts nil", input: awareListNil, want: awareNil}, - {name: "converts empty", input: awareListEmpty, want: awareEmpty}, - {name: "converts struct", input: awareListFull, want: awareFull}, + {name: "converts unknown", input: awareListUnk, want: awareSliceNil}, + {name: "converts nil", input: awareListNil, want: awareSliceNil}, + {name: "converts empty", input: awareListEmpty, want: awareSliceEmpty}, + {name: "converts struct", input: awareListFull, want: awareSliceFull}, } - ctx := context.Background() - for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { var diags diag.Diagnostics - got := utils.ListTypeAs[aware](ctx, tt.input, path.Empty(), &diags) - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("ListTypeAs() = %v, want %v", got, tt.want) - } - for _, d := range diags.Errors() { - t.Errorf("ListTypeAs() diagnostic: %s: %s", d.Summary(), d.Detail()) - } + got := utils.ListTypeAs[aware](context.Background(), tt.input, path.Empty(), &diags) + require.Equal(t, tt.want, got) + require.Empty(t, diags) }) } } @@ -302,51 +445,169 @@ func TestListValueFrom(t *testing.T) { input []aware want types.List }{ - {name: "converts nil", input: awareNil, want: awareListNil}, - {name: "converts empty", input: awareEmpty, want: awareListEmpty}, - {name: "converts struct", input: awareFull, want: awareListFull}, + {name: "converts nil", input: awareSliceNil, want: awareListNil}, + {name: "converts empty", input: awareSliceEmpty, want: awareListEmpty}, + {name: "converts struct", input: awareSliceFull, want: awareListFull}, } - ctx := context.Background() + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + var diags diag.Diagnostics + got := utils.ListValueFrom(context.Background(), tt.input, awareType, path.Empty(), &diags) + require.Equal(t, tt.want, got) + require.Empty(t, diags) + }) + } +} + +// Objects + +func TestStructToObjectType(t *testing.T) { + t.Parallel() + + tests := []struct { + name string + input *naive + want types.Object + }{ + {name: "converts nil", input: naiveStructNil, want: awareObjectNil}, + {name: "converts struct", input: naiveStructFull, want: awareObjectFull}, + } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { var diags diag.Diagnostics - got := utils.ListValueFrom(ctx, tt.input, awareType, path.Empty(), &diags) - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("ListValueFrom() = %v, want %v", got, tt.want) - } - for _, d := range diags.Errors() { - t.Errorf("ListTypeAs() diagnostic: %s: %s", d.Summary(), d.Detail()) - } + got := utils.StructToObjectType(context.Background(), tt.input, awareType.AttrTypes, path.Empty(), &diags, + func(item naive, meta utils.ObjectMeta) aware { + return aware{ID: types.StringValue(item.ID)} + }, + ) + require.Equal(t, tt.want, got) + require.Empty(t, diags) }) } } -func TestNormalizedTypeToMap(t *testing.T) { +func TestObjectTypeToStruct(t *testing.T) { t.Parallel() tests := []struct { name string - input jsontypes.Normalized - want map[string]naive + input types.Object + want *naive }{ - {name: "converts unknown", input: normUnk, want: mapNil}, - {name: "converts nil", input: normNil, want: mapNil}, - {name: "converts empty", input: normEmpty, want: mapEmpty}, - {name: "converts struct", input: normFull, want: mapFull}, + {name: "converts unknown", input: awareObjectUnk, want: naiveStructNil}, + {name: "converts nil", input: awareObjectNil, want: naiveStructNil}, + {name: "converts struct", input: awareObjectFull, want: naiveStructFull}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { var diags diag.Diagnostics - got := utils.NormalizedTypeToMap[naive](tt.input, path.Empty(), &diags) - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("MapToNormalizedType() = %v, want %v", got, tt.want) - } - for _, d := range diags.Errors() { - t.Errorf("MapToNormalizedType() diagnostic: %s: %s", d.Summary(), d.Detail()) - } + got := utils.ObjectTypeToStruct(context.Background(), tt.input, path.Empty(), &diags, + func(item aware, meta utils.ObjectMeta) naive { + return toNaive(item) + }) + require.Equal(t, tt.want, got) + require.Empty(t, diags) + }) + } +} + +func TestObjectTypeAs(t *testing.T) { + t.Parallel() + + tests := []struct { + name string + input types.Object + want *aware + }{ + {name: "converts unknown", input: awareObjectUnk, want: awareStructNil}, + {name: "converts nil", input: awareObjectNil, want: awareStructNil}, + {name: "converts struct", input: awareObjectFull, want: awareStructFull}, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + var diags diag.Diagnostics + got := utils.ObjectTypeAs[aware](context.Background(), tt.input, path.Empty(), &diags) + require.Equal(t, tt.want, got) + require.Empty(t, diags) + }) + } +} + +func TestObjectValueFrom(t *testing.T) { + t.Parallel() + + tests := []struct { + name string + input *aware + want types.Object + }{ + {name: "converts nil", input: awareStructNil, want: awareObjectNil}, + {name: "converts struct", input: awareStructFull, want: awareObjectFull}, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + var diags diag.Diagnostics + got := utils.ObjectValueFrom(context.Background(), tt.input, awareType.AttrTypes, path.Empty(), &diags) + require.Equal(t, tt.want, got) + require.Empty(t, diags) + }) + } +} + +// Transforms + +func TestTransformObject(t *testing.T) { + t.Parallel() + + tests := []struct { + name string + input *naive + want *aware + }{ + {name: "converts nil", input: (*naive)(nil), want: (*aware)(nil)}, + {name: "converts struct", input: &naiveSliceFull[0], want: &awareSliceFull[0]}, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + var diags diag.Diagnostics + got := utils.TransformObject(context.Background(), tt.input, path.Empty(), &diags, + func(item naive, meta utils.ObjectMeta) aware { + return toAware(item) + }) + require.Equal(t, tt.want, got) + require.Empty(t, diags) + }) + } +} + +func TestTransformMap(t *testing.T) { + t.Parallel() + + tests := []struct { + name string + input map[string]naive + want map[string]aware + }{ + {name: "converts nil", input: naiveMapNil, want: awareMapNil}, + {name: "converts empty", input: naiveMapEmpty, want: awareMapEmpty}, + {name: "converts struct", input: naiveMapFull, want: awareMapFull}, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + var diags diag.Diagnostics + got := utils.TransformMap(context.Background(), tt.input, path.Empty(), &diags, + func(item naive, meta utils.MapMeta) aware { + return toAware(item) + }) + require.Equal(t, tt.want, got) + require.Empty(t, diags) }) } } @@ -359,24 +620,20 @@ func TestTransformSlice(t *testing.T) { input []naive want []aware }{ - {name: "converts nil", input: naiveNil, want: awareNil}, - {name: "converts empty", input: naiveEmpty, want: awareEmpty}, - {name: "converts struct", input: naiveFull, want: awareFull}, + {name: "converts nil", input: naiveSliceNil, want: awareSliceNil}, + {name: "converts empty", input: naiveSliceEmpty, want: awareSliceEmpty}, + {name: "converts struct", input: naiveSliceFull, want: awareSliceFull}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { var diags diag.Diagnostics - got := utils.TransformSlice(tt.input, path.Empty(), &diags, + got := utils.TransformSlice(context.Background(), tt.input, path.Empty(), &diags, func(item naive, meta utils.ListMeta) aware { return toAware(item) }) - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("TransformSlice() = %v, want %v", got, tt.want) - } - for _, d := range diags.Errors() { - t.Errorf("TransformSlice() diagnostic: %s: %s", d.Summary(), d.Detail()) - } + require.Equal(t, tt.want, got) + require.Empty(t, diags) }) } } @@ -389,24 +646,20 @@ func TestTransformSliceToMap(t *testing.T) { input []aware want map[string]naive }{ - {name: "converts nil", input: awareNil, want: mapNil}, - {name: "converts empty", input: awareEmpty, want: mapEmpty}, - {name: "converts struct", input: awareFull, want: mapFull}, + {name: "converts nil", input: awareSliceNil, want: naiveMapNil}, + {name: "converts empty", input: awareSliceEmpty, want: naiveMapEmpty}, + {name: "converts struct", input: awareSliceFull, want: naiveMapFull}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { var diags diag.Diagnostics - got := utils.TransformSliceToMap(tt.input, path.Empty(), &diags, + got := utils.TransformSliceToMap(context.Background(), tt.input, path.Empty(), &diags, func(item aware, meta utils.ListMeta) (string, naive) { return "k" + item.ID.ValueString()[2:], toNaive(item) }) - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("TransformSliceToMap() = %v, want %v", got, tt.want) - } - for _, d := range diags.Errors() { - t.Errorf("TransformSliceToMap() diagnostic: %s: %s", d.Summary(), d.Detail()) - } + require.Equal(t, tt.want, got) + require.Empty(t, diags) }) } } @@ -419,9 +672,9 @@ func TestTransformMapToSlice(t *testing.T) { input map[string]naive want []naive }{ - {name: "converts nil", input: mapNil, want: naiveNil}, - {name: "converts empty", input: mapEmpty, want: naiveEmpty}, - {name: "converts struct", input: mapFull, want: naiveFull}, + {name: "converts nil", input: naiveMapNil, want: naiveSliceNil}, + {name: "converts empty", input: naiveMapEmpty, want: naiveSliceEmpty}, + {name: "converts struct", input: naiveMapFull, want: naiveSliceFull}, } sortFn := func(s []naive) func(i, j int) bool { @@ -433,7 +686,7 @@ func TestTransformMapToSlice(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { var diags diag.Diagnostics - got := utils.TransformMapToSlice(tt.input, path.Empty(), &diags, + got := utils.TransformMapToSlice(context.Background(), tt.input, path.Empty(), &diags, func(item naive, meta utils.MapMeta) naive { return item }) @@ -441,12 +694,8 @@ func TestTransformMapToSlice(t *testing.T) { sort.Slice(got, sortFn(got)) sort.Slice(tt.want, sortFn(tt.want)) - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("TransformMapToSlice() = %v, want %v", got, tt.want) - } - for _, d := range diags.Errors() { - t.Errorf("TransformMapToSlice() diagnostic: %s: %s", d.Summary(), d.Detail()) - } + require.Equal(t, tt.want, got) + require.Empty(t, diags) }) } } diff --git a/internal/utils/utils.go b/internal/utils/utils.go index a5f8ddc16..336f0cef0 100644 --- a/internal/utils/utils.go +++ b/internal/utils/utils.go @@ -156,7 +156,7 @@ func Pointer[T any](value T) *T { // MapRef is similar to Pointer, in that it takes the reference of // the given value, however if the value is already nil then it returns // nil rather than a pointer to nil. -func MapRef[T any](value map[string]T) *map[string]T { +func MapRef[T any, M ~map[string]T](value M) *M { if value == nil { return nil } @@ -166,7 +166,7 @@ func MapRef[T any](value map[string]T) *map[string]T { // SliceRef is similar to Pointer, in that it takes the reference of // the given value, however if the value is already nil then it returns // nil rather than a pointer to nil. -func SliceRef[T any](value []T) *[]T { +func SliceRef[T any, S ~[]T](value S) *S { if value == nil { return nil } @@ -184,6 +184,22 @@ func Deref[T any](value *T) T { } } +// Itol converts *int to *in64. +func Itol(value *int) *int64 { + if value == nil { + return nil + } + return Pointer(int64(*value)) +} + +// Ltoi converts *int64 to *int. +func Ltoi(value *int64) *int { + if value == nil { + return nil + } + return Pointer(int(*value)) +} + func FlipMap[K comparable, V comparable](m map[K]V) map[V]K { inv := make(map[V]K) for k, v := range m { diff --git a/provider/plugin_framework.go b/provider/plugin_framework.go index 652005d65..04752f129 100644 --- a/provider/plugin_framework.go +++ b/provider/plugin_framework.go @@ -89,7 +89,7 @@ func (p *Provider) DataSources(ctx context.Context) []func() datasource.DataSour func (p *Provider) Resources(ctx context.Context) []func() resource.Resource { return []func() resource.Resource{ func() resource.Resource { return &import_saved_objects.Resource{} }, - func() resource.Resource { return &data_view.Resource{} }, + data_view.NewResource, func() resource.Resource { return &private_location.Resource{} }, func() resource.Resource { return &index.Resource{} }, func() resource.Resource { return &synthetics.Resource{} }, diff --git a/tools/kibana_gen.go b/tools/kibana_gen.go new file mode 100644 index 000000000..bd3ec3bcb --- /dev/null +++ b/tools/kibana_gen.go @@ -0,0 +1,3 @@ +package tools + +//go:generate make -C ../generated/kibana clean all From 6d9c76a6cf04297d06e110bca351d3d617acfac5 Mon Sep 17 00:00:00 2001 From: Raymond Lynch Date: Sun, 27 Oct 2024 21:13:04 -0400 Subject: [PATCH 02/15] cl --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 62dc1deeb..03edfe32b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## [Unreleased] - Use the auto-generated OAS schema from elastic/kibana for the Fleet API. ([#834](https://github.com/elastic/terraform-provider-elasticstack/issues/834)) +- Use the auto-generated OAS schema from elastic/kibana for parts of the Kibana API as applicable. Keep libs/go-kibana-rest until migration can be completed. Clean and simplify the `elasticstack_kibana_data_view` resource to match the styling of Fleet resources. ([#???](https://github.com/elastic/terraform-provider-elasticstack/issues/???)) ## [0.11.11] - 2024-10-25 From 26694dd8066f28966d4820308c4a257e7599f252 Mon Sep 17 00:00:00 2001 From: Raymond Lynch Date: Mon, 28 Oct 2024 10:14:21 -0400 Subject: [PATCH 03/15] naming --- internal/clients/kibana2/client.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/clients/kibana2/client.go b/internal/clients/kibana2/client.go index 8b478a854..44e0b409a 100644 --- a/internal/clients/kibana2/client.go +++ b/internal/clients/kibana2/client.go @@ -13,7 +13,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/logging" ) -// Config is the configuration for the fleet client. +// Config is the configuration for the Kibana client. type Config struct { URL string Username string @@ -23,14 +23,14 @@ type Config struct { CACerts []string } -// Client provides an API client for Elastic Fleet. +// Client provides an API client for Elastic Kibana. type Client struct { URL string HTTP *http.Client API *kbapi.ClientWithResponses } -// NewClient creates a new Elastic Fleet API client. +// NewClient creates a new Elastic Kibana API client. func NewClient(cfg Config) (*Client, error) { var caCertPool *x509.CertPool if len(cfg.CACerts) > 0 { @@ -68,7 +68,7 @@ func NewClient(cfg Config) (*Client, error) { endpoint += "/" } - fleetAPIClient, err := kbapi.NewClientWithResponses(endpoint, kbapi.WithHTTPClient(httpClient)) + kibanaAPIClient, err := kbapi.NewClientWithResponses(endpoint, kbapi.WithHTTPClient(httpClient)) if err != nil { return nil, fmt.Errorf("unable to create Kibana API client: %w", err) } @@ -76,7 +76,7 @@ func NewClient(cfg Config) (*Client, error) { return &Client{ URL: cfg.URL, HTTP: httpClient, - API: fleetAPIClient, + API: kibanaAPIClient, }, nil } From f87792d0e2e562e3cc141c555665be5507342b09 Mon Sep 17 00:00:00 2001 From: Raymond Lynch Date: Mon, 28 Oct 2024 10:14:44 -0400 Subject: [PATCH 04/15] remove gen-dv-client from make --- Makefile | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/Makefile b/Makefile index fdeeff99a..9a202d452 100644 --- a/Makefile +++ b/Makefile @@ -343,21 +343,6 @@ generate-alerting-client: ## generate Kibana alerting client @ rm -rf generated/alerting/go.mod generated/alerting/go.sum generated/alerting/test @ go fmt ./generated/alerting/... -.PHONY: generate-data-views-client -generate-data-views-client: ## generate Kibana data-views client - @ docker run --rm -v "${PWD}:/local" openapitools/openapi-generator-cli:v7.0.1 generate \ - -i /local/generated/data_views/bundled.yaml \ - --skip-validate-spec \ - --git-repo-id terraform-provider-elasticstack \ - --git-user-id elastic \ - -p isGoSubmodule=true \ - -p packageName=data_views \ - -p generateInterfaces=true \ - -g go \ - -o /local/generated/data_views - @ rm -rf generated/data_views/go.mod generated/data_views/go.sum generated/data_views/test - @ go fmt ./generated/data_views/... - .PHONY: generate-connectors-client generate-connectors-client: tools ## generate Kibana connectors client @ cd tools && go generate @@ -381,4 +366,4 @@ generate-slo-client: tools ## generate Kibana slo client @ go fmt ./generated/... .PHONY: generate-clients -generate-clients: generate-alerting-client generate-slo-client generate-data-views-client generate-connectors-client ## generate all clients +generate-clients: generate-alerting-client generate-slo-client generate-connectors-client ## generate all clients From 5b0edaa061ab6c7da851db14455fb9a5e44611ff Mon Sep 17 00:00:00 2001 From: Raymond Lynch Date: Mon, 28 Oct 2024 10:31:30 -0400 Subject: [PATCH 05/15] comments --- internal/utils/tfsdk.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/utils/tfsdk.go b/internal/utils/tfsdk.go index 5f14b90d2..275d467ea 100644 --- a/internal/utils/tfsdk.go +++ b/internal/utils/tfsdk.go @@ -50,7 +50,7 @@ func ValueStringPointer(value types.String) *string { // ===== Maps ===== // ================ -// MapToNormalizedType marshals a map into a jsontypes.Normalized. +// MapToNormalizedType marshals a map[string]T into a jsontypes.Normalized. func MapToNormalizedType[T any](value map[string]T, p path.Path, diags *diag.Diagnostics) jsontypes.Normalized { if value == nil { return jsontypes.NewNormalizedNull() @@ -117,7 +117,7 @@ func MapTypeAs[T any](ctx context.Context, value types.Map, p path.Path, diags * return items } -// MapValueFrom converts a tfsdk aware []T to a types.List. +// MapValueFrom converts a tfsdk aware map[string]T to a types.Map. func MapValueFrom[T any](ctx context.Context, value map[string]T, elemType attr.Type, p path.Path, diags *diag.Diagnostics) types.Map { mapping, d := types.MapValueFrom(ctx, elemType, value) diags.Append(ConvertToAttrDiags(d, p)...) @@ -225,8 +225,8 @@ func StructToObjectType[T1 any, T2 any](ctx context.Context, value *T1, attrType return obj } -// ListTypeToSlice converts a types.List first into a tfsdk aware []T1 and transforms -// the result into a []T2. +// ObjectTypeToStruct converts a types.Object first into a tfsdk aware T1 and transforms +// the result into a T2. func ObjectTypeToStruct[T1 any, T2 any](ctx context.Context, value types.Object, p path.Path, diags *diag.Diagnostics, transformee func(item T1, meta ObjectMeta) T2) *T2 { if !IsKnown(value) { return nil @@ -263,7 +263,7 @@ func ObjectValueFrom[T any](ctx context.Context, value *T, attrTypes map[string] // ===== Transforms ===== // ====================== -// TransformSlice converts T1 to T2 via the iteratee. +// TransformObject converts T1 to T2 via the transformee. func TransformObject[T1 any, T2 any](ctx context.Context, value *T1, p path.Path, diags *diag.Diagnostics, transformee func(item T1, meta ObjectMeta) T2) *T2 { if value == nil { return nil From 9b52b4a1b52dd8bcc7fcbb3af2d20de9dc191012 Mon Sep 17 00:00:00 2001 From: Raymond Lynch Date: Mon, 28 Oct 2024 11:05:49 -0400 Subject: [PATCH 06/15] changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 03edfe32b..6f0d2c602 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ ## [Unreleased] - Use the auto-generated OAS schema from elastic/kibana for the Fleet API. ([#834](https://github.com/elastic/terraform-provider-elasticstack/issues/834)) -- Use the auto-generated OAS schema from elastic/kibana for parts of the Kibana API as applicable. Keep libs/go-kibana-rest until migration can be completed. Clean and simplify the `elasticstack_kibana_data_view` resource to match the styling of Fleet resources. ([#???](https://github.com/elastic/terraform-provider-elasticstack/issues/???)) +- Use the auto-generated OAS schema from elastic/kibana for parts of the Kibana API as applicable. Keep libs/go-kibana-rest until migration can be completed. Clean and simplify the `elasticstack_kibana_data_view` resource to match the styling of Fleet resources. ([#881](https://github.com/elastic/terraform-provider-elasticstack/issues/881)) ## [0.11.11] - 2024-10-25 From 052945f3363ab3aa1a7a2eb95335ad286c3fbee2 Mon Sep 17 00:00:00 2001 From: Raymond Lynch Date: Tue, 29 Oct 2024 12:06:31 -0400 Subject: [PATCH 07/15] merge generated kibana/fleet apis --- generated/fleet/.gitignore | 2 - generated/fleet/Makefile | 34 - generated/fleet/fleet.gen.go | 16559 --------------- generated/fleet/oapi-config.yaml | 9 - generated/fleet/transform_schema.go | 1054 - generated/kibana/kibana.gen.go | 16649 +++++++++++++++- generated/kibana/transform_schema.go | 275 +- internal/clients/fleet/client.go | 6 +- internal/clients/fleet/fleet.go | 64 +- internal/fleet/agent_policy/models.go | 28 +- internal/fleet/enrollment_tokens/models.go | 6 +- internal/fleet/enrollment_tokens/read.go | 4 +- internal/fleet/integration_ds/models.go | 4 +- internal/fleet/integration_policy/models.go | 20 +- internal/fleet/integration_policy/secrets.go | 8 +- .../fleet/integration_policy/secrets_test.go | 36 +- internal/fleet/output/models.go | 34 +- internal/fleet/server_host/models.go | 12 +- tools/fleet_gen.go | 3 - 19 files changed, 16914 insertions(+), 17893 deletions(-) delete mode 100644 generated/fleet/.gitignore delete mode 100644 generated/fleet/Makefile delete mode 100644 generated/fleet/fleet.gen.go delete mode 100644 generated/fleet/oapi-config.yaml delete mode 100644 generated/fleet/transform_schema.go delete mode 100644 tools/fleet_gen.go diff --git a/generated/fleet/.gitignore b/generated/fleet/.gitignore deleted file mode 100644 index 1ec8ffcc0..000000000 --- a/generated/fleet/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -oas.yaml -oas-filtered.yaml diff --git a/generated/fleet/Makefile b/generated/fleet/Makefile deleted file mode 100644 index 70a7690e7..000000000 --- a/generated/fleet/Makefile +++ /dev/null @@ -1,34 +0,0 @@ -.DEFAULT_GOAL = help -SHELL := /bin/bash -ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) - -github_ref := refs/heads/main -oas_url := https://raw.githubusercontent.com/elastic/kibana/$(github_ref)/oas_docs/output/kibana.yaml - -.PHONY: all -all: download transform generate ## Fetch, bundle, transform, and generate the API - - -.PHONY: download -download: oas.yaml ## Download the remote schema - -oas.yaml: - curl -sSo oas.yaml "$(oas_url)" - -.PHONY: transform -transform: download ## Transform and filter the schema - go run $(ROOT_DIR)/transform_schema.go -i ./oas.yaml -o ./oas-filtered.yaml - -.PHONY: generate -generate: ## Generate the API - go run github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen@v2.4.1 -config oapi-config.yaml ./oas-filtered.yaml - - -.PHONY: clean -clean: ## Remove any downloaded files - rm -rf oas.yaml oas-filtered.yaml - - -.PHONY: help -help: ## Show this help - @ awk 'BEGIN {FS = ":.*##"; printf "Usage: make \033[36m\033[0m\n\nTargets:\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-10s\033[0m\t%s\n", $$1, $$2 }' $(MAKEFILE_LIST) | column -s$$'\t' -t diff --git a/generated/fleet/fleet.gen.go b/generated/fleet/fleet.gen.go deleted file mode 100644 index 47987097e..000000000 --- a/generated/fleet/fleet.gen.go +++ /dev/null @@ -1,16559 +0,0 @@ -// Package fleetapi provides primitives to interact with the openapi HTTP API. -// -// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.4.1 DO NOT EDIT. -package fleetapi - -import ( - "bytes" - "context" - "encoding/json" - "errors" - "fmt" - "io" - "net/http" - "net/url" - "strings" - - "github.com/oapi-codegen/runtime" -) - -const ( - ApiKeyAuthScopes = "apiKeyAuth.Scopes" - BasicAuthScopes = "basicAuth.Scopes" -) - -// Defines values for AgentPolicyMonitoringEnabled. -const ( - AgentPolicyMonitoringEnabledLogs AgentPolicyMonitoringEnabled = "logs" - AgentPolicyMonitoringEnabledMetrics AgentPolicyMonitoringEnabled = "metrics" - AgentPolicyMonitoringEnabledTraces AgentPolicyMonitoringEnabled = "traces" -) - -// Defines values for AgentPolicyPackagePolicies1InputsStreamsRelease. -const ( - AgentPolicyPackagePolicies1InputsStreamsReleaseBeta AgentPolicyPackagePolicies1InputsStreamsRelease = "beta" - AgentPolicyPackagePolicies1InputsStreamsReleaseExperimental AgentPolicyPackagePolicies1InputsStreamsRelease = "experimental" - AgentPolicyPackagePolicies1InputsStreamsReleaseGa AgentPolicyPackagePolicies1InputsStreamsRelease = "ga" -) - -// Defines values for AgentPolicyStatus. -const ( - Active AgentPolicyStatus = "active" - Inactive AgentPolicyStatus = "inactive" -) - -// Defines values for NewOutputElasticsearchPreset. -const ( - NewOutputElasticsearchPresetBalanced NewOutputElasticsearchPreset = "balanced" - NewOutputElasticsearchPresetCustom NewOutputElasticsearchPreset = "custom" - NewOutputElasticsearchPresetLatency NewOutputElasticsearchPreset = "latency" - NewOutputElasticsearchPresetScale NewOutputElasticsearchPreset = "scale" - NewOutputElasticsearchPresetThroughput NewOutputElasticsearchPreset = "throughput" -) - -// Defines values for NewOutputElasticsearchType. -const ( - NewOutputElasticsearchTypeElasticsearch NewOutputElasticsearchType = "elasticsearch" -) - -// Defines values for NewOutputKafkaAuthType. -const ( - NewOutputKafkaAuthTypeKerberos NewOutputKafkaAuthType = "kerberos" - NewOutputKafkaAuthTypeNone NewOutputKafkaAuthType = "none" - NewOutputKafkaAuthTypeSsl NewOutputKafkaAuthType = "ssl" - NewOutputKafkaAuthTypeUserPass NewOutputKafkaAuthType = "user_pass" -) - -// Defines values for NewOutputKafkaCompression. -const ( - NewOutputKafkaCompressionGzip NewOutputKafkaCompression = "gzip" - NewOutputKafkaCompressionLz4 NewOutputKafkaCompression = "lz4" - NewOutputKafkaCompressionNone NewOutputKafkaCompression = "none" - NewOutputKafkaCompressionSnappy NewOutputKafkaCompression = "snappy" -) - -// Defines values for NewOutputKafkaPartition. -const ( - NewOutputKafkaPartitionHash NewOutputKafkaPartition = "hash" - NewOutputKafkaPartitionRandom NewOutputKafkaPartition = "random" - NewOutputKafkaPartitionRoundRobin NewOutputKafkaPartition = "round_robin" -) - -// Defines values for NewOutputKafkaRequiredAcks. -const ( - NewOutputKafkaRequiredAcksMinus1 NewOutputKafkaRequiredAcks = -1 - NewOutputKafkaRequiredAcksN0 NewOutputKafkaRequiredAcks = 0 - NewOutputKafkaRequiredAcksN1 NewOutputKafkaRequiredAcks = 1 -) - -// Defines values for NewOutputKafkaSaslMechanism. -const ( - NewOutputKafkaSaslMechanismPLAIN NewOutputKafkaSaslMechanism = "PLAIN" - NewOutputKafkaSaslMechanismSCRAMSHA256 NewOutputKafkaSaslMechanism = "SCRAM-SHA-256" - NewOutputKafkaSaslMechanismSCRAMSHA512 NewOutputKafkaSaslMechanism = "SCRAM-SHA-512" -) - -// Defines values for NewOutputKafkaTopicsWhenType. -const ( - NewOutputKafkaTopicsWhenTypeContains NewOutputKafkaTopicsWhenType = "contains" - NewOutputKafkaTopicsWhenTypeEquals NewOutputKafkaTopicsWhenType = "equals" - NewOutputKafkaTopicsWhenTypeRegexp NewOutputKafkaTopicsWhenType = "regexp" -) - -// Defines values for NewOutputKafkaType. -const ( - NewOutputKafkaTypeKafka NewOutputKafkaType = "kafka" -) - -// Defines values for NewOutputLogstashType. -const ( - NewOutputLogstashTypeLogstash NewOutputLogstashType = "logstash" -) - -// Defines values for NewOutputRemoteElasticsearchPreset. -const ( - NewOutputRemoteElasticsearchPresetBalanced NewOutputRemoteElasticsearchPreset = "balanced" - NewOutputRemoteElasticsearchPresetCustom NewOutputRemoteElasticsearchPreset = "custom" - NewOutputRemoteElasticsearchPresetLatency NewOutputRemoteElasticsearchPreset = "latency" - NewOutputRemoteElasticsearchPresetScale NewOutputRemoteElasticsearchPreset = "scale" - NewOutputRemoteElasticsearchPresetThroughput NewOutputRemoteElasticsearchPreset = "throughput" -) - -// Defines values for NewOutputRemoteElasticsearchType. -const ( - NewOutputRemoteElasticsearchTypeRemoteElasticsearch NewOutputRemoteElasticsearchType = "remote_elasticsearch" -) - -// Defines values for NewOutputSslVerificationMode. -const ( - NewOutputSslVerificationModeCertificate NewOutputSslVerificationMode = "certificate" - NewOutputSslVerificationModeFull NewOutputSslVerificationMode = "full" - NewOutputSslVerificationModeNone NewOutputSslVerificationMode = "none" - NewOutputSslVerificationModeStrict NewOutputSslVerificationMode = "strict" -) - -// Defines values for OutputElasticsearchPreset. -const ( - OutputElasticsearchPresetBalanced OutputElasticsearchPreset = "balanced" - OutputElasticsearchPresetCustom OutputElasticsearchPreset = "custom" - OutputElasticsearchPresetLatency OutputElasticsearchPreset = "latency" - OutputElasticsearchPresetScale OutputElasticsearchPreset = "scale" - OutputElasticsearchPresetThroughput OutputElasticsearchPreset = "throughput" -) - -// Defines values for OutputElasticsearchType. -const ( - OutputElasticsearchTypeElasticsearch OutputElasticsearchType = "elasticsearch" -) - -// Defines values for OutputKafkaAuthType. -const ( - OutputKafkaAuthTypeKerberos OutputKafkaAuthType = "kerberos" - OutputKafkaAuthTypeNone OutputKafkaAuthType = "none" - OutputKafkaAuthTypeSsl OutputKafkaAuthType = "ssl" - OutputKafkaAuthTypeUserPass OutputKafkaAuthType = "user_pass" -) - -// Defines values for OutputKafkaCompression. -const ( - OutputKafkaCompressionGzip OutputKafkaCompression = "gzip" - OutputKafkaCompressionLz4 OutputKafkaCompression = "lz4" - OutputKafkaCompressionNone OutputKafkaCompression = "none" - OutputKafkaCompressionSnappy OutputKafkaCompression = "snappy" -) - -// Defines values for OutputKafkaPartition. -const ( - OutputKafkaPartitionHash OutputKafkaPartition = "hash" - OutputKafkaPartitionRandom OutputKafkaPartition = "random" - OutputKafkaPartitionRoundRobin OutputKafkaPartition = "round_robin" -) - -// Defines values for OutputKafkaRequiredAcks. -const ( - OutputKafkaRequiredAcksMinus1 OutputKafkaRequiredAcks = -1 - OutputKafkaRequiredAcksN0 OutputKafkaRequiredAcks = 0 - OutputKafkaRequiredAcksN1 OutputKafkaRequiredAcks = 1 -) - -// Defines values for OutputKafkaSaslMechanism. -const ( - OutputKafkaSaslMechanismPLAIN OutputKafkaSaslMechanism = "PLAIN" - OutputKafkaSaslMechanismSCRAMSHA256 OutputKafkaSaslMechanism = "SCRAM-SHA-256" - OutputKafkaSaslMechanismSCRAMSHA512 OutputKafkaSaslMechanism = "SCRAM-SHA-512" -) - -// Defines values for OutputKafkaTopicsWhenType. -const ( - OutputKafkaTopicsWhenTypeContains OutputKafkaTopicsWhenType = "contains" - OutputKafkaTopicsWhenTypeEquals OutputKafkaTopicsWhenType = "equals" - OutputKafkaTopicsWhenTypeRegexp OutputKafkaTopicsWhenType = "regexp" -) - -// Defines values for OutputKafkaType. -const ( - OutputKafkaTypeKafka OutputKafkaType = "kafka" -) - -// Defines values for OutputLogstashType. -const ( - OutputLogstashTypeLogstash OutputLogstashType = "logstash" -) - -// Defines values for OutputRemoteElasticsearchPreset. -const ( - OutputRemoteElasticsearchPresetBalanced OutputRemoteElasticsearchPreset = "balanced" - OutputRemoteElasticsearchPresetCustom OutputRemoteElasticsearchPreset = "custom" - OutputRemoteElasticsearchPresetLatency OutputRemoteElasticsearchPreset = "latency" - OutputRemoteElasticsearchPresetScale OutputRemoteElasticsearchPreset = "scale" - OutputRemoteElasticsearchPresetThroughput OutputRemoteElasticsearchPreset = "throughput" -) - -// Defines values for OutputRemoteElasticsearchType. -const ( - OutputRemoteElasticsearchTypeRemoteElasticsearch OutputRemoteElasticsearchType = "remote_elasticsearch" -) - -// Defines values for OutputSslVerificationMode. -const ( - OutputSslVerificationModeCertificate OutputSslVerificationMode = "certificate" - OutputSslVerificationModeFull OutputSslVerificationMode = "full" - OutputSslVerificationModeNone OutputSslVerificationMode = "none" - OutputSslVerificationModeStrict OutputSslVerificationMode = "strict" -) - -// Defines values for PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType. -const ( - PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaTypeCspRuleTemplate PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType = "csp-rule-template" - PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaTypeDashboard PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType = "dashboard" - PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaTypeIndexPattern PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType = "index-pattern" - PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaTypeLens PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType = "lens" - PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaTypeMap PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType = "map" - PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaTypeMlModule PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType = "ml-module" - PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaTypeOsqueryPackAsset PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType = "osquery-pack-asset" - PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaTypeOsquerySavedQuery PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType = "osquery-saved-query" - PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaTypeSearch PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType = "search" - PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaTypeSecurityRule PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType = "security-rule" - PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaTypeTag PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType = "tag" - PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaTypeVisualization PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType = "visualization" -) - -// Defines values for PackageInfoInstallationInfoInstallSource. -const ( - PackageInfoInstallationInfoInstallSourceBundled PackageInfoInstallationInfoInstallSource = "bundled" - PackageInfoInstallationInfoInstallSourceCustom PackageInfoInstallationInfoInstallSource = "custom" - PackageInfoInstallationInfoInstallSourceRegistry PackageInfoInstallationInfoInstallSource = "registry" - PackageInfoInstallationInfoInstallSourceUpload PackageInfoInstallationInfoInstallSource = "upload" -) - -// Defines values for PackageInfoInstallationInfoInstallStatus. -const ( - PackageInfoInstallationInfoInstallStatusInstallFailed PackageInfoInstallationInfoInstallStatus = "install_failed" - PackageInfoInstallationInfoInstallStatusInstalled PackageInfoInstallationInfoInstallStatus = "installed" - PackageInfoInstallationInfoInstallStatusInstalling PackageInfoInstallationInfoInstallStatus = "installing" -) - -// Defines values for PackageInfoInstallationInfoInstalledEsType. -const ( - PackageInfoInstallationInfoInstalledEsTypeComponentTemplate PackageInfoInstallationInfoInstalledEsType = "component_template" - PackageInfoInstallationInfoInstalledEsTypeDataStreamIlmPolicy PackageInfoInstallationInfoInstalledEsType = "data_stream_ilm_policy" - PackageInfoInstallationInfoInstalledEsTypeIlmPolicy PackageInfoInstallationInfoInstalledEsType = "ilm_policy" - PackageInfoInstallationInfoInstalledEsTypeIndex PackageInfoInstallationInfoInstalledEsType = "index" - PackageInfoInstallationInfoInstalledEsTypeIndexTemplate PackageInfoInstallationInfoInstalledEsType = "index_template" - PackageInfoInstallationInfoInstalledEsTypeIngestPipeline PackageInfoInstallationInfoInstalledEsType = "ingest_pipeline" - PackageInfoInstallationInfoInstalledEsTypeMlModel PackageInfoInstallationInfoInstalledEsType = "ml_model" - PackageInfoInstallationInfoInstalledEsTypeTransform PackageInfoInstallationInfoInstalledEsType = "transform" -) - -// Defines values for PackageInfoInstallationInfoInstalledKibanaType. -const ( - PackageInfoInstallationInfoInstalledKibanaTypeCspRuleTemplate PackageInfoInstallationInfoInstalledKibanaType = "csp-rule-template" - PackageInfoInstallationInfoInstalledKibanaTypeDashboard PackageInfoInstallationInfoInstalledKibanaType = "dashboard" - PackageInfoInstallationInfoInstalledKibanaTypeIndexPattern PackageInfoInstallationInfoInstalledKibanaType = "index-pattern" - PackageInfoInstallationInfoInstalledKibanaTypeLens PackageInfoInstallationInfoInstalledKibanaType = "lens" - PackageInfoInstallationInfoInstalledKibanaTypeMap PackageInfoInstallationInfoInstalledKibanaType = "map" - PackageInfoInstallationInfoInstalledKibanaTypeMlModule PackageInfoInstallationInfoInstalledKibanaType = "ml-module" - PackageInfoInstallationInfoInstalledKibanaTypeOsqueryPackAsset PackageInfoInstallationInfoInstalledKibanaType = "osquery-pack-asset" - PackageInfoInstallationInfoInstalledKibanaTypeOsquerySavedQuery PackageInfoInstallationInfoInstalledKibanaType = "osquery-saved-query" - PackageInfoInstallationInfoInstalledKibanaTypeSearch PackageInfoInstallationInfoInstalledKibanaType = "search" - PackageInfoInstallationInfoInstalledKibanaTypeSecurityRule PackageInfoInstallationInfoInstalledKibanaType = "security-rule" - PackageInfoInstallationInfoInstalledKibanaTypeTag PackageInfoInstallationInfoInstalledKibanaType = "tag" - PackageInfoInstallationInfoInstalledKibanaTypeVisualization PackageInfoInstallationInfoInstalledKibanaType = "visualization" -) - -// Defines values for PackageInfoInstallationInfoVerificationStatus. -const ( - PackageInfoInstallationInfoVerificationStatusUnknown PackageInfoInstallationInfoVerificationStatus = "unknown" - PackageInfoInstallationInfoVerificationStatusUnverified PackageInfoInstallationInfoVerificationStatus = "unverified" - PackageInfoInstallationInfoVerificationStatusVerified PackageInfoInstallationInfoVerificationStatus = "verified" -) - -// Defines values for PackageInfoOwnerType. -const ( - PackageInfoOwnerTypeCommunity PackageInfoOwnerType = "community" - PackageInfoOwnerTypeElastic PackageInfoOwnerType = "elastic" - PackageInfoOwnerTypePartner PackageInfoOwnerType = "partner" -) - -// Defines values for PackageInfoRelease. -const ( - PackageInfoReleaseBeta PackageInfoRelease = "beta" - PackageInfoReleaseExperimental PackageInfoRelease = "experimental" - PackageInfoReleaseGa PackageInfoRelease = "ga" -) - -// Defines values for PackageInfoType. -const ( - PackageInfoTypeContent PackageInfoType = "content" - PackageInfoTypeInput PackageInfoType = "input" - PackageInfoTypeIntegration PackageInfoType = "integration" -) - -// Defines values for PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType. -const ( - PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaTypeCspRuleTemplate PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType = "csp-rule-template" - PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaTypeDashboard PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType = "dashboard" - PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaTypeIndexPattern PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType = "index-pattern" - PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaTypeLens PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType = "lens" - PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaTypeMap PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType = "map" - PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaTypeMlModule PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType = "ml-module" - PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaTypeOsqueryPackAsset PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType = "osquery-pack-asset" - PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaTypeOsquerySavedQuery PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType = "osquery-saved-query" - PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaTypeSearch PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType = "search" - PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaTypeSecurityRule PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType = "security-rule" - PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaTypeTag PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType = "tag" - PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaTypeVisualization PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType = "visualization" -) - -// Defines values for PackageListItemInstallationInfoInstallSource. -const ( - PackageListItemInstallationInfoInstallSourceBundled PackageListItemInstallationInfoInstallSource = "bundled" - PackageListItemInstallationInfoInstallSourceCustom PackageListItemInstallationInfoInstallSource = "custom" - PackageListItemInstallationInfoInstallSourceRegistry PackageListItemInstallationInfoInstallSource = "registry" - PackageListItemInstallationInfoInstallSourceUpload PackageListItemInstallationInfoInstallSource = "upload" -) - -// Defines values for PackageListItemInstallationInfoInstallStatus. -const ( - PackageListItemInstallationInfoInstallStatusInstallFailed PackageListItemInstallationInfoInstallStatus = "install_failed" - PackageListItemInstallationInfoInstallStatusInstalled PackageListItemInstallationInfoInstallStatus = "installed" - PackageListItemInstallationInfoInstallStatusInstalling PackageListItemInstallationInfoInstallStatus = "installing" -) - -// Defines values for PackageListItemInstallationInfoInstalledEsType. -const ( - PackageListItemInstallationInfoInstalledEsTypeComponentTemplate PackageListItemInstallationInfoInstalledEsType = "component_template" - PackageListItemInstallationInfoInstalledEsTypeDataStreamIlmPolicy PackageListItemInstallationInfoInstalledEsType = "data_stream_ilm_policy" - PackageListItemInstallationInfoInstalledEsTypeIlmPolicy PackageListItemInstallationInfoInstalledEsType = "ilm_policy" - PackageListItemInstallationInfoInstalledEsTypeIndex PackageListItemInstallationInfoInstalledEsType = "index" - PackageListItemInstallationInfoInstalledEsTypeIndexTemplate PackageListItemInstallationInfoInstalledEsType = "index_template" - PackageListItemInstallationInfoInstalledEsTypeIngestPipeline PackageListItemInstallationInfoInstalledEsType = "ingest_pipeline" - PackageListItemInstallationInfoInstalledEsTypeMlModel PackageListItemInstallationInfoInstalledEsType = "ml_model" - PackageListItemInstallationInfoInstalledEsTypeTransform PackageListItemInstallationInfoInstalledEsType = "transform" -) - -// Defines values for PackageListItemInstallationInfoInstalledKibanaType. -const ( - PackageListItemInstallationInfoInstalledKibanaTypeCspRuleTemplate PackageListItemInstallationInfoInstalledKibanaType = "csp-rule-template" - PackageListItemInstallationInfoInstalledKibanaTypeDashboard PackageListItemInstallationInfoInstalledKibanaType = "dashboard" - PackageListItemInstallationInfoInstalledKibanaTypeIndexPattern PackageListItemInstallationInfoInstalledKibanaType = "index-pattern" - PackageListItemInstallationInfoInstalledKibanaTypeLens PackageListItemInstallationInfoInstalledKibanaType = "lens" - PackageListItemInstallationInfoInstalledKibanaTypeMap PackageListItemInstallationInfoInstalledKibanaType = "map" - PackageListItemInstallationInfoInstalledKibanaTypeMlModule PackageListItemInstallationInfoInstalledKibanaType = "ml-module" - PackageListItemInstallationInfoInstalledKibanaTypeOsqueryPackAsset PackageListItemInstallationInfoInstalledKibanaType = "osquery-pack-asset" - PackageListItemInstallationInfoInstalledKibanaTypeOsquerySavedQuery PackageListItemInstallationInfoInstalledKibanaType = "osquery-saved-query" - PackageListItemInstallationInfoInstalledKibanaTypeSearch PackageListItemInstallationInfoInstalledKibanaType = "search" - PackageListItemInstallationInfoInstalledKibanaTypeSecurityRule PackageListItemInstallationInfoInstalledKibanaType = "security-rule" - PackageListItemInstallationInfoInstalledKibanaTypeTag PackageListItemInstallationInfoInstalledKibanaType = "tag" - PackageListItemInstallationInfoInstalledKibanaTypeVisualization PackageListItemInstallationInfoInstalledKibanaType = "visualization" -) - -// Defines values for PackageListItemInstallationInfoVerificationStatus. -const ( - PackageListItemInstallationInfoVerificationStatusUnknown PackageListItemInstallationInfoVerificationStatus = "unknown" - PackageListItemInstallationInfoVerificationStatusUnverified PackageListItemInstallationInfoVerificationStatus = "unverified" - PackageListItemInstallationInfoVerificationStatusVerified PackageListItemInstallationInfoVerificationStatus = "verified" -) - -// Defines values for PackageListItemOwnerType. -const ( - PackageListItemOwnerTypeCommunity PackageListItemOwnerType = "community" - PackageListItemOwnerTypeElastic PackageListItemOwnerType = "elastic" - PackageListItemOwnerTypePartner PackageListItemOwnerType = "partner" -) - -// Defines values for PackageListItemRelease. -const ( - Beta PackageListItemRelease = "beta" - Experimental PackageListItemRelease = "experimental" - Ga PackageListItemRelease = "ga" -) - -// Defines values for PackageListItemType. -const ( - PackageListItemTypeContent PackageListItemType = "content" - PackageListItemTypeInput PackageListItemType = "input" - PackageListItemTypeIntegration PackageListItemType = "integration" -) - -// Defines values for UpdateOutputElasticsearchPreset. -const ( - UpdateOutputElasticsearchPresetBalanced UpdateOutputElasticsearchPreset = "balanced" - UpdateOutputElasticsearchPresetCustom UpdateOutputElasticsearchPreset = "custom" - UpdateOutputElasticsearchPresetLatency UpdateOutputElasticsearchPreset = "latency" - UpdateOutputElasticsearchPresetScale UpdateOutputElasticsearchPreset = "scale" - UpdateOutputElasticsearchPresetThroughput UpdateOutputElasticsearchPreset = "throughput" -) - -// Defines values for UpdateOutputElasticsearchType. -const ( - Elasticsearch UpdateOutputElasticsearchType = "elasticsearch" -) - -// Defines values for UpdateOutputKafkaAuthType. -const ( - UpdateOutputKafkaAuthTypeKerberos UpdateOutputKafkaAuthType = "kerberos" - UpdateOutputKafkaAuthTypeNone UpdateOutputKafkaAuthType = "none" - UpdateOutputKafkaAuthTypeSsl UpdateOutputKafkaAuthType = "ssl" - UpdateOutputKafkaAuthTypeUserPass UpdateOutputKafkaAuthType = "user_pass" -) - -// Defines values for UpdateOutputKafkaCompression. -const ( - UpdateOutputKafkaCompressionGzip UpdateOutputKafkaCompression = "gzip" - UpdateOutputKafkaCompressionLz4 UpdateOutputKafkaCompression = "lz4" - UpdateOutputKafkaCompressionNone UpdateOutputKafkaCompression = "none" - UpdateOutputKafkaCompressionSnappy UpdateOutputKafkaCompression = "snappy" -) - -// Defines values for UpdateOutputKafkaPartition. -const ( - Hash UpdateOutputKafkaPartition = "hash" - Random UpdateOutputKafkaPartition = "random" - RoundRobin UpdateOutputKafkaPartition = "round_robin" -) - -// Defines values for UpdateOutputKafkaRequiredAcks. -const ( - Minus1 UpdateOutputKafkaRequiredAcks = -1 - N0 UpdateOutputKafkaRequiredAcks = 0 - N1 UpdateOutputKafkaRequiredAcks = 1 -) - -// Defines values for UpdateOutputKafkaSaslMechanism. -const ( - PLAIN UpdateOutputKafkaSaslMechanism = "PLAIN" - SCRAMSHA256 UpdateOutputKafkaSaslMechanism = "SCRAM-SHA-256" - SCRAMSHA512 UpdateOutputKafkaSaslMechanism = "SCRAM-SHA-512" -) - -// Defines values for UpdateOutputKafkaTopicsWhenType. -const ( - Contains UpdateOutputKafkaTopicsWhenType = "contains" - Equals UpdateOutputKafkaTopicsWhenType = "equals" - Regexp UpdateOutputKafkaTopicsWhenType = "regexp" -) - -// Defines values for UpdateOutputKafkaType. -const ( - Kafka UpdateOutputKafkaType = "kafka" -) - -// Defines values for UpdateOutputLogstashType. -const ( - Logstash UpdateOutputLogstashType = "logstash" -) - -// Defines values for UpdateOutputRemoteElasticsearchPreset. -const ( - UpdateOutputRemoteElasticsearchPresetBalanced UpdateOutputRemoteElasticsearchPreset = "balanced" - UpdateOutputRemoteElasticsearchPresetCustom UpdateOutputRemoteElasticsearchPreset = "custom" - UpdateOutputRemoteElasticsearchPresetLatency UpdateOutputRemoteElasticsearchPreset = "latency" - UpdateOutputRemoteElasticsearchPresetScale UpdateOutputRemoteElasticsearchPreset = "scale" - UpdateOutputRemoteElasticsearchPresetThroughput UpdateOutputRemoteElasticsearchPreset = "throughput" -) - -// Defines values for UpdateOutputRemoteElasticsearchType. -const ( - RemoteElasticsearch UpdateOutputRemoteElasticsearchType = "remote_elasticsearch" -) - -// Defines values for UpdateOutputSslVerificationMode. -const ( - Certificate UpdateOutputSslVerificationMode = "certificate" - Full UpdateOutputSslVerificationMode = "full" - None UpdateOutputSslVerificationMode = "none" - Strict UpdateOutputSslVerificationMode = "strict" -) - -// Defines values for GetAgentPoliciesParamsSortOrder. -const ( - GetAgentPoliciesParamsSortOrderAsc GetAgentPoliciesParamsSortOrder = "asc" - GetAgentPoliciesParamsSortOrderDesc GetAgentPoliciesParamsSortOrder = "desc" -) - -// Defines values for GetAgentPoliciesParamsFormat. -const ( - GetAgentPoliciesParamsFormatLegacy GetAgentPoliciesParamsFormat = "legacy" - GetAgentPoliciesParamsFormatSimplified GetAgentPoliciesParamsFormat = "simplified" -) - -// Defines values for CreateAgentPolicyJSONBodyMonitoringEnabled. -const ( - CreateAgentPolicyJSONBodyMonitoringEnabledLogs CreateAgentPolicyJSONBodyMonitoringEnabled = "logs" - CreateAgentPolicyJSONBodyMonitoringEnabledMetrics CreateAgentPolicyJSONBodyMonitoringEnabled = "metrics" - CreateAgentPolicyJSONBodyMonitoringEnabledTraces CreateAgentPolicyJSONBodyMonitoringEnabled = "traces" -) - -// Defines values for GetAgentPolicyParamsFormat. -const ( - GetAgentPolicyParamsFormatLegacy GetAgentPolicyParamsFormat = "legacy" - GetAgentPolicyParamsFormatSimplified GetAgentPolicyParamsFormat = "simplified" -) - -// Defines values for UpdateAgentPolicyParamsFormat. -const ( - UpdateAgentPolicyParamsFormatLegacy UpdateAgentPolicyParamsFormat = "legacy" - UpdateAgentPolicyParamsFormatSimplified UpdateAgentPolicyParamsFormat = "simplified" -) - -// Defines values for UpdateAgentPolicyJSONBodyMonitoringEnabled. -const ( - Logs UpdateAgentPolicyJSONBodyMonitoringEnabled = "logs" - Metrics UpdateAgentPolicyJSONBodyMonitoringEnabled = "metrics" - Traces UpdateAgentPolicyJSONBodyMonitoringEnabled = "traces" -) - -// Defines values for GetPackagePoliciesParamsSortOrder. -const ( - GetPackagePoliciesParamsSortOrderAsc GetPackagePoliciesParamsSortOrder = "asc" - GetPackagePoliciesParamsSortOrderDesc GetPackagePoliciesParamsSortOrder = "desc" -) - -// Defines values for GetPackagePoliciesParamsFormat. -const ( - GetPackagePoliciesParamsFormatLegacy GetPackagePoliciesParamsFormat = "legacy" - GetPackagePoliciesParamsFormatSimplified GetPackagePoliciesParamsFormat = "simplified" -) - -// Defines values for CreatePackagePolicyParamsFormat. -const ( - CreatePackagePolicyParamsFormatLegacy CreatePackagePolicyParamsFormat = "legacy" - CreatePackagePolicyParamsFormatSimplified CreatePackagePolicyParamsFormat = "simplified" -) - -// Defines values for GetPackagePolicyParamsFormat. -const ( - GetPackagePolicyParamsFormatLegacy GetPackagePolicyParamsFormat = "legacy" - GetPackagePolicyParamsFormatSimplified GetPackagePolicyParamsFormat = "simplified" -) - -// Defines values for UpdatePackagePolicyParamsFormat. -const ( - Legacy UpdatePackagePolicyParamsFormat = "legacy" - Simplified UpdatePackagePolicyParamsFormat = "simplified" -) - -// AgentPolicy defines model for agent_policy. -type AgentPolicy struct { - AdvancedSettings *struct { - AgentDownloadTargetDirectory *interface{} `json:"agent_download_target_directory"` - AgentDownloadTimeout *interface{} `json:"agent_download_timeout"` - AgentLimitsGoMaxProcs *interface{} `json:"agent_limits_go_max_procs"` - AgentLoggingLevel *interface{} `json:"agent_logging_level"` - AgentLoggingMetricsPeriod *interface{} `json:"agent_logging_metrics_period"` - } `json:"advanced_settings,omitempty"` - AgentFeatures *[]struct { - Enabled bool `json:"enabled"` - Name string `json:"name"` - } `json:"agent_features,omitempty"` - Agents *float32 `json:"agents,omitempty"` - DataOutputId *string `json:"data_output_id"` - Description *string `json:"description,omitempty"` - DownloadSourceId *string `json:"download_source_id"` - FleetServerHostId *string `json:"fleet_server_host_id"` - - // GlobalDataTags User defined data tags that are added to all of the inputs. The values can be strings or numbers. - GlobalDataTags *[]struct { - Name string `json:"name"` - Value AgentPolicy_GlobalDataTags_Value `json:"value"` - } `json:"global_data_tags,omitempty"` - HasFleetServer *bool `json:"has_fleet_server,omitempty"` - Id string `json:"id"` - InactivityTimeout *float32 `json:"inactivity_timeout,omitempty"` - IsDefault *bool `json:"is_default,omitempty"` - IsDefaultFleetServer *bool `json:"is_default_fleet_server,omitempty"` - IsManaged bool `json:"is_managed"` - IsPreconfigured *bool `json:"is_preconfigured,omitempty"` - - // IsProtected Indicates whether the agent policy has tamper protection enabled. Default false. - IsProtected bool `json:"is_protected"` - - // KeepMonitoringAlive When set to true, monitoring will be enabled but logs/metrics collection will be disabled - KeepMonitoringAlive *bool `json:"keep_monitoring_alive"` - MonitoringDiagnostics *struct { - Limit *struct { - Burst *float32 `json:"burst,omitempty"` - Interval *string `json:"interval,omitempty"` - } `json:"limit,omitempty"` - Uploader *struct { - InitDur *string `json:"init_dur,omitempty"` - MaxDur *string `json:"max_dur,omitempty"` - MaxRetries *float32 `json:"max_retries,omitempty"` - } `json:"uploader,omitempty"` - } `json:"monitoring_diagnostics,omitempty"` - MonitoringEnabled *[]AgentPolicyMonitoringEnabled `json:"monitoring_enabled,omitempty"` - MonitoringHttp *struct { - Buffer *struct { - Enabled *bool `json:"enabled,omitempty"` - } `json:"buffer,omitempty"` - Enabled bool `json:"enabled"` - Host *string `json:"host,omitempty"` - Port *float32 `json:"port,omitempty"` - } `json:"monitoring_http,omitempty"` - MonitoringOutputId *string `json:"monitoring_output_id"` - MonitoringPprofEnabled *bool `json:"monitoring_pprof_enabled,omitempty"` - Name string `json:"name"` - Namespace string `json:"namespace"` - - // Overrides Override settings that are defined in the agent policy. Input settings cannot be overridden. The override option should be used only in unusual circumstances and not as a routine procedure. - Overrides *map[string]interface{} `json:"overrides"` - PackagePolicies *AgentPolicy_PackagePolicies `json:"package_policies,omitempty"` - Revision float32 `json:"revision"` - SchemaVersion *string `json:"schema_version,omitempty"` - SpaceIds *[]string `json:"space_ids,omitempty"` - Status AgentPolicyStatus `json:"status"` - - // SupportsAgentless Indicates whether the agent policy supports agentless integrations. - SupportsAgentless *bool `json:"supports_agentless"` - UnenrollTimeout *float32 `json:"unenroll_timeout,omitempty"` - UnprivilegedAgents *float32 `json:"unprivileged_agents,omitempty"` - UpdatedAt string `json:"updated_at"` - UpdatedBy string `json:"updated_by"` - Version *string `json:"version,omitempty"` -} - -// AgentPolicyGlobalDataTagsValue0 defines model for . -type AgentPolicyGlobalDataTagsValue0 = string - -// AgentPolicyGlobalDataTagsValue1 defines model for . -type AgentPolicyGlobalDataTagsValue1 = float32 - -// AgentPolicy_GlobalDataTags_Value defines model for AgentPolicy.GlobalDataTags.Value. -type AgentPolicy_GlobalDataTags_Value struct { - union json.RawMessage -} - -// AgentPolicyMonitoringEnabled defines model for AgentPolicy.MonitoringEnabled. -type AgentPolicyMonitoringEnabled string - -// AgentPolicyPackagePolicies0 defines model for . -type AgentPolicyPackagePolicies0 = []string - -// AgentPolicyPackagePolicies1 This field is present only when retrieving a single agent policy, or when retrieving a list of agent policies with the ?full=true parameter -type AgentPolicyPackagePolicies1 = []struct { - CreatedAt string `json:"created_at"` - CreatedBy string `json:"created_by"` - - // Description Package policy description - Description *string `json:"description,omitempty"` - Elasticsearch *AgentPolicy_PackagePolicies_1_Elasticsearch `json:"elasticsearch,omitempty"` - Enabled bool `json:"enabled"` - Id string `json:"id"` - Inputs []struct { - CompiledInput interface{} `json:"compiled_input"` - - // Config Package variable (see integration documentation for more information) - Config *map[string]struct { - Frozen *bool `json:"frozen,omitempty"` - Type *string `json:"type,omitempty"` - Value interface{} `json:"value"` - } `json:"config,omitempty"` - Enabled bool `json:"enabled"` - Id *string `json:"id,omitempty"` - KeepEnabled *bool `json:"keep_enabled,omitempty"` - PolicyTemplate *string `json:"policy_template,omitempty"` - Streams []struct { - CompiledStream interface{} `json:"compiled_stream"` - - // Config Package variable (see integration documentation for more information) - Config *map[string]struct { - Frozen *bool `json:"frozen,omitempty"` - Type *string `json:"type,omitempty"` - Value interface{} `json:"value"` - } `json:"config,omitempty"` - DataStream struct { - Dataset string `json:"dataset"` - Elasticsearch *struct { - DynamicDataset *bool `json:"dynamic_dataset,omitempty"` - DynamicNamespace *bool `json:"dynamic_namespace,omitempty"` - Privileges *struct { - Indices *[]string `json:"indices,omitempty"` - } `json:"privileges,omitempty"` - } `json:"elasticsearch,omitempty"` - Type string `json:"type"` - } `json:"data_stream"` - Enabled bool `json:"enabled"` - Id *string `json:"id,omitempty"` - KeepEnabled *bool `json:"keep_enabled,omitempty"` - Release *AgentPolicyPackagePolicies1InputsStreamsRelease `json:"release,omitempty"` - - // Vars Package variable (see integration documentation for more information) - Vars *map[string]struct { - Frozen *bool `json:"frozen,omitempty"` - Type *string `json:"type,omitempty"` - Value interface{} `json:"value"` - } `json:"vars,omitempty"` - } `json:"streams"` - Type string `json:"type"` - - // Vars Package variable (see integration documentation for more information) - Vars *map[string]struct { - Frozen *bool `json:"frozen,omitempty"` - Type *string `json:"type,omitempty"` - Value interface{} `json:"value"` - } `json:"vars,omitempty"` - } `json:"inputs"` - IsManaged *bool `json:"is_managed,omitempty"` - - // Name Package policy name (should be unique) - Name string `json:"name"` - - // Namespace The package policy namespace. Leave blank to inherit the agent policy's namespace. - Namespace *string `json:"namespace,omitempty"` - OutputId *string `json:"output_id"` - - // Overrides Override settings that are defined in the package policy. The override option should be used only in unusual circumstances and not as a routine procedure. - Overrides *struct { - Inputs *map[string]interface{} `json:"inputs,omitempty"` - } `json:"overrides"` - Package *struct { - ExperimentalDataStreamFeatures *[]struct { - DataStream string `json:"data_stream"` - Features struct { - DocValueOnlyNumeric *bool `json:"doc_value_only_numeric,omitempty"` - DocValueOnlyOther *bool `json:"doc_value_only_other,omitempty"` - SyntheticSource *bool `json:"synthetic_source,omitempty"` - Tsdb *bool `json:"tsdb,omitempty"` - } `json:"features"` - } `json:"experimental_data_stream_features,omitempty"` - - // Name Package name - Name string `json:"name"` - RequiresRoot *bool `json:"requires_root,omitempty"` - Title *string `json:"title,omitempty"` - - // Version Package version - Version string `json:"version"` - } `json:"package,omitempty"` - - // PolicyId Agent policy ID where that package policy will be added - // Deprecated: - PolicyId *string `json:"policy_id"` - PolicyIds *[]string `json:"policy_ids,omitempty"` - Revision float32 `json:"revision"` - SecretReferences *[]struct { - Id string `json:"id"` - } `json:"secret_references,omitempty"` - UpdatedAt string `json:"updated_at"` - UpdatedBy string `json:"updated_by"` - - // Vars Package variable (see integration documentation for more information) - Vars *map[string]struct { - Frozen *bool `json:"frozen,omitempty"` - Type *string `json:"type,omitempty"` - Value interface{} `json:"value"` - } `json:"vars,omitempty"` - Version *string `json:"version,omitempty"` -} - -// AgentPolicy_PackagePolicies_1_Elasticsearch_Privileges defines model for AgentPolicy.PackagePolicies.1.Elasticsearch.Privileges. -type AgentPolicy_PackagePolicies_1_Elasticsearch_Privileges struct { - Cluster *[]string `json:"cluster,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// AgentPolicy_PackagePolicies_1_Elasticsearch defines model for AgentPolicy.PackagePolicies.1.Elasticsearch. -type AgentPolicy_PackagePolicies_1_Elasticsearch struct { - Privileges *AgentPolicy_PackagePolicies_1_Elasticsearch_Privileges `json:"privileges,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// AgentPolicyPackagePolicies1InputsStreamsRelease defines model for AgentPolicy.PackagePolicies.1.Inputs.Streams.Release. -type AgentPolicyPackagePolicies1InputsStreamsRelease string - -// AgentPolicy_PackagePolicies defines model for AgentPolicy.PackagePolicies. -type AgentPolicy_PackagePolicies struct { - union json.RawMessage -} - -// AgentPolicyStatus defines model for AgentPolicy.Status. -type AgentPolicyStatus string - -// EnrollmentApiKey defines model for enrollment_api_key. -type EnrollmentApiKey struct { - // Active When false, the enrollment API key is revoked and cannot be used for enrolling Elastic Agents. - Active bool `json:"active"` - - // ApiKey The enrollment API key (token) used for enrolling Elastic Agents. - ApiKey string `json:"api_key"` - - // ApiKeyId The ID of the API key in the Security API. - ApiKeyId string `json:"api_key_id"` - CreatedAt string `json:"created_at"` - Id string `json:"id"` - - // Name The name of the enrollment API key. - Name *string `json:"name,omitempty"` - - // PolicyId The ID of the agent policy the Elastic Agent will be enrolled in. - PolicyId *string `json:"policy_id,omitempty"` -} - -// NewOutputElasticsearch defines model for new_output_elasticsearch. -type NewOutputElasticsearch struct { - AllowEdit *[]string `json:"allow_edit,omitempty"` - CaSha256 *string `json:"ca_sha256,omitempty"` - CaTrustedFingerprint *string `json:"ca_trusted_fingerprint,omitempty"` - ConfigYaml *string `json:"config_yaml"` - Hosts []string `json:"hosts"` - Id *string `json:"id,omitempty"` - IsDefault *bool `json:"is_default,omitempty"` - IsDefaultMonitoring *bool `json:"is_default_monitoring,omitempty"` - IsInternal *bool `json:"is_internal,omitempty"` - IsPreconfigured *bool `json:"is_preconfigured,omitempty"` - Name string `json:"name"` - Preset *NewOutputElasticsearchPreset `json:"preset,omitempty"` - ProxyId *string `json:"proxy_id,omitempty"` - Shipper *NewOutputShipper `json:"shipper,omitempty"` - Ssl *NewOutputSsl `json:"ssl,omitempty"` - Type NewOutputElasticsearchType `json:"type"` -} - -// NewOutputElasticsearchPreset defines model for NewOutputElasticsearch.Preset. -type NewOutputElasticsearchPreset string - -// NewOutputElasticsearchType defines model for NewOutputElasticsearch.Type. -type NewOutputElasticsearchType string - -// NewOutputKafka defines model for new_output_kafka. -type NewOutputKafka struct { - AllowEdit *[]string `json:"allow_edit,omitempty"` - AuthType NewOutputKafkaAuthType `json:"auth_type"` - BrokerTimeout *float32 `json:"broker_timeout,omitempty"` - CaSha256 *string `json:"ca_sha256,omitempty"` - CaTrustedFingerprint *string `json:"ca_trusted_fingerprint,omitempty"` - ClientId *string `json:"client_id,omitempty"` - Compression *NewOutputKafkaCompression `json:"compression,omitempty"` - CompressionLevel interface{} `json:"compression_level"` - ConfigYaml *string `json:"config_yaml"` - ConnectionType interface{} `json:"connection_type"` - Hash *struct { - Hash *string `json:"hash,omitempty"` - Random *bool `json:"random,omitempty"` - } `json:"hash,omitempty"` - Headers *[]struct { - Key string `json:"key"` - Value string `json:"value"` - } `json:"headers,omitempty"` - Hosts []string `json:"hosts"` - Id *string `json:"id,omitempty"` - IsDefault *bool `json:"is_default,omitempty"` - IsDefaultMonitoring *bool `json:"is_default_monitoring,omitempty"` - IsInternal *bool `json:"is_internal,omitempty"` - IsPreconfigured *bool `json:"is_preconfigured,omitempty"` - Key *string `json:"key,omitempty"` - Name string `json:"name"` - Partition *NewOutputKafkaPartition `json:"partition,omitempty"` - Password interface{} `json:"password"` - ProxyId *string `json:"proxy_id,omitempty"` - Random *struct { - GroupEvents *float32 `json:"group_events,omitempty"` - } `json:"random,omitempty"` - RequiredAcks *NewOutputKafkaRequiredAcks `json:"required_acks,omitempty"` - RoundRobin *struct { - GroupEvents *float32 `json:"group_events,omitempty"` - } `json:"round_robin,omitempty"` - Sasl *struct { - Mechanism *NewOutputKafkaSaslMechanism `json:"mechanism,omitempty"` - } `json:"sasl"` - Secrets *struct { - Password *NewOutputKafka_Secrets_Password `json:"password,omitempty"` - Ssl *struct { - Key NewOutputKafka_Secrets_Ssl_Key `json:"key"` - } `json:"ssl,omitempty"` - } `json:"secrets,omitempty"` - Shipper *NewOutputShipper `json:"shipper,omitempty"` - Ssl *NewOutputSsl `json:"ssl,omitempty"` - Timeout *float32 `json:"timeout,omitempty"` - Topic *string `json:"topic,omitempty"` - Topics *[]struct { - Topic string `json:"topic"` - When *struct { - Condition *string `json:"condition,omitempty"` - Type *NewOutputKafkaTopicsWhenType `json:"type,omitempty"` - } `json:"when,omitempty"` - } `json:"topics,omitempty"` - Type NewOutputKafkaType `json:"type"` - Username interface{} `json:"username"` - Version *string `json:"version,omitempty"` -} - -// NewOutputKafkaAuthType defines model for NewOutputKafka.AuthType. -type NewOutputKafkaAuthType string - -// NewOutputKafkaCompression defines model for NewOutputKafka.Compression. -type NewOutputKafkaCompression string - -// NewOutputKafkaPartition defines model for NewOutputKafka.Partition. -type NewOutputKafkaPartition string - -// NewOutputKafkaRequiredAcks defines model for NewOutputKafka.RequiredAcks. -type NewOutputKafkaRequiredAcks int - -// NewOutputKafkaSaslMechanism defines model for NewOutputKafka.Sasl.Mechanism. -type NewOutputKafkaSaslMechanism string - -// NewOutputKafkaSecretsPassword0 defines model for . -type NewOutputKafkaSecretsPassword0 struct { - Id string `json:"id"` -} - -// NewOutputKafkaSecretsPassword1 defines model for . -type NewOutputKafkaSecretsPassword1 = string - -// NewOutputKafka_Secrets_Password defines model for NewOutputKafka.Secrets.Password. -type NewOutputKafka_Secrets_Password struct { - union json.RawMessage -} - -// NewOutputKafkaSecretsSslKey0 defines model for . -type NewOutputKafkaSecretsSslKey0 struct { - Id string `json:"id"` -} - -// NewOutputKafkaSecretsSslKey1 defines model for . -type NewOutputKafkaSecretsSslKey1 = string - -// NewOutputKafka_Secrets_Ssl_Key defines model for NewOutputKafka.Secrets.Ssl.Key. -type NewOutputKafka_Secrets_Ssl_Key struct { - union json.RawMessage -} - -// NewOutputKafkaTopicsWhenType defines model for NewOutputKafka.Topics.When.Type. -type NewOutputKafkaTopicsWhenType string - -// NewOutputKafkaType defines model for NewOutputKafka.Type. -type NewOutputKafkaType string - -// NewOutputLogstash defines model for new_output_logstash. -type NewOutputLogstash struct { - AllowEdit *[]string `json:"allow_edit,omitempty"` - CaSha256 *string `json:"ca_sha256,omitempty"` - CaTrustedFingerprint *string `json:"ca_trusted_fingerprint,omitempty"` - ConfigYaml *string `json:"config_yaml"` - Hosts []string `json:"hosts"` - Id *string `json:"id,omitempty"` - IsDefault *bool `json:"is_default,omitempty"` - IsDefaultMonitoring *bool `json:"is_default_monitoring,omitempty"` - IsInternal *bool `json:"is_internal,omitempty"` - IsPreconfigured *bool `json:"is_preconfigured,omitempty"` - Name string `json:"name"` - ProxyId *string `json:"proxy_id,omitempty"` - Secrets *struct { - Ssl *struct { - Key *NewOutputLogstash_Secrets_Ssl_Key `json:"key,omitempty"` - } `json:"ssl,omitempty"` - } `json:"secrets,omitempty"` - Shipper *NewOutputShipper `json:"shipper,omitempty"` - Ssl *NewOutputSsl `json:"ssl,omitempty"` - Type NewOutputLogstashType `json:"type"` -} - -// NewOutputLogstashSecretsSslKey0 defines model for . -type NewOutputLogstashSecretsSslKey0 struct { - Id string `json:"id"` -} - -// NewOutputLogstashSecretsSslKey1 defines model for . -type NewOutputLogstashSecretsSslKey1 = string - -// NewOutputLogstash_Secrets_Ssl_Key defines model for NewOutputLogstash.Secrets.Ssl.Key. -type NewOutputLogstash_Secrets_Ssl_Key struct { - union json.RawMessage -} - -// NewOutputLogstashType defines model for NewOutputLogstash.Type. -type NewOutputLogstashType string - -// NewOutputRemoteElasticsearch defines model for new_output_remote_elasticsearch. -type NewOutputRemoteElasticsearch struct { - AllowEdit *[]string `json:"allow_edit,omitempty"` - CaSha256 *string `json:"ca_sha256,omitempty"` - CaTrustedFingerprint *string `json:"ca_trusted_fingerprint,omitempty"` - ConfigYaml *string `json:"config_yaml"` - Hosts []string `json:"hosts"` - Id *string `json:"id,omitempty"` - IsDefault *bool `json:"is_default,omitempty"` - IsDefaultMonitoring *bool `json:"is_default_monitoring,omitempty"` - IsInternal *bool `json:"is_internal,omitempty"` - IsPreconfigured *bool `json:"is_preconfigured,omitempty"` - Name string `json:"name"` - Preset *NewOutputRemoteElasticsearchPreset `json:"preset,omitempty"` - ProxyId *string `json:"proxy_id,omitempty"` - Secrets *struct { - ServiceToken *NewOutputRemoteElasticsearch_Secrets_ServiceToken `json:"service_token,omitempty"` - } `json:"secrets,omitempty"` - ServiceToken *string `json:"service_token"` - Shipper *NewOutputShipper `json:"shipper,omitempty"` - Ssl *NewOutputSsl `json:"ssl,omitempty"` - Type NewOutputRemoteElasticsearchType `json:"type"` -} - -// NewOutputRemoteElasticsearchPreset defines model for NewOutputRemoteElasticsearch.Preset. -type NewOutputRemoteElasticsearchPreset string - -// NewOutputRemoteElasticsearchSecretsServiceToken0 defines model for . -type NewOutputRemoteElasticsearchSecretsServiceToken0 struct { - Id string `json:"id"` -} - -// NewOutputRemoteElasticsearchSecretsServiceToken1 defines model for . -type NewOutputRemoteElasticsearchSecretsServiceToken1 = string - -// NewOutputRemoteElasticsearch_Secrets_ServiceToken defines model for NewOutputRemoteElasticsearch.Secrets.ServiceToken. -type NewOutputRemoteElasticsearch_Secrets_ServiceToken struct { - union json.RawMessage -} - -// NewOutputRemoteElasticsearchType defines model for NewOutputRemoteElasticsearch.Type. -type NewOutputRemoteElasticsearchType string - -// NewOutputShipper defines model for new_output_shipper. -type NewOutputShipper struct { - CompressionLevel *float32 `json:"compression_level"` - DiskQueueCompressionEnabled *bool `json:"disk_queue_compression_enabled"` - DiskQueueEnabled *bool `json:"disk_queue_enabled"` - DiskQueueEncryptionEnabled *bool `json:"disk_queue_encryption_enabled"` - DiskQueueMaxSize *float32 `json:"disk_queue_max_size"` - DiskQueuePath *string `json:"disk_queue_path"` - Loadbalance *bool `json:"loadbalance"` - MaxBatchBytes *float32 `json:"max_batch_bytes"` - MemQueueEvents *float32 `json:"mem_queue_events"` - QueueFlushTimeout *float32 `json:"queue_flush_timeout"` -} - -// NewOutputSsl defines model for new_output_ssl. -type NewOutputSsl struct { - Certificate *string `json:"certificate,omitempty"` - CertificateAuthorities *[]string `json:"certificate_authorities,omitempty"` - Key *string `json:"key,omitempty"` - VerificationMode *NewOutputSslVerificationMode `json:"verification_mode,omitempty"` -} - -// NewOutputSslVerificationMode defines model for NewOutputSsl.VerificationMode. -type NewOutputSslVerificationMode string - -// NewOutputUnion defines model for new_output_union. -type NewOutputUnion struct { - union json.RawMessage -} - -// OutputElasticsearch defines model for output_elasticsearch. -type OutputElasticsearch struct { - AllowEdit *[]string `json:"allow_edit,omitempty"` - CaSha256 *string `json:"ca_sha256"` - CaTrustedFingerprint *string `json:"ca_trusted_fingerprint"` - ConfigYaml *string `json:"config_yaml"` - Hosts []string `json:"hosts"` - Id *string `json:"id,omitempty"` - IsDefault *bool `json:"is_default,omitempty"` - IsDefaultMonitoring *bool `json:"is_default_monitoring,omitempty"` - IsInternal *bool `json:"is_internal,omitempty"` - IsPreconfigured *bool `json:"is_preconfigured,omitempty"` - Name string `json:"name"` - Preset *OutputElasticsearchPreset `json:"preset,omitempty"` - ProxyId *string `json:"proxy_id"` - Shipper *OutputShipper `json:"shipper"` - Ssl *OutputSsl `json:"ssl"` - Type OutputElasticsearchType `json:"type"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// OutputElasticsearchPreset defines model for OutputElasticsearch.Preset. -type OutputElasticsearchPreset string - -// OutputElasticsearchType defines model for OutputElasticsearch.Type. -type OutputElasticsearchType string - -// OutputKafka defines model for output_kafka. -type OutputKafka struct { - AllowEdit *[]string `json:"allow_edit,omitempty"` - AuthType OutputKafkaAuthType `json:"auth_type"` - BrokerTimeout *float32 `json:"broker_timeout,omitempty"` - CaSha256 *string `json:"ca_sha256"` - CaTrustedFingerprint *string `json:"ca_trusted_fingerprint"` - ClientId *string `json:"client_id,omitempty"` - Compression *OutputKafkaCompression `json:"compression,omitempty"` - CompressionLevel interface{} `json:"compression_level"` - ConfigYaml *string `json:"config_yaml"` - ConnectionType interface{} `json:"connection_type"` - Hash *OutputKafka_Hash `json:"hash,omitempty"` - Headers *[]OutputKafka_Headers_Item `json:"headers,omitempty"` - Hosts []string `json:"hosts"` - Id *string `json:"id,omitempty"` - IsDefault *bool `json:"is_default,omitempty"` - IsDefaultMonitoring *bool `json:"is_default_monitoring,omitempty"` - IsInternal *bool `json:"is_internal,omitempty"` - IsPreconfigured *bool `json:"is_preconfigured,omitempty"` - Key *string `json:"key,omitempty"` - Name string `json:"name"` - Partition *OutputKafkaPartition `json:"partition,omitempty"` - Password interface{} `json:"password"` - ProxyId *string `json:"proxy_id"` - Random *OutputKafka_Random `json:"random,omitempty"` - RequiredAcks *OutputKafkaRequiredAcks `json:"required_acks,omitempty"` - RoundRobin *OutputKafka_RoundRobin `json:"round_robin,omitempty"` - Sasl *OutputKafka_Sasl `json:"sasl"` - Secrets *OutputKafka_Secrets `json:"secrets,omitempty"` - Shipper *OutputShipper `json:"shipper"` - Ssl *OutputSsl `json:"ssl"` - Timeout *float32 `json:"timeout,omitempty"` - Topic *string `json:"topic,omitempty"` - Topics *[]OutputKafka_Topics_Item `json:"topics,omitempty"` - Type OutputKafkaType `json:"type"` - Username interface{} `json:"username"` - Version *string `json:"version,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// OutputKafkaAuthType defines model for OutputKafka.AuthType. -type OutputKafkaAuthType string - -// OutputKafkaCompression defines model for OutputKafka.Compression. -type OutputKafkaCompression string - -// OutputKafka_Hash defines model for OutputKafka.Hash. -type OutputKafka_Hash struct { - Hash *string `json:"hash,omitempty"` - Random *bool `json:"random,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// OutputKafka_Headers_Item defines model for output_kafka.headers.Item. -type OutputKafka_Headers_Item struct { - Key string `json:"key"` - Value string `json:"value"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// OutputKafkaPartition defines model for OutputKafka.Partition. -type OutputKafkaPartition string - -// OutputKafka_Random defines model for OutputKafka.Random. -type OutputKafka_Random struct { - GroupEvents *float32 `json:"group_events,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// OutputKafkaRequiredAcks defines model for OutputKafka.RequiredAcks. -type OutputKafkaRequiredAcks int - -// OutputKafka_RoundRobin defines model for OutputKafka.RoundRobin. -type OutputKafka_RoundRobin struct { - GroupEvents *float32 `json:"group_events,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// OutputKafkaSaslMechanism defines model for OutputKafka.Sasl.Mechanism. -type OutputKafkaSaslMechanism string - -// OutputKafka_Sasl defines model for OutputKafka.Sasl. -type OutputKafka_Sasl struct { - Mechanism *OutputKafkaSaslMechanism `json:"mechanism,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// OutputKafkaSecretsPassword0 defines model for . -type OutputKafkaSecretsPassword0 struct { - Id string `json:"id"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// OutputKafkaSecretsPassword1 defines model for . -type OutputKafkaSecretsPassword1 = string - -// OutputKafka_Secrets_Password defines model for OutputKafka.Secrets.Password. -type OutputKafka_Secrets_Password struct { - union json.RawMessage -} - -// OutputKafkaSecretsSslKey0 defines model for . -type OutputKafkaSecretsSslKey0 struct { - Id string `json:"id"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// OutputKafkaSecretsSslKey1 defines model for . -type OutputKafkaSecretsSslKey1 = string - -// OutputKafka_Secrets_Ssl_Key defines model for OutputKafka.Secrets.Ssl.Key. -type OutputKafka_Secrets_Ssl_Key struct { - union json.RawMessage -} - -// OutputKafka_Secrets_Ssl defines model for OutputKafka.Secrets.Ssl. -type OutputKafka_Secrets_Ssl struct { - Key OutputKafka_Secrets_Ssl_Key `json:"key"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// OutputKafka_Secrets defines model for OutputKafka.Secrets. -type OutputKafka_Secrets struct { - Password *OutputKafka_Secrets_Password `json:"password,omitempty"` - Ssl *OutputKafka_Secrets_Ssl `json:"ssl,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// OutputKafkaTopicsWhenType defines model for OutputKafka.Topics.When.Type. -type OutputKafkaTopicsWhenType string - -// OutputKafka_Topics_When defines model for OutputKafka.Topics.When. -type OutputKafka_Topics_When struct { - Condition *string `json:"condition,omitempty"` - Type *OutputKafkaTopicsWhenType `json:"type,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// OutputKafka_Topics_Item defines model for output_kafka.topics.Item. -type OutputKafka_Topics_Item struct { - Topic string `json:"topic"` - When *OutputKafka_Topics_When `json:"when,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// OutputKafkaType defines model for OutputKafka.Type. -type OutputKafkaType string - -// OutputLogstash defines model for output_logstash. -type OutputLogstash struct { - AllowEdit *[]string `json:"allow_edit,omitempty"` - CaSha256 *string `json:"ca_sha256"` - CaTrustedFingerprint *string `json:"ca_trusted_fingerprint"` - ConfigYaml *string `json:"config_yaml"` - Hosts []string `json:"hosts"` - Id *string `json:"id,omitempty"` - IsDefault *bool `json:"is_default,omitempty"` - IsDefaultMonitoring *bool `json:"is_default_monitoring,omitempty"` - IsInternal *bool `json:"is_internal,omitempty"` - IsPreconfigured *bool `json:"is_preconfigured,omitempty"` - Name string `json:"name"` - ProxyId *string `json:"proxy_id"` - Secrets *OutputLogstash_Secrets `json:"secrets,omitempty"` - Shipper *OutputShipper `json:"shipper"` - Ssl *OutputSsl `json:"ssl"` - Type OutputLogstashType `json:"type"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// OutputLogstashSecretsSslKey0 defines model for . -type OutputLogstashSecretsSslKey0 struct { - Id string `json:"id"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// OutputLogstashSecretsSslKey1 defines model for . -type OutputLogstashSecretsSslKey1 = string - -// OutputLogstash_Secrets_Ssl_Key defines model for OutputLogstash.Secrets.Ssl.Key. -type OutputLogstash_Secrets_Ssl_Key struct { - union json.RawMessage -} - -// OutputLogstash_Secrets_Ssl defines model for OutputLogstash.Secrets.Ssl. -type OutputLogstash_Secrets_Ssl struct { - Key *OutputLogstash_Secrets_Ssl_Key `json:"key,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// OutputLogstash_Secrets defines model for OutputLogstash.Secrets. -type OutputLogstash_Secrets struct { - Ssl *OutputLogstash_Secrets_Ssl `json:"ssl,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// OutputLogstashType defines model for OutputLogstash.Type. -type OutputLogstashType string - -// OutputRemoteElasticsearch defines model for output_remote_elasticsearch. -type OutputRemoteElasticsearch struct { - AllowEdit *[]string `json:"allow_edit,omitempty"` - CaSha256 *string `json:"ca_sha256"` - CaTrustedFingerprint *string `json:"ca_trusted_fingerprint"` - ConfigYaml *string `json:"config_yaml"` - Hosts []string `json:"hosts"` - Id *string `json:"id,omitempty"` - IsDefault *bool `json:"is_default,omitempty"` - IsDefaultMonitoring *bool `json:"is_default_monitoring,omitempty"` - IsInternal *bool `json:"is_internal,omitempty"` - IsPreconfigured *bool `json:"is_preconfigured,omitempty"` - Name string `json:"name"` - Preset *OutputRemoteElasticsearchPreset `json:"preset,omitempty"` - ProxyId *string `json:"proxy_id"` - Secrets *OutputRemoteElasticsearch_Secrets `json:"secrets,omitempty"` - ServiceToken *string `json:"service_token"` - Shipper *OutputShipper `json:"shipper"` - Ssl *OutputSsl `json:"ssl"` - Type OutputRemoteElasticsearchType `json:"type"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// OutputRemoteElasticsearchPreset defines model for OutputRemoteElasticsearch.Preset. -type OutputRemoteElasticsearchPreset string - -// OutputRemoteElasticsearchSecretsServiceToken0 defines model for . -type OutputRemoteElasticsearchSecretsServiceToken0 struct { - Id string `json:"id"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// OutputRemoteElasticsearchSecretsServiceToken1 defines model for . -type OutputRemoteElasticsearchSecretsServiceToken1 = string - -// OutputRemoteElasticsearch_Secrets_ServiceToken defines model for OutputRemoteElasticsearch.Secrets.ServiceToken. -type OutputRemoteElasticsearch_Secrets_ServiceToken struct { - union json.RawMessage -} - -// OutputRemoteElasticsearch_Secrets defines model for OutputRemoteElasticsearch.Secrets. -type OutputRemoteElasticsearch_Secrets struct { - ServiceToken *OutputRemoteElasticsearch_Secrets_ServiceToken `json:"service_token,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// OutputRemoteElasticsearchType defines model for OutputRemoteElasticsearch.Type. -type OutputRemoteElasticsearchType string - -// OutputShipper defines model for output_shipper. -type OutputShipper struct { - CompressionLevel *float32 `json:"compression_level"` - DiskQueueCompressionEnabled *bool `json:"disk_queue_compression_enabled"` - DiskQueueEnabled *bool `json:"disk_queue_enabled"` - DiskQueueEncryptionEnabled *bool `json:"disk_queue_encryption_enabled"` - DiskQueueMaxSize *float32 `json:"disk_queue_max_size"` - DiskQueuePath *string `json:"disk_queue_path"` - Loadbalance *bool `json:"loadbalance"` - MaxBatchBytes *float32 `json:"max_batch_bytes"` - MemQueueEvents *float32 `json:"mem_queue_events"` - QueueFlushTimeout *float32 `json:"queue_flush_timeout"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// OutputSsl defines model for output_ssl. -type OutputSsl struct { - Certificate *string `json:"certificate,omitempty"` - CertificateAuthorities *[]string `json:"certificate_authorities,omitempty"` - Key *string `json:"key,omitempty"` - VerificationMode *OutputSslVerificationMode `json:"verification_mode,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// OutputSslVerificationMode defines model for OutputSsl.VerificationMode. -type OutputSslVerificationMode string - -// OutputUnion defines model for output_union. -type OutputUnion struct { - union json.RawMessage -} - -// PackageInfo defines model for package_info. -type PackageInfo struct { - Agent *struct { - Privileges *struct { - Root *bool `json:"root,omitempty"` - } `json:"privileges,omitempty"` - } `json:"agent,omitempty"` - AssetTags *[]struct { - AssetIds *[]string `json:"asset_ids,omitempty"` - AssetTypes *[]string `json:"asset_types,omitempty"` - Text string `json:"text"` - } `json:"asset_tags,omitempty"` - Assets map[string]interface{} `json:"assets"` - Categories *[]string `json:"categories,omitempty"` - Conditions *PackageInfo_Conditions `json:"conditions,omitempty"` - DataStreams *[]map[string]interface{} `json:"data_streams,omitempty"` - Description *string `json:"description,omitempty"` - Discovery *PackageInfo_Discovery `json:"discovery,omitempty"` - Download *string `json:"download,omitempty"` - Elasticsearch *map[string]interface{} `json:"elasticsearch,omitempty"` - FormatVersion *string `json:"format_version,omitempty"` - Icons *[]PackageInfo_Icons_Item `json:"icons,omitempty"` - InstallationInfo *PackageInfo_InstallationInfo `json:"installationInfo,omitempty"` - Internal *bool `json:"internal,omitempty"` - KeepPoliciesUpToDate *bool `json:"keepPoliciesUpToDate,omitempty"` - LatestVersion *string `json:"latestVersion,omitempty"` - License *string `json:"license,omitempty"` - LicensePath *string `json:"licensePath,omitempty"` - Name string `json:"name"` - Notice *string `json:"notice,omitempty"` - Owner *PackageInfo_Owner `json:"owner,omitempty"` - Path *string `json:"path,omitempty"` - PolicyTemplates *[]map[string]interface{} `json:"policy_templates,omitempty"` - Readme *string `json:"readme,omitempty"` - Release *PackageInfoRelease `json:"release,omitempty"` - SavedObject interface{} `json:"savedObject"` - Screenshots *[]struct { - DarkMode *bool `json:"dark_mode,omitempty"` - Path *string `json:"path,omitempty"` - Size *string `json:"size,omitempty"` - Src string `json:"src"` - Title *string `json:"title,omitempty"` - Type *string `json:"type,omitempty"` - } `json:"screenshots,omitempty"` - SignaturePath *string `json:"signature_path,omitempty"` - Source *PackageInfo_Source `json:"source,omitempty"` - Status *string `json:"status,omitempty"` - Title string `json:"title"` - Type *PackageInfoType `json:"type,omitempty"` - Vars *[]map[string]interface{} `json:"vars,omitempty"` - Version string `json:"version"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// PackageInfo_Conditions_Elastic defines model for PackageInfo.Conditions.Elastic. -type PackageInfo_Conditions_Elastic struct { - Capabilities *[]string `json:"capabilities,omitempty"` - Subscription *string `json:"subscription,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// PackageInfo_Conditions_Kibana defines model for PackageInfo.Conditions.Kibana. -type PackageInfo_Conditions_Kibana struct { - Version *string `json:"version,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// PackageInfo_Conditions defines model for PackageInfo.Conditions. -type PackageInfo_Conditions struct { - Elastic *PackageInfo_Conditions_Elastic `json:"elastic,omitempty"` - Kibana *PackageInfo_Conditions_Kibana `json:"kibana,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// PackageInfo_Discovery_Fields_Item defines model for PackageInfo.Discovery.Fields.Item. -type PackageInfo_Discovery_Fields_Item struct { - Name string `json:"name"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// PackageInfo_Discovery defines model for PackageInfo.Discovery. -type PackageInfo_Discovery struct { - Fields *[]PackageInfo_Discovery_Fields_Item `json:"fields,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// PackageInfo_Icons_Item defines model for package_info.icons.Item. -type PackageInfo_Icons_Item struct { - DarkMode *bool `json:"dark_mode,omitempty"` - Path *string `json:"path,omitempty"` - Size *string `json:"size,omitempty"` - Src string `json:"src"` - Title *string `json:"title,omitempty"` - Type *string `json:"type,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType defines model for PackageInfo.InstallationInfo.AdditionalSpacesInstalledKibana.Type. -type PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType string - -// PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Item defines model for PackageInfo.InstallationInfo.AdditionalSpacesInstalledKibana.Item. -type PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Item struct { - Id string `json:"id"` - OriginId *string `json:"originId,omitempty"` - Type PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType `json:"type"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// PackageInfo_InstallationInfo_ExperimentalDataStreamFeatures_Features defines model for PackageInfo.InstallationInfo.ExperimentalDataStreamFeatures.Features. -type PackageInfo_InstallationInfo_ExperimentalDataStreamFeatures_Features struct { - DocValueOnlyNumeric *bool `json:"doc_value_only_numeric,omitempty"` - DocValueOnlyOther *bool `json:"doc_value_only_other,omitempty"` - SyntheticSource *bool `json:"synthetic_source,omitempty"` - Tsdb *bool `json:"tsdb,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// PackageInfo_InstallationInfo_ExperimentalDataStreamFeatures_Item defines model for PackageInfo.InstallationInfo.ExperimentalDataStreamFeatures.Item. -type PackageInfo_InstallationInfo_ExperimentalDataStreamFeatures_Item struct { - DataStream string `json:"data_stream"` - Features PackageInfo_InstallationInfo_ExperimentalDataStreamFeatures_Features `json:"features"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// PackageInfoInstallationInfoInstallSource defines model for PackageInfo.InstallationInfo.InstallSource. -type PackageInfoInstallationInfoInstallSource string - -// PackageInfoInstallationInfoInstallStatus defines model for PackageInfo.InstallationInfo.InstallStatus. -type PackageInfoInstallationInfoInstallStatus string - -// PackageInfoInstallationInfoInstalledEsType defines model for PackageInfo.InstallationInfo.InstalledEs.Type. -type PackageInfoInstallationInfoInstalledEsType string - -// PackageInfo_InstallationInfo_InstalledEs_Item defines model for PackageInfo.InstallationInfo.InstalledEs.Item. -type PackageInfo_InstallationInfo_InstalledEs_Item struct { - Deferred *bool `json:"deferred,omitempty"` - Id string `json:"id"` - Type PackageInfoInstallationInfoInstalledEsType `json:"type"` - Version *string `json:"version,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// PackageInfoInstallationInfoInstalledKibanaType defines model for PackageInfo.InstallationInfo.InstalledKibana.Type. -type PackageInfoInstallationInfoInstalledKibanaType string - -// PackageInfo_InstallationInfo_InstalledKibana_Item defines model for PackageInfo.InstallationInfo.InstalledKibana.Item. -type PackageInfo_InstallationInfo_InstalledKibana_Item struct { - Id string `json:"id"` - OriginId *string `json:"originId,omitempty"` - Type PackageInfoInstallationInfoInstalledKibanaType `json:"type"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// PackageInfo_InstallationInfo_LatestExecutedState defines model for PackageInfo.InstallationInfo.LatestExecutedState. -type PackageInfo_InstallationInfo_LatestExecutedState struct { - Error *string `json:"error,omitempty"` - Name string `json:"name"` - StartedAt string `json:"started_at"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// PackageInfo_InstallationInfo_LatestInstallFailedAttempts_Error defines model for PackageInfo.InstallationInfo.LatestInstallFailedAttempts.Error. -type PackageInfo_InstallationInfo_LatestInstallFailedAttempts_Error struct { - Message string `json:"message"` - Name string `json:"name"` - Stack *string `json:"stack,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// PackageInfo_InstallationInfo_LatestInstallFailedAttempts_Item defines model for PackageInfo.InstallationInfo.LatestInstallFailedAttempts.Item. -type PackageInfo_InstallationInfo_LatestInstallFailedAttempts_Item struct { - CreatedAt string `json:"created_at"` - Error PackageInfo_InstallationInfo_LatestInstallFailedAttempts_Error `json:"error"` - TargetVersion string `json:"target_version"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// PackageInfoInstallationInfoVerificationStatus defines model for PackageInfo.InstallationInfo.VerificationStatus. -type PackageInfoInstallationInfoVerificationStatus string - -// PackageInfo_InstallationInfo defines model for PackageInfo.InstallationInfo. -type PackageInfo_InstallationInfo struct { - AdditionalSpacesInstalledKibana *map[string][]PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Item `json:"additional_spaces_installed_kibana,omitempty"` - CreatedAt *string `json:"created_at,omitempty"` - ExperimentalDataStreamFeatures *[]PackageInfo_InstallationInfo_ExperimentalDataStreamFeatures_Item `json:"experimental_data_stream_features,omitempty"` - InstallFormatSchemaVersion *string `json:"install_format_schema_version,omitempty"` - InstallSource PackageInfoInstallationInfoInstallSource `json:"install_source"` - InstallStatus PackageInfoInstallationInfoInstallStatus `json:"install_status"` - InstalledEs []PackageInfo_InstallationInfo_InstalledEs_Item `json:"installed_es"` - InstalledKibana []PackageInfo_InstallationInfo_InstalledKibana_Item `json:"installed_kibana"` - InstalledKibanaSpaceId *string `json:"installed_kibana_space_id,omitempty"` - LatestExecutedState *PackageInfo_InstallationInfo_LatestExecutedState `json:"latest_executed_state,omitempty"` - LatestInstallFailedAttempts *[]PackageInfo_InstallationInfo_LatestInstallFailedAttempts_Item `json:"latest_install_failed_attempts,omitempty"` - Name string `json:"name"` - Namespaces *[]string `json:"namespaces,omitempty"` - Type string `json:"type"` - UpdatedAt *string `json:"updated_at,omitempty"` - VerificationKeyId *string `json:"verification_key_id"` - VerificationStatus PackageInfoInstallationInfoVerificationStatus `json:"verification_status"` - Version string `json:"version"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// PackageInfoOwnerType defines model for PackageInfo.Owner.Type. -type PackageInfoOwnerType string - -// PackageInfo_Owner defines model for PackageInfo.Owner. -type PackageInfo_Owner struct { - Github *string `json:"github,omitempty"` - Type *PackageInfoOwnerType `json:"type,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// PackageInfoRelease defines model for PackageInfo.Release. -type PackageInfoRelease string - -// PackageInfo_Source defines model for PackageInfo.Source. -type PackageInfo_Source struct { - License string `json:"license"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// PackageInfoType defines model for PackageInfo.Type. -type PackageInfoType string - -// PackageListItem defines model for package_list_item. -type PackageListItem struct { - Categories *[]string `json:"categories,omitempty"` - Conditions *PackageListItem_Conditions `json:"conditions,omitempty"` - DataStreams *[]map[string]interface{} `json:"data_streams,omitempty"` - Description *string `json:"description,omitempty"` - Discovery *PackageListItem_Discovery `json:"discovery,omitempty"` - Download *string `json:"download,omitempty"` - FormatVersion *string `json:"format_version,omitempty"` - Icons *[]PackageListItem_Icons_Item `json:"icons,omitempty"` - Id string `json:"id"` - InstallationInfo *PackageListItem_InstallationInfo `json:"installationInfo,omitempty"` - Integration *string `json:"integration,omitempty"` - Internal *bool `json:"internal,omitempty"` - LatestVersion *string `json:"latestVersion,omitempty"` - Name string `json:"name"` - Owner *PackageListItem_Owner `json:"owner,omitempty"` - Path *string `json:"path,omitempty"` - PolicyTemplates *[]map[string]interface{} `json:"policy_templates,omitempty"` - Readme *string `json:"readme,omitempty"` - Release *PackageListItemRelease `json:"release,omitempty"` - SavedObject interface{} `json:"savedObject"` - SignaturePath *string `json:"signature_path,omitempty"` - Source *PackageListItem_Source `json:"source,omitempty"` - Status *string `json:"status,omitempty"` - Title string `json:"title"` - Type *PackageListItemType `json:"type,omitempty"` - Vars *[]map[string]interface{} `json:"vars,omitempty"` - Version string `json:"version"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// PackageListItem_Conditions_Elastic defines model for PackageListItem.Conditions.Elastic. -type PackageListItem_Conditions_Elastic struct { - Capabilities *[]string `json:"capabilities,omitempty"` - Subscription *string `json:"subscription,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// PackageListItem_Conditions_Kibana defines model for PackageListItem.Conditions.Kibana. -type PackageListItem_Conditions_Kibana struct { - Version *string `json:"version,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// PackageListItem_Conditions defines model for PackageListItem.Conditions. -type PackageListItem_Conditions struct { - Elastic *PackageListItem_Conditions_Elastic `json:"elastic,omitempty"` - Kibana *PackageListItem_Conditions_Kibana `json:"kibana,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// PackageListItem_Discovery_Fields_Item defines model for PackageListItem.Discovery.Fields.Item. -type PackageListItem_Discovery_Fields_Item struct { - Name string `json:"name"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// PackageListItem_Discovery defines model for PackageListItem.Discovery. -type PackageListItem_Discovery struct { - Fields *[]PackageListItem_Discovery_Fields_Item `json:"fields,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// PackageListItem_Icons_Item defines model for package_list_item.icons.Item. -type PackageListItem_Icons_Item struct { - DarkMode *bool `json:"dark_mode,omitempty"` - Path *string `json:"path,omitempty"` - Size *string `json:"size,omitempty"` - Src string `json:"src"` - Title *string `json:"title,omitempty"` - Type *string `json:"type,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType defines model for PackageListItem.InstallationInfo.AdditionalSpacesInstalledKibana.Type. -type PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType string - -// PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Item defines model for PackageListItem.InstallationInfo.AdditionalSpacesInstalledKibana.Item. -type PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Item struct { - Id string `json:"id"` - OriginId *string `json:"originId,omitempty"` - Type PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType `json:"type"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// PackageListItem_InstallationInfo_ExperimentalDataStreamFeatures_Features defines model for PackageListItem.InstallationInfo.ExperimentalDataStreamFeatures.Features. -type PackageListItem_InstallationInfo_ExperimentalDataStreamFeatures_Features struct { - DocValueOnlyNumeric *bool `json:"doc_value_only_numeric,omitempty"` - DocValueOnlyOther *bool `json:"doc_value_only_other,omitempty"` - SyntheticSource *bool `json:"synthetic_source,omitempty"` - Tsdb *bool `json:"tsdb,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// PackageListItem_InstallationInfo_ExperimentalDataStreamFeatures_Item defines model for PackageListItem.InstallationInfo.ExperimentalDataStreamFeatures.Item. -type PackageListItem_InstallationInfo_ExperimentalDataStreamFeatures_Item struct { - DataStream string `json:"data_stream"` - Features PackageListItem_InstallationInfo_ExperimentalDataStreamFeatures_Features `json:"features"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// PackageListItemInstallationInfoInstallSource defines model for PackageListItem.InstallationInfo.InstallSource. -type PackageListItemInstallationInfoInstallSource string - -// PackageListItemInstallationInfoInstallStatus defines model for PackageListItem.InstallationInfo.InstallStatus. -type PackageListItemInstallationInfoInstallStatus string - -// PackageListItemInstallationInfoInstalledEsType defines model for PackageListItem.InstallationInfo.InstalledEs.Type. -type PackageListItemInstallationInfoInstalledEsType string - -// PackageListItem_InstallationInfo_InstalledEs_Item defines model for PackageListItem.InstallationInfo.InstalledEs.Item. -type PackageListItem_InstallationInfo_InstalledEs_Item struct { - Deferred *bool `json:"deferred,omitempty"` - Id string `json:"id"` - Type PackageListItemInstallationInfoInstalledEsType `json:"type"` - Version *string `json:"version,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// PackageListItemInstallationInfoInstalledKibanaType defines model for PackageListItem.InstallationInfo.InstalledKibana.Type. -type PackageListItemInstallationInfoInstalledKibanaType string - -// PackageListItem_InstallationInfo_InstalledKibana_Item defines model for PackageListItem.InstallationInfo.InstalledKibana.Item. -type PackageListItem_InstallationInfo_InstalledKibana_Item struct { - Id string `json:"id"` - OriginId *string `json:"originId,omitempty"` - Type PackageListItemInstallationInfoInstalledKibanaType `json:"type"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// PackageListItem_InstallationInfo_LatestExecutedState defines model for PackageListItem.InstallationInfo.LatestExecutedState. -type PackageListItem_InstallationInfo_LatestExecutedState struct { - Error *string `json:"error,omitempty"` - Name string `json:"name"` - StartedAt string `json:"started_at"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// PackageListItem_InstallationInfo_LatestInstallFailedAttempts_Error defines model for PackageListItem.InstallationInfo.LatestInstallFailedAttempts.Error. -type PackageListItem_InstallationInfo_LatestInstallFailedAttempts_Error struct { - Message string `json:"message"` - Name string `json:"name"` - Stack *string `json:"stack,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// PackageListItem_InstallationInfo_LatestInstallFailedAttempts_Item defines model for PackageListItem.InstallationInfo.LatestInstallFailedAttempts.Item. -type PackageListItem_InstallationInfo_LatestInstallFailedAttempts_Item struct { - CreatedAt string `json:"created_at"` - Error PackageListItem_InstallationInfo_LatestInstallFailedAttempts_Error `json:"error"` - TargetVersion string `json:"target_version"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// PackageListItemInstallationInfoVerificationStatus defines model for PackageListItem.InstallationInfo.VerificationStatus. -type PackageListItemInstallationInfoVerificationStatus string - -// PackageListItem_InstallationInfo defines model for PackageListItem.InstallationInfo. -type PackageListItem_InstallationInfo struct { - AdditionalSpacesInstalledKibana *map[string][]PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Item `json:"additional_spaces_installed_kibana,omitempty"` - CreatedAt *string `json:"created_at,omitempty"` - ExperimentalDataStreamFeatures *[]PackageListItem_InstallationInfo_ExperimentalDataStreamFeatures_Item `json:"experimental_data_stream_features,omitempty"` - InstallFormatSchemaVersion *string `json:"install_format_schema_version,omitempty"` - InstallSource PackageListItemInstallationInfoInstallSource `json:"install_source"` - InstallStatus PackageListItemInstallationInfoInstallStatus `json:"install_status"` - InstalledEs []PackageListItem_InstallationInfo_InstalledEs_Item `json:"installed_es"` - InstalledKibana []PackageListItem_InstallationInfo_InstalledKibana_Item `json:"installed_kibana"` - InstalledKibanaSpaceId *string `json:"installed_kibana_space_id,omitempty"` - LatestExecutedState *PackageListItem_InstallationInfo_LatestExecutedState `json:"latest_executed_state,omitempty"` - LatestInstallFailedAttempts *[]PackageListItem_InstallationInfo_LatestInstallFailedAttempts_Item `json:"latest_install_failed_attempts,omitempty"` - Name string `json:"name"` - Namespaces *[]string `json:"namespaces,omitempty"` - Type string `json:"type"` - UpdatedAt *string `json:"updated_at,omitempty"` - VerificationKeyId *string `json:"verification_key_id"` - VerificationStatus PackageListItemInstallationInfoVerificationStatus `json:"verification_status"` - Version string `json:"version"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// PackageListItemOwnerType defines model for PackageListItem.Owner.Type. -type PackageListItemOwnerType string - -// PackageListItem_Owner defines model for PackageListItem.Owner. -type PackageListItem_Owner struct { - Github *string `json:"github,omitempty"` - Type *PackageListItemOwnerType `json:"type,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// PackageListItemRelease defines model for PackageListItem.Release. -type PackageListItemRelease string - -// PackageListItem_Source defines model for PackageListItem.Source. -type PackageListItem_Source struct { - License string `json:"license"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// PackageListItemType defines model for PackageListItem.Type. -type PackageListItemType string - -// PackagePolicy defines model for package_policy. -type PackagePolicy struct { - Agents *float32 `json:"agents,omitempty"` - CreatedAt string `json:"created_at"` - CreatedBy string `json:"created_by"` - - // Description Package policy description - Description *string `json:"description,omitempty"` - Elasticsearch *PackagePolicy_Elasticsearch `json:"elasticsearch,omitempty"` - Enabled bool `json:"enabled"` - Id string `json:"id"` - - // Inputs Package policy inputs (see integration documentation to know what inputs are available) - Inputs map[string]PackagePolicyInput `json:"inputs"` - IsManaged *bool `json:"is_managed,omitempty"` - - // Name Package policy name (should be unique) - Name string `json:"name"` - - // Namespace The package policy namespace. Leave blank to inherit the agent policy's namespace. - Namespace *string `json:"namespace,omitempty"` - OutputId *string `json:"output_id"` - - // Overrides Override settings that are defined in the package policy. The override option should be used only in unusual circumstances and not as a routine procedure. - Overrides *struct { - Inputs *map[string]interface{} `json:"inputs,omitempty"` - } `json:"overrides"` - Package *struct { - ExperimentalDataStreamFeatures *[]struct { - DataStream string `json:"data_stream"` - Features struct { - DocValueOnlyNumeric *bool `json:"doc_value_only_numeric,omitempty"` - DocValueOnlyOther *bool `json:"doc_value_only_other,omitempty"` - SyntheticSource *bool `json:"synthetic_source,omitempty"` - Tsdb *bool `json:"tsdb,omitempty"` - } `json:"features"` - } `json:"experimental_data_stream_features,omitempty"` - - // Name Package name - Name string `json:"name"` - RequiresRoot *bool `json:"requires_root,omitempty"` - Title *string `json:"title,omitempty"` - - // Version Package version - Version string `json:"version"` - } `json:"package,omitempty"` - - // PolicyId Agent policy ID where that package policy will be added - // Deprecated: - PolicyId *string `json:"policy_id"` - PolicyIds *[]string `json:"policy_ids,omitempty"` - Revision float32 `json:"revision"` - SecretReferences *[]PackagePolicySecretRef `json:"secret_references,omitempty"` - SpaceIds *[]string `json:"spaceIds,omitempty"` - UpdatedAt string `json:"updated_at"` - UpdatedBy string `json:"updated_by"` - Vars *map[string]interface{} `json:"vars,omitempty"` - Version *string `json:"version,omitempty"` -} - -// PackagePolicy_Elasticsearch_Privileges defines model for PackagePolicy.Elasticsearch.Privileges. -type PackagePolicy_Elasticsearch_Privileges struct { - Cluster *[]string `json:"cluster,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// PackagePolicy_Elasticsearch defines model for PackagePolicy.Elasticsearch. -type PackagePolicy_Elasticsearch struct { - Privileges *PackagePolicy_Elasticsearch_Privileges `json:"privileges,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// PackagePolicyInput defines model for package_policy_input. -type PackagePolicyInput struct { - // Enabled enable or disable that input, (default to true) - Enabled *bool `json:"enabled,omitempty"` - - // Streams Input streams (see integration documentation to know what streams are available) - Streams *map[string]PackagePolicyInputStream `json:"streams,omitempty"` - Vars *map[string]interface{} `json:"vars,omitempty"` -} - -// PackagePolicyInputStream defines model for package_policy_input_stream. -type PackagePolicyInputStream struct { - // Enabled enable or disable that stream, (default to true) - Enabled *bool `json:"enabled,omitempty"` - Vars *map[string]interface{} `json:"vars,omitempty"` -} - -// PackagePolicyRequest defines model for package_policy_request. -type PackagePolicyRequest struct { - Description *string `json:"description,omitempty"` - Force *bool `json:"force,omitempty"` - Id *string `json:"id,omitempty"` - - // Inputs Package policy inputs (see integration documentation to know what inputs are available) - Inputs *map[string]PackagePolicyRequestInput `json:"inputs,omitempty"` - Name string `json:"name"` - Namespace *string `json:"namespace,omitempty"` - OutputId *string `json:"output_id,omitempty"` - Package PackagePolicyRequestPackage `json:"package"` - PolicyId *string `json:"policy_id"` - PolicyIds *[]string `json:"policy_ids,omitempty"` - Vars *map[string]interface{} `json:"vars,omitempty"` -} - -// PackagePolicyRequestInput defines model for package_policy_request_input. -type PackagePolicyRequestInput struct { - // Enabled enable or disable that input, (default to true) - Enabled *bool `json:"enabled,omitempty"` - - // Streams Input streams (see integration documentation to know what streams are available) - Streams *map[string]PackagePolicyRequestInputStream `json:"streams,omitempty"` - Vars *map[string]interface{} `json:"vars,omitempty"` -} - -// PackagePolicyRequestInputStream defines model for package_policy_request_input_stream. -type PackagePolicyRequestInputStream struct { - // Enabled enable or disable that stream, (default to true) - Enabled *bool `json:"enabled,omitempty"` - Vars *map[string]interface{} `json:"vars,omitempty"` -} - -// PackagePolicyRequestPackage defines model for package_policy_request_package. -type PackagePolicyRequestPackage struct { - ExperimentalDataStreamFeatures *[]struct { - DataStream string `json:"data_stream"` - Features struct { - DocValueOnlyNumeric *bool `json:"doc_value_only_numeric,omitempty"` - DocValueOnlyOther *bool `json:"doc_value_only_other,omitempty"` - SyntheticSource *bool `json:"synthetic_source,omitempty"` - Tsdb *bool `json:"tsdb,omitempty"` - } `json:"features"` - } `json:"experimental_data_stream_features,omitempty"` - - // Name Package name - Name string `json:"name"` - RequiresRoot *bool `json:"requires_root,omitempty"` - Title *string `json:"title,omitempty"` - - // Version Package version - Version string `json:"version"` -} - -// PackagePolicySecretRef defines model for package_policy_secret_ref. -type PackagePolicySecretRef struct { - Id string `json:"id"` -} - -// ServerHost defines model for server_host. -type ServerHost struct { - HostUrls []string `json:"host_urls"` - Id string `json:"id"` - IsDefault *bool `json:"is_default,omitempty"` - IsInternal *bool `json:"is_internal,omitempty"` - IsPreconfigured *bool `json:"is_preconfigured,omitempty"` - Name string `json:"name"` - ProxyId *string `json:"proxy_id"` -} - -// UpdateOutputElasticsearch defines model for update_output_elasticsearch. -type UpdateOutputElasticsearch struct { - AllowEdit *[]string `json:"allow_edit,omitempty"` - CaSha256 *string `json:"ca_sha256,omitempty"` - CaTrustedFingerprint *string `json:"ca_trusted_fingerprint,omitempty"` - ConfigYaml *string `json:"config_yaml"` - Hosts *[]string `json:"hosts,omitempty"` - IsDefault *bool `json:"is_default,omitempty"` - IsDefaultMonitoring *bool `json:"is_default_monitoring,omitempty"` - IsInternal *bool `json:"is_internal,omitempty"` - IsPreconfigured *bool `json:"is_preconfigured,omitempty"` - Name *string `json:"name,omitempty"` - Preset *UpdateOutputElasticsearchPreset `json:"preset,omitempty"` - ProxyId *string `json:"proxy_id,omitempty"` - Shipper *UpdateOutputShipper `json:"shipper,omitempty"` - Ssl *UpdateOutputSsl `json:"ssl,omitempty"` - Type *UpdateOutputElasticsearchType `json:"type,omitempty"` -} - -// UpdateOutputElasticsearchPreset defines model for UpdateOutputElasticsearch.Preset. -type UpdateOutputElasticsearchPreset string - -// UpdateOutputElasticsearchType defines model for UpdateOutputElasticsearch.Type. -type UpdateOutputElasticsearchType string - -// UpdateOutputKafka defines model for update_output_kafka. -type UpdateOutputKafka struct { - AllowEdit *[]string `json:"allow_edit,omitempty"` - AuthType *UpdateOutputKafkaAuthType `json:"auth_type,omitempty"` - BrokerTimeout *float32 `json:"broker_timeout,omitempty"` - CaSha256 *string `json:"ca_sha256,omitempty"` - CaTrustedFingerprint *string `json:"ca_trusted_fingerprint,omitempty"` - ClientId *string `json:"client_id,omitempty"` - Compression *UpdateOutputKafkaCompression `json:"compression,omitempty"` - CompressionLevel interface{} `json:"compression_level"` - ConfigYaml *string `json:"config_yaml"` - ConnectionType interface{} `json:"connection_type"` - Hash *struct { - Hash *string `json:"hash,omitempty"` - Random *bool `json:"random,omitempty"` - } `json:"hash,omitempty"` - Headers *[]struct { - Key string `json:"key"` - Value string `json:"value"` - } `json:"headers,omitempty"` - Hosts *[]string `json:"hosts,omitempty"` - IsDefault *bool `json:"is_default,omitempty"` - IsDefaultMonitoring *bool `json:"is_default_monitoring,omitempty"` - IsInternal *bool `json:"is_internal,omitempty"` - IsPreconfigured *bool `json:"is_preconfigured,omitempty"` - Key *string `json:"key,omitempty"` - Name string `json:"name"` - Partition *UpdateOutputKafkaPartition `json:"partition,omitempty"` - Password interface{} `json:"password"` - ProxyId *string `json:"proxy_id,omitempty"` - Random *struct { - GroupEvents *float32 `json:"group_events,omitempty"` - } `json:"random,omitempty"` - RequiredAcks *UpdateOutputKafkaRequiredAcks `json:"required_acks,omitempty"` - RoundRobin *struct { - GroupEvents *float32 `json:"group_events,omitempty"` - } `json:"round_robin,omitempty"` - Sasl *struct { - Mechanism *UpdateOutputKafkaSaslMechanism `json:"mechanism,omitempty"` - } `json:"sasl"` - Secrets *struct { - Password *UpdateOutputKafka_Secrets_Password `json:"password,omitempty"` - Ssl *struct { - Key UpdateOutputKafka_Secrets_Ssl_Key `json:"key"` - } `json:"ssl,omitempty"` - } `json:"secrets,omitempty"` - Shipper *UpdateOutputShipper `json:"shipper,omitempty"` - Ssl *UpdateOutputSsl `json:"ssl,omitempty"` - Timeout *float32 `json:"timeout,omitempty"` - Topic *string `json:"topic,omitempty"` - Topics *[]struct { - Topic string `json:"topic"` - When *struct { - Condition *string `json:"condition,omitempty"` - Type *UpdateOutputKafkaTopicsWhenType `json:"type,omitempty"` - } `json:"when,omitempty"` - } `json:"topics,omitempty"` - Type *UpdateOutputKafkaType `json:"type,omitempty"` - Username interface{} `json:"username"` - Version *string `json:"version,omitempty"` -} - -// UpdateOutputKafkaAuthType defines model for UpdateOutputKafka.AuthType. -type UpdateOutputKafkaAuthType string - -// UpdateOutputKafkaCompression defines model for UpdateOutputKafka.Compression. -type UpdateOutputKafkaCompression string - -// UpdateOutputKafkaPartition defines model for UpdateOutputKafka.Partition. -type UpdateOutputKafkaPartition string - -// UpdateOutputKafkaRequiredAcks defines model for UpdateOutputKafka.RequiredAcks. -type UpdateOutputKafkaRequiredAcks int - -// UpdateOutputKafkaSaslMechanism defines model for UpdateOutputKafka.Sasl.Mechanism. -type UpdateOutputKafkaSaslMechanism string - -// UpdateOutputKafkaSecretsPassword0 defines model for . -type UpdateOutputKafkaSecretsPassword0 struct { - Id string `json:"id"` -} - -// UpdateOutputKafkaSecretsPassword1 defines model for . -type UpdateOutputKafkaSecretsPassword1 = string - -// UpdateOutputKafka_Secrets_Password defines model for UpdateOutputKafka.Secrets.Password. -type UpdateOutputKafka_Secrets_Password struct { - union json.RawMessage -} - -// UpdateOutputKafkaSecretsSslKey0 defines model for . -type UpdateOutputKafkaSecretsSslKey0 struct { - Id string `json:"id"` -} - -// UpdateOutputKafkaSecretsSslKey1 defines model for . -type UpdateOutputKafkaSecretsSslKey1 = string - -// UpdateOutputKafka_Secrets_Ssl_Key defines model for UpdateOutputKafka.Secrets.Ssl.Key. -type UpdateOutputKafka_Secrets_Ssl_Key struct { - union json.RawMessage -} - -// UpdateOutputKafkaTopicsWhenType defines model for UpdateOutputKafka.Topics.When.Type. -type UpdateOutputKafkaTopicsWhenType string - -// UpdateOutputKafkaType defines model for UpdateOutputKafka.Type. -type UpdateOutputKafkaType string - -// UpdateOutputLogstash defines model for update_output_logstash. -type UpdateOutputLogstash struct { - AllowEdit *[]string `json:"allow_edit,omitempty"` - CaSha256 *string `json:"ca_sha256,omitempty"` - CaTrustedFingerprint *string `json:"ca_trusted_fingerprint,omitempty"` - ConfigYaml *string `json:"config_yaml"` - Hosts *[]string `json:"hosts,omitempty"` - IsDefault *bool `json:"is_default,omitempty"` - IsDefaultMonitoring *bool `json:"is_default_monitoring,omitempty"` - IsInternal *bool `json:"is_internal,omitempty"` - IsPreconfigured *bool `json:"is_preconfigured,omitempty"` - Name *string `json:"name,omitempty"` - ProxyId *string `json:"proxy_id,omitempty"` - Secrets *struct { - Ssl *struct { - Key *UpdateOutputLogstash_Secrets_Ssl_Key `json:"key,omitempty"` - } `json:"ssl,omitempty"` - } `json:"secrets,omitempty"` - Shipper *UpdateOutputShipper `json:"shipper,omitempty"` - Ssl *UpdateOutputSsl `json:"ssl,omitempty"` - Type *UpdateOutputLogstashType `json:"type,omitempty"` -} - -// UpdateOutputLogstashSecretsSslKey0 defines model for . -type UpdateOutputLogstashSecretsSslKey0 struct { - Id string `json:"id"` -} - -// UpdateOutputLogstashSecretsSslKey1 defines model for . -type UpdateOutputLogstashSecretsSslKey1 = string - -// UpdateOutputLogstash_Secrets_Ssl_Key defines model for UpdateOutputLogstash.Secrets.Ssl.Key. -type UpdateOutputLogstash_Secrets_Ssl_Key struct { - union json.RawMessage -} - -// UpdateOutputLogstashType defines model for UpdateOutputLogstash.Type. -type UpdateOutputLogstashType string - -// UpdateOutputRemoteElasticsearch defines model for update_output_remote_elasticsearch. -type UpdateOutputRemoteElasticsearch struct { - AllowEdit *[]string `json:"allow_edit,omitempty"` - CaSha256 *string `json:"ca_sha256,omitempty"` - CaTrustedFingerprint *string `json:"ca_trusted_fingerprint,omitempty"` - ConfigYaml *string `json:"config_yaml"` - Hosts *[]string `json:"hosts,omitempty"` - IsDefault *bool `json:"is_default,omitempty"` - IsDefaultMonitoring *bool `json:"is_default_monitoring,omitempty"` - IsInternal *bool `json:"is_internal,omitempty"` - IsPreconfigured *bool `json:"is_preconfigured,omitempty"` - Name *string `json:"name,omitempty"` - Preset *UpdateOutputRemoteElasticsearchPreset `json:"preset,omitempty"` - ProxyId *string `json:"proxy_id,omitempty"` - Secrets *struct { - ServiceToken *UpdateOutputRemoteElasticsearch_Secrets_ServiceToken `json:"service_token,omitempty"` - } `json:"secrets,omitempty"` - ServiceToken *string `json:"service_token"` - Shipper *UpdateOutputShipper `json:"shipper,omitempty"` - Ssl *UpdateOutputSsl `json:"ssl,omitempty"` - Type *UpdateOutputRemoteElasticsearchType `json:"type,omitempty"` -} - -// UpdateOutputRemoteElasticsearchPreset defines model for UpdateOutputRemoteElasticsearch.Preset. -type UpdateOutputRemoteElasticsearchPreset string - -// UpdateOutputRemoteElasticsearchSecretsServiceToken0 defines model for . -type UpdateOutputRemoteElasticsearchSecretsServiceToken0 struct { - Id string `json:"id"` -} - -// UpdateOutputRemoteElasticsearchSecretsServiceToken1 defines model for . -type UpdateOutputRemoteElasticsearchSecretsServiceToken1 = string - -// UpdateOutputRemoteElasticsearch_Secrets_ServiceToken defines model for UpdateOutputRemoteElasticsearch.Secrets.ServiceToken. -type UpdateOutputRemoteElasticsearch_Secrets_ServiceToken struct { - union json.RawMessage -} - -// UpdateOutputRemoteElasticsearchType defines model for UpdateOutputRemoteElasticsearch.Type. -type UpdateOutputRemoteElasticsearchType string - -// UpdateOutputShipper defines model for update_output_shipper. -type UpdateOutputShipper struct { - CompressionLevel *float32 `json:"compression_level"` - DiskQueueCompressionEnabled *bool `json:"disk_queue_compression_enabled"` - DiskQueueEnabled *bool `json:"disk_queue_enabled"` - DiskQueueEncryptionEnabled *bool `json:"disk_queue_encryption_enabled"` - DiskQueueMaxSize *float32 `json:"disk_queue_max_size"` - DiskQueuePath *string `json:"disk_queue_path"` - Loadbalance *bool `json:"loadbalance"` - MaxBatchBytes *float32 `json:"max_batch_bytes"` - MemQueueEvents *float32 `json:"mem_queue_events"` - QueueFlushTimeout *float32 `json:"queue_flush_timeout"` -} - -// UpdateOutputSsl defines model for update_output_ssl. -type UpdateOutputSsl struct { - Certificate *string `json:"certificate,omitempty"` - CertificateAuthorities *[]string `json:"certificate_authorities,omitempty"` - Key *string `json:"key,omitempty"` - VerificationMode *UpdateOutputSslVerificationMode `json:"verification_mode,omitempty"` -} - -// UpdateOutputSslVerificationMode defines model for UpdateOutputSsl.VerificationMode. -type UpdateOutputSslVerificationMode string - -// UpdateOutputUnion defines model for update_output_union. -type UpdateOutputUnion struct { - union json.RawMessage -} - -// GetAgentPoliciesParams defines parameters for GetAgentPolicies. -type GetAgentPoliciesParams struct { - Page *float32 `form:"page,omitempty" json:"page,omitempty"` - PerPage *float32 `form:"perPage,omitempty" json:"perPage,omitempty"` - SortField *string `form:"sortField,omitempty" json:"sortField,omitempty"` - SortOrder *GetAgentPoliciesParamsSortOrder `form:"sortOrder,omitempty" json:"sortOrder,omitempty"` - ShowUpgradeable *bool `form:"showUpgradeable,omitempty" json:"showUpgradeable,omitempty"` - Kuery *string `form:"kuery,omitempty" json:"kuery,omitempty"` - - // NoAgentCount use withAgentCount instead - NoAgentCount *bool `form:"noAgentCount,omitempty" json:"noAgentCount,omitempty"` - - // WithAgentCount get policies with agent count - WithAgentCount *bool `form:"withAgentCount,omitempty" json:"withAgentCount,omitempty"` - - // Full get full policies with package policies populated - Full *bool `form:"full,omitempty" json:"full,omitempty"` - Format *GetAgentPoliciesParamsFormat `form:"format,omitempty" json:"format,omitempty"` -} - -// GetAgentPoliciesParamsSortOrder defines parameters for GetAgentPolicies. -type GetAgentPoliciesParamsSortOrder string - -// GetAgentPoliciesParamsFormat defines parameters for GetAgentPolicies. -type GetAgentPoliciesParamsFormat string - -// CreateAgentPolicyJSONBody defines parameters for CreateAgentPolicy. -type CreateAgentPolicyJSONBody struct { - AdvancedSettings *struct { - AgentDownloadTargetDirectory *interface{} `json:"agent_download_target_directory"` - AgentDownloadTimeout *interface{} `json:"agent_download_timeout"` - AgentLimitsGoMaxProcs *interface{} `json:"agent_limits_go_max_procs"` - AgentLoggingLevel *interface{} `json:"agent_logging_level"` - AgentLoggingMetricsPeriod *interface{} `json:"agent_logging_metrics_period"` - } `json:"advanced_settings,omitempty"` - AgentFeatures *[]struct { - Enabled bool `json:"enabled"` - Name string `json:"name"` - } `json:"agent_features,omitempty"` - DataOutputId *string `json:"data_output_id"` - Description *string `json:"description,omitempty"` - DownloadSourceId *string `json:"download_source_id"` - FleetServerHostId *string `json:"fleet_server_host_id"` - Force *bool `json:"force,omitempty"` - - // GlobalDataTags User defined data tags that are added to all of the inputs. The values can be strings or numbers. - GlobalDataTags *[]struct { - Name string `json:"name"` - Value CreateAgentPolicyJSONBody_GlobalDataTags_Value `json:"value"` - } `json:"global_data_tags,omitempty"` - HasFleetServer *bool `json:"has_fleet_server,omitempty"` - Id *string `json:"id,omitempty"` - InactivityTimeout *float32 `json:"inactivity_timeout,omitempty"` - IsDefault *bool `json:"is_default,omitempty"` - IsDefaultFleetServer *bool `json:"is_default_fleet_server,omitempty"` - IsManaged *bool `json:"is_managed,omitempty"` - IsProtected *bool `json:"is_protected,omitempty"` - - // KeepMonitoringAlive When set to true, monitoring will be enabled but logs/metrics collection will be disabled - KeepMonitoringAlive *bool `json:"keep_monitoring_alive,omitempty"` - MonitoringDiagnostics *struct { - Limit *struct { - Burst *float32 `json:"burst,omitempty"` - Interval *string `json:"interval,omitempty"` - } `json:"limit,omitempty"` - Uploader *struct { - InitDur *string `json:"init_dur,omitempty"` - MaxDur *string `json:"max_dur,omitempty"` - MaxRetries *float32 `json:"max_retries,omitempty"` - } `json:"uploader,omitempty"` - } `json:"monitoring_diagnostics,omitempty"` - MonitoringEnabled *[]CreateAgentPolicyJSONBodyMonitoringEnabled `json:"monitoring_enabled,omitempty"` - MonitoringHttp *struct { - Buffer *struct { - Enabled *bool `json:"enabled,omitempty"` - } `json:"buffer,omitempty"` - Enabled bool `json:"enabled"` - Host *string `json:"host,omitempty"` - Port *float32 `json:"port,omitempty"` - } `json:"monitoring_http,omitempty"` - MonitoringOutputId *string `json:"monitoring_output_id"` - MonitoringPprofEnabled *bool `json:"monitoring_pprof_enabled,omitempty"` - Name string `json:"name"` - Namespace string `json:"namespace"` - - // Overrides Override settings that are defined in the agent policy. Input settings cannot be overridden. The override option should be used only in unusual circumstances and not as a routine procedure. - Overrides *map[string]interface{} `json:"overrides,omitempty"` - SpaceIds *[]string `json:"space_ids,omitempty"` - - // SupportsAgentless Indicates whether the agent policy supports agentless integrations. - SupportsAgentless *bool `json:"supports_agentless,omitempty"` - UnenrollTimeout *float32 `json:"unenroll_timeout,omitempty"` -} - -// CreateAgentPolicyParams defines parameters for CreateAgentPolicy. -type CreateAgentPolicyParams struct { - SysMonitoring *bool `form:"sys_monitoring,omitempty" json:"sys_monitoring,omitempty"` -} - -// CreateAgentPolicyJSONBodyGlobalDataTagsValue0 defines parameters for CreateAgentPolicy. -type CreateAgentPolicyJSONBodyGlobalDataTagsValue0 = string - -// CreateAgentPolicyJSONBodyGlobalDataTagsValue1 defines parameters for CreateAgentPolicy. -type CreateAgentPolicyJSONBodyGlobalDataTagsValue1 = float32 - -// CreateAgentPolicyJSONBody_GlobalDataTags_Value defines parameters for CreateAgentPolicy. -type CreateAgentPolicyJSONBody_GlobalDataTags_Value struct { - union json.RawMessage -} - -// CreateAgentPolicyJSONBodyMonitoringEnabled defines parameters for CreateAgentPolicy. -type CreateAgentPolicyJSONBodyMonitoringEnabled string - -// DeleteAgentPolicyJSONBody defines parameters for DeleteAgentPolicy. -type DeleteAgentPolicyJSONBody struct { - AgentPolicyId string `json:"agentPolicyId"` - - // Force bypass validation checks that can prevent agent policy deletion - Force *bool `json:"force,omitempty"` -} - -// GetAgentPolicyParams defines parameters for GetAgentPolicy. -type GetAgentPolicyParams struct { - Format *GetAgentPolicyParamsFormat `form:"format,omitempty" json:"format,omitempty"` -} - -// GetAgentPolicyParamsFormat defines parameters for GetAgentPolicy. -type GetAgentPolicyParamsFormat string - -// UpdateAgentPolicyJSONBody defines parameters for UpdateAgentPolicy. -type UpdateAgentPolicyJSONBody struct { - AdvancedSettings *struct { - AgentDownloadTargetDirectory *interface{} `json:"agent_download_target_directory"` - AgentDownloadTimeout *interface{} `json:"agent_download_timeout"` - AgentLimitsGoMaxProcs *interface{} `json:"agent_limits_go_max_procs"` - AgentLoggingLevel *interface{} `json:"agent_logging_level"` - AgentLoggingMetricsPeriod *interface{} `json:"agent_logging_metrics_period"` - } `json:"advanced_settings,omitempty"` - AgentFeatures *[]struct { - Enabled bool `json:"enabled"` - Name string `json:"name"` - } `json:"agent_features,omitempty"` - DataOutputId *string `json:"data_output_id"` - Description *string `json:"description,omitempty"` - DownloadSourceId *string `json:"download_source_id"` - FleetServerHostId *string `json:"fleet_server_host_id"` - Force *bool `json:"force,omitempty"` - - // GlobalDataTags User defined data tags that are added to all of the inputs. The values can be strings or numbers. - GlobalDataTags *[]struct { - Name string `json:"name"` - Value UpdateAgentPolicyJSONBody_GlobalDataTags_Value `json:"value"` - } `json:"global_data_tags,omitempty"` - HasFleetServer *bool `json:"has_fleet_server,omitempty"` - Id *string `json:"id,omitempty"` - InactivityTimeout *float32 `json:"inactivity_timeout,omitempty"` - IsDefault *bool `json:"is_default,omitempty"` - IsDefaultFleetServer *bool `json:"is_default_fleet_server,omitempty"` - IsManaged *bool `json:"is_managed,omitempty"` - IsProtected *bool `json:"is_protected,omitempty"` - - // KeepMonitoringAlive When set to true, monitoring will be enabled but logs/metrics collection will be disabled - KeepMonitoringAlive *bool `json:"keep_monitoring_alive,omitempty"` - MonitoringDiagnostics *struct { - Limit *struct { - Burst *float32 `json:"burst,omitempty"` - Interval *string `json:"interval,omitempty"` - } `json:"limit,omitempty"` - Uploader *struct { - InitDur *string `json:"init_dur,omitempty"` - MaxDur *string `json:"max_dur,omitempty"` - MaxRetries *float32 `json:"max_retries,omitempty"` - } `json:"uploader,omitempty"` - } `json:"monitoring_diagnostics,omitempty"` - MonitoringEnabled *[]UpdateAgentPolicyJSONBodyMonitoringEnabled `json:"monitoring_enabled,omitempty"` - MonitoringHttp *struct { - Buffer *struct { - Enabled *bool `json:"enabled,omitempty"` - } `json:"buffer,omitempty"` - Enabled bool `json:"enabled"` - Host *string `json:"host,omitempty"` - Port *float32 `json:"port,omitempty"` - } `json:"monitoring_http,omitempty"` - MonitoringOutputId *string `json:"monitoring_output_id"` - MonitoringPprofEnabled *bool `json:"monitoring_pprof_enabled,omitempty"` - Name string `json:"name"` - Namespace string `json:"namespace"` - - // Overrides Override settings that are defined in the agent policy. Input settings cannot be overridden. The override option should be used only in unusual circumstances and not as a routine procedure. - Overrides *map[string]interface{} `json:"overrides,omitempty"` - SpaceIds *[]string `json:"space_ids,omitempty"` - - // SupportsAgentless Indicates whether the agent policy supports agentless integrations. - SupportsAgentless *bool `json:"supports_agentless,omitempty"` - UnenrollTimeout *float32 `json:"unenroll_timeout,omitempty"` -} - -// UpdateAgentPolicyParams defines parameters for UpdateAgentPolicy. -type UpdateAgentPolicyParams struct { - Format *UpdateAgentPolicyParamsFormat `form:"format,omitempty" json:"format,omitempty"` -} - -// UpdateAgentPolicyParamsFormat defines parameters for UpdateAgentPolicy. -type UpdateAgentPolicyParamsFormat string - -// UpdateAgentPolicyJSONBodyGlobalDataTagsValue0 defines parameters for UpdateAgentPolicy. -type UpdateAgentPolicyJSONBodyGlobalDataTagsValue0 = string - -// UpdateAgentPolicyJSONBodyGlobalDataTagsValue1 defines parameters for UpdateAgentPolicy. -type UpdateAgentPolicyJSONBodyGlobalDataTagsValue1 = float32 - -// UpdateAgentPolicyJSONBody_GlobalDataTags_Value defines parameters for UpdateAgentPolicy. -type UpdateAgentPolicyJSONBody_GlobalDataTags_Value struct { - union json.RawMessage -} - -// UpdateAgentPolicyJSONBodyMonitoringEnabled defines parameters for UpdateAgentPolicy. -type UpdateAgentPolicyJSONBodyMonitoringEnabled string - -// GetEnrollmentApiKeysParams defines parameters for GetEnrollmentApiKeys. -type GetEnrollmentApiKeysParams struct { - Page *float32 `form:"page,omitempty" json:"page,omitempty"` - PerPage *float32 `form:"perPage,omitempty" json:"perPage,omitempty"` - Kuery *string `form:"kuery,omitempty" json:"kuery,omitempty"` -} - -// ListPackagesParams defines parameters for ListPackages. -type ListPackagesParams struct { - Category *string `form:"category,omitempty" json:"category,omitempty"` - Prerelease *bool `form:"prerelease,omitempty" json:"prerelease,omitempty"` - Experimental *bool `form:"experimental,omitempty" json:"experimental,omitempty"` - ExcludeInstallStatus *bool `form:"excludeInstallStatus,omitempty" json:"excludeInstallStatus,omitempty"` -} - -// InstallPackageByUploadParams defines parameters for InstallPackageByUpload. -type InstallPackageByUploadParams struct { - IgnoreMappingUpdateErrors *bool `form:"ignoreMappingUpdateErrors,omitempty" json:"ignoreMappingUpdateErrors,omitempty"` - SkipDataStreamRollover *bool `form:"skipDataStreamRollover,omitempty" json:"skipDataStreamRollover,omitempty"` -} - -// DeletePackageJSONBody defines parameters for DeletePackage. -type DeletePackageJSONBody struct { - Force bool `json:"force"` -} - -// DeletePackageParams defines parameters for DeletePackage. -type DeletePackageParams struct { - Force *bool `form:"force,omitempty" json:"force,omitempty"` -} - -// GetPackageParams defines parameters for GetPackage. -type GetPackageParams struct { - IgnoreUnverified *bool `form:"ignoreUnverified,omitempty" json:"ignoreUnverified,omitempty"` - Prerelease *bool `form:"prerelease,omitempty" json:"prerelease,omitempty"` - Full *bool `form:"full,omitempty" json:"full,omitempty"` - WithMetadata *bool `form:"withMetadata,omitempty" json:"withMetadata,omitempty"` -} - -// InstallPackageJSONBody defines parameters for InstallPackage. -type InstallPackageJSONBody struct { - Force *bool `json:"force,omitempty"` - IgnoreConstraints *bool `json:"ignore_constraints,omitempty"` -} - -// InstallPackageParams defines parameters for InstallPackage. -type InstallPackageParams struct { - Prerelease *bool `form:"prerelease,omitempty" json:"prerelease,omitempty"` - IgnoreMappingUpdateErrors *bool `form:"ignoreMappingUpdateErrors,omitempty" json:"ignoreMappingUpdateErrors,omitempty"` - SkipDataStreamRollover *bool `form:"skipDataStreamRollover,omitempty" json:"skipDataStreamRollover,omitempty"` -} - -// CreateFleetServerHostJSONBody defines parameters for CreateFleetServerHost. -type CreateFleetServerHostJSONBody struct { - HostUrls []string `json:"host_urls"` - Id *string `json:"id,omitempty"` - IsDefault *bool `json:"is_default,omitempty"` - IsInternal *bool `json:"is_internal,omitempty"` - IsPreconfigured *bool `json:"is_preconfigured,omitempty"` - Name string `json:"name"` - ProxyId *string `json:"proxy_id,omitempty"` -} - -// UpdateFleetServerHostJSONBody defines parameters for UpdateFleetServerHost. -type UpdateFleetServerHostJSONBody struct { - HostUrls *[]string `json:"host_urls,omitempty"` - IsDefault *bool `json:"is_default,omitempty"` - IsInternal *bool `json:"is_internal,omitempty"` - Name *string `json:"name,omitempty"` - ProxyId *string `json:"proxy_id,omitempty"` -} - -// GetPackagePoliciesParams defines parameters for GetPackagePolicies. -type GetPackagePoliciesParams struct { - Page *float32 `form:"page,omitempty" json:"page,omitempty"` - PerPage *float32 `form:"perPage,omitempty" json:"perPage,omitempty"` - SortField *string `form:"sortField,omitempty" json:"sortField,omitempty"` - SortOrder *GetPackagePoliciesParamsSortOrder `form:"sortOrder,omitempty" json:"sortOrder,omitempty"` - ShowUpgradeable *bool `form:"showUpgradeable,omitempty" json:"showUpgradeable,omitempty"` - Kuery *string `form:"kuery,omitempty" json:"kuery,omitempty"` - Format *GetPackagePoliciesParamsFormat `form:"format,omitempty" json:"format,omitempty"` - WithAgentCount *bool `form:"withAgentCount,omitempty" json:"withAgentCount,omitempty"` -} - -// GetPackagePoliciesParamsSortOrder defines parameters for GetPackagePolicies. -type GetPackagePoliciesParamsSortOrder string - -// GetPackagePoliciesParamsFormat defines parameters for GetPackagePolicies. -type GetPackagePoliciesParamsFormat string - -// CreatePackagePolicyParams defines parameters for CreatePackagePolicy. -type CreatePackagePolicyParams struct { - Format *CreatePackagePolicyParamsFormat `form:"format,omitempty" json:"format,omitempty"` -} - -// CreatePackagePolicyParamsFormat defines parameters for CreatePackagePolicy. -type CreatePackagePolicyParamsFormat string - -// DeletePackagePolicyParams defines parameters for DeletePackagePolicy. -type DeletePackagePolicyParams struct { - Force *bool `form:"force,omitempty" json:"force,omitempty"` -} - -// GetPackagePolicyParams defines parameters for GetPackagePolicy. -type GetPackagePolicyParams struct { - Format *GetPackagePolicyParamsFormat `form:"format,omitempty" json:"format,omitempty"` -} - -// GetPackagePolicyParamsFormat defines parameters for GetPackagePolicy. -type GetPackagePolicyParamsFormat string - -// UpdatePackagePolicyParams defines parameters for UpdatePackagePolicy. -type UpdatePackagePolicyParams struct { - Format *UpdatePackagePolicyParamsFormat `form:"format,omitempty" json:"format,omitempty"` -} - -// UpdatePackagePolicyParamsFormat defines parameters for UpdatePackagePolicy. -type UpdatePackagePolicyParamsFormat string - -// CreateAgentPolicyJSONRequestBody defines body for CreateAgentPolicy for application/json ContentType. -type CreateAgentPolicyJSONRequestBody CreateAgentPolicyJSONBody - -// DeleteAgentPolicyJSONRequestBody defines body for DeleteAgentPolicy for application/json ContentType. -type DeleteAgentPolicyJSONRequestBody DeleteAgentPolicyJSONBody - -// UpdateAgentPolicyJSONRequestBody defines body for UpdateAgentPolicy for application/json ContentType. -type UpdateAgentPolicyJSONRequestBody UpdateAgentPolicyJSONBody - -// DeletePackageJSONRequestBody defines body for DeletePackage for application/json ContentType. -type DeletePackageJSONRequestBody DeletePackageJSONBody - -// InstallPackageJSONRequestBody defines body for InstallPackage for application/json ContentType. -type InstallPackageJSONRequestBody InstallPackageJSONBody - -// CreateFleetServerHostJSONRequestBody defines body for CreateFleetServerHost for application/json ContentType. -type CreateFleetServerHostJSONRequestBody CreateFleetServerHostJSONBody - -// UpdateFleetServerHostJSONRequestBody defines body for UpdateFleetServerHost for application/json ContentType. -type UpdateFleetServerHostJSONRequestBody UpdateFleetServerHostJSONBody - -// CreateOutputJSONRequestBody defines body for CreateOutput for application/json ContentType. -type CreateOutputJSONRequestBody = NewOutputUnion - -// UpdateOutputJSONRequestBody defines body for UpdateOutput for application/json ContentType. -type UpdateOutputJSONRequestBody = UpdateOutputUnion - -// CreatePackagePolicyJSONRequestBody defines body for CreatePackagePolicy for application/json ContentType. -type CreatePackagePolicyJSONRequestBody = PackagePolicyRequest - -// UpdatePackagePolicyJSONRequestBody defines body for UpdatePackagePolicy for application/json ContentType. -type UpdatePackagePolicyJSONRequestBody = PackagePolicyRequest - -// Getter for additional properties for AgentPolicy_PackagePolicies_1_Elasticsearch_Privileges. Returns the specified -// element and whether it was found -func (a AgentPolicy_PackagePolicies_1_Elasticsearch_Privileges) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for AgentPolicy_PackagePolicies_1_Elasticsearch_Privileges -func (a *AgentPolicy_PackagePolicies_1_Elasticsearch_Privileges) Set(fieldName string, value interface{}) { - if a.AdditionalProperties == nil { - a.AdditionalProperties = make(map[string]interface{}) - } - a.AdditionalProperties[fieldName] = value -} - -// Override default JSON handling for AgentPolicy_PackagePolicies_1_Elasticsearch_Privileges to handle AdditionalProperties -func (a *AgentPolicy_PackagePolicies_1_Elasticsearch_Privileges) UnmarshalJSON(b []byte) error { - object := make(map[string]json.RawMessage) - err := json.Unmarshal(b, &object) - if err != nil { - return err - } - - if raw, found := object["cluster"]; found { - err = json.Unmarshal(raw, &a.Cluster) - if err != nil { - return fmt.Errorf("error reading 'cluster': %w", err) - } - delete(object, "cluster") - } - - if len(object) != 0 { - a.AdditionalProperties = make(map[string]interface{}) - for fieldName, fieldBuf := range object { - var fieldVal interface{} - err := json.Unmarshal(fieldBuf, &fieldVal) - if err != nil { - return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) - } - a.AdditionalProperties[fieldName] = fieldVal - } - } - return nil -} - -// Override default JSON handling for AgentPolicy_PackagePolicies_1_Elasticsearch_Privileges to handle AdditionalProperties -func (a AgentPolicy_PackagePolicies_1_Elasticsearch_Privileges) MarshalJSON() ([]byte, error) { - var err error - object := make(map[string]json.RawMessage) - - if a.Cluster != nil { - object["cluster"], err = json.Marshal(a.Cluster) - if err != nil { - return nil, fmt.Errorf("error marshaling 'cluster': %w", err) - } - } - - for fieldName, field := range a.AdditionalProperties { - object[fieldName], err = json.Marshal(field) - if err != nil { - return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) - } - } - return json.Marshal(object) -} - -// Getter for additional properties for AgentPolicy_PackagePolicies_1_Elasticsearch. Returns the specified -// element and whether it was found -func (a AgentPolicy_PackagePolicies_1_Elasticsearch) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for AgentPolicy_PackagePolicies_1_Elasticsearch -func (a *AgentPolicy_PackagePolicies_1_Elasticsearch) Set(fieldName string, value interface{}) { - if a.AdditionalProperties == nil { - a.AdditionalProperties = make(map[string]interface{}) - } - a.AdditionalProperties[fieldName] = value -} - -// Override default JSON handling for AgentPolicy_PackagePolicies_1_Elasticsearch to handle AdditionalProperties -func (a *AgentPolicy_PackagePolicies_1_Elasticsearch) UnmarshalJSON(b []byte) error { - object := make(map[string]json.RawMessage) - err := json.Unmarshal(b, &object) - if err != nil { - return err - } - - if raw, found := object["privileges"]; found { - err = json.Unmarshal(raw, &a.Privileges) - if err != nil { - return fmt.Errorf("error reading 'privileges': %w", err) - } - delete(object, "privileges") - } - - if len(object) != 0 { - a.AdditionalProperties = make(map[string]interface{}) - for fieldName, fieldBuf := range object { - var fieldVal interface{} - err := json.Unmarshal(fieldBuf, &fieldVal) - if err != nil { - return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) - } - a.AdditionalProperties[fieldName] = fieldVal - } - } - return nil -} - -// Override default JSON handling for AgentPolicy_PackagePolicies_1_Elasticsearch to handle AdditionalProperties -func (a AgentPolicy_PackagePolicies_1_Elasticsearch) MarshalJSON() ([]byte, error) { - var err error - object := make(map[string]json.RawMessage) - - if a.Privileges != nil { - object["privileges"], err = json.Marshal(a.Privileges) - if err != nil { - return nil, fmt.Errorf("error marshaling 'privileges': %w", err) - } - } - - for fieldName, field := range a.AdditionalProperties { - object[fieldName], err = json.Marshal(field) - if err != nil { - return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) - } - } - return json.Marshal(object) -} - -// Getter for additional properties for OutputElasticsearch. Returns the specified -// element and whether it was found -func (a OutputElasticsearch) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for OutputElasticsearch -func (a *OutputElasticsearch) Set(fieldName string, value interface{}) { - if a.AdditionalProperties == nil { - a.AdditionalProperties = make(map[string]interface{}) - } - a.AdditionalProperties[fieldName] = value -} - -// Override default JSON handling for OutputElasticsearch to handle AdditionalProperties -func (a *OutputElasticsearch) UnmarshalJSON(b []byte) error { - object := make(map[string]json.RawMessage) - err := json.Unmarshal(b, &object) - if err != nil { - return err - } - - if raw, found := object["allow_edit"]; found { - err = json.Unmarshal(raw, &a.AllowEdit) - if err != nil { - return fmt.Errorf("error reading 'allow_edit': %w", err) - } - delete(object, "allow_edit") - } - - if raw, found := object["ca_sha256"]; found { - err = json.Unmarshal(raw, &a.CaSha256) - if err != nil { - return fmt.Errorf("error reading 'ca_sha256': %w", err) - } - delete(object, "ca_sha256") - } - - if raw, found := object["ca_trusted_fingerprint"]; found { - err = json.Unmarshal(raw, &a.CaTrustedFingerprint) - if err != nil { - return fmt.Errorf("error reading 'ca_trusted_fingerprint': %w", err) - } - delete(object, "ca_trusted_fingerprint") - } - - if raw, found := object["config_yaml"]; found { - err = json.Unmarshal(raw, &a.ConfigYaml) - if err != nil { - return fmt.Errorf("error reading 'config_yaml': %w", err) - } - delete(object, "config_yaml") - } - - if raw, found := object["hosts"]; found { - err = json.Unmarshal(raw, &a.Hosts) - if err != nil { - return fmt.Errorf("error reading 'hosts': %w", err) - } - delete(object, "hosts") - } - - if raw, found := object["id"]; found { - err = json.Unmarshal(raw, &a.Id) - if err != nil { - return fmt.Errorf("error reading 'id': %w", err) - } - delete(object, "id") - } - - if raw, found := object["is_default"]; found { - err = json.Unmarshal(raw, &a.IsDefault) - if err != nil { - return fmt.Errorf("error reading 'is_default': %w", err) - } - delete(object, "is_default") - } - - if raw, found := object["is_default_monitoring"]; found { - err = json.Unmarshal(raw, &a.IsDefaultMonitoring) - if err != nil { - return fmt.Errorf("error reading 'is_default_monitoring': %w", err) - } - delete(object, "is_default_monitoring") - } - - if raw, found := object["is_internal"]; found { - err = json.Unmarshal(raw, &a.IsInternal) - if err != nil { - return fmt.Errorf("error reading 'is_internal': %w", err) - } - delete(object, "is_internal") - } - - if raw, found := object["is_preconfigured"]; found { - err = json.Unmarshal(raw, &a.IsPreconfigured) - if err != nil { - return fmt.Errorf("error reading 'is_preconfigured': %w", err) - } - delete(object, "is_preconfigured") - } - - if raw, found := object["name"]; found { - err = json.Unmarshal(raw, &a.Name) - if err != nil { - return fmt.Errorf("error reading 'name': %w", err) - } - delete(object, "name") - } - - if raw, found := object["preset"]; found { - err = json.Unmarshal(raw, &a.Preset) - if err != nil { - return fmt.Errorf("error reading 'preset': %w", err) - } - delete(object, "preset") - } - - if raw, found := object["proxy_id"]; found { - err = json.Unmarshal(raw, &a.ProxyId) - if err != nil { - return fmt.Errorf("error reading 'proxy_id': %w", err) - } - delete(object, "proxy_id") - } - - if raw, found := object["shipper"]; found { - err = json.Unmarshal(raw, &a.Shipper) - if err != nil { - return fmt.Errorf("error reading 'shipper': %w", err) - } - delete(object, "shipper") - } - - if raw, found := object["ssl"]; found { - err = json.Unmarshal(raw, &a.Ssl) - if err != nil { - return fmt.Errorf("error reading 'ssl': %w", err) - } - delete(object, "ssl") - } - - if raw, found := object["type"]; found { - err = json.Unmarshal(raw, &a.Type) - if err != nil { - return fmt.Errorf("error reading 'type': %w", err) - } - delete(object, "type") - } - - if len(object) != 0 { - a.AdditionalProperties = make(map[string]interface{}) - for fieldName, fieldBuf := range object { - var fieldVal interface{} - err := json.Unmarshal(fieldBuf, &fieldVal) - if err != nil { - return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) - } - a.AdditionalProperties[fieldName] = fieldVal - } - } - return nil -} - -// Override default JSON handling for OutputElasticsearch to handle AdditionalProperties -func (a OutputElasticsearch) MarshalJSON() ([]byte, error) { - var err error - object := make(map[string]json.RawMessage) - - if a.AllowEdit != nil { - object["allow_edit"], err = json.Marshal(a.AllowEdit) - if err != nil { - return nil, fmt.Errorf("error marshaling 'allow_edit': %w", err) - } - } - - if a.CaSha256 != nil { - object["ca_sha256"], err = json.Marshal(a.CaSha256) - if err != nil { - return nil, fmt.Errorf("error marshaling 'ca_sha256': %w", err) - } - } - - if a.CaTrustedFingerprint != nil { - object["ca_trusted_fingerprint"], err = json.Marshal(a.CaTrustedFingerprint) - if err != nil { - return nil, fmt.Errorf("error marshaling 'ca_trusted_fingerprint': %w", err) - } - } - - if a.ConfigYaml != nil { - object["config_yaml"], err = json.Marshal(a.ConfigYaml) - if err != nil { - return nil, fmt.Errorf("error marshaling 'config_yaml': %w", err) - } - } - - object["hosts"], err = json.Marshal(a.Hosts) - if err != nil { - return nil, fmt.Errorf("error marshaling 'hosts': %w", err) - } - - if a.Id != nil { - object["id"], err = json.Marshal(a.Id) - if err != nil { - return nil, fmt.Errorf("error marshaling 'id': %w", err) - } - } - - if a.IsDefault != nil { - object["is_default"], err = json.Marshal(a.IsDefault) - if err != nil { - return nil, fmt.Errorf("error marshaling 'is_default': %w", err) - } - } - - if a.IsDefaultMonitoring != nil { - object["is_default_monitoring"], err = json.Marshal(a.IsDefaultMonitoring) - if err != nil { - return nil, fmt.Errorf("error marshaling 'is_default_monitoring': %w", err) - } - } - - if a.IsInternal != nil { - object["is_internal"], err = json.Marshal(a.IsInternal) - if err != nil { - return nil, fmt.Errorf("error marshaling 'is_internal': %w", err) - } - } - - if a.IsPreconfigured != nil { - object["is_preconfigured"], err = json.Marshal(a.IsPreconfigured) - if err != nil { - return nil, fmt.Errorf("error marshaling 'is_preconfigured': %w", err) - } - } - - object["name"], err = json.Marshal(a.Name) - if err != nil { - return nil, fmt.Errorf("error marshaling 'name': %w", err) - } - - if a.Preset != nil { - object["preset"], err = json.Marshal(a.Preset) - if err != nil { - return nil, fmt.Errorf("error marshaling 'preset': %w", err) - } - } - - if a.ProxyId != nil { - object["proxy_id"], err = json.Marshal(a.ProxyId) - if err != nil { - return nil, fmt.Errorf("error marshaling 'proxy_id': %w", err) - } - } - - if a.Shipper != nil { - object["shipper"], err = json.Marshal(a.Shipper) - if err != nil { - return nil, fmt.Errorf("error marshaling 'shipper': %w", err) - } - } - - if a.Ssl != nil { - object["ssl"], err = json.Marshal(a.Ssl) - if err != nil { - return nil, fmt.Errorf("error marshaling 'ssl': %w", err) - } - } - - object["type"], err = json.Marshal(a.Type) - if err != nil { - return nil, fmt.Errorf("error marshaling 'type': %w", err) - } - - for fieldName, field := range a.AdditionalProperties { - object[fieldName], err = json.Marshal(field) - if err != nil { - return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) - } - } - return json.Marshal(object) -} - -// Getter for additional properties for OutputKafka. Returns the specified -// element and whether it was found -func (a OutputKafka) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for OutputKafka -func (a *OutputKafka) Set(fieldName string, value interface{}) { - if a.AdditionalProperties == nil { - a.AdditionalProperties = make(map[string]interface{}) - } - a.AdditionalProperties[fieldName] = value -} - -// Override default JSON handling for OutputKafka to handle AdditionalProperties -func (a *OutputKafka) UnmarshalJSON(b []byte) error { - object := make(map[string]json.RawMessage) - err := json.Unmarshal(b, &object) - if err != nil { - return err - } - - if raw, found := object["allow_edit"]; found { - err = json.Unmarshal(raw, &a.AllowEdit) - if err != nil { - return fmt.Errorf("error reading 'allow_edit': %w", err) - } - delete(object, "allow_edit") - } - - if raw, found := object["auth_type"]; found { - err = json.Unmarshal(raw, &a.AuthType) - if err != nil { - return fmt.Errorf("error reading 'auth_type': %w", err) - } - delete(object, "auth_type") - } - - if raw, found := object["broker_timeout"]; found { - err = json.Unmarshal(raw, &a.BrokerTimeout) - if err != nil { - return fmt.Errorf("error reading 'broker_timeout': %w", err) - } - delete(object, "broker_timeout") - } - - if raw, found := object["ca_sha256"]; found { - err = json.Unmarshal(raw, &a.CaSha256) - if err != nil { - return fmt.Errorf("error reading 'ca_sha256': %w", err) - } - delete(object, "ca_sha256") - } - - if raw, found := object["ca_trusted_fingerprint"]; found { - err = json.Unmarshal(raw, &a.CaTrustedFingerprint) - if err != nil { - return fmt.Errorf("error reading 'ca_trusted_fingerprint': %w", err) - } - delete(object, "ca_trusted_fingerprint") - } - - if raw, found := object["client_id"]; found { - err = json.Unmarshal(raw, &a.ClientId) - if err != nil { - return fmt.Errorf("error reading 'client_id': %w", err) - } - delete(object, "client_id") - } - - if raw, found := object["compression"]; found { - err = json.Unmarshal(raw, &a.Compression) - if err != nil { - return fmt.Errorf("error reading 'compression': %w", err) - } - delete(object, "compression") - } - - if raw, found := object["compression_level"]; found { - err = json.Unmarshal(raw, &a.CompressionLevel) - if err != nil { - return fmt.Errorf("error reading 'compression_level': %w", err) - } - delete(object, "compression_level") - } - - if raw, found := object["config_yaml"]; found { - err = json.Unmarshal(raw, &a.ConfigYaml) - if err != nil { - return fmt.Errorf("error reading 'config_yaml': %w", err) - } - delete(object, "config_yaml") - } - - if raw, found := object["connection_type"]; found { - err = json.Unmarshal(raw, &a.ConnectionType) - if err != nil { - return fmt.Errorf("error reading 'connection_type': %w", err) - } - delete(object, "connection_type") - } - - if raw, found := object["hash"]; found { - err = json.Unmarshal(raw, &a.Hash) - if err != nil { - return fmt.Errorf("error reading 'hash': %w", err) - } - delete(object, "hash") - } - - if raw, found := object["headers"]; found { - err = json.Unmarshal(raw, &a.Headers) - if err != nil { - return fmt.Errorf("error reading 'headers': %w", err) - } - delete(object, "headers") - } - - if raw, found := object["hosts"]; found { - err = json.Unmarshal(raw, &a.Hosts) - if err != nil { - return fmt.Errorf("error reading 'hosts': %w", err) - } - delete(object, "hosts") - } - - if raw, found := object["id"]; found { - err = json.Unmarshal(raw, &a.Id) - if err != nil { - return fmt.Errorf("error reading 'id': %w", err) - } - delete(object, "id") - } - - if raw, found := object["is_default"]; found { - err = json.Unmarshal(raw, &a.IsDefault) - if err != nil { - return fmt.Errorf("error reading 'is_default': %w", err) - } - delete(object, "is_default") - } - - if raw, found := object["is_default_monitoring"]; found { - err = json.Unmarshal(raw, &a.IsDefaultMonitoring) - if err != nil { - return fmt.Errorf("error reading 'is_default_monitoring': %w", err) - } - delete(object, "is_default_monitoring") - } - - if raw, found := object["is_internal"]; found { - err = json.Unmarshal(raw, &a.IsInternal) - if err != nil { - return fmt.Errorf("error reading 'is_internal': %w", err) - } - delete(object, "is_internal") - } - - if raw, found := object["is_preconfigured"]; found { - err = json.Unmarshal(raw, &a.IsPreconfigured) - if err != nil { - return fmt.Errorf("error reading 'is_preconfigured': %w", err) - } - delete(object, "is_preconfigured") - } - - if raw, found := object["key"]; found { - err = json.Unmarshal(raw, &a.Key) - if err != nil { - return fmt.Errorf("error reading 'key': %w", err) - } - delete(object, "key") - } - - if raw, found := object["name"]; found { - err = json.Unmarshal(raw, &a.Name) - if err != nil { - return fmt.Errorf("error reading 'name': %w", err) - } - delete(object, "name") - } - - if raw, found := object["partition"]; found { - err = json.Unmarshal(raw, &a.Partition) - if err != nil { - return fmt.Errorf("error reading 'partition': %w", err) - } - delete(object, "partition") - } - - if raw, found := object["password"]; found { - err = json.Unmarshal(raw, &a.Password) - if err != nil { - return fmt.Errorf("error reading 'password': %w", err) - } - delete(object, "password") - } - - if raw, found := object["proxy_id"]; found { - err = json.Unmarshal(raw, &a.ProxyId) - if err != nil { - return fmt.Errorf("error reading 'proxy_id': %w", err) - } - delete(object, "proxy_id") - } - - if raw, found := object["random"]; found { - err = json.Unmarshal(raw, &a.Random) - if err != nil { - return fmt.Errorf("error reading 'random': %w", err) - } - delete(object, "random") - } - - if raw, found := object["required_acks"]; found { - err = json.Unmarshal(raw, &a.RequiredAcks) - if err != nil { - return fmt.Errorf("error reading 'required_acks': %w", err) - } - delete(object, "required_acks") - } - - if raw, found := object["round_robin"]; found { - err = json.Unmarshal(raw, &a.RoundRobin) - if err != nil { - return fmt.Errorf("error reading 'round_robin': %w", err) - } - delete(object, "round_robin") - } - - if raw, found := object["sasl"]; found { - err = json.Unmarshal(raw, &a.Sasl) - if err != nil { - return fmt.Errorf("error reading 'sasl': %w", err) - } - delete(object, "sasl") - } - - if raw, found := object["secrets"]; found { - err = json.Unmarshal(raw, &a.Secrets) - if err != nil { - return fmt.Errorf("error reading 'secrets': %w", err) - } - delete(object, "secrets") - } - - if raw, found := object["shipper"]; found { - err = json.Unmarshal(raw, &a.Shipper) - if err != nil { - return fmt.Errorf("error reading 'shipper': %w", err) - } - delete(object, "shipper") - } - - if raw, found := object["ssl"]; found { - err = json.Unmarshal(raw, &a.Ssl) - if err != nil { - return fmt.Errorf("error reading 'ssl': %w", err) - } - delete(object, "ssl") - } - - if raw, found := object["timeout"]; found { - err = json.Unmarshal(raw, &a.Timeout) - if err != nil { - return fmt.Errorf("error reading 'timeout': %w", err) - } - delete(object, "timeout") - } - - if raw, found := object["topic"]; found { - err = json.Unmarshal(raw, &a.Topic) - if err != nil { - return fmt.Errorf("error reading 'topic': %w", err) - } - delete(object, "topic") - } - - if raw, found := object["topics"]; found { - err = json.Unmarshal(raw, &a.Topics) - if err != nil { - return fmt.Errorf("error reading 'topics': %w", err) - } - delete(object, "topics") - } - - if raw, found := object["type"]; found { - err = json.Unmarshal(raw, &a.Type) - if err != nil { - return fmt.Errorf("error reading 'type': %w", err) - } - delete(object, "type") - } - - if raw, found := object["username"]; found { - err = json.Unmarshal(raw, &a.Username) - if err != nil { - return fmt.Errorf("error reading 'username': %w", err) - } - delete(object, "username") - } - - if raw, found := object["version"]; found { - err = json.Unmarshal(raw, &a.Version) - if err != nil { - return fmt.Errorf("error reading 'version': %w", err) - } - delete(object, "version") - } - - if len(object) != 0 { - a.AdditionalProperties = make(map[string]interface{}) - for fieldName, fieldBuf := range object { - var fieldVal interface{} - err := json.Unmarshal(fieldBuf, &fieldVal) - if err != nil { - return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) - } - a.AdditionalProperties[fieldName] = fieldVal - } - } - return nil -} - -// Override default JSON handling for OutputKafka to handle AdditionalProperties -func (a OutputKafka) MarshalJSON() ([]byte, error) { - var err error - object := make(map[string]json.RawMessage) - - if a.AllowEdit != nil { - object["allow_edit"], err = json.Marshal(a.AllowEdit) - if err != nil { - return nil, fmt.Errorf("error marshaling 'allow_edit': %w", err) - } - } - - object["auth_type"], err = json.Marshal(a.AuthType) - if err != nil { - return nil, fmt.Errorf("error marshaling 'auth_type': %w", err) - } - - if a.BrokerTimeout != nil { - object["broker_timeout"], err = json.Marshal(a.BrokerTimeout) - if err != nil { - return nil, fmt.Errorf("error marshaling 'broker_timeout': %w", err) - } - } - - if a.CaSha256 != nil { - object["ca_sha256"], err = json.Marshal(a.CaSha256) - if err != nil { - return nil, fmt.Errorf("error marshaling 'ca_sha256': %w", err) - } - } - - if a.CaTrustedFingerprint != nil { - object["ca_trusted_fingerprint"], err = json.Marshal(a.CaTrustedFingerprint) - if err != nil { - return nil, fmt.Errorf("error marshaling 'ca_trusted_fingerprint': %w", err) - } - } - - if a.ClientId != nil { - object["client_id"], err = json.Marshal(a.ClientId) - if err != nil { - return nil, fmt.Errorf("error marshaling 'client_id': %w", err) - } - } - - if a.Compression != nil { - object["compression"], err = json.Marshal(a.Compression) - if err != nil { - return nil, fmt.Errorf("error marshaling 'compression': %w", err) - } - } - - object["compression_level"], err = json.Marshal(a.CompressionLevel) - if err != nil { - return nil, fmt.Errorf("error marshaling 'compression_level': %w", err) - } - - if a.ConfigYaml != nil { - object["config_yaml"], err = json.Marshal(a.ConfigYaml) - if err != nil { - return nil, fmt.Errorf("error marshaling 'config_yaml': %w", err) - } - } - - object["connection_type"], err = json.Marshal(a.ConnectionType) - if err != nil { - return nil, fmt.Errorf("error marshaling 'connection_type': %w", err) - } - - if a.Hash != nil { - object["hash"], err = json.Marshal(a.Hash) - if err != nil { - return nil, fmt.Errorf("error marshaling 'hash': %w", err) - } - } - - if a.Headers != nil { - object["headers"], err = json.Marshal(a.Headers) - if err != nil { - return nil, fmt.Errorf("error marshaling 'headers': %w", err) - } - } - - object["hosts"], err = json.Marshal(a.Hosts) - if err != nil { - return nil, fmt.Errorf("error marshaling 'hosts': %w", err) - } - - if a.Id != nil { - object["id"], err = json.Marshal(a.Id) - if err != nil { - return nil, fmt.Errorf("error marshaling 'id': %w", err) - } - } - - if a.IsDefault != nil { - object["is_default"], err = json.Marshal(a.IsDefault) - if err != nil { - return nil, fmt.Errorf("error marshaling 'is_default': %w", err) - } - } - - if a.IsDefaultMonitoring != nil { - object["is_default_monitoring"], err = json.Marshal(a.IsDefaultMonitoring) - if err != nil { - return nil, fmt.Errorf("error marshaling 'is_default_monitoring': %w", err) - } - } - - if a.IsInternal != nil { - object["is_internal"], err = json.Marshal(a.IsInternal) - if err != nil { - return nil, fmt.Errorf("error marshaling 'is_internal': %w", err) - } - } - - if a.IsPreconfigured != nil { - object["is_preconfigured"], err = json.Marshal(a.IsPreconfigured) - if err != nil { - return nil, fmt.Errorf("error marshaling 'is_preconfigured': %w", err) - } - } - - if a.Key != nil { - object["key"], err = json.Marshal(a.Key) - if err != nil { - return nil, fmt.Errorf("error marshaling 'key': %w", err) - } - } - - object["name"], err = json.Marshal(a.Name) - if err != nil { - return nil, fmt.Errorf("error marshaling 'name': %w", err) - } - - if a.Partition != nil { - object["partition"], err = json.Marshal(a.Partition) - if err != nil { - return nil, fmt.Errorf("error marshaling 'partition': %w", err) - } - } - - object["password"], err = json.Marshal(a.Password) - if err != nil { - return nil, fmt.Errorf("error marshaling 'password': %w", err) - } - - if a.ProxyId != nil { - object["proxy_id"], err = json.Marshal(a.ProxyId) - if err != nil { - return nil, fmt.Errorf("error marshaling 'proxy_id': %w", err) - } - } - - if a.Random != nil { - object["random"], err = json.Marshal(a.Random) - if err != nil { - return nil, fmt.Errorf("error marshaling 'random': %w", err) - } - } - - if a.RequiredAcks != nil { - object["required_acks"], err = json.Marshal(a.RequiredAcks) - if err != nil { - return nil, fmt.Errorf("error marshaling 'required_acks': %w", err) - } - } - - if a.RoundRobin != nil { - object["round_robin"], err = json.Marshal(a.RoundRobin) - if err != nil { - return nil, fmt.Errorf("error marshaling 'round_robin': %w", err) - } - } - - if a.Sasl != nil { - object["sasl"], err = json.Marshal(a.Sasl) - if err != nil { - return nil, fmt.Errorf("error marshaling 'sasl': %w", err) - } - } - - if a.Secrets != nil { - object["secrets"], err = json.Marshal(a.Secrets) - if err != nil { - return nil, fmt.Errorf("error marshaling 'secrets': %w", err) - } - } - - if a.Shipper != nil { - object["shipper"], err = json.Marshal(a.Shipper) - if err != nil { - return nil, fmt.Errorf("error marshaling 'shipper': %w", err) - } - } - - if a.Ssl != nil { - object["ssl"], err = json.Marshal(a.Ssl) - if err != nil { - return nil, fmt.Errorf("error marshaling 'ssl': %w", err) - } - } - - if a.Timeout != nil { - object["timeout"], err = json.Marshal(a.Timeout) - if err != nil { - return nil, fmt.Errorf("error marshaling 'timeout': %w", err) - } - } - - if a.Topic != nil { - object["topic"], err = json.Marshal(a.Topic) - if err != nil { - return nil, fmt.Errorf("error marshaling 'topic': %w", err) - } - } - - if a.Topics != nil { - object["topics"], err = json.Marshal(a.Topics) - if err != nil { - return nil, fmt.Errorf("error marshaling 'topics': %w", err) - } - } - - object["type"], err = json.Marshal(a.Type) - if err != nil { - return nil, fmt.Errorf("error marshaling 'type': %w", err) - } - - object["username"], err = json.Marshal(a.Username) - if err != nil { - return nil, fmt.Errorf("error marshaling 'username': %w", err) - } - - if a.Version != nil { - object["version"], err = json.Marshal(a.Version) - if err != nil { - return nil, fmt.Errorf("error marshaling 'version': %w", err) - } - } - - for fieldName, field := range a.AdditionalProperties { - object[fieldName], err = json.Marshal(field) - if err != nil { - return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) - } - } - return json.Marshal(object) -} - -// Getter for additional properties for OutputKafka_Hash. Returns the specified -// element and whether it was found -func (a OutputKafka_Hash) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for OutputKafka_Hash -func (a *OutputKafka_Hash) Set(fieldName string, value interface{}) { - if a.AdditionalProperties == nil { - a.AdditionalProperties = make(map[string]interface{}) - } - a.AdditionalProperties[fieldName] = value -} - -// Override default JSON handling for OutputKafka_Hash to handle AdditionalProperties -func (a *OutputKafka_Hash) UnmarshalJSON(b []byte) error { - object := make(map[string]json.RawMessage) - err := json.Unmarshal(b, &object) - if err != nil { - return err - } - - if raw, found := object["hash"]; found { - err = json.Unmarshal(raw, &a.Hash) - if err != nil { - return fmt.Errorf("error reading 'hash': %w", err) - } - delete(object, "hash") - } - - if raw, found := object["random"]; found { - err = json.Unmarshal(raw, &a.Random) - if err != nil { - return fmt.Errorf("error reading 'random': %w", err) - } - delete(object, "random") - } - - if len(object) != 0 { - a.AdditionalProperties = make(map[string]interface{}) - for fieldName, fieldBuf := range object { - var fieldVal interface{} - err := json.Unmarshal(fieldBuf, &fieldVal) - if err != nil { - return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) - } - a.AdditionalProperties[fieldName] = fieldVal - } - } - return nil -} - -// Override default JSON handling for OutputKafka_Hash to handle AdditionalProperties -func (a OutputKafka_Hash) MarshalJSON() ([]byte, error) { - var err error - object := make(map[string]json.RawMessage) - - if a.Hash != nil { - object["hash"], err = json.Marshal(a.Hash) - if err != nil { - return nil, fmt.Errorf("error marshaling 'hash': %w", err) - } - } - - if a.Random != nil { - object["random"], err = json.Marshal(a.Random) - if err != nil { - return nil, fmt.Errorf("error marshaling 'random': %w", err) - } - } - - for fieldName, field := range a.AdditionalProperties { - object[fieldName], err = json.Marshal(field) - if err != nil { - return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) - } - } - return json.Marshal(object) -} - -// Getter for additional properties for OutputKafka_Headers_Item. Returns the specified -// element and whether it was found -func (a OutputKafka_Headers_Item) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for OutputKafka_Headers_Item -func (a *OutputKafka_Headers_Item) Set(fieldName string, value interface{}) { - if a.AdditionalProperties == nil { - a.AdditionalProperties = make(map[string]interface{}) - } - a.AdditionalProperties[fieldName] = value -} - -// Override default JSON handling for OutputKafka_Headers_Item to handle AdditionalProperties -func (a *OutputKafka_Headers_Item) UnmarshalJSON(b []byte) error { - object := make(map[string]json.RawMessage) - err := json.Unmarshal(b, &object) - if err != nil { - return err - } - - if raw, found := object["key"]; found { - err = json.Unmarshal(raw, &a.Key) - if err != nil { - return fmt.Errorf("error reading 'key': %w", err) - } - delete(object, "key") - } - - if raw, found := object["value"]; found { - err = json.Unmarshal(raw, &a.Value) - if err != nil { - return fmt.Errorf("error reading 'value': %w", err) - } - delete(object, "value") - } - - if len(object) != 0 { - a.AdditionalProperties = make(map[string]interface{}) - for fieldName, fieldBuf := range object { - var fieldVal interface{} - err := json.Unmarshal(fieldBuf, &fieldVal) - if err != nil { - return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) - } - a.AdditionalProperties[fieldName] = fieldVal - } - } - return nil -} - -// Override default JSON handling for OutputKafka_Headers_Item to handle AdditionalProperties -func (a OutputKafka_Headers_Item) MarshalJSON() ([]byte, error) { - var err error - object := make(map[string]json.RawMessage) - - object["key"], err = json.Marshal(a.Key) - if err != nil { - return nil, fmt.Errorf("error marshaling 'key': %w", err) - } - - object["value"], err = json.Marshal(a.Value) - if err != nil { - return nil, fmt.Errorf("error marshaling 'value': %w", err) - } - - for fieldName, field := range a.AdditionalProperties { - object[fieldName], err = json.Marshal(field) - if err != nil { - return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) - } - } - return json.Marshal(object) -} - -// Getter for additional properties for OutputKafka_Random. Returns the specified -// element and whether it was found -func (a OutputKafka_Random) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for OutputKafka_Random -func (a *OutputKafka_Random) Set(fieldName string, value interface{}) { - if a.AdditionalProperties == nil { - a.AdditionalProperties = make(map[string]interface{}) - } - a.AdditionalProperties[fieldName] = value -} - -// Override default JSON handling for OutputKafka_Random to handle AdditionalProperties -func (a *OutputKafka_Random) UnmarshalJSON(b []byte) error { - object := make(map[string]json.RawMessage) - err := json.Unmarshal(b, &object) - if err != nil { - return err - } - - if raw, found := object["group_events"]; found { - err = json.Unmarshal(raw, &a.GroupEvents) - if err != nil { - return fmt.Errorf("error reading 'group_events': %w", err) - } - delete(object, "group_events") - } - - if len(object) != 0 { - a.AdditionalProperties = make(map[string]interface{}) - for fieldName, fieldBuf := range object { - var fieldVal interface{} - err := json.Unmarshal(fieldBuf, &fieldVal) - if err != nil { - return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) - } - a.AdditionalProperties[fieldName] = fieldVal - } - } - return nil -} - -// Override default JSON handling for OutputKafka_Random to handle AdditionalProperties -func (a OutputKafka_Random) MarshalJSON() ([]byte, error) { - var err error - object := make(map[string]json.RawMessage) - - if a.GroupEvents != nil { - object["group_events"], err = json.Marshal(a.GroupEvents) - if err != nil { - return nil, fmt.Errorf("error marshaling 'group_events': %w", err) - } - } - - for fieldName, field := range a.AdditionalProperties { - object[fieldName], err = json.Marshal(field) - if err != nil { - return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) - } - } - return json.Marshal(object) -} - -// Getter for additional properties for OutputKafka_RoundRobin. Returns the specified -// element and whether it was found -func (a OutputKafka_RoundRobin) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for OutputKafka_RoundRobin -func (a *OutputKafka_RoundRobin) Set(fieldName string, value interface{}) { - if a.AdditionalProperties == nil { - a.AdditionalProperties = make(map[string]interface{}) - } - a.AdditionalProperties[fieldName] = value -} - -// Override default JSON handling for OutputKafka_RoundRobin to handle AdditionalProperties -func (a *OutputKafka_RoundRobin) UnmarshalJSON(b []byte) error { - object := make(map[string]json.RawMessage) - err := json.Unmarshal(b, &object) - if err != nil { - return err - } - - if raw, found := object["group_events"]; found { - err = json.Unmarshal(raw, &a.GroupEvents) - if err != nil { - return fmt.Errorf("error reading 'group_events': %w", err) - } - delete(object, "group_events") - } - - if len(object) != 0 { - a.AdditionalProperties = make(map[string]interface{}) - for fieldName, fieldBuf := range object { - var fieldVal interface{} - err := json.Unmarshal(fieldBuf, &fieldVal) - if err != nil { - return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) - } - a.AdditionalProperties[fieldName] = fieldVal - } - } - return nil -} - -// Override default JSON handling for OutputKafka_RoundRobin to handle AdditionalProperties -func (a OutputKafka_RoundRobin) MarshalJSON() ([]byte, error) { - var err error - object := make(map[string]json.RawMessage) - - if a.GroupEvents != nil { - object["group_events"], err = json.Marshal(a.GroupEvents) - if err != nil { - return nil, fmt.Errorf("error marshaling 'group_events': %w", err) - } - } - - for fieldName, field := range a.AdditionalProperties { - object[fieldName], err = json.Marshal(field) - if err != nil { - return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) - } - } - return json.Marshal(object) -} - -// Getter for additional properties for OutputKafka_Sasl. Returns the specified -// element and whether it was found -func (a OutputKafka_Sasl) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for OutputKafka_Sasl -func (a *OutputKafka_Sasl) Set(fieldName string, value interface{}) { - if a.AdditionalProperties == nil { - a.AdditionalProperties = make(map[string]interface{}) - } - a.AdditionalProperties[fieldName] = value -} - -// Override default JSON handling for OutputKafka_Sasl to handle AdditionalProperties -func (a *OutputKafka_Sasl) UnmarshalJSON(b []byte) error { - object := make(map[string]json.RawMessage) - err := json.Unmarshal(b, &object) - if err != nil { - return err - } - - if raw, found := object["mechanism"]; found { - err = json.Unmarshal(raw, &a.Mechanism) - if err != nil { - return fmt.Errorf("error reading 'mechanism': %w", err) - } - delete(object, "mechanism") - } - - if len(object) != 0 { - a.AdditionalProperties = make(map[string]interface{}) - for fieldName, fieldBuf := range object { - var fieldVal interface{} - err := json.Unmarshal(fieldBuf, &fieldVal) - if err != nil { - return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) - } - a.AdditionalProperties[fieldName] = fieldVal - } - } - return nil -} - -// Override default JSON handling for OutputKafka_Sasl to handle AdditionalProperties -func (a OutputKafka_Sasl) MarshalJSON() ([]byte, error) { - var err error - object := make(map[string]json.RawMessage) - - if a.Mechanism != nil { - object["mechanism"], err = json.Marshal(a.Mechanism) - if err != nil { - return nil, fmt.Errorf("error marshaling 'mechanism': %w", err) - } - } - - for fieldName, field := range a.AdditionalProperties { - object[fieldName], err = json.Marshal(field) - if err != nil { - return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) - } - } - return json.Marshal(object) -} - -// Getter for additional properties for OutputKafkaSecretsPassword0. Returns the specified -// element and whether it was found -func (a OutputKafkaSecretsPassword0) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for OutputKafkaSecretsPassword0 -func (a *OutputKafkaSecretsPassword0) Set(fieldName string, value interface{}) { - if a.AdditionalProperties == nil { - a.AdditionalProperties = make(map[string]interface{}) - } - a.AdditionalProperties[fieldName] = value -} - -// Override default JSON handling for OutputKafkaSecretsPassword0 to handle AdditionalProperties -func (a *OutputKafkaSecretsPassword0) UnmarshalJSON(b []byte) error { - object := make(map[string]json.RawMessage) - err := json.Unmarshal(b, &object) - if err != nil { - return err - } - - if raw, found := object["id"]; found { - err = json.Unmarshal(raw, &a.Id) - if err != nil { - return fmt.Errorf("error reading 'id': %w", err) - } - delete(object, "id") - } - - if len(object) != 0 { - a.AdditionalProperties = make(map[string]interface{}) - for fieldName, fieldBuf := range object { - var fieldVal interface{} - err := json.Unmarshal(fieldBuf, &fieldVal) - if err != nil { - return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) - } - a.AdditionalProperties[fieldName] = fieldVal - } - } - return nil -} - -// Override default JSON handling for OutputKafkaSecretsPassword0 to handle AdditionalProperties -func (a OutputKafkaSecretsPassword0) MarshalJSON() ([]byte, error) { - var err error - object := make(map[string]json.RawMessage) - - object["id"], err = json.Marshal(a.Id) - if err != nil { - return nil, fmt.Errorf("error marshaling 'id': %w", err) - } - - for fieldName, field := range a.AdditionalProperties { - object[fieldName], err = json.Marshal(field) - if err != nil { - return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) - } - } - return json.Marshal(object) -} - -// Getter for additional properties for OutputKafkaSecretsSslKey0. Returns the specified -// element and whether it was found -func (a OutputKafkaSecretsSslKey0) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for OutputKafkaSecretsSslKey0 -func (a *OutputKafkaSecretsSslKey0) Set(fieldName string, value interface{}) { - if a.AdditionalProperties == nil { - a.AdditionalProperties = make(map[string]interface{}) - } - a.AdditionalProperties[fieldName] = value -} - -// Override default JSON handling for OutputKafkaSecretsSslKey0 to handle AdditionalProperties -func (a *OutputKafkaSecretsSslKey0) UnmarshalJSON(b []byte) error { - object := make(map[string]json.RawMessage) - err := json.Unmarshal(b, &object) - if err != nil { - return err - } - - if raw, found := object["id"]; found { - err = json.Unmarshal(raw, &a.Id) - if err != nil { - return fmt.Errorf("error reading 'id': %w", err) - } - delete(object, "id") - } - - if len(object) != 0 { - a.AdditionalProperties = make(map[string]interface{}) - for fieldName, fieldBuf := range object { - var fieldVal interface{} - err := json.Unmarshal(fieldBuf, &fieldVal) - if err != nil { - return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) - } - a.AdditionalProperties[fieldName] = fieldVal - } - } - return nil -} - -// Override default JSON handling for OutputKafkaSecretsSslKey0 to handle AdditionalProperties -func (a OutputKafkaSecretsSslKey0) MarshalJSON() ([]byte, error) { - var err error - object := make(map[string]json.RawMessage) - - object["id"], err = json.Marshal(a.Id) - if err != nil { - return nil, fmt.Errorf("error marshaling 'id': %w", err) - } - - for fieldName, field := range a.AdditionalProperties { - object[fieldName], err = json.Marshal(field) - if err != nil { - return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) - } - } - return json.Marshal(object) -} - -// Getter for additional properties for OutputKafka_Secrets_Ssl. Returns the specified -// element and whether it was found -func (a OutputKafka_Secrets_Ssl) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for OutputKafka_Secrets_Ssl -func (a *OutputKafka_Secrets_Ssl) Set(fieldName string, value interface{}) { - if a.AdditionalProperties == nil { - a.AdditionalProperties = make(map[string]interface{}) - } - a.AdditionalProperties[fieldName] = value -} - -// Override default JSON handling for OutputKafka_Secrets_Ssl to handle AdditionalProperties -func (a *OutputKafka_Secrets_Ssl) UnmarshalJSON(b []byte) error { - object := make(map[string]json.RawMessage) - err := json.Unmarshal(b, &object) - if err != nil { - return err - } - - if raw, found := object["key"]; found { - err = json.Unmarshal(raw, &a.Key) - if err != nil { - return fmt.Errorf("error reading 'key': %w", err) - } - delete(object, "key") - } - - if len(object) != 0 { - a.AdditionalProperties = make(map[string]interface{}) - for fieldName, fieldBuf := range object { - var fieldVal interface{} - err := json.Unmarshal(fieldBuf, &fieldVal) - if err != nil { - return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) - } - a.AdditionalProperties[fieldName] = fieldVal - } - } - return nil -} - -// Override default JSON handling for OutputKafka_Secrets_Ssl to handle AdditionalProperties -func (a OutputKafka_Secrets_Ssl) MarshalJSON() ([]byte, error) { - var err error - object := make(map[string]json.RawMessage) - - object["key"], err = json.Marshal(a.Key) - if err != nil { - return nil, fmt.Errorf("error marshaling 'key': %w", err) - } - - for fieldName, field := range a.AdditionalProperties { - object[fieldName], err = json.Marshal(field) - if err != nil { - return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) - } - } - return json.Marshal(object) -} - -// Getter for additional properties for OutputKafka_Secrets. Returns the specified -// element and whether it was found -func (a OutputKafka_Secrets) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for OutputKafka_Secrets -func (a *OutputKafka_Secrets) Set(fieldName string, value interface{}) { - if a.AdditionalProperties == nil { - a.AdditionalProperties = make(map[string]interface{}) - } - a.AdditionalProperties[fieldName] = value -} - -// Override default JSON handling for OutputKafka_Secrets to handle AdditionalProperties -func (a *OutputKafka_Secrets) UnmarshalJSON(b []byte) error { - object := make(map[string]json.RawMessage) - err := json.Unmarshal(b, &object) - if err != nil { - return err - } - - if raw, found := object["password"]; found { - err = json.Unmarshal(raw, &a.Password) - if err != nil { - return fmt.Errorf("error reading 'password': %w", err) - } - delete(object, "password") - } - - if raw, found := object["ssl"]; found { - err = json.Unmarshal(raw, &a.Ssl) - if err != nil { - return fmt.Errorf("error reading 'ssl': %w", err) - } - delete(object, "ssl") - } - - if len(object) != 0 { - a.AdditionalProperties = make(map[string]interface{}) - for fieldName, fieldBuf := range object { - var fieldVal interface{} - err := json.Unmarshal(fieldBuf, &fieldVal) - if err != nil { - return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) - } - a.AdditionalProperties[fieldName] = fieldVal - } - } - return nil -} - -// Override default JSON handling for OutputKafka_Secrets to handle AdditionalProperties -func (a OutputKafka_Secrets) MarshalJSON() ([]byte, error) { - var err error - object := make(map[string]json.RawMessage) - - if a.Password != nil { - object["password"], err = json.Marshal(a.Password) - if err != nil { - return nil, fmt.Errorf("error marshaling 'password': %w", err) - } - } - - if a.Ssl != nil { - object["ssl"], err = json.Marshal(a.Ssl) - if err != nil { - return nil, fmt.Errorf("error marshaling 'ssl': %w", err) - } - } - - for fieldName, field := range a.AdditionalProperties { - object[fieldName], err = json.Marshal(field) - if err != nil { - return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) - } - } - return json.Marshal(object) -} - -// Getter for additional properties for OutputKafka_Topics_When. Returns the specified -// element and whether it was found -func (a OutputKafka_Topics_When) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for OutputKafka_Topics_When -func (a *OutputKafka_Topics_When) Set(fieldName string, value interface{}) { - if a.AdditionalProperties == nil { - a.AdditionalProperties = make(map[string]interface{}) - } - a.AdditionalProperties[fieldName] = value -} - -// Override default JSON handling for OutputKafka_Topics_When to handle AdditionalProperties -func (a *OutputKafka_Topics_When) UnmarshalJSON(b []byte) error { - object := make(map[string]json.RawMessage) - err := json.Unmarshal(b, &object) - if err != nil { - return err - } - - if raw, found := object["condition"]; found { - err = json.Unmarshal(raw, &a.Condition) - if err != nil { - return fmt.Errorf("error reading 'condition': %w", err) - } - delete(object, "condition") - } - - if raw, found := object["type"]; found { - err = json.Unmarshal(raw, &a.Type) - if err != nil { - return fmt.Errorf("error reading 'type': %w", err) - } - delete(object, "type") - } - - if len(object) != 0 { - a.AdditionalProperties = make(map[string]interface{}) - for fieldName, fieldBuf := range object { - var fieldVal interface{} - err := json.Unmarshal(fieldBuf, &fieldVal) - if err != nil { - return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) - } - a.AdditionalProperties[fieldName] = fieldVal - } - } - return nil -} - -// Override default JSON handling for OutputKafka_Topics_When to handle AdditionalProperties -func (a OutputKafka_Topics_When) MarshalJSON() ([]byte, error) { - var err error - object := make(map[string]json.RawMessage) - - if a.Condition != nil { - object["condition"], err = json.Marshal(a.Condition) - if err != nil { - return nil, fmt.Errorf("error marshaling 'condition': %w", err) - } - } - - if a.Type != nil { - object["type"], err = json.Marshal(a.Type) - if err != nil { - return nil, fmt.Errorf("error marshaling 'type': %w", err) - } - } - - for fieldName, field := range a.AdditionalProperties { - object[fieldName], err = json.Marshal(field) - if err != nil { - return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) - } - } - return json.Marshal(object) -} - -// Getter for additional properties for OutputKafka_Topics_Item. Returns the specified -// element and whether it was found -func (a OutputKafka_Topics_Item) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for OutputKafka_Topics_Item -func (a *OutputKafka_Topics_Item) Set(fieldName string, value interface{}) { - if a.AdditionalProperties == nil { - a.AdditionalProperties = make(map[string]interface{}) - } - a.AdditionalProperties[fieldName] = value -} - -// Override default JSON handling for OutputKafka_Topics_Item to handle AdditionalProperties -func (a *OutputKafka_Topics_Item) UnmarshalJSON(b []byte) error { - object := make(map[string]json.RawMessage) - err := json.Unmarshal(b, &object) - if err != nil { - return err - } - - if raw, found := object["topic"]; found { - err = json.Unmarshal(raw, &a.Topic) - if err != nil { - return fmt.Errorf("error reading 'topic': %w", err) - } - delete(object, "topic") - } - - if raw, found := object["when"]; found { - err = json.Unmarshal(raw, &a.When) - if err != nil { - return fmt.Errorf("error reading 'when': %w", err) - } - delete(object, "when") - } - - if len(object) != 0 { - a.AdditionalProperties = make(map[string]interface{}) - for fieldName, fieldBuf := range object { - var fieldVal interface{} - err := json.Unmarshal(fieldBuf, &fieldVal) - if err != nil { - return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) - } - a.AdditionalProperties[fieldName] = fieldVal - } - } - return nil -} - -// Override default JSON handling for OutputKafka_Topics_Item to handle AdditionalProperties -func (a OutputKafka_Topics_Item) MarshalJSON() ([]byte, error) { - var err error - object := make(map[string]json.RawMessage) - - object["topic"], err = json.Marshal(a.Topic) - if err != nil { - return nil, fmt.Errorf("error marshaling 'topic': %w", err) - } - - if a.When != nil { - object["when"], err = json.Marshal(a.When) - if err != nil { - return nil, fmt.Errorf("error marshaling 'when': %w", err) - } - } - - for fieldName, field := range a.AdditionalProperties { - object[fieldName], err = json.Marshal(field) - if err != nil { - return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) - } - } - return json.Marshal(object) -} - -// Getter for additional properties for OutputLogstash. Returns the specified -// element and whether it was found -func (a OutputLogstash) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for OutputLogstash -func (a *OutputLogstash) Set(fieldName string, value interface{}) { - if a.AdditionalProperties == nil { - a.AdditionalProperties = make(map[string]interface{}) - } - a.AdditionalProperties[fieldName] = value -} - -// Override default JSON handling for OutputLogstash to handle AdditionalProperties -func (a *OutputLogstash) UnmarshalJSON(b []byte) error { - object := make(map[string]json.RawMessage) - err := json.Unmarshal(b, &object) - if err != nil { - return err - } - - if raw, found := object["allow_edit"]; found { - err = json.Unmarshal(raw, &a.AllowEdit) - if err != nil { - return fmt.Errorf("error reading 'allow_edit': %w", err) - } - delete(object, "allow_edit") - } - - if raw, found := object["ca_sha256"]; found { - err = json.Unmarshal(raw, &a.CaSha256) - if err != nil { - return fmt.Errorf("error reading 'ca_sha256': %w", err) - } - delete(object, "ca_sha256") - } - - if raw, found := object["ca_trusted_fingerprint"]; found { - err = json.Unmarshal(raw, &a.CaTrustedFingerprint) - if err != nil { - return fmt.Errorf("error reading 'ca_trusted_fingerprint': %w", err) - } - delete(object, "ca_trusted_fingerprint") - } - - if raw, found := object["config_yaml"]; found { - err = json.Unmarshal(raw, &a.ConfigYaml) - if err != nil { - return fmt.Errorf("error reading 'config_yaml': %w", err) - } - delete(object, "config_yaml") - } - - if raw, found := object["hosts"]; found { - err = json.Unmarshal(raw, &a.Hosts) - if err != nil { - return fmt.Errorf("error reading 'hosts': %w", err) - } - delete(object, "hosts") - } - - if raw, found := object["id"]; found { - err = json.Unmarshal(raw, &a.Id) - if err != nil { - return fmt.Errorf("error reading 'id': %w", err) - } - delete(object, "id") - } - - if raw, found := object["is_default"]; found { - err = json.Unmarshal(raw, &a.IsDefault) - if err != nil { - return fmt.Errorf("error reading 'is_default': %w", err) - } - delete(object, "is_default") - } - - if raw, found := object["is_default_monitoring"]; found { - err = json.Unmarshal(raw, &a.IsDefaultMonitoring) - if err != nil { - return fmt.Errorf("error reading 'is_default_monitoring': %w", err) - } - delete(object, "is_default_monitoring") - } - - if raw, found := object["is_internal"]; found { - err = json.Unmarshal(raw, &a.IsInternal) - if err != nil { - return fmt.Errorf("error reading 'is_internal': %w", err) - } - delete(object, "is_internal") - } - - if raw, found := object["is_preconfigured"]; found { - err = json.Unmarshal(raw, &a.IsPreconfigured) - if err != nil { - return fmt.Errorf("error reading 'is_preconfigured': %w", err) - } - delete(object, "is_preconfigured") - } - - if raw, found := object["name"]; found { - err = json.Unmarshal(raw, &a.Name) - if err != nil { - return fmt.Errorf("error reading 'name': %w", err) - } - delete(object, "name") - } - - if raw, found := object["proxy_id"]; found { - err = json.Unmarshal(raw, &a.ProxyId) - if err != nil { - return fmt.Errorf("error reading 'proxy_id': %w", err) - } - delete(object, "proxy_id") - } - - if raw, found := object["secrets"]; found { - err = json.Unmarshal(raw, &a.Secrets) - if err != nil { - return fmt.Errorf("error reading 'secrets': %w", err) - } - delete(object, "secrets") - } - - if raw, found := object["shipper"]; found { - err = json.Unmarshal(raw, &a.Shipper) - if err != nil { - return fmt.Errorf("error reading 'shipper': %w", err) - } - delete(object, "shipper") - } - - if raw, found := object["ssl"]; found { - err = json.Unmarshal(raw, &a.Ssl) - if err != nil { - return fmt.Errorf("error reading 'ssl': %w", err) - } - delete(object, "ssl") - } - - if raw, found := object["type"]; found { - err = json.Unmarshal(raw, &a.Type) - if err != nil { - return fmt.Errorf("error reading 'type': %w", err) - } - delete(object, "type") - } - - if len(object) != 0 { - a.AdditionalProperties = make(map[string]interface{}) - for fieldName, fieldBuf := range object { - var fieldVal interface{} - err := json.Unmarshal(fieldBuf, &fieldVal) - if err != nil { - return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) - } - a.AdditionalProperties[fieldName] = fieldVal - } - } - return nil -} - -// Override default JSON handling for OutputLogstash to handle AdditionalProperties -func (a OutputLogstash) MarshalJSON() ([]byte, error) { - var err error - object := make(map[string]json.RawMessage) - - if a.AllowEdit != nil { - object["allow_edit"], err = json.Marshal(a.AllowEdit) - if err != nil { - return nil, fmt.Errorf("error marshaling 'allow_edit': %w", err) - } - } - - if a.CaSha256 != nil { - object["ca_sha256"], err = json.Marshal(a.CaSha256) - if err != nil { - return nil, fmt.Errorf("error marshaling 'ca_sha256': %w", err) - } - } - - if a.CaTrustedFingerprint != nil { - object["ca_trusted_fingerprint"], err = json.Marshal(a.CaTrustedFingerprint) - if err != nil { - return nil, fmt.Errorf("error marshaling 'ca_trusted_fingerprint': %w", err) - } - } - - if a.ConfigYaml != nil { - object["config_yaml"], err = json.Marshal(a.ConfigYaml) - if err != nil { - return nil, fmt.Errorf("error marshaling 'config_yaml': %w", err) - } - } - - object["hosts"], err = json.Marshal(a.Hosts) - if err != nil { - return nil, fmt.Errorf("error marshaling 'hosts': %w", err) - } - - if a.Id != nil { - object["id"], err = json.Marshal(a.Id) - if err != nil { - return nil, fmt.Errorf("error marshaling 'id': %w", err) - } - } - - if a.IsDefault != nil { - object["is_default"], err = json.Marshal(a.IsDefault) - if err != nil { - return nil, fmt.Errorf("error marshaling 'is_default': %w", err) - } - } - - if a.IsDefaultMonitoring != nil { - object["is_default_monitoring"], err = json.Marshal(a.IsDefaultMonitoring) - if err != nil { - return nil, fmt.Errorf("error marshaling 'is_default_monitoring': %w", err) - } - } - - if a.IsInternal != nil { - object["is_internal"], err = json.Marshal(a.IsInternal) - if err != nil { - return nil, fmt.Errorf("error marshaling 'is_internal': %w", err) - } - } - - if a.IsPreconfigured != nil { - object["is_preconfigured"], err = json.Marshal(a.IsPreconfigured) - if err != nil { - return nil, fmt.Errorf("error marshaling 'is_preconfigured': %w", err) - } - } - - object["name"], err = json.Marshal(a.Name) - if err != nil { - return nil, fmt.Errorf("error marshaling 'name': %w", err) - } - - if a.ProxyId != nil { - object["proxy_id"], err = json.Marshal(a.ProxyId) - if err != nil { - return nil, fmt.Errorf("error marshaling 'proxy_id': %w", err) - } - } - - if a.Secrets != nil { - object["secrets"], err = json.Marshal(a.Secrets) - if err != nil { - return nil, fmt.Errorf("error marshaling 'secrets': %w", err) - } - } - - if a.Shipper != nil { - object["shipper"], err = json.Marshal(a.Shipper) - if err != nil { - return nil, fmt.Errorf("error marshaling 'shipper': %w", err) - } - } - - if a.Ssl != nil { - object["ssl"], err = json.Marshal(a.Ssl) - if err != nil { - return nil, fmt.Errorf("error marshaling 'ssl': %w", err) - } - } - - object["type"], err = json.Marshal(a.Type) - if err != nil { - return nil, fmt.Errorf("error marshaling 'type': %w", err) - } - - for fieldName, field := range a.AdditionalProperties { - object[fieldName], err = json.Marshal(field) - if err != nil { - return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) - } - } - return json.Marshal(object) -} - -// Getter for additional properties for OutputLogstashSecretsSslKey0. Returns the specified -// element and whether it was found -func (a OutputLogstashSecretsSslKey0) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for OutputLogstashSecretsSslKey0 -func (a *OutputLogstashSecretsSslKey0) Set(fieldName string, value interface{}) { - if a.AdditionalProperties == nil { - a.AdditionalProperties = make(map[string]interface{}) - } - a.AdditionalProperties[fieldName] = value -} - -// Override default JSON handling for OutputLogstashSecretsSslKey0 to handle AdditionalProperties -func (a *OutputLogstashSecretsSslKey0) UnmarshalJSON(b []byte) error { - object := make(map[string]json.RawMessage) - err := json.Unmarshal(b, &object) - if err != nil { - return err - } - - if raw, found := object["id"]; found { - err = json.Unmarshal(raw, &a.Id) - if err != nil { - return fmt.Errorf("error reading 'id': %w", err) - } - delete(object, "id") - } - - if len(object) != 0 { - a.AdditionalProperties = make(map[string]interface{}) - for fieldName, fieldBuf := range object { - var fieldVal interface{} - err := json.Unmarshal(fieldBuf, &fieldVal) - if err != nil { - return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) - } - a.AdditionalProperties[fieldName] = fieldVal - } - } - return nil -} - -// Override default JSON handling for OutputLogstashSecretsSslKey0 to handle AdditionalProperties -func (a OutputLogstashSecretsSslKey0) MarshalJSON() ([]byte, error) { - var err error - object := make(map[string]json.RawMessage) - - object["id"], err = json.Marshal(a.Id) - if err != nil { - return nil, fmt.Errorf("error marshaling 'id': %w", err) - } - - for fieldName, field := range a.AdditionalProperties { - object[fieldName], err = json.Marshal(field) - if err != nil { - return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) - } - } - return json.Marshal(object) -} - -// Getter for additional properties for OutputLogstash_Secrets_Ssl. Returns the specified -// element and whether it was found -func (a OutputLogstash_Secrets_Ssl) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for OutputLogstash_Secrets_Ssl -func (a *OutputLogstash_Secrets_Ssl) Set(fieldName string, value interface{}) { - if a.AdditionalProperties == nil { - a.AdditionalProperties = make(map[string]interface{}) - } - a.AdditionalProperties[fieldName] = value -} - -// Override default JSON handling for OutputLogstash_Secrets_Ssl to handle AdditionalProperties -func (a *OutputLogstash_Secrets_Ssl) UnmarshalJSON(b []byte) error { - object := make(map[string]json.RawMessage) - err := json.Unmarshal(b, &object) - if err != nil { - return err - } - - if raw, found := object["key"]; found { - err = json.Unmarshal(raw, &a.Key) - if err != nil { - return fmt.Errorf("error reading 'key': %w", err) - } - delete(object, "key") - } - - if len(object) != 0 { - a.AdditionalProperties = make(map[string]interface{}) - for fieldName, fieldBuf := range object { - var fieldVal interface{} - err := json.Unmarshal(fieldBuf, &fieldVal) - if err != nil { - return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) - } - a.AdditionalProperties[fieldName] = fieldVal - } - } - return nil -} - -// Override default JSON handling for OutputLogstash_Secrets_Ssl to handle AdditionalProperties -func (a OutputLogstash_Secrets_Ssl) MarshalJSON() ([]byte, error) { - var err error - object := make(map[string]json.RawMessage) - - if a.Key != nil { - object["key"], err = json.Marshal(a.Key) - if err != nil { - return nil, fmt.Errorf("error marshaling 'key': %w", err) - } - } - - for fieldName, field := range a.AdditionalProperties { - object[fieldName], err = json.Marshal(field) - if err != nil { - return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) - } - } - return json.Marshal(object) -} - -// Getter for additional properties for OutputLogstash_Secrets. Returns the specified -// element and whether it was found -func (a OutputLogstash_Secrets) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for OutputLogstash_Secrets -func (a *OutputLogstash_Secrets) Set(fieldName string, value interface{}) { - if a.AdditionalProperties == nil { - a.AdditionalProperties = make(map[string]interface{}) - } - a.AdditionalProperties[fieldName] = value -} - -// Override default JSON handling for OutputLogstash_Secrets to handle AdditionalProperties -func (a *OutputLogstash_Secrets) UnmarshalJSON(b []byte) error { - object := make(map[string]json.RawMessage) - err := json.Unmarshal(b, &object) - if err != nil { - return err - } - - if raw, found := object["ssl"]; found { - err = json.Unmarshal(raw, &a.Ssl) - if err != nil { - return fmt.Errorf("error reading 'ssl': %w", err) - } - delete(object, "ssl") - } - - if len(object) != 0 { - a.AdditionalProperties = make(map[string]interface{}) - for fieldName, fieldBuf := range object { - var fieldVal interface{} - err := json.Unmarshal(fieldBuf, &fieldVal) - if err != nil { - return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) - } - a.AdditionalProperties[fieldName] = fieldVal - } - } - return nil -} - -// Override default JSON handling for OutputLogstash_Secrets to handle AdditionalProperties -func (a OutputLogstash_Secrets) MarshalJSON() ([]byte, error) { - var err error - object := make(map[string]json.RawMessage) - - if a.Ssl != nil { - object["ssl"], err = json.Marshal(a.Ssl) - if err != nil { - return nil, fmt.Errorf("error marshaling 'ssl': %w", err) - } - } - - for fieldName, field := range a.AdditionalProperties { - object[fieldName], err = json.Marshal(field) - if err != nil { - return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) - } - } - return json.Marshal(object) -} - -// Getter for additional properties for OutputRemoteElasticsearch. Returns the specified -// element and whether it was found -func (a OutputRemoteElasticsearch) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for OutputRemoteElasticsearch -func (a *OutputRemoteElasticsearch) Set(fieldName string, value interface{}) { - if a.AdditionalProperties == nil { - a.AdditionalProperties = make(map[string]interface{}) - } - a.AdditionalProperties[fieldName] = value -} - -// Override default JSON handling for OutputRemoteElasticsearch to handle AdditionalProperties -func (a *OutputRemoteElasticsearch) UnmarshalJSON(b []byte) error { - object := make(map[string]json.RawMessage) - err := json.Unmarshal(b, &object) - if err != nil { - return err - } - - if raw, found := object["allow_edit"]; found { - err = json.Unmarshal(raw, &a.AllowEdit) - if err != nil { - return fmt.Errorf("error reading 'allow_edit': %w", err) - } - delete(object, "allow_edit") - } - - if raw, found := object["ca_sha256"]; found { - err = json.Unmarshal(raw, &a.CaSha256) - if err != nil { - return fmt.Errorf("error reading 'ca_sha256': %w", err) - } - delete(object, "ca_sha256") - } - - if raw, found := object["ca_trusted_fingerprint"]; found { - err = json.Unmarshal(raw, &a.CaTrustedFingerprint) - if err != nil { - return fmt.Errorf("error reading 'ca_trusted_fingerprint': %w", err) - } - delete(object, "ca_trusted_fingerprint") - } - - if raw, found := object["config_yaml"]; found { - err = json.Unmarshal(raw, &a.ConfigYaml) - if err != nil { - return fmt.Errorf("error reading 'config_yaml': %w", err) - } - delete(object, "config_yaml") - } - - if raw, found := object["hosts"]; found { - err = json.Unmarshal(raw, &a.Hosts) - if err != nil { - return fmt.Errorf("error reading 'hosts': %w", err) - } - delete(object, "hosts") - } - - if raw, found := object["id"]; found { - err = json.Unmarshal(raw, &a.Id) - if err != nil { - return fmt.Errorf("error reading 'id': %w", err) - } - delete(object, "id") - } - - if raw, found := object["is_default"]; found { - err = json.Unmarshal(raw, &a.IsDefault) - if err != nil { - return fmt.Errorf("error reading 'is_default': %w", err) - } - delete(object, "is_default") - } - - if raw, found := object["is_default_monitoring"]; found { - err = json.Unmarshal(raw, &a.IsDefaultMonitoring) - if err != nil { - return fmt.Errorf("error reading 'is_default_monitoring': %w", err) - } - delete(object, "is_default_monitoring") - } - - if raw, found := object["is_internal"]; found { - err = json.Unmarshal(raw, &a.IsInternal) - if err != nil { - return fmt.Errorf("error reading 'is_internal': %w", err) - } - delete(object, "is_internal") - } - - if raw, found := object["is_preconfigured"]; found { - err = json.Unmarshal(raw, &a.IsPreconfigured) - if err != nil { - return fmt.Errorf("error reading 'is_preconfigured': %w", err) - } - delete(object, "is_preconfigured") - } - - if raw, found := object["name"]; found { - err = json.Unmarshal(raw, &a.Name) - if err != nil { - return fmt.Errorf("error reading 'name': %w", err) - } - delete(object, "name") - } - - if raw, found := object["preset"]; found { - err = json.Unmarshal(raw, &a.Preset) - if err != nil { - return fmt.Errorf("error reading 'preset': %w", err) - } - delete(object, "preset") - } - - if raw, found := object["proxy_id"]; found { - err = json.Unmarshal(raw, &a.ProxyId) - if err != nil { - return fmt.Errorf("error reading 'proxy_id': %w", err) - } - delete(object, "proxy_id") - } - - if raw, found := object["secrets"]; found { - err = json.Unmarshal(raw, &a.Secrets) - if err != nil { - return fmt.Errorf("error reading 'secrets': %w", err) - } - delete(object, "secrets") - } - - if raw, found := object["service_token"]; found { - err = json.Unmarshal(raw, &a.ServiceToken) - if err != nil { - return fmt.Errorf("error reading 'service_token': %w", err) - } - delete(object, "service_token") - } - - if raw, found := object["shipper"]; found { - err = json.Unmarshal(raw, &a.Shipper) - if err != nil { - return fmt.Errorf("error reading 'shipper': %w", err) - } - delete(object, "shipper") - } - - if raw, found := object["ssl"]; found { - err = json.Unmarshal(raw, &a.Ssl) - if err != nil { - return fmt.Errorf("error reading 'ssl': %w", err) - } - delete(object, "ssl") - } - - if raw, found := object["type"]; found { - err = json.Unmarshal(raw, &a.Type) - if err != nil { - return fmt.Errorf("error reading 'type': %w", err) - } - delete(object, "type") - } - - if len(object) != 0 { - a.AdditionalProperties = make(map[string]interface{}) - for fieldName, fieldBuf := range object { - var fieldVal interface{} - err := json.Unmarshal(fieldBuf, &fieldVal) - if err != nil { - return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) - } - a.AdditionalProperties[fieldName] = fieldVal - } - } - return nil -} - -// Override default JSON handling for OutputRemoteElasticsearch to handle AdditionalProperties -func (a OutputRemoteElasticsearch) MarshalJSON() ([]byte, error) { - var err error - object := make(map[string]json.RawMessage) - - if a.AllowEdit != nil { - object["allow_edit"], err = json.Marshal(a.AllowEdit) - if err != nil { - return nil, fmt.Errorf("error marshaling 'allow_edit': %w", err) - } - } - - if a.CaSha256 != nil { - object["ca_sha256"], err = json.Marshal(a.CaSha256) - if err != nil { - return nil, fmt.Errorf("error marshaling 'ca_sha256': %w", err) - } - } - - if a.CaTrustedFingerprint != nil { - object["ca_trusted_fingerprint"], err = json.Marshal(a.CaTrustedFingerprint) - if err != nil { - return nil, fmt.Errorf("error marshaling 'ca_trusted_fingerprint': %w", err) - } - } - - if a.ConfigYaml != nil { - object["config_yaml"], err = json.Marshal(a.ConfigYaml) - if err != nil { - return nil, fmt.Errorf("error marshaling 'config_yaml': %w", err) - } - } - - object["hosts"], err = json.Marshal(a.Hosts) - if err != nil { - return nil, fmt.Errorf("error marshaling 'hosts': %w", err) - } - - if a.Id != nil { - object["id"], err = json.Marshal(a.Id) - if err != nil { - return nil, fmt.Errorf("error marshaling 'id': %w", err) - } - } - - if a.IsDefault != nil { - object["is_default"], err = json.Marshal(a.IsDefault) - if err != nil { - return nil, fmt.Errorf("error marshaling 'is_default': %w", err) - } - } - - if a.IsDefaultMonitoring != nil { - object["is_default_monitoring"], err = json.Marshal(a.IsDefaultMonitoring) - if err != nil { - return nil, fmt.Errorf("error marshaling 'is_default_monitoring': %w", err) - } - } - - if a.IsInternal != nil { - object["is_internal"], err = json.Marshal(a.IsInternal) - if err != nil { - return nil, fmt.Errorf("error marshaling 'is_internal': %w", err) - } - } - - if a.IsPreconfigured != nil { - object["is_preconfigured"], err = json.Marshal(a.IsPreconfigured) - if err != nil { - return nil, fmt.Errorf("error marshaling 'is_preconfigured': %w", err) - } - } - - object["name"], err = json.Marshal(a.Name) - if err != nil { - return nil, fmt.Errorf("error marshaling 'name': %w", err) - } - - if a.Preset != nil { - object["preset"], err = json.Marshal(a.Preset) - if err != nil { - return nil, fmt.Errorf("error marshaling 'preset': %w", err) - } - } - - if a.ProxyId != nil { - object["proxy_id"], err = json.Marshal(a.ProxyId) - if err != nil { - return nil, fmt.Errorf("error marshaling 'proxy_id': %w", err) - } - } - - if a.Secrets != nil { - object["secrets"], err = json.Marshal(a.Secrets) - if err != nil { - return nil, fmt.Errorf("error marshaling 'secrets': %w", err) - } - } - - if a.ServiceToken != nil { - object["service_token"], err = json.Marshal(a.ServiceToken) - if err != nil { - return nil, fmt.Errorf("error marshaling 'service_token': %w", err) - } - } - - if a.Shipper != nil { - object["shipper"], err = json.Marshal(a.Shipper) - if err != nil { - return nil, fmt.Errorf("error marshaling 'shipper': %w", err) - } - } - - if a.Ssl != nil { - object["ssl"], err = json.Marshal(a.Ssl) - if err != nil { - return nil, fmt.Errorf("error marshaling 'ssl': %w", err) - } - } - - object["type"], err = json.Marshal(a.Type) - if err != nil { - return nil, fmt.Errorf("error marshaling 'type': %w", err) - } - - for fieldName, field := range a.AdditionalProperties { - object[fieldName], err = json.Marshal(field) - if err != nil { - return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) - } - } - return json.Marshal(object) -} - -// Getter for additional properties for OutputRemoteElasticsearchSecretsServiceToken0. Returns the specified -// element and whether it was found -func (a OutputRemoteElasticsearchSecretsServiceToken0) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for OutputRemoteElasticsearchSecretsServiceToken0 -func (a *OutputRemoteElasticsearchSecretsServiceToken0) Set(fieldName string, value interface{}) { - if a.AdditionalProperties == nil { - a.AdditionalProperties = make(map[string]interface{}) - } - a.AdditionalProperties[fieldName] = value -} - -// Override default JSON handling for OutputRemoteElasticsearchSecretsServiceToken0 to handle AdditionalProperties -func (a *OutputRemoteElasticsearchSecretsServiceToken0) UnmarshalJSON(b []byte) error { - object := make(map[string]json.RawMessage) - err := json.Unmarshal(b, &object) - if err != nil { - return err - } - - if raw, found := object["id"]; found { - err = json.Unmarshal(raw, &a.Id) - if err != nil { - return fmt.Errorf("error reading 'id': %w", err) - } - delete(object, "id") - } - - if len(object) != 0 { - a.AdditionalProperties = make(map[string]interface{}) - for fieldName, fieldBuf := range object { - var fieldVal interface{} - err := json.Unmarshal(fieldBuf, &fieldVal) - if err != nil { - return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) - } - a.AdditionalProperties[fieldName] = fieldVal - } - } - return nil -} - -// Override default JSON handling for OutputRemoteElasticsearchSecretsServiceToken0 to handle AdditionalProperties -func (a OutputRemoteElasticsearchSecretsServiceToken0) MarshalJSON() ([]byte, error) { - var err error - object := make(map[string]json.RawMessage) - - object["id"], err = json.Marshal(a.Id) - if err != nil { - return nil, fmt.Errorf("error marshaling 'id': %w", err) - } - - for fieldName, field := range a.AdditionalProperties { - object[fieldName], err = json.Marshal(field) - if err != nil { - return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) - } - } - return json.Marshal(object) -} - -// Getter for additional properties for OutputRemoteElasticsearch_Secrets. Returns the specified -// element and whether it was found -func (a OutputRemoteElasticsearch_Secrets) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for OutputRemoteElasticsearch_Secrets -func (a *OutputRemoteElasticsearch_Secrets) Set(fieldName string, value interface{}) { - if a.AdditionalProperties == nil { - a.AdditionalProperties = make(map[string]interface{}) - } - a.AdditionalProperties[fieldName] = value -} - -// Override default JSON handling for OutputRemoteElasticsearch_Secrets to handle AdditionalProperties -func (a *OutputRemoteElasticsearch_Secrets) UnmarshalJSON(b []byte) error { - object := make(map[string]json.RawMessage) - err := json.Unmarshal(b, &object) - if err != nil { - return err - } - - if raw, found := object["service_token"]; found { - err = json.Unmarshal(raw, &a.ServiceToken) - if err != nil { - return fmt.Errorf("error reading 'service_token': %w", err) - } - delete(object, "service_token") - } - - if len(object) != 0 { - a.AdditionalProperties = make(map[string]interface{}) - for fieldName, fieldBuf := range object { - var fieldVal interface{} - err := json.Unmarshal(fieldBuf, &fieldVal) - if err != nil { - return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) - } - a.AdditionalProperties[fieldName] = fieldVal - } - } - return nil -} - -// Override default JSON handling for OutputRemoteElasticsearch_Secrets to handle AdditionalProperties -func (a OutputRemoteElasticsearch_Secrets) MarshalJSON() ([]byte, error) { - var err error - object := make(map[string]json.RawMessage) - - if a.ServiceToken != nil { - object["service_token"], err = json.Marshal(a.ServiceToken) - if err != nil { - return nil, fmt.Errorf("error marshaling 'service_token': %w", err) - } - } - - for fieldName, field := range a.AdditionalProperties { - object[fieldName], err = json.Marshal(field) - if err != nil { - return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) - } - } - return json.Marshal(object) -} - -// Getter for additional properties for OutputShipper. Returns the specified -// element and whether it was found -func (a OutputShipper) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for OutputShipper -func (a *OutputShipper) Set(fieldName string, value interface{}) { - if a.AdditionalProperties == nil { - a.AdditionalProperties = make(map[string]interface{}) - } - a.AdditionalProperties[fieldName] = value -} - -// Override default JSON handling for OutputShipper to handle AdditionalProperties -func (a *OutputShipper) UnmarshalJSON(b []byte) error { - object := make(map[string]json.RawMessage) - err := json.Unmarshal(b, &object) - if err != nil { - return err - } - - if raw, found := object["compression_level"]; found { - err = json.Unmarshal(raw, &a.CompressionLevel) - if err != nil { - return fmt.Errorf("error reading 'compression_level': %w", err) - } - delete(object, "compression_level") - } - - if raw, found := object["disk_queue_compression_enabled"]; found { - err = json.Unmarshal(raw, &a.DiskQueueCompressionEnabled) - if err != nil { - return fmt.Errorf("error reading 'disk_queue_compression_enabled': %w", err) - } - delete(object, "disk_queue_compression_enabled") - } - - if raw, found := object["disk_queue_enabled"]; found { - err = json.Unmarshal(raw, &a.DiskQueueEnabled) - if err != nil { - return fmt.Errorf("error reading 'disk_queue_enabled': %w", err) - } - delete(object, "disk_queue_enabled") - } - - if raw, found := object["disk_queue_encryption_enabled"]; found { - err = json.Unmarshal(raw, &a.DiskQueueEncryptionEnabled) - if err != nil { - return fmt.Errorf("error reading 'disk_queue_encryption_enabled': %w", err) - } - delete(object, "disk_queue_encryption_enabled") - } - - if raw, found := object["disk_queue_max_size"]; found { - err = json.Unmarshal(raw, &a.DiskQueueMaxSize) - if err != nil { - return fmt.Errorf("error reading 'disk_queue_max_size': %w", err) - } - delete(object, "disk_queue_max_size") - } - - if raw, found := object["disk_queue_path"]; found { - err = json.Unmarshal(raw, &a.DiskQueuePath) - if err != nil { - return fmt.Errorf("error reading 'disk_queue_path': %w", err) - } - delete(object, "disk_queue_path") - } - - if raw, found := object["loadbalance"]; found { - err = json.Unmarshal(raw, &a.Loadbalance) - if err != nil { - return fmt.Errorf("error reading 'loadbalance': %w", err) - } - delete(object, "loadbalance") - } - - if raw, found := object["max_batch_bytes"]; found { - err = json.Unmarshal(raw, &a.MaxBatchBytes) - if err != nil { - return fmt.Errorf("error reading 'max_batch_bytes': %w", err) - } - delete(object, "max_batch_bytes") - } - - if raw, found := object["mem_queue_events"]; found { - err = json.Unmarshal(raw, &a.MemQueueEvents) - if err != nil { - return fmt.Errorf("error reading 'mem_queue_events': %w", err) - } - delete(object, "mem_queue_events") - } - - if raw, found := object["queue_flush_timeout"]; found { - err = json.Unmarshal(raw, &a.QueueFlushTimeout) - if err != nil { - return fmt.Errorf("error reading 'queue_flush_timeout': %w", err) - } - delete(object, "queue_flush_timeout") - } - - if len(object) != 0 { - a.AdditionalProperties = make(map[string]interface{}) - for fieldName, fieldBuf := range object { - var fieldVal interface{} - err := json.Unmarshal(fieldBuf, &fieldVal) - if err != nil { - return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) - } - a.AdditionalProperties[fieldName] = fieldVal - } - } - return nil -} - -// Override default JSON handling for OutputShipper to handle AdditionalProperties -func (a OutputShipper) MarshalJSON() ([]byte, error) { - var err error - object := make(map[string]json.RawMessage) - - object["compression_level"], err = json.Marshal(a.CompressionLevel) - if err != nil { - return nil, fmt.Errorf("error marshaling 'compression_level': %w", err) - } - - object["disk_queue_compression_enabled"], err = json.Marshal(a.DiskQueueCompressionEnabled) - if err != nil { - return nil, fmt.Errorf("error marshaling 'disk_queue_compression_enabled': %w", err) - } - - if a.DiskQueueEnabled != nil { - object["disk_queue_enabled"], err = json.Marshal(a.DiskQueueEnabled) - if err != nil { - return nil, fmt.Errorf("error marshaling 'disk_queue_enabled': %w", err) - } - } - - object["disk_queue_encryption_enabled"], err = json.Marshal(a.DiskQueueEncryptionEnabled) - if err != nil { - return nil, fmt.Errorf("error marshaling 'disk_queue_encryption_enabled': %w", err) - } - - object["disk_queue_max_size"], err = json.Marshal(a.DiskQueueMaxSize) - if err != nil { - return nil, fmt.Errorf("error marshaling 'disk_queue_max_size': %w", err) - } - - object["disk_queue_path"], err = json.Marshal(a.DiskQueuePath) - if err != nil { - return nil, fmt.Errorf("error marshaling 'disk_queue_path': %w", err) - } - - object["loadbalance"], err = json.Marshal(a.Loadbalance) - if err != nil { - return nil, fmt.Errorf("error marshaling 'loadbalance': %w", err) - } - - object["max_batch_bytes"], err = json.Marshal(a.MaxBatchBytes) - if err != nil { - return nil, fmt.Errorf("error marshaling 'max_batch_bytes': %w", err) - } - - object["mem_queue_events"], err = json.Marshal(a.MemQueueEvents) - if err != nil { - return nil, fmt.Errorf("error marshaling 'mem_queue_events': %w", err) - } - - object["queue_flush_timeout"], err = json.Marshal(a.QueueFlushTimeout) - if err != nil { - return nil, fmt.Errorf("error marshaling 'queue_flush_timeout': %w", err) - } - - for fieldName, field := range a.AdditionalProperties { - object[fieldName], err = json.Marshal(field) - if err != nil { - return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) - } - } - return json.Marshal(object) -} - -// Getter for additional properties for OutputSsl. Returns the specified -// element and whether it was found -func (a OutputSsl) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for OutputSsl -func (a *OutputSsl) Set(fieldName string, value interface{}) { - if a.AdditionalProperties == nil { - a.AdditionalProperties = make(map[string]interface{}) - } - a.AdditionalProperties[fieldName] = value -} - -// Override default JSON handling for OutputSsl to handle AdditionalProperties -func (a *OutputSsl) UnmarshalJSON(b []byte) error { - object := make(map[string]json.RawMessage) - err := json.Unmarshal(b, &object) - if err != nil { - return err - } - - if raw, found := object["certificate"]; found { - err = json.Unmarshal(raw, &a.Certificate) - if err != nil { - return fmt.Errorf("error reading 'certificate': %w", err) - } - delete(object, "certificate") - } - - if raw, found := object["certificate_authorities"]; found { - err = json.Unmarshal(raw, &a.CertificateAuthorities) - if err != nil { - return fmt.Errorf("error reading 'certificate_authorities': %w", err) - } - delete(object, "certificate_authorities") - } - - if raw, found := object["key"]; found { - err = json.Unmarshal(raw, &a.Key) - if err != nil { - return fmt.Errorf("error reading 'key': %w", err) - } - delete(object, "key") - } - - if raw, found := object["verification_mode"]; found { - err = json.Unmarshal(raw, &a.VerificationMode) - if err != nil { - return fmt.Errorf("error reading 'verification_mode': %w", err) - } - delete(object, "verification_mode") - } - - if len(object) != 0 { - a.AdditionalProperties = make(map[string]interface{}) - for fieldName, fieldBuf := range object { - var fieldVal interface{} - err := json.Unmarshal(fieldBuf, &fieldVal) - if err != nil { - return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) - } - a.AdditionalProperties[fieldName] = fieldVal - } - } - return nil -} - -// Override default JSON handling for OutputSsl to handle AdditionalProperties -func (a OutputSsl) MarshalJSON() ([]byte, error) { - var err error - object := make(map[string]json.RawMessage) - - if a.Certificate != nil { - object["certificate"], err = json.Marshal(a.Certificate) - if err != nil { - return nil, fmt.Errorf("error marshaling 'certificate': %w", err) - } - } - - if a.CertificateAuthorities != nil { - object["certificate_authorities"], err = json.Marshal(a.CertificateAuthorities) - if err != nil { - return nil, fmt.Errorf("error marshaling 'certificate_authorities': %w", err) - } - } - - if a.Key != nil { - object["key"], err = json.Marshal(a.Key) - if err != nil { - return nil, fmt.Errorf("error marshaling 'key': %w", err) - } - } - - if a.VerificationMode != nil { - object["verification_mode"], err = json.Marshal(a.VerificationMode) - if err != nil { - return nil, fmt.Errorf("error marshaling 'verification_mode': %w", err) - } - } - - for fieldName, field := range a.AdditionalProperties { - object[fieldName], err = json.Marshal(field) - if err != nil { - return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) - } - } - return json.Marshal(object) -} - -// Getter for additional properties for PackageInfo. Returns the specified -// element and whether it was found -func (a PackageInfo) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for PackageInfo -func (a *PackageInfo) Set(fieldName string, value interface{}) { - if a.AdditionalProperties == nil { - a.AdditionalProperties = make(map[string]interface{}) - } - a.AdditionalProperties[fieldName] = value -} - -// Override default JSON handling for PackageInfo to handle AdditionalProperties -func (a *PackageInfo) UnmarshalJSON(b []byte) error { - object := make(map[string]json.RawMessage) - err := json.Unmarshal(b, &object) - if err != nil { - return err - } - - if raw, found := object["agent"]; found { - err = json.Unmarshal(raw, &a.Agent) - if err != nil { - return fmt.Errorf("error reading 'agent': %w", err) - } - delete(object, "agent") - } - - if raw, found := object["asset_tags"]; found { - err = json.Unmarshal(raw, &a.AssetTags) - if err != nil { - return fmt.Errorf("error reading 'asset_tags': %w", err) - } - delete(object, "asset_tags") - } - - if raw, found := object["assets"]; found { - err = json.Unmarshal(raw, &a.Assets) - if err != nil { - return fmt.Errorf("error reading 'assets': %w", err) - } - delete(object, "assets") - } - - if raw, found := object["categories"]; found { - err = json.Unmarshal(raw, &a.Categories) - if err != nil { - return fmt.Errorf("error reading 'categories': %w", err) - } - delete(object, "categories") - } - - if raw, found := object["conditions"]; found { - err = json.Unmarshal(raw, &a.Conditions) - if err != nil { - return fmt.Errorf("error reading 'conditions': %w", err) - } - delete(object, "conditions") - } - - if raw, found := object["data_streams"]; found { - err = json.Unmarshal(raw, &a.DataStreams) - if err != nil { - return fmt.Errorf("error reading 'data_streams': %w", err) - } - delete(object, "data_streams") - } - - if raw, found := object["description"]; found { - err = json.Unmarshal(raw, &a.Description) - if err != nil { - return fmt.Errorf("error reading 'description': %w", err) - } - delete(object, "description") - } - - if raw, found := object["discovery"]; found { - err = json.Unmarshal(raw, &a.Discovery) - if err != nil { - return fmt.Errorf("error reading 'discovery': %w", err) - } - delete(object, "discovery") - } - - if raw, found := object["download"]; found { - err = json.Unmarshal(raw, &a.Download) - if err != nil { - return fmt.Errorf("error reading 'download': %w", err) - } - delete(object, "download") - } - - if raw, found := object["elasticsearch"]; found { - err = json.Unmarshal(raw, &a.Elasticsearch) - if err != nil { - return fmt.Errorf("error reading 'elasticsearch': %w", err) - } - delete(object, "elasticsearch") - } - - if raw, found := object["format_version"]; found { - err = json.Unmarshal(raw, &a.FormatVersion) - if err != nil { - return fmt.Errorf("error reading 'format_version': %w", err) - } - delete(object, "format_version") - } - - if raw, found := object["icons"]; found { - err = json.Unmarshal(raw, &a.Icons) - if err != nil { - return fmt.Errorf("error reading 'icons': %w", err) - } - delete(object, "icons") - } - - if raw, found := object["installationInfo"]; found { - err = json.Unmarshal(raw, &a.InstallationInfo) - if err != nil { - return fmt.Errorf("error reading 'installationInfo': %w", err) - } - delete(object, "installationInfo") - } - - if raw, found := object["internal"]; found { - err = json.Unmarshal(raw, &a.Internal) - if err != nil { - return fmt.Errorf("error reading 'internal': %w", err) - } - delete(object, "internal") - } - - if raw, found := object["keepPoliciesUpToDate"]; found { - err = json.Unmarshal(raw, &a.KeepPoliciesUpToDate) - if err != nil { - return fmt.Errorf("error reading 'keepPoliciesUpToDate': %w", err) - } - delete(object, "keepPoliciesUpToDate") - } - - if raw, found := object["latestVersion"]; found { - err = json.Unmarshal(raw, &a.LatestVersion) - if err != nil { - return fmt.Errorf("error reading 'latestVersion': %w", err) - } - delete(object, "latestVersion") - } - - if raw, found := object["license"]; found { - err = json.Unmarshal(raw, &a.License) - if err != nil { - return fmt.Errorf("error reading 'license': %w", err) - } - delete(object, "license") - } - - if raw, found := object["licensePath"]; found { - err = json.Unmarshal(raw, &a.LicensePath) - if err != nil { - return fmt.Errorf("error reading 'licensePath': %w", err) - } - delete(object, "licensePath") - } - - if raw, found := object["name"]; found { - err = json.Unmarshal(raw, &a.Name) - if err != nil { - return fmt.Errorf("error reading 'name': %w", err) - } - delete(object, "name") - } - - if raw, found := object["notice"]; found { - err = json.Unmarshal(raw, &a.Notice) - if err != nil { - return fmt.Errorf("error reading 'notice': %w", err) - } - delete(object, "notice") - } - - if raw, found := object["owner"]; found { - err = json.Unmarshal(raw, &a.Owner) - if err != nil { - return fmt.Errorf("error reading 'owner': %w", err) - } - delete(object, "owner") - } - - if raw, found := object["path"]; found { - err = json.Unmarshal(raw, &a.Path) - if err != nil { - return fmt.Errorf("error reading 'path': %w", err) - } - delete(object, "path") - } - - if raw, found := object["policy_templates"]; found { - err = json.Unmarshal(raw, &a.PolicyTemplates) - if err != nil { - return fmt.Errorf("error reading 'policy_templates': %w", err) - } - delete(object, "policy_templates") - } - - if raw, found := object["readme"]; found { - err = json.Unmarshal(raw, &a.Readme) - if err != nil { - return fmt.Errorf("error reading 'readme': %w", err) - } - delete(object, "readme") - } - - if raw, found := object["release"]; found { - err = json.Unmarshal(raw, &a.Release) - if err != nil { - return fmt.Errorf("error reading 'release': %w", err) - } - delete(object, "release") - } - - if raw, found := object["savedObject"]; found { - err = json.Unmarshal(raw, &a.SavedObject) - if err != nil { - return fmt.Errorf("error reading 'savedObject': %w", err) - } - delete(object, "savedObject") - } - - if raw, found := object["screenshots"]; found { - err = json.Unmarshal(raw, &a.Screenshots) - if err != nil { - return fmt.Errorf("error reading 'screenshots': %w", err) - } - delete(object, "screenshots") - } - - if raw, found := object["signature_path"]; found { - err = json.Unmarshal(raw, &a.SignaturePath) - if err != nil { - return fmt.Errorf("error reading 'signature_path': %w", err) - } - delete(object, "signature_path") - } - - if raw, found := object["source"]; found { - err = json.Unmarshal(raw, &a.Source) - if err != nil { - return fmt.Errorf("error reading 'source': %w", err) - } - delete(object, "source") - } - - if raw, found := object["status"]; found { - err = json.Unmarshal(raw, &a.Status) - if err != nil { - return fmt.Errorf("error reading 'status': %w", err) - } - delete(object, "status") - } - - if raw, found := object["title"]; found { - err = json.Unmarshal(raw, &a.Title) - if err != nil { - return fmt.Errorf("error reading 'title': %w", err) - } - delete(object, "title") - } - - if raw, found := object["type"]; found { - err = json.Unmarshal(raw, &a.Type) - if err != nil { - return fmt.Errorf("error reading 'type': %w", err) - } - delete(object, "type") - } - - if raw, found := object["vars"]; found { - err = json.Unmarshal(raw, &a.Vars) - if err != nil { - return fmt.Errorf("error reading 'vars': %w", err) - } - delete(object, "vars") - } - - if raw, found := object["version"]; found { - err = json.Unmarshal(raw, &a.Version) - if err != nil { - return fmt.Errorf("error reading 'version': %w", err) - } - delete(object, "version") - } - - if len(object) != 0 { - a.AdditionalProperties = make(map[string]interface{}) - for fieldName, fieldBuf := range object { - var fieldVal interface{} - err := json.Unmarshal(fieldBuf, &fieldVal) - if err != nil { - return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) - } - a.AdditionalProperties[fieldName] = fieldVal - } - } - return nil -} - -// Override default JSON handling for PackageInfo to handle AdditionalProperties -func (a PackageInfo) MarshalJSON() ([]byte, error) { - var err error - object := make(map[string]json.RawMessage) - - if a.Agent != nil { - object["agent"], err = json.Marshal(a.Agent) - if err != nil { - return nil, fmt.Errorf("error marshaling 'agent': %w", err) - } - } - - if a.AssetTags != nil { - object["asset_tags"], err = json.Marshal(a.AssetTags) - if err != nil { - return nil, fmt.Errorf("error marshaling 'asset_tags': %w", err) - } - } - - object["assets"], err = json.Marshal(a.Assets) - if err != nil { - return nil, fmt.Errorf("error marshaling 'assets': %w", err) - } - - if a.Categories != nil { - object["categories"], err = json.Marshal(a.Categories) - if err != nil { - return nil, fmt.Errorf("error marshaling 'categories': %w", err) - } - } - - if a.Conditions != nil { - object["conditions"], err = json.Marshal(a.Conditions) - if err != nil { - return nil, fmt.Errorf("error marshaling 'conditions': %w", err) - } - } - - if a.DataStreams != nil { - object["data_streams"], err = json.Marshal(a.DataStreams) - if err != nil { - return nil, fmt.Errorf("error marshaling 'data_streams': %w", err) - } - } - - if a.Description != nil { - object["description"], err = json.Marshal(a.Description) - if err != nil { - return nil, fmt.Errorf("error marshaling 'description': %w", err) - } - } - - if a.Discovery != nil { - object["discovery"], err = json.Marshal(a.Discovery) - if err != nil { - return nil, fmt.Errorf("error marshaling 'discovery': %w", err) - } - } - - if a.Download != nil { - object["download"], err = json.Marshal(a.Download) - if err != nil { - return nil, fmt.Errorf("error marshaling 'download': %w", err) - } - } - - if a.Elasticsearch != nil { - object["elasticsearch"], err = json.Marshal(a.Elasticsearch) - if err != nil { - return nil, fmt.Errorf("error marshaling 'elasticsearch': %w", err) - } - } - - if a.FormatVersion != nil { - object["format_version"], err = json.Marshal(a.FormatVersion) - if err != nil { - return nil, fmt.Errorf("error marshaling 'format_version': %w", err) - } - } - - if a.Icons != nil { - object["icons"], err = json.Marshal(a.Icons) - if err != nil { - return nil, fmt.Errorf("error marshaling 'icons': %w", err) - } - } - - if a.InstallationInfo != nil { - object["installationInfo"], err = json.Marshal(a.InstallationInfo) - if err != nil { - return nil, fmt.Errorf("error marshaling 'installationInfo': %w", err) - } - } - - if a.Internal != nil { - object["internal"], err = json.Marshal(a.Internal) - if err != nil { - return nil, fmt.Errorf("error marshaling 'internal': %w", err) - } - } - - if a.KeepPoliciesUpToDate != nil { - object["keepPoliciesUpToDate"], err = json.Marshal(a.KeepPoliciesUpToDate) - if err != nil { - return nil, fmt.Errorf("error marshaling 'keepPoliciesUpToDate': %w", err) - } - } - - if a.LatestVersion != nil { - object["latestVersion"], err = json.Marshal(a.LatestVersion) - if err != nil { - return nil, fmt.Errorf("error marshaling 'latestVersion': %w", err) - } - } - - if a.License != nil { - object["license"], err = json.Marshal(a.License) - if err != nil { - return nil, fmt.Errorf("error marshaling 'license': %w", err) - } - } - - if a.LicensePath != nil { - object["licensePath"], err = json.Marshal(a.LicensePath) - if err != nil { - return nil, fmt.Errorf("error marshaling 'licensePath': %w", err) - } - } - - object["name"], err = json.Marshal(a.Name) - if err != nil { - return nil, fmt.Errorf("error marshaling 'name': %w", err) - } - - if a.Notice != nil { - object["notice"], err = json.Marshal(a.Notice) - if err != nil { - return nil, fmt.Errorf("error marshaling 'notice': %w", err) - } - } - - if a.Owner != nil { - object["owner"], err = json.Marshal(a.Owner) - if err != nil { - return nil, fmt.Errorf("error marshaling 'owner': %w", err) - } - } - - if a.Path != nil { - object["path"], err = json.Marshal(a.Path) - if err != nil { - return nil, fmt.Errorf("error marshaling 'path': %w", err) - } - } - - if a.PolicyTemplates != nil { - object["policy_templates"], err = json.Marshal(a.PolicyTemplates) - if err != nil { - return nil, fmt.Errorf("error marshaling 'policy_templates': %w", err) - } - } - - if a.Readme != nil { - object["readme"], err = json.Marshal(a.Readme) - if err != nil { - return nil, fmt.Errorf("error marshaling 'readme': %w", err) - } - } - - if a.Release != nil { - object["release"], err = json.Marshal(a.Release) - if err != nil { - return nil, fmt.Errorf("error marshaling 'release': %w", err) - } - } - - object["savedObject"], err = json.Marshal(a.SavedObject) - if err != nil { - return nil, fmt.Errorf("error marshaling 'savedObject': %w", err) - } - - if a.Screenshots != nil { - object["screenshots"], err = json.Marshal(a.Screenshots) - if err != nil { - return nil, fmt.Errorf("error marshaling 'screenshots': %w", err) - } - } - - if a.SignaturePath != nil { - object["signature_path"], err = json.Marshal(a.SignaturePath) - if err != nil { - return nil, fmt.Errorf("error marshaling 'signature_path': %w", err) - } - } - - if a.Source != nil { - object["source"], err = json.Marshal(a.Source) - if err != nil { - return nil, fmt.Errorf("error marshaling 'source': %w", err) - } - } - - if a.Status != nil { - object["status"], err = json.Marshal(a.Status) - if err != nil { - return nil, fmt.Errorf("error marshaling 'status': %w", err) - } - } - - object["title"], err = json.Marshal(a.Title) - if err != nil { - return nil, fmt.Errorf("error marshaling 'title': %w", err) - } - - if a.Type != nil { - object["type"], err = json.Marshal(a.Type) - if err != nil { - return nil, fmt.Errorf("error marshaling 'type': %w", err) - } - } - - if a.Vars != nil { - object["vars"], err = json.Marshal(a.Vars) - if err != nil { - return nil, fmt.Errorf("error marshaling 'vars': %w", err) - } - } - - object["version"], err = json.Marshal(a.Version) - if err != nil { - return nil, fmt.Errorf("error marshaling 'version': %w", err) - } - - for fieldName, field := range a.AdditionalProperties { - object[fieldName], err = json.Marshal(field) - if err != nil { - return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) - } - } - return json.Marshal(object) -} - -// Getter for additional properties for PackageInfo_Conditions_Elastic. Returns the specified -// element and whether it was found -func (a PackageInfo_Conditions_Elastic) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for PackageInfo_Conditions_Elastic -func (a *PackageInfo_Conditions_Elastic) Set(fieldName string, value interface{}) { - if a.AdditionalProperties == nil { - a.AdditionalProperties = make(map[string]interface{}) - } - a.AdditionalProperties[fieldName] = value -} - -// Override default JSON handling for PackageInfo_Conditions_Elastic to handle AdditionalProperties -func (a *PackageInfo_Conditions_Elastic) UnmarshalJSON(b []byte) error { - object := make(map[string]json.RawMessage) - err := json.Unmarshal(b, &object) - if err != nil { - return err - } - - if raw, found := object["capabilities"]; found { - err = json.Unmarshal(raw, &a.Capabilities) - if err != nil { - return fmt.Errorf("error reading 'capabilities': %w", err) - } - delete(object, "capabilities") - } - - if raw, found := object["subscription"]; found { - err = json.Unmarshal(raw, &a.Subscription) - if err != nil { - return fmt.Errorf("error reading 'subscription': %w", err) - } - delete(object, "subscription") - } - - if len(object) != 0 { - a.AdditionalProperties = make(map[string]interface{}) - for fieldName, fieldBuf := range object { - var fieldVal interface{} - err := json.Unmarshal(fieldBuf, &fieldVal) - if err != nil { - return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) - } - a.AdditionalProperties[fieldName] = fieldVal - } - } - return nil -} - -// Override default JSON handling for PackageInfo_Conditions_Elastic to handle AdditionalProperties -func (a PackageInfo_Conditions_Elastic) MarshalJSON() ([]byte, error) { - var err error - object := make(map[string]json.RawMessage) - - if a.Capabilities != nil { - object["capabilities"], err = json.Marshal(a.Capabilities) - if err != nil { - return nil, fmt.Errorf("error marshaling 'capabilities': %w", err) - } - } - - if a.Subscription != nil { - object["subscription"], err = json.Marshal(a.Subscription) - if err != nil { - return nil, fmt.Errorf("error marshaling 'subscription': %w", err) - } - } - - for fieldName, field := range a.AdditionalProperties { - object[fieldName], err = json.Marshal(field) - if err != nil { - return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) - } - } - return json.Marshal(object) -} - -// Getter for additional properties for PackageInfo_Conditions_Kibana. Returns the specified -// element and whether it was found -func (a PackageInfo_Conditions_Kibana) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for PackageInfo_Conditions_Kibana -func (a *PackageInfo_Conditions_Kibana) Set(fieldName string, value interface{}) { - if a.AdditionalProperties == nil { - a.AdditionalProperties = make(map[string]interface{}) - } - a.AdditionalProperties[fieldName] = value -} - -// Override default JSON handling for PackageInfo_Conditions_Kibana to handle AdditionalProperties -func (a *PackageInfo_Conditions_Kibana) UnmarshalJSON(b []byte) error { - object := make(map[string]json.RawMessage) - err := json.Unmarshal(b, &object) - if err != nil { - return err - } - - if raw, found := object["version"]; found { - err = json.Unmarshal(raw, &a.Version) - if err != nil { - return fmt.Errorf("error reading 'version': %w", err) - } - delete(object, "version") - } - - if len(object) != 0 { - a.AdditionalProperties = make(map[string]interface{}) - for fieldName, fieldBuf := range object { - var fieldVal interface{} - err := json.Unmarshal(fieldBuf, &fieldVal) - if err != nil { - return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) - } - a.AdditionalProperties[fieldName] = fieldVal - } - } - return nil -} - -// Override default JSON handling for PackageInfo_Conditions_Kibana to handle AdditionalProperties -func (a PackageInfo_Conditions_Kibana) MarshalJSON() ([]byte, error) { - var err error - object := make(map[string]json.RawMessage) - - if a.Version != nil { - object["version"], err = json.Marshal(a.Version) - if err != nil { - return nil, fmt.Errorf("error marshaling 'version': %w", err) - } - } - - for fieldName, field := range a.AdditionalProperties { - object[fieldName], err = json.Marshal(field) - if err != nil { - return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) - } - } - return json.Marshal(object) -} - -// Getter for additional properties for PackageInfo_Conditions. Returns the specified -// element and whether it was found -func (a PackageInfo_Conditions) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for PackageInfo_Conditions -func (a *PackageInfo_Conditions) Set(fieldName string, value interface{}) { - if a.AdditionalProperties == nil { - a.AdditionalProperties = make(map[string]interface{}) - } - a.AdditionalProperties[fieldName] = value -} - -// Override default JSON handling for PackageInfo_Conditions to handle AdditionalProperties -func (a *PackageInfo_Conditions) UnmarshalJSON(b []byte) error { - object := make(map[string]json.RawMessage) - err := json.Unmarshal(b, &object) - if err != nil { - return err - } - - if raw, found := object["elastic"]; found { - err = json.Unmarshal(raw, &a.Elastic) - if err != nil { - return fmt.Errorf("error reading 'elastic': %w", err) - } - delete(object, "elastic") - } - - if raw, found := object["kibana"]; found { - err = json.Unmarshal(raw, &a.Kibana) - if err != nil { - return fmt.Errorf("error reading 'kibana': %w", err) - } - delete(object, "kibana") - } - - if len(object) != 0 { - a.AdditionalProperties = make(map[string]interface{}) - for fieldName, fieldBuf := range object { - var fieldVal interface{} - err := json.Unmarshal(fieldBuf, &fieldVal) - if err != nil { - return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) - } - a.AdditionalProperties[fieldName] = fieldVal - } - } - return nil -} - -// Override default JSON handling for PackageInfo_Conditions to handle AdditionalProperties -func (a PackageInfo_Conditions) MarshalJSON() ([]byte, error) { - var err error - object := make(map[string]json.RawMessage) - - if a.Elastic != nil { - object["elastic"], err = json.Marshal(a.Elastic) - if err != nil { - return nil, fmt.Errorf("error marshaling 'elastic': %w", err) - } - } - - if a.Kibana != nil { - object["kibana"], err = json.Marshal(a.Kibana) - if err != nil { - return nil, fmt.Errorf("error marshaling 'kibana': %w", err) - } - } - - for fieldName, field := range a.AdditionalProperties { - object[fieldName], err = json.Marshal(field) - if err != nil { - return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) - } - } - return json.Marshal(object) -} - -// Getter for additional properties for PackageInfo_Discovery_Fields_Item. Returns the specified -// element and whether it was found -func (a PackageInfo_Discovery_Fields_Item) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for PackageInfo_Discovery_Fields_Item -func (a *PackageInfo_Discovery_Fields_Item) Set(fieldName string, value interface{}) { - if a.AdditionalProperties == nil { - a.AdditionalProperties = make(map[string]interface{}) - } - a.AdditionalProperties[fieldName] = value -} - -// Override default JSON handling for PackageInfo_Discovery_Fields_Item to handle AdditionalProperties -func (a *PackageInfo_Discovery_Fields_Item) UnmarshalJSON(b []byte) error { - object := make(map[string]json.RawMessage) - err := json.Unmarshal(b, &object) - if err != nil { - return err - } - - if raw, found := object["name"]; found { - err = json.Unmarshal(raw, &a.Name) - if err != nil { - return fmt.Errorf("error reading 'name': %w", err) - } - delete(object, "name") - } - - if len(object) != 0 { - a.AdditionalProperties = make(map[string]interface{}) - for fieldName, fieldBuf := range object { - var fieldVal interface{} - err := json.Unmarshal(fieldBuf, &fieldVal) - if err != nil { - return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) - } - a.AdditionalProperties[fieldName] = fieldVal - } - } - return nil -} - -// Override default JSON handling for PackageInfo_Discovery_Fields_Item to handle AdditionalProperties -func (a PackageInfo_Discovery_Fields_Item) MarshalJSON() ([]byte, error) { - var err error - object := make(map[string]json.RawMessage) - - object["name"], err = json.Marshal(a.Name) - if err != nil { - return nil, fmt.Errorf("error marshaling 'name': %w", err) - } - - for fieldName, field := range a.AdditionalProperties { - object[fieldName], err = json.Marshal(field) - if err != nil { - return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) - } - } - return json.Marshal(object) -} - -// Getter for additional properties for PackageInfo_Discovery. Returns the specified -// element and whether it was found -func (a PackageInfo_Discovery) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for PackageInfo_Discovery -func (a *PackageInfo_Discovery) Set(fieldName string, value interface{}) { - if a.AdditionalProperties == nil { - a.AdditionalProperties = make(map[string]interface{}) - } - a.AdditionalProperties[fieldName] = value -} - -// Override default JSON handling for PackageInfo_Discovery to handle AdditionalProperties -func (a *PackageInfo_Discovery) UnmarshalJSON(b []byte) error { - object := make(map[string]json.RawMessage) - err := json.Unmarshal(b, &object) - if err != nil { - return err - } - - if raw, found := object["fields"]; found { - err = json.Unmarshal(raw, &a.Fields) - if err != nil { - return fmt.Errorf("error reading 'fields': %w", err) - } - delete(object, "fields") - } - - if len(object) != 0 { - a.AdditionalProperties = make(map[string]interface{}) - for fieldName, fieldBuf := range object { - var fieldVal interface{} - err := json.Unmarshal(fieldBuf, &fieldVal) - if err != nil { - return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) - } - a.AdditionalProperties[fieldName] = fieldVal - } - } - return nil -} - -// Override default JSON handling for PackageInfo_Discovery to handle AdditionalProperties -func (a PackageInfo_Discovery) MarshalJSON() ([]byte, error) { - var err error - object := make(map[string]json.RawMessage) - - if a.Fields != nil { - object["fields"], err = json.Marshal(a.Fields) - if err != nil { - return nil, fmt.Errorf("error marshaling 'fields': %w", err) - } - } - - for fieldName, field := range a.AdditionalProperties { - object[fieldName], err = json.Marshal(field) - if err != nil { - return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) - } - } - return json.Marshal(object) -} - -// Getter for additional properties for PackageInfo_Icons_Item. Returns the specified -// element and whether it was found -func (a PackageInfo_Icons_Item) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for PackageInfo_Icons_Item -func (a *PackageInfo_Icons_Item) Set(fieldName string, value interface{}) { - if a.AdditionalProperties == nil { - a.AdditionalProperties = make(map[string]interface{}) - } - a.AdditionalProperties[fieldName] = value -} - -// Override default JSON handling for PackageInfo_Icons_Item to handle AdditionalProperties -func (a *PackageInfo_Icons_Item) UnmarshalJSON(b []byte) error { - object := make(map[string]json.RawMessage) - err := json.Unmarshal(b, &object) - if err != nil { - return err - } - - if raw, found := object["dark_mode"]; found { - err = json.Unmarshal(raw, &a.DarkMode) - if err != nil { - return fmt.Errorf("error reading 'dark_mode': %w", err) - } - delete(object, "dark_mode") - } - - if raw, found := object["path"]; found { - err = json.Unmarshal(raw, &a.Path) - if err != nil { - return fmt.Errorf("error reading 'path': %w", err) - } - delete(object, "path") - } - - if raw, found := object["size"]; found { - err = json.Unmarshal(raw, &a.Size) - if err != nil { - return fmt.Errorf("error reading 'size': %w", err) - } - delete(object, "size") - } - - if raw, found := object["src"]; found { - err = json.Unmarshal(raw, &a.Src) - if err != nil { - return fmt.Errorf("error reading 'src': %w", err) - } - delete(object, "src") - } - - if raw, found := object["title"]; found { - err = json.Unmarshal(raw, &a.Title) - if err != nil { - return fmt.Errorf("error reading 'title': %w", err) - } - delete(object, "title") - } - - if raw, found := object["type"]; found { - err = json.Unmarshal(raw, &a.Type) - if err != nil { - return fmt.Errorf("error reading 'type': %w", err) - } - delete(object, "type") - } - - if len(object) != 0 { - a.AdditionalProperties = make(map[string]interface{}) - for fieldName, fieldBuf := range object { - var fieldVal interface{} - err := json.Unmarshal(fieldBuf, &fieldVal) - if err != nil { - return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) - } - a.AdditionalProperties[fieldName] = fieldVal - } - } - return nil -} - -// Override default JSON handling for PackageInfo_Icons_Item to handle AdditionalProperties -func (a PackageInfo_Icons_Item) MarshalJSON() ([]byte, error) { - var err error - object := make(map[string]json.RawMessage) - - if a.DarkMode != nil { - object["dark_mode"], err = json.Marshal(a.DarkMode) - if err != nil { - return nil, fmt.Errorf("error marshaling 'dark_mode': %w", err) - } - } - - if a.Path != nil { - object["path"], err = json.Marshal(a.Path) - if err != nil { - return nil, fmt.Errorf("error marshaling 'path': %w", err) - } - } - - if a.Size != nil { - object["size"], err = json.Marshal(a.Size) - if err != nil { - return nil, fmt.Errorf("error marshaling 'size': %w", err) - } - } - - object["src"], err = json.Marshal(a.Src) - if err != nil { - return nil, fmt.Errorf("error marshaling 'src': %w", err) - } - - if a.Title != nil { - object["title"], err = json.Marshal(a.Title) - if err != nil { - return nil, fmt.Errorf("error marshaling 'title': %w", err) - } - } - - if a.Type != nil { - object["type"], err = json.Marshal(a.Type) - if err != nil { - return nil, fmt.Errorf("error marshaling 'type': %w", err) - } - } - - for fieldName, field := range a.AdditionalProperties { - object[fieldName], err = json.Marshal(field) - if err != nil { - return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) - } - } - return json.Marshal(object) -} - -// Getter for additional properties for PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Item. Returns the specified -// element and whether it was found -func (a PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Item) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Item -func (a *PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Item) Set(fieldName string, value interface{}) { - if a.AdditionalProperties == nil { - a.AdditionalProperties = make(map[string]interface{}) - } - a.AdditionalProperties[fieldName] = value -} - -// Override default JSON handling for PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Item to handle AdditionalProperties -func (a *PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Item) UnmarshalJSON(b []byte) error { - object := make(map[string]json.RawMessage) - err := json.Unmarshal(b, &object) - if err != nil { - return err - } - - if raw, found := object["id"]; found { - err = json.Unmarshal(raw, &a.Id) - if err != nil { - return fmt.Errorf("error reading 'id': %w", err) - } - delete(object, "id") - } - - if raw, found := object["originId"]; found { - err = json.Unmarshal(raw, &a.OriginId) - if err != nil { - return fmt.Errorf("error reading 'originId': %w", err) - } - delete(object, "originId") - } - - if raw, found := object["type"]; found { - err = json.Unmarshal(raw, &a.Type) - if err != nil { - return fmt.Errorf("error reading 'type': %w", err) - } - delete(object, "type") - } - - if len(object) != 0 { - a.AdditionalProperties = make(map[string]interface{}) - for fieldName, fieldBuf := range object { - var fieldVal interface{} - err := json.Unmarshal(fieldBuf, &fieldVal) - if err != nil { - return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) - } - a.AdditionalProperties[fieldName] = fieldVal - } - } - return nil -} - -// Override default JSON handling for PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Item to handle AdditionalProperties -func (a PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Item) MarshalJSON() ([]byte, error) { - var err error - object := make(map[string]json.RawMessage) - - object["id"], err = json.Marshal(a.Id) - if err != nil { - return nil, fmt.Errorf("error marshaling 'id': %w", err) - } - - if a.OriginId != nil { - object["originId"], err = json.Marshal(a.OriginId) - if err != nil { - return nil, fmt.Errorf("error marshaling 'originId': %w", err) - } - } - - object["type"], err = json.Marshal(a.Type) - if err != nil { - return nil, fmt.Errorf("error marshaling 'type': %w", err) - } - - for fieldName, field := range a.AdditionalProperties { - object[fieldName], err = json.Marshal(field) - if err != nil { - return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) - } - } - return json.Marshal(object) -} - -// Getter for additional properties for PackageInfo_InstallationInfo_ExperimentalDataStreamFeatures_Features. Returns the specified -// element and whether it was found -func (a PackageInfo_InstallationInfo_ExperimentalDataStreamFeatures_Features) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for PackageInfo_InstallationInfo_ExperimentalDataStreamFeatures_Features -func (a *PackageInfo_InstallationInfo_ExperimentalDataStreamFeatures_Features) Set(fieldName string, value interface{}) { - if a.AdditionalProperties == nil { - a.AdditionalProperties = make(map[string]interface{}) - } - a.AdditionalProperties[fieldName] = value -} - -// Override default JSON handling for PackageInfo_InstallationInfo_ExperimentalDataStreamFeatures_Features to handle AdditionalProperties -func (a *PackageInfo_InstallationInfo_ExperimentalDataStreamFeatures_Features) UnmarshalJSON(b []byte) error { - object := make(map[string]json.RawMessage) - err := json.Unmarshal(b, &object) - if err != nil { - return err - } - - if raw, found := object["doc_value_only_numeric"]; found { - err = json.Unmarshal(raw, &a.DocValueOnlyNumeric) - if err != nil { - return fmt.Errorf("error reading 'doc_value_only_numeric': %w", err) - } - delete(object, "doc_value_only_numeric") - } - - if raw, found := object["doc_value_only_other"]; found { - err = json.Unmarshal(raw, &a.DocValueOnlyOther) - if err != nil { - return fmt.Errorf("error reading 'doc_value_only_other': %w", err) - } - delete(object, "doc_value_only_other") - } - - if raw, found := object["synthetic_source"]; found { - err = json.Unmarshal(raw, &a.SyntheticSource) - if err != nil { - return fmt.Errorf("error reading 'synthetic_source': %w", err) - } - delete(object, "synthetic_source") - } - - if raw, found := object["tsdb"]; found { - err = json.Unmarshal(raw, &a.Tsdb) - if err != nil { - return fmt.Errorf("error reading 'tsdb': %w", err) - } - delete(object, "tsdb") - } - - if len(object) != 0 { - a.AdditionalProperties = make(map[string]interface{}) - for fieldName, fieldBuf := range object { - var fieldVal interface{} - err := json.Unmarshal(fieldBuf, &fieldVal) - if err != nil { - return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) - } - a.AdditionalProperties[fieldName] = fieldVal - } - } - return nil -} - -// Override default JSON handling for PackageInfo_InstallationInfo_ExperimentalDataStreamFeatures_Features to handle AdditionalProperties -func (a PackageInfo_InstallationInfo_ExperimentalDataStreamFeatures_Features) MarshalJSON() ([]byte, error) { - var err error - object := make(map[string]json.RawMessage) - - if a.DocValueOnlyNumeric != nil { - object["doc_value_only_numeric"], err = json.Marshal(a.DocValueOnlyNumeric) - if err != nil { - return nil, fmt.Errorf("error marshaling 'doc_value_only_numeric': %w", err) - } - } - - if a.DocValueOnlyOther != nil { - object["doc_value_only_other"], err = json.Marshal(a.DocValueOnlyOther) - if err != nil { - return nil, fmt.Errorf("error marshaling 'doc_value_only_other': %w", err) - } - } - - if a.SyntheticSource != nil { - object["synthetic_source"], err = json.Marshal(a.SyntheticSource) - if err != nil { - return nil, fmt.Errorf("error marshaling 'synthetic_source': %w", err) - } - } - - if a.Tsdb != nil { - object["tsdb"], err = json.Marshal(a.Tsdb) - if err != nil { - return nil, fmt.Errorf("error marshaling 'tsdb': %w", err) - } - } - - for fieldName, field := range a.AdditionalProperties { - object[fieldName], err = json.Marshal(field) - if err != nil { - return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) - } - } - return json.Marshal(object) -} - -// Getter for additional properties for PackageInfo_InstallationInfo_ExperimentalDataStreamFeatures_Item. Returns the specified -// element and whether it was found -func (a PackageInfo_InstallationInfo_ExperimentalDataStreamFeatures_Item) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for PackageInfo_InstallationInfo_ExperimentalDataStreamFeatures_Item -func (a *PackageInfo_InstallationInfo_ExperimentalDataStreamFeatures_Item) Set(fieldName string, value interface{}) { - if a.AdditionalProperties == nil { - a.AdditionalProperties = make(map[string]interface{}) - } - a.AdditionalProperties[fieldName] = value -} - -// Override default JSON handling for PackageInfo_InstallationInfo_ExperimentalDataStreamFeatures_Item to handle AdditionalProperties -func (a *PackageInfo_InstallationInfo_ExperimentalDataStreamFeatures_Item) UnmarshalJSON(b []byte) error { - object := make(map[string]json.RawMessage) - err := json.Unmarshal(b, &object) - if err != nil { - return err - } - - if raw, found := object["data_stream"]; found { - err = json.Unmarshal(raw, &a.DataStream) - if err != nil { - return fmt.Errorf("error reading 'data_stream': %w", err) - } - delete(object, "data_stream") - } - - if raw, found := object["features"]; found { - err = json.Unmarshal(raw, &a.Features) - if err != nil { - return fmt.Errorf("error reading 'features': %w", err) - } - delete(object, "features") - } - - if len(object) != 0 { - a.AdditionalProperties = make(map[string]interface{}) - for fieldName, fieldBuf := range object { - var fieldVal interface{} - err := json.Unmarshal(fieldBuf, &fieldVal) - if err != nil { - return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) - } - a.AdditionalProperties[fieldName] = fieldVal - } - } - return nil -} - -// Override default JSON handling for PackageInfo_InstallationInfo_ExperimentalDataStreamFeatures_Item to handle AdditionalProperties -func (a PackageInfo_InstallationInfo_ExperimentalDataStreamFeatures_Item) MarshalJSON() ([]byte, error) { - var err error - object := make(map[string]json.RawMessage) - - object["data_stream"], err = json.Marshal(a.DataStream) - if err != nil { - return nil, fmt.Errorf("error marshaling 'data_stream': %w", err) - } - - object["features"], err = json.Marshal(a.Features) - if err != nil { - return nil, fmt.Errorf("error marshaling 'features': %w", err) - } - - for fieldName, field := range a.AdditionalProperties { - object[fieldName], err = json.Marshal(field) - if err != nil { - return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) - } - } - return json.Marshal(object) -} - -// Getter for additional properties for PackageInfo_InstallationInfo_InstalledEs_Item. Returns the specified -// element and whether it was found -func (a PackageInfo_InstallationInfo_InstalledEs_Item) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for PackageInfo_InstallationInfo_InstalledEs_Item -func (a *PackageInfo_InstallationInfo_InstalledEs_Item) Set(fieldName string, value interface{}) { - if a.AdditionalProperties == nil { - a.AdditionalProperties = make(map[string]interface{}) - } - a.AdditionalProperties[fieldName] = value -} - -// Override default JSON handling for PackageInfo_InstallationInfo_InstalledEs_Item to handle AdditionalProperties -func (a *PackageInfo_InstallationInfo_InstalledEs_Item) UnmarshalJSON(b []byte) error { - object := make(map[string]json.RawMessage) - err := json.Unmarshal(b, &object) - if err != nil { - return err - } - - if raw, found := object["deferred"]; found { - err = json.Unmarshal(raw, &a.Deferred) - if err != nil { - return fmt.Errorf("error reading 'deferred': %w", err) - } - delete(object, "deferred") - } - - if raw, found := object["id"]; found { - err = json.Unmarshal(raw, &a.Id) - if err != nil { - return fmt.Errorf("error reading 'id': %w", err) - } - delete(object, "id") - } - - if raw, found := object["type"]; found { - err = json.Unmarshal(raw, &a.Type) - if err != nil { - return fmt.Errorf("error reading 'type': %w", err) - } - delete(object, "type") - } - - if raw, found := object["version"]; found { - err = json.Unmarshal(raw, &a.Version) - if err != nil { - return fmt.Errorf("error reading 'version': %w", err) - } - delete(object, "version") - } - - if len(object) != 0 { - a.AdditionalProperties = make(map[string]interface{}) - for fieldName, fieldBuf := range object { - var fieldVal interface{} - err := json.Unmarshal(fieldBuf, &fieldVal) - if err != nil { - return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) - } - a.AdditionalProperties[fieldName] = fieldVal - } - } - return nil -} - -// Override default JSON handling for PackageInfo_InstallationInfo_InstalledEs_Item to handle AdditionalProperties -func (a PackageInfo_InstallationInfo_InstalledEs_Item) MarshalJSON() ([]byte, error) { - var err error - object := make(map[string]json.RawMessage) - - if a.Deferred != nil { - object["deferred"], err = json.Marshal(a.Deferred) - if err != nil { - return nil, fmt.Errorf("error marshaling 'deferred': %w", err) - } - } - - object["id"], err = json.Marshal(a.Id) - if err != nil { - return nil, fmt.Errorf("error marshaling 'id': %w", err) - } - - object["type"], err = json.Marshal(a.Type) - if err != nil { - return nil, fmt.Errorf("error marshaling 'type': %w", err) - } - - if a.Version != nil { - object["version"], err = json.Marshal(a.Version) - if err != nil { - return nil, fmt.Errorf("error marshaling 'version': %w", err) - } - } - - for fieldName, field := range a.AdditionalProperties { - object[fieldName], err = json.Marshal(field) - if err != nil { - return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) - } - } - return json.Marshal(object) -} - -// Getter for additional properties for PackageInfo_InstallationInfo_InstalledKibana_Item. Returns the specified -// element and whether it was found -func (a PackageInfo_InstallationInfo_InstalledKibana_Item) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for PackageInfo_InstallationInfo_InstalledKibana_Item -func (a *PackageInfo_InstallationInfo_InstalledKibana_Item) Set(fieldName string, value interface{}) { - if a.AdditionalProperties == nil { - a.AdditionalProperties = make(map[string]interface{}) - } - a.AdditionalProperties[fieldName] = value -} - -// Override default JSON handling for PackageInfo_InstallationInfo_InstalledKibana_Item to handle AdditionalProperties -func (a *PackageInfo_InstallationInfo_InstalledKibana_Item) UnmarshalJSON(b []byte) error { - object := make(map[string]json.RawMessage) - err := json.Unmarshal(b, &object) - if err != nil { - return err - } - - if raw, found := object["id"]; found { - err = json.Unmarshal(raw, &a.Id) - if err != nil { - return fmt.Errorf("error reading 'id': %w", err) - } - delete(object, "id") - } - - if raw, found := object["originId"]; found { - err = json.Unmarshal(raw, &a.OriginId) - if err != nil { - return fmt.Errorf("error reading 'originId': %w", err) - } - delete(object, "originId") - } - - if raw, found := object["type"]; found { - err = json.Unmarshal(raw, &a.Type) - if err != nil { - return fmt.Errorf("error reading 'type': %w", err) - } - delete(object, "type") - } - - if len(object) != 0 { - a.AdditionalProperties = make(map[string]interface{}) - for fieldName, fieldBuf := range object { - var fieldVal interface{} - err := json.Unmarshal(fieldBuf, &fieldVal) - if err != nil { - return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) - } - a.AdditionalProperties[fieldName] = fieldVal - } - } - return nil -} - -// Override default JSON handling for PackageInfo_InstallationInfo_InstalledKibana_Item to handle AdditionalProperties -func (a PackageInfo_InstallationInfo_InstalledKibana_Item) MarshalJSON() ([]byte, error) { - var err error - object := make(map[string]json.RawMessage) - - object["id"], err = json.Marshal(a.Id) - if err != nil { - return nil, fmt.Errorf("error marshaling 'id': %w", err) - } - - if a.OriginId != nil { - object["originId"], err = json.Marshal(a.OriginId) - if err != nil { - return nil, fmt.Errorf("error marshaling 'originId': %w", err) - } - } - - object["type"], err = json.Marshal(a.Type) - if err != nil { - return nil, fmt.Errorf("error marshaling 'type': %w", err) - } - - for fieldName, field := range a.AdditionalProperties { - object[fieldName], err = json.Marshal(field) - if err != nil { - return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) - } - } - return json.Marshal(object) -} - -// Getter for additional properties for PackageInfo_InstallationInfo_LatestExecutedState. Returns the specified -// element and whether it was found -func (a PackageInfo_InstallationInfo_LatestExecutedState) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for PackageInfo_InstallationInfo_LatestExecutedState -func (a *PackageInfo_InstallationInfo_LatestExecutedState) Set(fieldName string, value interface{}) { - if a.AdditionalProperties == nil { - a.AdditionalProperties = make(map[string]interface{}) - } - a.AdditionalProperties[fieldName] = value -} - -// Override default JSON handling for PackageInfo_InstallationInfo_LatestExecutedState to handle AdditionalProperties -func (a *PackageInfo_InstallationInfo_LatestExecutedState) UnmarshalJSON(b []byte) error { - object := make(map[string]json.RawMessage) - err := json.Unmarshal(b, &object) - if err != nil { - return err - } - - if raw, found := object["error"]; found { - err = json.Unmarshal(raw, &a.Error) - if err != nil { - return fmt.Errorf("error reading 'error': %w", err) - } - delete(object, "error") - } - - if raw, found := object["name"]; found { - err = json.Unmarshal(raw, &a.Name) - if err != nil { - return fmt.Errorf("error reading 'name': %w", err) - } - delete(object, "name") - } - - if raw, found := object["started_at"]; found { - err = json.Unmarshal(raw, &a.StartedAt) - if err != nil { - return fmt.Errorf("error reading 'started_at': %w", err) - } - delete(object, "started_at") - } - - if len(object) != 0 { - a.AdditionalProperties = make(map[string]interface{}) - for fieldName, fieldBuf := range object { - var fieldVal interface{} - err := json.Unmarshal(fieldBuf, &fieldVal) - if err != nil { - return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) - } - a.AdditionalProperties[fieldName] = fieldVal - } - } - return nil -} - -// Override default JSON handling for PackageInfo_InstallationInfo_LatestExecutedState to handle AdditionalProperties -func (a PackageInfo_InstallationInfo_LatestExecutedState) MarshalJSON() ([]byte, error) { - var err error - object := make(map[string]json.RawMessage) - - if a.Error != nil { - object["error"], err = json.Marshal(a.Error) - if err != nil { - return nil, fmt.Errorf("error marshaling 'error': %w", err) - } - } - - object["name"], err = json.Marshal(a.Name) - if err != nil { - return nil, fmt.Errorf("error marshaling 'name': %w", err) - } - - object["started_at"], err = json.Marshal(a.StartedAt) - if err != nil { - return nil, fmt.Errorf("error marshaling 'started_at': %w", err) - } - - for fieldName, field := range a.AdditionalProperties { - object[fieldName], err = json.Marshal(field) - if err != nil { - return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) - } - } - return json.Marshal(object) -} - -// Getter for additional properties for PackageInfo_InstallationInfo_LatestInstallFailedAttempts_Error. Returns the specified -// element and whether it was found -func (a PackageInfo_InstallationInfo_LatestInstallFailedAttempts_Error) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for PackageInfo_InstallationInfo_LatestInstallFailedAttempts_Error -func (a *PackageInfo_InstallationInfo_LatestInstallFailedAttempts_Error) Set(fieldName string, value interface{}) { - if a.AdditionalProperties == nil { - a.AdditionalProperties = make(map[string]interface{}) - } - a.AdditionalProperties[fieldName] = value -} - -// Override default JSON handling for PackageInfo_InstallationInfo_LatestInstallFailedAttempts_Error to handle AdditionalProperties -func (a *PackageInfo_InstallationInfo_LatestInstallFailedAttempts_Error) UnmarshalJSON(b []byte) error { - object := make(map[string]json.RawMessage) - err := json.Unmarshal(b, &object) - if err != nil { - return err - } - - if raw, found := object["message"]; found { - err = json.Unmarshal(raw, &a.Message) - if err != nil { - return fmt.Errorf("error reading 'message': %w", err) - } - delete(object, "message") - } - - if raw, found := object["name"]; found { - err = json.Unmarshal(raw, &a.Name) - if err != nil { - return fmt.Errorf("error reading 'name': %w", err) - } - delete(object, "name") - } - - if raw, found := object["stack"]; found { - err = json.Unmarshal(raw, &a.Stack) - if err != nil { - return fmt.Errorf("error reading 'stack': %w", err) - } - delete(object, "stack") - } - - if len(object) != 0 { - a.AdditionalProperties = make(map[string]interface{}) - for fieldName, fieldBuf := range object { - var fieldVal interface{} - err := json.Unmarshal(fieldBuf, &fieldVal) - if err != nil { - return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) - } - a.AdditionalProperties[fieldName] = fieldVal - } - } - return nil -} - -// Override default JSON handling for PackageInfo_InstallationInfo_LatestInstallFailedAttempts_Error to handle AdditionalProperties -func (a PackageInfo_InstallationInfo_LatestInstallFailedAttempts_Error) MarshalJSON() ([]byte, error) { - var err error - object := make(map[string]json.RawMessage) - - object["message"], err = json.Marshal(a.Message) - if err != nil { - return nil, fmt.Errorf("error marshaling 'message': %w", err) - } - - object["name"], err = json.Marshal(a.Name) - if err != nil { - return nil, fmt.Errorf("error marshaling 'name': %w", err) - } - - if a.Stack != nil { - object["stack"], err = json.Marshal(a.Stack) - if err != nil { - return nil, fmt.Errorf("error marshaling 'stack': %w", err) - } - } - - for fieldName, field := range a.AdditionalProperties { - object[fieldName], err = json.Marshal(field) - if err != nil { - return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) - } - } - return json.Marshal(object) -} - -// Getter for additional properties for PackageInfo_InstallationInfo_LatestInstallFailedAttempts_Item. Returns the specified -// element and whether it was found -func (a PackageInfo_InstallationInfo_LatestInstallFailedAttempts_Item) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for PackageInfo_InstallationInfo_LatestInstallFailedAttempts_Item -func (a *PackageInfo_InstallationInfo_LatestInstallFailedAttempts_Item) Set(fieldName string, value interface{}) { - if a.AdditionalProperties == nil { - a.AdditionalProperties = make(map[string]interface{}) - } - a.AdditionalProperties[fieldName] = value -} - -// Override default JSON handling for PackageInfo_InstallationInfo_LatestInstallFailedAttempts_Item to handle AdditionalProperties -func (a *PackageInfo_InstallationInfo_LatestInstallFailedAttempts_Item) UnmarshalJSON(b []byte) error { - object := make(map[string]json.RawMessage) - err := json.Unmarshal(b, &object) - if err != nil { - return err - } - - if raw, found := object["created_at"]; found { - err = json.Unmarshal(raw, &a.CreatedAt) - if err != nil { - return fmt.Errorf("error reading 'created_at': %w", err) - } - delete(object, "created_at") - } - - if raw, found := object["error"]; found { - err = json.Unmarshal(raw, &a.Error) - if err != nil { - return fmt.Errorf("error reading 'error': %w", err) - } - delete(object, "error") - } - - if raw, found := object["target_version"]; found { - err = json.Unmarshal(raw, &a.TargetVersion) - if err != nil { - return fmt.Errorf("error reading 'target_version': %w", err) - } - delete(object, "target_version") - } - - if len(object) != 0 { - a.AdditionalProperties = make(map[string]interface{}) - for fieldName, fieldBuf := range object { - var fieldVal interface{} - err := json.Unmarshal(fieldBuf, &fieldVal) - if err != nil { - return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) - } - a.AdditionalProperties[fieldName] = fieldVal - } - } - return nil -} - -// Override default JSON handling for PackageInfo_InstallationInfo_LatestInstallFailedAttempts_Item to handle AdditionalProperties -func (a PackageInfo_InstallationInfo_LatestInstallFailedAttempts_Item) MarshalJSON() ([]byte, error) { - var err error - object := make(map[string]json.RawMessage) - - object["created_at"], err = json.Marshal(a.CreatedAt) - if err != nil { - return nil, fmt.Errorf("error marshaling 'created_at': %w", err) - } - - object["error"], err = json.Marshal(a.Error) - if err != nil { - return nil, fmt.Errorf("error marshaling 'error': %w", err) - } - - object["target_version"], err = json.Marshal(a.TargetVersion) - if err != nil { - return nil, fmt.Errorf("error marshaling 'target_version': %w", err) - } - - for fieldName, field := range a.AdditionalProperties { - object[fieldName], err = json.Marshal(field) - if err != nil { - return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) - } - } - return json.Marshal(object) -} - -// Getter for additional properties for PackageInfo_InstallationInfo. Returns the specified -// element and whether it was found -func (a PackageInfo_InstallationInfo) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for PackageInfo_InstallationInfo -func (a *PackageInfo_InstallationInfo) Set(fieldName string, value interface{}) { - if a.AdditionalProperties == nil { - a.AdditionalProperties = make(map[string]interface{}) - } - a.AdditionalProperties[fieldName] = value -} - -// Override default JSON handling for PackageInfo_InstallationInfo to handle AdditionalProperties -func (a *PackageInfo_InstallationInfo) UnmarshalJSON(b []byte) error { - object := make(map[string]json.RawMessage) - err := json.Unmarshal(b, &object) - if err != nil { - return err - } - - if raw, found := object["additional_spaces_installed_kibana"]; found { - err = json.Unmarshal(raw, &a.AdditionalSpacesInstalledKibana) - if err != nil { - return fmt.Errorf("error reading 'additional_spaces_installed_kibana': %w", err) - } - delete(object, "additional_spaces_installed_kibana") - } - - if raw, found := object["created_at"]; found { - err = json.Unmarshal(raw, &a.CreatedAt) - if err != nil { - return fmt.Errorf("error reading 'created_at': %w", err) - } - delete(object, "created_at") - } - - if raw, found := object["experimental_data_stream_features"]; found { - err = json.Unmarshal(raw, &a.ExperimentalDataStreamFeatures) - if err != nil { - return fmt.Errorf("error reading 'experimental_data_stream_features': %w", err) - } - delete(object, "experimental_data_stream_features") - } - - if raw, found := object["install_format_schema_version"]; found { - err = json.Unmarshal(raw, &a.InstallFormatSchemaVersion) - if err != nil { - return fmt.Errorf("error reading 'install_format_schema_version': %w", err) - } - delete(object, "install_format_schema_version") - } - - if raw, found := object["install_source"]; found { - err = json.Unmarshal(raw, &a.InstallSource) - if err != nil { - return fmt.Errorf("error reading 'install_source': %w", err) - } - delete(object, "install_source") - } - - if raw, found := object["install_status"]; found { - err = json.Unmarshal(raw, &a.InstallStatus) - if err != nil { - return fmt.Errorf("error reading 'install_status': %w", err) - } - delete(object, "install_status") - } - - if raw, found := object["installed_es"]; found { - err = json.Unmarshal(raw, &a.InstalledEs) - if err != nil { - return fmt.Errorf("error reading 'installed_es': %w", err) - } - delete(object, "installed_es") - } - - if raw, found := object["installed_kibana"]; found { - err = json.Unmarshal(raw, &a.InstalledKibana) - if err != nil { - return fmt.Errorf("error reading 'installed_kibana': %w", err) - } - delete(object, "installed_kibana") - } - - if raw, found := object["installed_kibana_space_id"]; found { - err = json.Unmarshal(raw, &a.InstalledKibanaSpaceId) - if err != nil { - return fmt.Errorf("error reading 'installed_kibana_space_id': %w", err) - } - delete(object, "installed_kibana_space_id") - } - - if raw, found := object["latest_executed_state"]; found { - err = json.Unmarshal(raw, &a.LatestExecutedState) - if err != nil { - return fmt.Errorf("error reading 'latest_executed_state': %w", err) - } - delete(object, "latest_executed_state") - } - - if raw, found := object["latest_install_failed_attempts"]; found { - err = json.Unmarshal(raw, &a.LatestInstallFailedAttempts) - if err != nil { - return fmt.Errorf("error reading 'latest_install_failed_attempts': %w", err) - } - delete(object, "latest_install_failed_attempts") - } - - if raw, found := object["name"]; found { - err = json.Unmarshal(raw, &a.Name) - if err != nil { - return fmt.Errorf("error reading 'name': %w", err) - } - delete(object, "name") - } - - if raw, found := object["namespaces"]; found { - err = json.Unmarshal(raw, &a.Namespaces) - if err != nil { - return fmt.Errorf("error reading 'namespaces': %w", err) - } - delete(object, "namespaces") - } - - if raw, found := object["type"]; found { - err = json.Unmarshal(raw, &a.Type) - if err != nil { - return fmt.Errorf("error reading 'type': %w", err) - } - delete(object, "type") - } - - if raw, found := object["updated_at"]; found { - err = json.Unmarshal(raw, &a.UpdatedAt) - if err != nil { - return fmt.Errorf("error reading 'updated_at': %w", err) - } - delete(object, "updated_at") - } - - if raw, found := object["verification_key_id"]; found { - err = json.Unmarshal(raw, &a.VerificationKeyId) - if err != nil { - return fmt.Errorf("error reading 'verification_key_id': %w", err) - } - delete(object, "verification_key_id") - } - - if raw, found := object["verification_status"]; found { - err = json.Unmarshal(raw, &a.VerificationStatus) - if err != nil { - return fmt.Errorf("error reading 'verification_status': %w", err) - } - delete(object, "verification_status") - } - - if raw, found := object["version"]; found { - err = json.Unmarshal(raw, &a.Version) - if err != nil { - return fmt.Errorf("error reading 'version': %w", err) - } - delete(object, "version") - } - - if len(object) != 0 { - a.AdditionalProperties = make(map[string]interface{}) - for fieldName, fieldBuf := range object { - var fieldVal interface{} - err := json.Unmarshal(fieldBuf, &fieldVal) - if err != nil { - return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) - } - a.AdditionalProperties[fieldName] = fieldVal - } - } - return nil -} - -// Override default JSON handling for PackageInfo_InstallationInfo to handle AdditionalProperties -func (a PackageInfo_InstallationInfo) MarshalJSON() ([]byte, error) { - var err error - object := make(map[string]json.RawMessage) - - if a.AdditionalSpacesInstalledKibana != nil { - object["additional_spaces_installed_kibana"], err = json.Marshal(a.AdditionalSpacesInstalledKibana) - if err != nil { - return nil, fmt.Errorf("error marshaling 'additional_spaces_installed_kibana': %w", err) - } - } - - if a.CreatedAt != nil { - object["created_at"], err = json.Marshal(a.CreatedAt) - if err != nil { - return nil, fmt.Errorf("error marshaling 'created_at': %w", err) - } - } - - if a.ExperimentalDataStreamFeatures != nil { - object["experimental_data_stream_features"], err = json.Marshal(a.ExperimentalDataStreamFeatures) - if err != nil { - return nil, fmt.Errorf("error marshaling 'experimental_data_stream_features': %w", err) - } - } - - if a.InstallFormatSchemaVersion != nil { - object["install_format_schema_version"], err = json.Marshal(a.InstallFormatSchemaVersion) - if err != nil { - return nil, fmt.Errorf("error marshaling 'install_format_schema_version': %w", err) - } - } - - object["install_source"], err = json.Marshal(a.InstallSource) - if err != nil { - return nil, fmt.Errorf("error marshaling 'install_source': %w", err) - } - - object["install_status"], err = json.Marshal(a.InstallStatus) - if err != nil { - return nil, fmt.Errorf("error marshaling 'install_status': %w", err) - } - - object["installed_es"], err = json.Marshal(a.InstalledEs) - if err != nil { - return nil, fmt.Errorf("error marshaling 'installed_es': %w", err) - } - - object["installed_kibana"], err = json.Marshal(a.InstalledKibana) - if err != nil { - return nil, fmt.Errorf("error marshaling 'installed_kibana': %w", err) - } - - if a.InstalledKibanaSpaceId != nil { - object["installed_kibana_space_id"], err = json.Marshal(a.InstalledKibanaSpaceId) - if err != nil { - return nil, fmt.Errorf("error marshaling 'installed_kibana_space_id': %w", err) - } - } - - if a.LatestExecutedState != nil { - object["latest_executed_state"], err = json.Marshal(a.LatestExecutedState) - if err != nil { - return nil, fmt.Errorf("error marshaling 'latest_executed_state': %w", err) - } - } - - if a.LatestInstallFailedAttempts != nil { - object["latest_install_failed_attempts"], err = json.Marshal(a.LatestInstallFailedAttempts) - if err != nil { - return nil, fmt.Errorf("error marshaling 'latest_install_failed_attempts': %w", err) - } - } - - object["name"], err = json.Marshal(a.Name) - if err != nil { - return nil, fmt.Errorf("error marshaling 'name': %w", err) - } - - if a.Namespaces != nil { - object["namespaces"], err = json.Marshal(a.Namespaces) - if err != nil { - return nil, fmt.Errorf("error marshaling 'namespaces': %w", err) - } - } - - object["type"], err = json.Marshal(a.Type) - if err != nil { - return nil, fmt.Errorf("error marshaling 'type': %w", err) - } - - if a.UpdatedAt != nil { - object["updated_at"], err = json.Marshal(a.UpdatedAt) - if err != nil { - return nil, fmt.Errorf("error marshaling 'updated_at': %w", err) - } - } - - if a.VerificationKeyId != nil { - object["verification_key_id"], err = json.Marshal(a.VerificationKeyId) - if err != nil { - return nil, fmt.Errorf("error marshaling 'verification_key_id': %w", err) - } - } - - object["verification_status"], err = json.Marshal(a.VerificationStatus) - if err != nil { - return nil, fmt.Errorf("error marshaling 'verification_status': %w", err) - } - - object["version"], err = json.Marshal(a.Version) - if err != nil { - return nil, fmt.Errorf("error marshaling 'version': %w", err) - } - - for fieldName, field := range a.AdditionalProperties { - object[fieldName], err = json.Marshal(field) - if err != nil { - return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) - } - } - return json.Marshal(object) -} - -// Getter for additional properties for PackageInfo_Owner. Returns the specified -// element and whether it was found -func (a PackageInfo_Owner) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for PackageInfo_Owner -func (a *PackageInfo_Owner) Set(fieldName string, value interface{}) { - if a.AdditionalProperties == nil { - a.AdditionalProperties = make(map[string]interface{}) - } - a.AdditionalProperties[fieldName] = value -} - -// Override default JSON handling for PackageInfo_Owner to handle AdditionalProperties -func (a *PackageInfo_Owner) UnmarshalJSON(b []byte) error { - object := make(map[string]json.RawMessage) - err := json.Unmarshal(b, &object) - if err != nil { - return err - } - - if raw, found := object["github"]; found { - err = json.Unmarshal(raw, &a.Github) - if err != nil { - return fmt.Errorf("error reading 'github': %w", err) - } - delete(object, "github") - } - - if raw, found := object["type"]; found { - err = json.Unmarshal(raw, &a.Type) - if err != nil { - return fmt.Errorf("error reading 'type': %w", err) - } - delete(object, "type") - } - - if len(object) != 0 { - a.AdditionalProperties = make(map[string]interface{}) - for fieldName, fieldBuf := range object { - var fieldVal interface{} - err := json.Unmarshal(fieldBuf, &fieldVal) - if err != nil { - return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) - } - a.AdditionalProperties[fieldName] = fieldVal - } - } - return nil -} - -// Override default JSON handling for PackageInfo_Owner to handle AdditionalProperties -func (a PackageInfo_Owner) MarshalJSON() ([]byte, error) { - var err error - object := make(map[string]json.RawMessage) - - if a.Github != nil { - object["github"], err = json.Marshal(a.Github) - if err != nil { - return nil, fmt.Errorf("error marshaling 'github': %w", err) - } - } - - if a.Type != nil { - object["type"], err = json.Marshal(a.Type) - if err != nil { - return nil, fmt.Errorf("error marshaling 'type': %w", err) - } - } - - for fieldName, field := range a.AdditionalProperties { - object[fieldName], err = json.Marshal(field) - if err != nil { - return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) - } - } - return json.Marshal(object) -} - -// Getter for additional properties for PackageInfo_Source. Returns the specified -// element and whether it was found -func (a PackageInfo_Source) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for PackageInfo_Source -func (a *PackageInfo_Source) Set(fieldName string, value interface{}) { - if a.AdditionalProperties == nil { - a.AdditionalProperties = make(map[string]interface{}) - } - a.AdditionalProperties[fieldName] = value -} - -// Override default JSON handling for PackageInfo_Source to handle AdditionalProperties -func (a *PackageInfo_Source) UnmarshalJSON(b []byte) error { - object := make(map[string]json.RawMessage) - err := json.Unmarshal(b, &object) - if err != nil { - return err - } - - if raw, found := object["license"]; found { - err = json.Unmarshal(raw, &a.License) - if err != nil { - return fmt.Errorf("error reading 'license': %w", err) - } - delete(object, "license") - } - - if len(object) != 0 { - a.AdditionalProperties = make(map[string]interface{}) - for fieldName, fieldBuf := range object { - var fieldVal interface{} - err := json.Unmarshal(fieldBuf, &fieldVal) - if err != nil { - return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) - } - a.AdditionalProperties[fieldName] = fieldVal - } - } - return nil -} - -// Override default JSON handling for PackageInfo_Source to handle AdditionalProperties -func (a PackageInfo_Source) MarshalJSON() ([]byte, error) { - var err error - object := make(map[string]json.RawMessage) - - object["license"], err = json.Marshal(a.License) - if err != nil { - return nil, fmt.Errorf("error marshaling 'license': %w", err) - } - - for fieldName, field := range a.AdditionalProperties { - object[fieldName], err = json.Marshal(field) - if err != nil { - return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) - } - } - return json.Marshal(object) -} - -// Getter for additional properties for PackageListItem. Returns the specified -// element and whether it was found -func (a PackageListItem) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for PackageListItem -func (a *PackageListItem) Set(fieldName string, value interface{}) { - if a.AdditionalProperties == nil { - a.AdditionalProperties = make(map[string]interface{}) - } - a.AdditionalProperties[fieldName] = value -} - -// Override default JSON handling for PackageListItem to handle AdditionalProperties -func (a *PackageListItem) UnmarshalJSON(b []byte) error { - object := make(map[string]json.RawMessage) - err := json.Unmarshal(b, &object) - if err != nil { - return err - } - - if raw, found := object["categories"]; found { - err = json.Unmarshal(raw, &a.Categories) - if err != nil { - return fmt.Errorf("error reading 'categories': %w", err) - } - delete(object, "categories") - } - - if raw, found := object["conditions"]; found { - err = json.Unmarshal(raw, &a.Conditions) - if err != nil { - return fmt.Errorf("error reading 'conditions': %w", err) - } - delete(object, "conditions") - } - - if raw, found := object["data_streams"]; found { - err = json.Unmarshal(raw, &a.DataStreams) - if err != nil { - return fmt.Errorf("error reading 'data_streams': %w", err) - } - delete(object, "data_streams") - } - - if raw, found := object["description"]; found { - err = json.Unmarshal(raw, &a.Description) - if err != nil { - return fmt.Errorf("error reading 'description': %w", err) - } - delete(object, "description") - } - - if raw, found := object["discovery"]; found { - err = json.Unmarshal(raw, &a.Discovery) - if err != nil { - return fmt.Errorf("error reading 'discovery': %w", err) - } - delete(object, "discovery") - } - - if raw, found := object["download"]; found { - err = json.Unmarshal(raw, &a.Download) - if err != nil { - return fmt.Errorf("error reading 'download': %w", err) - } - delete(object, "download") - } - - if raw, found := object["format_version"]; found { - err = json.Unmarshal(raw, &a.FormatVersion) - if err != nil { - return fmt.Errorf("error reading 'format_version': %w", err) - } - delete(object, "format_version") - } - - if raw, found := object["icons"]; found { - err = json.Unmarshal(raw, &a.Icons) - if err != nil { - return fmt.Errorf("error reading 'icons': %w", err) - } - delete(object, "icons") - } - - if raw, found := object["id"]; found { - err = json.Unmarshal(raw, &a.Id) - if err != nil { - return fmt.Errorf("error reading 'id': %w", err) - } - delete(object, "id") - } - - if raw, found := object["installationInfo"]; found { - err = json.Unmarshal(raw, &a.InstallationInfo) - if err != nil { - return fmt.Errorf("error reading 'installationInfo': %w", err) - } - delete(object, "installationInfo") - } - - if raw, found := object["integration"]; found { - err = json.Unmarshal(raw, &a.Integration) - if err != nil { - return fmt.Errorf("error reading 'integration': %w", err) - } - delete(object, "integration") - } - - if raw, found := object["internal"]; found { - err = json.Unmarshal(raw, &a.Internal) - if err != nil { - return fmt.Errorf("error reading 'internal': %w", err) - } - delete(object, "internal") - } - - if raw, found := object["latestVersion"]; found { - err = json.Unmarshal(raw, &a.LatestVersion) - if err != nil { - return fmt.Errorf("error reading 'latestVersion': %w", err) - } - delete(object, "latestVersion") - } - - if raw, found := object["name"]; found { - err = json.Unmarshal(raw, &a.Name) - if err != nil { - return fmt.Errorf("error reading 'name': %w", err) - } - delete(object, "name") - } - - if raw, found := object["owner"]; found { - err = json.Unmarshal(raw, &a.Owner) - if err != nil { - return fmt.Errorf("error reading 'owner': %w", err) - } - delete(object, "owner") - } - - if raw, found := object["path"]; found { - err = json.Unmarshal(raw, &a.Path) - if err != nil { - return fmt.Errorf("error reading 'path': %w", err) - } - delete(object, "path") - } - - if raw, found := object["policy_templates"]; found { - err = json.Unmarshal(raw, &a.PolicyTemplates) - if err != nil { - return fmt.Errorf("error reading 'policy_templates': %w", err) - } - delete(object, "policy_templates") - } - - if raw, found := object["readme"]; found { - err = json.Unmarshal(raw, &a.Readme) - if err != nil { - return fmt.Errorf("error reading 'readme': %w", err) - } - delete(object, "readme") - } - - if raw, found := object["release"]; found { - err = json.Unmarshal(raw, &a.Release) - if err != nil { - return fmt.Errorf("error reading 'release': %w", err) - } - delete(object, "release") - } - - if raw, found := object["savedObject"]; found { - err = json.Unmarshal(raw, &a.SavedObject) - if err != nil { - return fmt.Errorf("error reading 'savedObject': %w", err) - } - delete(object, "savedObject") - } - - if raw, found := object["signature_path"]; found { - err = json.Unmarshal(raw, &a.SignaturePath) - if err != nil { - return fmt.Errorf("error reading 'signature_path': %w", err) - } - delete(object, "signature_path") - } - - if raw, found := object["source"]; found { - err = json.Unmarshal(raw, &a.Source) - if err != nil { - return fmt.Errorf("error reading 'source': %w", err) - } - delete(object, "source") - } - - if raw, found := object["status"]; found { - err = json.Unmarshal(raw, &a.Status) - if err != nil { - return fmt.Errorf("error reading 'status': %w", err) - } - delete(object, "status") - } - - if raw, found := object["title"]; found { - err = json.Unmarshal(raw, &a.Title) - if err != nil { - return fmt.Errorf("error reading 'title': %w", err) - } - delete(object, "title") - } - - if raw, found := object["type"]; found { - err = json.Unmarshal(raw, &a.Type) - if err != nil { - return fmt.Errorf("error reading 'type': %w", err) - } - delete(object, "type") - } - - if raw, found := object["vars"]; found { - err = json.Unmarshal(raw, &a.Vars) - if err != nil { - return fmt.Errorf("error reading 'vars': %w", err) - } - delete(object, "vars") - } - - if raw, found := object["version"]; found { - err = json.Unmarshal(raw, &a.Version) - if err != nil { - return fmt.Errorf("error reading 'version': %w", err) - } - delete(object, "version") - } - - if len(object) != 0 { - a.AdditionalProperties = make(map[string]interface{}) - for fieldName, fieldBuf := range object { - var fieldVal interface{} - err := json.Unmarshal(fieldBuf, &fieldVal) - if err != nil { - return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) - } - a.AdditionalProperties[fieldName] = fieldVal - } - } - return nil -} - -// Override default JSON handling for PackageListItem to handle AdditionalProperties -func (a PackageListItem) MarshalJSON() ([]byte, error) { - var err error - object := make(map[string]json.RawMessage) - - if a.Categories != nil { - object["categories"], err = json.Marshal(a.Categories) - if err != nil { - return nil, fmt.Errorf("error marshaling 'categories': %w", err) - } - } - - if a.Conditions != nil { - object["conditions"], err = json.Marshal(a.Conditions) - if err != nil { - return nil, fmt.Errorf("error marshaling 'conditions': %w", err) - } - } - - if a.DataStreams != nil { - object["data_streams"], err = json.Marshal(a.DataStreams) - if err != nil { - return nil, fmt.Errorf("error marshaling 'data_streams': %w", err) - } - } - - if a.Description != nil { - object["description"], err = json.Marshal(a.Description) - if err != nil { - return nil, fmt.Errorf("error marshaling 'description': %w", err) - } - } - - if a.Discovery != nil { - object["discovery"], err = json.Marshal(a.Discovery) - if err != nil { - return nil, fmt.Errorf("error marshaling 'discovery': %w", err) - } - } - - if a.Download != nil { - object["download"], err = json.Marshal(a.Download) - if err != nil { - return nil, fmt.Errorf("error marshaling 'download': %w", err) - } - } - - if a.FormatVersion != nil { - object["format_version"], err = json.Marshal(a.FormatVersion) - if err != nil { - return nil, fmt.Errorf("error marshaling 'format_version': %w", err) - } - } - - if a.Icons != nil { - object["icons"], err = json.Marshal(a.Icons) - if err != nil { - return nil, fmt.Errorf("error marshaling 'icons': %w", err) - } - } - - object["id"], err = json.Marshal(a.Id) - if err != nil { - return nil, fmt.Errorf("error marshaling 'id': %w", err) - } - - if a.InstallationInfo != nil { - object["installationInfo"], err = json.Marshal(a.InstallationInfo) - if err != nil { - return nil, fmt.Errorf("error marshaling 'installationInfo': %w", err) - } - } - - if a.Integration != nil { - object["integration"], err = json.Marshal(a.Integration) - if err != nil { - return nil, fmt.Errorf("error marshaling 'integration': %w", err) - } - } - - if a.Internal != nil { - object["internal"], err = json.Marshal(a.Internal) - if err != nil { - return nil, fmt.Errorf("error marshaling 'internal': %w", err) - } - } - - if a.LatestVersion != nil { - object["latestVersion"], err = json.Marshal(a.LatestVersion) - if err != nil { - return nil, fmt.Errorf("error marshaling 'latestVersion': %w", err) - } - } - - object["name"], err = json.Marshal(a.Name) - if err != nil { - return nil, fmt.Errorf("error marshaling 'name': %w", err) - } - - if a.Owner != nil { - object["owner"], err = json.Marshal(a.Owner) - if err != nil { - return nil, fmt.Errorf("error marshaling 'owner': %w", err) - } - } - - if a.Path != nil { - object["path"], err = json.Marshal(a.Path) - if err != nil { - return nil, fmt.Errorf("error marshaling 'path': %w", err) - } - } - - if a.PolicyTemplates != nil { - object["policy_templates"], err = json.Marshal(a.PolicyTemplates) - if err != nil { - return nil, fmt.Errorf("error marshaling 'policy_templates': %w", err) - } - } - - if a.Readme != nil { - object["readme"], err = json.Marshal(a.Readme) - if err != nil { - return nil, fmt.Errorf("error marshaling 'readme': %w", err) - } - } - - if a.Release != nil { - object["release"], err = json.Marshal(a.Release) - if err != nil { - return nil, fmt.Errorf("error marshaling 'release': %w", err) - } - } - - object["savedObject"], err = json.Marshal(a.SavedObject) - if err != nil { - return nil, fmt.Errorf("error marshaling 'savedObject': %w", err) - } - - if a.SignaturePath != nil { - object["signature_path"], err = json.Marshal(a.SignaturePath) - if err != nil { - return nil, fmt.Errorf("error marshaling 'signature_path': %w", err) - } - } - - if a.Source != nil { - object["source"], err = json.Marshal(a.Source) - if err != nil { - return nil, fmt.Errorf("error marshaling 'source': %w", err) - } - } - - if a.Status != nil { - object["status"], err = json.Marshal(a.Status) - if err != nil { - return nil, fmt.Errorf("error marshaling 'status': %w", err) - } - } - - object["title"], err = json.Marshal(a.Title) - if err != nil { - return nil, fmt.Errorf("error marshaling 'title': %w", err) - } - - if a.Type != nil { - object["type"], err = json.Marshal(a.Type) - if err != nil { - return nil, fmt.Errorf("error marshaling 'type': %w", err) - } - } - - if a.Vars != nil { - object["vars"], err = json.Marshal(a.Vars) - if err != nil { - return nil, fmt.Errorf("error marshaling 'vars': %w", err) - } - } - - object["version"], err = json.Marshal(a.Version) - if err != nil { - return nil, fmt.Errorf("error marshaling 'version': %w", err) - } - - for fieldName, field := range a.AdditionalProperties { - object[fieldName], err = json.Marshal(field) - if err != nil { - return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) - } - } - return json.Marshal(object) -} - -// Getter for additional properties for PackageListItem_Conditions_Elastic. Returns the specified -// element and whether it was found -func (a PackageListItem_Conditions_Elastic) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for PackageListItem_Conditions_Elastic -func (a *PackageListItem_Conditions_Elastic) Set(fieldName string, value interface{}) { - if a.AdditionalProperties == nil { - a.AdditionalProperties = make(map[string]interface{}) - } - a.AdditionalProperties[fieldName] = value -} - -// Override default JSON handling for PackageListItem_Conditions_Elastic to handle AdditionalProperties -func (a *PackageListItem_Conditions_Elastic) UnmarshalJSON(b []byte) error { - object := make(map[string]json.RawMessage) - err := json.Unmarshal(b, &object) - if err != nil { - return err - } - - if raw, found := object["capabilities"]; found { - err = json.Unmarshal(raw, &a.Capabilities) - if err != nil { - return fmt.Errorf("error reading 'capabilities': %w", err) - } - delete(object, "capabilities") - } - - if raw, found := object["subscription"]; found { - err = json.Unmarshal(raw, &a.Subscription) - if err != nil { - return fmt.Errorf("error reading 'subscription': %w", err) - } - delete(object, "subscription") - } - - if len(object) != 0 { - a.AdditionalProperties = make(map[string]interface{}) - for fieldName, fieldBuf := range object { - var fieldVal interface{} - err := json.Unmarshal(fieldBuf, &fieldVal) - if err != nil { - return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) - } - a.AdditionalProperties[fieldName] = fieldVal - } - } - return nil -} - -// Override default JSON handling for PackageListItem_Conditions_Elastic to handle AdditionalProperties -func (a PackageListItem_Conditions_Elastic) MarshalJSON() ([]byte, error) { - var err error - object := make(map[string]json.RawMessage) - - if a.Capabilities != nil { - object["capabilities"], err = json.Marshal(a.Capabilities) - if err != nil { - return nil, fmt.Errorf("error marshaling 'capabilities': %w", err) - } - } - - if a.Subscription != nil { - object["subscription"], err = json.Marshal(a.Subscription) - if err != nil { - return nil, fmt.Errorf("error marshaling 'subscription': %w", err) - } - } - - for fieldName, field := range a.AdditionalProperties { - object[fieldName], err = json.Marshal(field) - if err != nil { - return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) - } - } - return json.Marshal(object) -} - -// Getter for additional properties for PackageListItem_Conditions_Kibana. Returns the specified -// element and whether it was found -func (a PackageListItem_Conditions_Kibana) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for PackageListItem_Conditions_Kibana -func (a *PackageListItem_Conditions_Kibana) Set(fieldName string, value interface{}) { - if a.AdditionalProperties == nil { - a.AdditionalProperties = make(map[string]interface{}) - } - a.AdditionalProperties[fieldName] = value -} - -// Override default JSON handling for PackageListItem_Conditions_Kibana to handle AdditionalProperties -func (a *PackageListItem_Conditions_Kibana) UnmarshalJSON(b []byte) error { - object := make(map[string]json.RawMessage) - err := json.Unmarshal(b, &object) - if err != nil { - return err - } - - if raw, found := object["version"]; found { - err = json.Unmarshal(raw, &a.Version) - if err != nil { - return fmt.Errorf("error reading 'version': %w", err) - } - delete(object, "version") - } - - if len(object) != 0 { - a.AdditionalProperties = make(map[string]interface{}) - for fieldName, fieldBuf := range object { - var fieldVal interface{} - err := json.Unmarshal(fieldBuf, &fieldVal) - if err != nil { - return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) - } - a.AdditionalProperties[fieldName] = fieldVal - } - } - return nil -} - -// Override default JSON handling for PackageListItem_Conditions_Kibana to handle AdditionalProperties -func (a PackageListItem_Conditions_Kibana) MarshalJSON() ([]byte, error) { - var err error - object := make(map[string]json.RawMessage) - - if a.Version != nil { - object["version"], err = json.Marshal(a.Version) - if err != nil { - return nil, fmt.Errorf("error marshaling 'version': %w", err) - } - } - - for fieldName, field := range a.AdditionalProperties { - object[fieldName], err = json.Marshal(field) - if err != nil { - return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) - } - } - return json.Marshal(object) -} - -// Getter for additional properties for PackageListItem_Conditions. Returns the specified -// element and whether it was found -func (a PackageListItem_Conditions) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for PackageListItem_Conditions -func (a *PackageListItem_Conditions) Set(fieldName string, value interface{}) { - if a.AdditionalProperties == nil { - a.AdditionalProperties = make(map[string]interface{}) - } - a.AdditionalProperties[fieldName] = value -} - -// Override default JSON handling for PackageListItem_Conditions to handle AdditionalProperties -func (a *PackageListItem_Conditions) UnmarshalJSON(b []byte) error { - object := make(map[string]json.RawMessage) - err := json.Unmarshal(b, &object) - if err != nil { - return err - } - - if raw, found := object["elastic"]; found { - err = json.Unmarshal(raw, &a.Elastic) - if err != nil { - return fmt.Errorf("error reading 'elastic': %w", err) - } - delete(object, "elastic") - } - - if raw, found := object["kibana"]; found { - err = json.Unmarshal(raw, &a.Kibana) - if err != nil { - return fmt.Errorf("error reading 'kibana': %w", err) - } - delete(object, "kibana") - } - - if len(object) != 0 { - a.AdditionalProperties = make(map[string]interface{}) - for fieldName, fieldBuf := range object { - var fieldVal interface{} - err := json.Unmarshal(fieldBuf, &fieldVal) - if err != nil { - return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) - } - a.AdditionalProperties[fieldName] = fieldVal - } - } - return nil -} - -// Override default JSON handling for PackageListItem_Conditions to handle AdditionalProperties -func (a PackageListItem_Conditions) MarshalJSON() ([]byte, error) { - var err error - object := make(map[string]json.RawMessage) - - if a.Elastic != nil { - object["elastic"], err = json.Marshal(a.Elastic) - if err != nil { - return nil, fmt.Errorf("error marshaling 'elastic': %w", err) - } - } - - if a.Kibana != nil { - object["kibana"], err = json.Marshal(a.Kibana) - if err != nil { - return nil, fmt.Errorf("error marshaling 'kibana': %w", err) - } - } - - for fieldName, field := range a.AdditionalProperties { - object[fieldName], err = json.Marshal(field) - if err != nil { - return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) - } - } - return json.Marshal(object) -} - -// Getter for additional properties for PackageListItem_Discovery_Fields_Item. Returns the specified -// element and whether it was found -func (a PackageListItem_Discovery_Fields_Item) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for PackageListItem_Discovery_Fields_Item -func (a *PackageListItem_Discovery_Fields_Item) Set(fieldName string, value interface{}) { - if a.AdditionalProperties == nil { - a.AdditionalProperties = make(map[string]interface{}) - } - a.AdditionalProperties[fieldName] = value -} - -// Override default JSON handling for PackageListItem_Discovery_Fields_Item to handle AdditionalProperties -func (a *PackageListItem_Discovery_Fields_Item) UnmarshalJSON(b []byte) error { - object := make(map[string]json.RawMessage) - err := json.Unmarshal(b, &object) - if err != nil { - return err - } - - if raw, found := object["name"]; found { - err = json.Unmarshal(raw, &a.Name) - if err != nil { - return fmt.Errorf("error reading 'name': %w", err) - } - delete(object, "name") - } - - if len(object) != 0 { - a.AdditionalProperties = make(map[string]interface{}) - for fieldName, fieldBuf := range object { - var fieldVal interface{} - err := json.Unmarshal(fieldBuf, &fieldVal) - if err != nil { - return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) - } - a.AdditionalProperties[fieldName] = fieldVal - } - } - return nil -} - -// Override default JSON handling for PackageListItem_Discovery_Fields_Item to handle AdditionalProperties -func (a PackageListItem_Discovery_Fields_Item) MarshalJSON() ([]byte, error) { - var err error - object := make(map[string]json.RawMessage) - - object["name"], err = json.Marshal(a.Name) - if err != nil { - return nil, fmt.Errorf("error marshaling 'name': %w", err) - } - - for fieldName, field := range a.AdditionalProperties { - object[fieldName], err = json.Marshal(field) - if err != nil { - return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) - } - } - return json.Marshal(object) -} - -// Getter for additional properties for PackageListItem_Discovery. Returns the specified -// element and whether it was found -func (a PackageListItem_Discovery) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for PackageListItem_Discovery -func (a *PackageListItem_Discovery) Set(fieldName string, value interface{}) { - if a.AdditionalProperties == nil { - a.AdditionalProperties = make(map[string]interface{}) - } - a.AdditionalProperties[fieldName] = value -} - -// Override default JSON handling for PackageListItem_Discovery to handle AdditionalProperties -func (a *PackageListItem_Discovery) UnmarshalJSON(b []byte) error { - object := make(map[string]json.RawMessage) - err := json.Unmarshal(b, &object) - if err != nil { - return err - } - - if raw, found := object["fields"]; found { - err = json.Unmarshal(raw, &a.Fields) - if err != nil { - return fmt.Errorf("error reading 'fields': %w", err) - } - delete(object, "fields") - } - - if len(object) != 0 { - a.AdditionalProperties = make(map[string]interface{}) - for fieldName, fieldBuf := range object { - var fieldVal interface{} - err := json.Unmarshal(fieldBuf, &fieldVal) - if err != nil { - return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) - } - a.AdditionalProperties[fieldName] = fieldVal - } - } - return nil -} - -// Override default JSON handling for PackageListItem_Discovery to handle AdditionalProperties -func (a PackageListItem_Discovery) MarshalJSON() ([]byte, error) { - var err error - object := make(map[string]json.RawMessage) - - if a.Fields != nil { - object["fields"], err = json.Marshal(a.Fields) - if err != nil { - return nil, fmt.Errorf("error marshaling 'fields': %w", err) - } - } - - for fieldName, field := range a.AdditionalProperties { - object[fieldName], err = json.Marshal(field) - if err != nil { - return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) - } - } - return json.Marshal(object) -} - -// Getter for additional properties for PackageListItem_Icons_Item. Returns the specified -// element and whether it was found -func (a PackageListItem_Icons_Item) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for PackageListItem_Icons_Item -func (a *PackageListItem_Icons_Item) Set(fieldName string, value interface{}) { - if a.AdditionalProperties == nil { - a.AdditionalProperties = make(map[string]interface{}) - } - a.AdditionalProperties[fieldName] = value -} - -// Override default JSON handling for PackageListItem_Icons_Item to handle AdditionalProperties -func (a *PackageListItem_Icons_Item) UnmarshalJSON(b []byte) error { - object := make(map[string]json.RawMessage) - err := json.Unmarshal(b, &object) - if err != nil { - return err - } - - if raw, found := object["dark_mode"]; found { - err = json.Unmarshal(raw, &a.DarkMode) - if err != nil { - return fmt.Errorf("error reading 'dark_mode': %w", err) - } - delete(object, "dark_mode") - } - - if raw, found := object["path"]; found { - err = json.Unmarshal(raw, &a.Path) - if err != nil { - return fmt.Errorf("error reading 'path': %w", err) - } - delete(object, "path") - } - - if raw, found := object["size"]; found { - err = json.Unmarshal(raw, &a.Size) - if err != nil { - return fmt.Errorf("error reading 'size': %w", err) - } - delete(object, "size") - } - - if raw, found := object["src"]; found { - err = json.Unmarshal(raw, &a.Src) - if err != nil { - return fmt.Errorf("error reading 'src': %w", err) - } - delete(object, "src") - } - - if raw, found := object["title"]; found { - err = json.Unmarshal(raw, &a.Title) - if err != nil { - return fmt.Errorf("error reading 'title': %w", err) - } - delete(object, "title") - } - - if raw, found := object["type"]; found { - err = json.Unmarshal(raw, &a.Type) - if err != nil { - return fmt.Errorf("error reading 'type': %w", err) - } - delete(object, "type") - } - - if len(object) != 0 { - a.AdditionalProperties = make(map[string]interface{}) - for fieldName, fieldBuf := range object { - var fieldVal interface{} - err := json.Unmarshal(fieldBuf, &fieldVal) - if err != nil { - return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) - } - a.AdditionalProperties[fieldName] = fieldVal - } - } - return nil -} - -// Override default JSON handling for PackageListItem_Icons_Item to handle AdditionalProperties -func (a PackageListItem_Icons_Item) MarshalJSON() ([]byte, error) { - var err error - object := make(map[string]json.RawMessage) - - if a.DarkMode != nil { - object["dark_mode"], err = json.Marshal(a.DarkMode) - if err != nil { - return nil, fmt.Errorf("error marshaling 'dark_mode': %w", err) - } - } - - if a.Path != nil { - object["path"], err = json.Marshal(a.Path) - if err != nil { - return nil, fmt.Errorf("error marshaling 'path': %w", err) - } - } - - if a.Size != nil { - object["size"], err = json.Marshal(a.Size) - if err != nil { - return nil, fmt.Errorf("error marshaling 'size': %w", err) - } - } - - object["src"], err = json.Marshal(a.Src) - if err != nil { - return nil, fmt.Errorf("error marshaling 'src': %w", err) - } - - if a.Title != nil { - object["title"], err = json.Marshal(a.Title) - if err != nil { - return nil, fmt.Errorf("error marshaling 'title': %w", err) - } - } - - if a.Type != nil { - object["type"], err = json.Marshal(a.Type) - if err != nil { - return nil, fmt.Errorf("error marshaling 'type': %w", err) - } - } - - for fieldName, field := range a.AdditionalProperties { - object[fieldName], err = json.Marshal(field) - if err != nil { - return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) - } - } - return json.Marshal(object) -} - -// Getter for additional properties for PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Item. Returns the specified -// element and whether it was found -func (a PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Item) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Item -func (a *PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Item) Set(fieldName string, value interface{}) { - if a.AdditionalProperties == nil { - a.AdditionalProperties = make(map[string]interface{}) - } - a.AdditionalProperties[fieldName] = value -} - -// Override default JSON handling for PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Item to handle AdditionalProperties -func (a *PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Item) UnmarshalJSON(b []byte) error { - object := make(map[string]json.RawMessage) - err := json.Unmarshal(b, &object) - if err != nil { - return err - } - - if raw, found := object["id"]; found { - err = json.Unmarshal(raw, &a.Id) - if err != nil { - return fmt.Errorf("error reading 'id': %w", err) - } - delete(object, "id") - } - - if raw, found := object["originId"]; found { - err = json.Unmarshal(raw, &a.OriginId) - if err != nil { - return fmt.Errorf("error reading 'originId': %w", err) - } - delete(object, "originId") - } - - if raw, found := object["type"]; found { - err = json.Unmarshal(raw, &a.Type) - if err != nil { - return fmt.Errorf("error reading 'type': %w", err) - } - delete(object, "type") - } - - if len(object) != 0 { - a.AdditionalProperties = make(map[string]interface{}) - for fieldName, fieldBuf := range object { - var fieldVal interface{} - err := json.Unmarshal(fieldBuf, &fieldVal) - if err != nil { - return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) - } - a.AdditionalProperties[fieldName] = fieldVal - } - } - return nil -} - -// Override default JSON handling for PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Item to handle AdditionalProperties -func (a PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Item) MarshalJSON() ([]byte, error) { - var err error - object := make(map[string]json.RawMessage) - - object["id"], err = json.Marshal(a.Id) - if err != nil { - return nil, fmt.Errorf("error marshaling 'id': %w", err) - } - - if a.OriginId != nil { - object["originId"], err = json.Marshal(a.OriginId) - if err != nil { - return nil, fmt.Errorf("error marshaling 'originId': %w", err) - } - } - - object["type"], err = json.Marshal(a.Type) - if err != nil { - return nil, fmt.Errorf("error marshaling 'type': %w", err) - } - - for fieldName, field := range a.AdditionalProperties { - object[fieldName], err = json.Marshal(field) - if err != nil { - return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) - } - } - return json.Marshal(object) -} - -// Getter for additional properties for PackageListItem_InstallationInfo_ExperimentalDataStreamFeatures_Features. Returns the specified -// element and whether it was found -func (a PackageListItem_InstallationInfo_ExperimentalDataStreamFeatures_Features) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for PackageListItem_InstallationInfo_ExperimentalDataStreamFeatures_Features -func (a *PackageListItem_InstallationInfo_ExperimentalDataStreamFeatures_Features) Set(fieldName string, value interface{}) { - if a.AdditionalProperties == nil { - a.AdditionalProperties = make(map[string]interface{}) - } - a.AdditionalProperties[fieldName] = value -} - -// Override default JSON handling for PackageListItem_InstallationInfo_ExperimentalDataStreamFeatures_Features to handle AdditionalProperties -func (a *PackageListItem_InstallationInfo_ExperimentalDataStreamFeatures_Features) UnmarshalJSON(b []byte) error { - object := make(map[string]json.RawMessage) - err := json.Unmarshal(b, &object) - if err != nil { - return err - } - - if raw, found := object["doc_value_only_numeric"]; found { - err = json.Unmarshal(raw, &a.DocValueOnlyNumeric) - if err != nil { - return fmt.Errorf("error reading 'doc_value_only_numeric': %w", err) - } - delete(object, "doc_value_only_numeric") - } - - if raw, found := object["doc_value_only_other"]; found { - err = json.Unmarshal(raw, &a.DocValueOnlyOther) - if err != nil { - return fmt.Errorf("error reading 'doc_value_only_other': %w", err) - } - delete(object, "doc_value_only_other") - } - - if raw, found := object["synthetic_source"]; found { - err = json.Unmarshal(raw, &a.SyntheticSource) - if err != nil { - return fmt.Errorf("error reading 'synthetic_source': %w", err) - } - delete(object, "synthetic_source") - } - - if raw, found := object["tsdb"]; found { - err = json.Unmarshal(raw, &a.Tsdb) - if err != nil { - return fmt.Errorf("error reading 'tsdb': %w", err) - } - delete(object, "tsdb") - } - - if len(object) != 0 { - a.AdditionalProperties = make(map[string]interface{}) - for fieldName, fieldBuf := range object { - var fieldVal interface{} - err := json.Unmarshal(fieldBuf, &fieldVal) - if err != nil { - return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) - } - a.AdditionalProperties[fieldName] = fieldVal - } - } - return nil -} - -// Override default JSON handling for PackageListItem_InstallationInfo_ExperimentalDataStreamFeatures_Features to handle AdditionalProperties -func (a PackageListItem_InstallationInfo_ExperimentalDataStreamFeatures_Features) MarshalJSON() ([]byte, error) { - var err error - object := make(map[string]json.RawMessage) - - if a.DocValueOnlyNumeric != nil { - object["doc_value_only_numeric"], err = json.Marshal(a.DocValueOnlyNumeric) - if err != nil { - return nil, fmt.Errorf("error marshaling 'doc_value_only_numeric': %w", err) - } - } - - if a.DocValueOnlyOther != nil { - object["doc_value_only_other"], err = json.Marshal(a.DocValueOnlyOther) - if err != nil { - return nil, fmt.Errorf("error marshaling 'doc_value_only_other': %w", err) - } - } - - if a.SyntheticSource != nil { - object["synthetic_source"], err = json.Marshal(a.SyntheticSource) - if err != nil { - return nil, fmt.Errorf("error marshaling 'synthetic_source': %w", err) - } - } - - if a.Tsdb != nil { - object["tsdb"], err = json.Marshal(a.Tsdb) - if err != nil { - return nil, fmt.Errorf("error marshaling 'tsdb': %w", err) - } - } - - for fieldName, field := range a.AdditionalProperties { - object[fieldName], err = json.Marshal(field) - if err != nil { - return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) - } - } - return json.Marshal(object) -} - -// Getter for additional properties for PackageListItem_InstallationInfo_ExperimentalDataStreamFeatures_Item. Returns the specified -// element and whether it was found -func (a PackageListItem_InstallationInfo_ExperimentalDataStreamFeatures_Item) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for PackageListItem_InstallationInfo_ExperimentalDataStreamFeatures_Item -func (a *PackageListItem_InstallationInfo_ExperimentalDataStreamFeatures_Item) Set(fieldName string, value interface{}) { - if a.AdditionalProperties == nil { - a.AdditionalProperties = make(map[string]interface{}) - } - a.AdditionalProperties[fieldName] = value -} - -// Override default JSON handling for PackageListItem_InstallationInfo_ExperimentalDataStreamFeatures_Item to handle AdditionalProperties -func (a *PackageListItem_InstallationInfo_ExperimentalDataStreamFeatures_Item) UnmarshalJSON(b []byte) error { - object := make(map[string]json.RawMessage) - err := json.Unmarshal(b, &object) - if err != nil { - return err - } - - if raw, found := object["data_stream"]; found { - err = json.Unmarshal(raw, &a.DataStream) - if err != nil { - return fmt.Errorf("error reading 'data_stream': %w", err) - } - delete(object, "data_stream") - } - - if raw, found := object["features"]; found { - err = json.Unmarshal(raw, &a.Features) - if err != nil { - return fmt.Errorf("error reading 'features': %w", err) - } - delete(object, "features") - } - - if len(object) != 0 { - a.AdditionalProperties = make(map[string]interface{}) - for fieldName, fieldBuf := range object { - var fieldVal interface{} - err := json.Unmarshal(fieldBuf, &fieldVal) - if err != nil { - return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) - } - a.AdditionalProperties[fieldName] = fieldVal - } - } - return nil -} - -// Override default JSON handling for PackageListItem_InstallationInfo_ExperimentalDataStreamFeatures_Item to handle AdditionalProperties -func (a PackageListItem_InstallationInfo_ExperimentalDataStreamFeatures_Item) MarshalJSON() ([]byte, error) { - var err error - object := make(map[string]json.RawMessage) - - object["data_stream"], err = json.Marshal(a.DataStream) - if err != nil { - return nil, fmt.Errorf("error marshaling 'data_stream': %w", err) - } - - object["features"], err = json.Marshal(a.Features) - if err != nil { - return nil, fmt.Errorf("error marshaling 'features': %w", err) - } - - for fieldName, field := range a.AdditionalProperties { - object[fieldName], err = json.Marshal(field) - if err != nil { - return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) - } - } - return json.Marshal(object) -} - -// Getter for additional properties for PackageListItem_InstallationInfo_InstalledEs_Item. Returns the specified -// element and whether it was found -func (a PackageListItem_InstallationInfo_InstalledEs_Item) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for PackageListItem_InstallationInfo_InstalledEs_Item -func (a *PackageListItem_InstallationInfo_InstalledEs_Item) Set(fieldName string, value interface{}) { - if a.AdditionalProperties == nil { - a.AdditionalProperties = make(map[string]interface{}) - } - a.AdditionalProperties[fieldName] = value -} - -// Override default JSON handling for PackageListItem_InstallationInfo_InstalledEs_Item to handle AdditionalProperties -func (a *PackageListItem_InstallationInfo_InstalledEs_Item) UnmarshalJSON(b []byte) error { - object := make(map[string]json.RawMessage) - err := json.Unmarshal(b, &object) - if err != nil { - return err - } - - if raw, found := object["deferred"]; found { - err = json.Unmarshal(raw, &a.Deferred) - if err != nil { - return fmt.Errorf("error reading 'deferred': %w", err) - } - delete(object, "deferred") - } - - if raw, found := object["id"]; found { - err = json.Unmarshal(raw, &a.Id) - if err != nil { - return fmt.Errorf("error reading 'id': %w", err) - } - delete(object, "id") - } - - if raw, found := object["type"]; found { - err = json.Unmarshal(raw, &a.Type) - if err != nil { - return fmt.Errorf("error reading 'type': %w", err) - } - delete(object, "type") - } - - if raw, found := object["version"]; found { - err = json.Unmarshal(raw, &a.Version) - if err != nil { - return fmt.Errorf("error reading 'version': %w", err) - } - delete(object, "version") - } - - if len(object) != 0 { - a.AdditionalProperties = make(map[string]interface{}) - for fieldName, fieldBuf := range object { - var fieldVal interface{} - err := json.Unmarshal(fieldBuf, &fieldVal) - if err != nil { - return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) - } - a.AdditionalProperties[fieldName] = fieldVal - } - } - return nil -} - -// Override default JSON handling for PackageListItem_InstallationInfo_InstalledEs_Item to handle AdditionalProperties -func (a PackageListItem_InstallationInfo_InstalledEs_Item) MarshalJSON() ([]byte, error) { - var err error - object := make(map[string]json.RawMessage) - - if a.Deferred != nil { - object["deferred"], err = json.Marshal(a.Deferred) - if err != nil { - return nil, fmt.Errorf("error marshaling 'deferred': %w", err) - } - } - - object["id"], err = json.Marshal(a.Id) - if err != nil { - return nil, fmt.Errorf("error marshaling 'id': %w", err) - } - - object["type"], err = json.Marshal(a.Type) - if err != nil { - return nil, fmt.Errorf("error marshaling 'type': %w", err) - } - - if a.Version != nil { - object["version"], err = json.Marshal(a.Version) - if err != nil { - return nil, fmt.Errorf("error marshaling 'version': %w", err) - } - } - - for fieldName, field := range a.AdditionalProperties { - object[fieldName], err = json.Marshal(field) - if err != nil { - return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) - } - } - return json.Marshal(object) -} - -// Getter for additional properties for PackageListItem_InstallationInfo_InstalledKibana_Item. Returns the specified -// element and whether it was found -func (a PackageListItem_InstallationInfo_InstalledKibana_Item) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for PackageListItem_InstallationInfo_InstalledKibana_Item -func (a *PackageListItem_InstallationInfo_InstalledKibana_Item) Set(fieldName string, value interface{}) { - if a.AdditionalProperties == nil { - a.AdditionalProperties = make(map[string]interface{}) - } - a.AdditionalProperties[fieldName] = value -} - -// Override default JSON handling for PackageListItem_InstallationInfo_InstalledKibana_Item to handle AdditionalProperties -func (a *PackageListItem_InstallationInfo_InstalledKibana_Item) UnmarshalJSON(b []byte) error { - object := make(map[string]json.RawMessage) - err := json.Unmarshal(b, &object) - if err != nil { - return err - } - - if raw, found := object["id"]; found { - err = json.Unmarshal(raw, &a.Id) - if err != nil { - return fmt.Errorf("error reading 'id': %w", err) - } - delete(object, "id") - } - - if raw, found := object["originId"]; found { - err = json.Unmarshal(raw, &a.OriginId) - if err != nil { - return fmt.Errorf("error reading 'originId': %w", err) - } - delete(object, "originId") - } - - if raw, found := object["type"]; found { - err = json.Unmarshal(raw, &a.Type) - if err != nil { - return fmt.Errorf("error reading 'type': %w", err) - } - delete(object, "type") - } - - if len(object) != 0 { - a.AdditionalProperties = make(map[string]interface{}) - for fieldName, fieldBuf := range object { - var fieldVal interface{} - err := json.Unmarshal(fieldBuf, &fieldVal) - if err != nil { - return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) - } - a.AdditionalProperties[fieldName] = fieldVal - } - } - return nil -} - -// Override default JSON handling for PackageListItem_InstallationInfo_InstalledKibana_Item to handle AdditionalProperties -func (a PackageListItem_InstallationInfo_InstalledKibana_Item) MarshalJSON() ([]byte, error) { - var err error - object := make(map[string]json.RawMessage) - - object["id"], err = json.Marshal(a.Id) - if err != nil { - return nil, fmt.Errorf("error marshaling 'id': %w", err) - } - - if a.OriginId != nil { - object["originId"], err = json.Marshal(a.OriginId) - if err != nil { - return nil, fmt.Errorf("error marshaling 'originId': %w", err) - } - } - - object["type"], err = json.Marshal(a.Type) - if err != nil { - return nil, fmt.Errorf("error marshaling 'type': %w", err) - } - - for fieldName, field := range a.AdditionalProperties { - object[fieldName], err = json.Marshal(field) - if err != nil { - return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) - } - } - return json.Marshal(object) -} - -// Getter for additional properties for PackageListItem_InstallationInfo_LatestExecutedState. Returns the specified -// element and whether it was found -func (a PackageListItem_InstallationInfo_LatestExecutedState) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for PackageListItem_InstallationInfo_LatestExecutedState -func (a *PackageListItem_InstallationInfo_LatestExecutedState) Set(fieldName string, value interface{}) { - if a.AdditionalProperties == nil { - a.AdditionalProperties = make(map[string]interface{}) - } - a.AdditionalProperties[fieldName] = value -} - -// Override default JSON handling for PackageListItem_InstallationInfo_LatestExecutedState to handle AdditionalProperties -func (a *PackageListItem_InstallationInfo_LatestExecutedState) UnmarshalJSON(b []byte) error { - object := make(map[string]json.RawMessage) - err := json.Unmarshal(b, &object) - if err != nil { - return err - } - - if raw, found := object["error"]; found { - err = json.Unmarshal(raw, &a.Error) - if err != nil { - return fmt.Errorf("error reading 'error': %w", err) - } - delete(object, "error") - } - - if raw, found := object["name"]; found { - err = json.Unmarshal(raw, &a.Name) - if err != nil { - return fmt.Errorf("error reading 'name': %w", err) - } - delete(object, "name") - } - - if raw, found := object["started_at"]; found { - err = json.Unmarshal(raw, &a.StartedAt) - if err != nil { - return fmt.Errorf("error reading 'started_at': %w", err) - } - delete(object, "started_at") - } - - if len(object) != 0 { - a.AdditionalProperties = make(map[string]interface{}) - for fieldName, fieldBuf := range object { - var fieldVal interface{} - err := json.Unmarshal(fieldBuf, &fieldVal) - if err != nil { - return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) - } - a.AdditionalProperties[fieldName] = fieldVal - } - } - return nil -} - -// Override default JSON handling for PackageListItem_InstallationInfo_LatestExecutedState to handle AdditionalProperties -func (a PackageListItem_InstallationInfo_LatestExecutedState) MarshalJSON() ([]byte, error) { - var err error - object := make(map[string]json.RawMessage) - - if a.Error != nil { - object["error"], err = json.Marshal(a.Error) - if err != nil { - return nil, fmt.Errorf("error marshaling 'error': %w", err) - } - } - - object["name"], err = json.Marshal(a.Name) - if err != nil { - return nil, fmt.Errorf("error marshaling 'name': %w", err) - } - - object["started_at"], err = json.Marshal(a.StartedAt) - if err != nil { - return nil, fmt.Errorf("error marshaling 'started_at': %w", err) - } - - for fieldName, field := range a.AdditionalProperties { - object[fieldName], err = json.Marshal(field) - if err != nil { - return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) - } - } - return json.Marshal(object) -} - -// Getter for additional properties for PackageListItem_InstallationInfo_LatestInstallFailedAttempts_Error. Returns the specified -// element and whether it was found -func (a PackageListItem_InstallationInfo_LatestInstallFailedAttempts_Error) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for PackageListItem_InstallationInfo_LatestInstallFailedAttempts_Error -func (a *PackageListItem_InstallationInfo_LatestInstallFailedAttempts_Error) Set(fieldName string, value interface{}) { - if a.AdditionalProperties == nil { - a.AdditionalProperties = make(map[string]interface{}) - } - a.AdditionalProperties[fieldName] = value -} - -// Override default JSON handling for PackageListItem_InstallationInfo_LatestInstallFailedAttempts_Error to handle AdditionalProperties -func (a *PackageListItem_InstallationInfo_LatestInstallFailedAttempts_Error) UnmarshalJSON(b []byte) error { - object := make(map[string]json.RawMessage) - err := json.Unmarshal(b, &object) - if err != nil { - return err - } - - if raw, found := object["message"]; found { - err = json.Unmarshal(raw, &a.Message) - if err != nil { - return fmt.Errorf("error reading 'message': %w", err) - } - delete(object, "message") - } - - if raw, found := object["name"]; found { - err = json.Unmarshal(raw, &a.Name) - if err != nil { - return fmt.Errorf("error reading 'name': %w", err) - } - delete(object, "name") - } - - if raw, found := object["stack"]; found { - err = json.Unmarshal(raw, &a.Stack) - if err != nil { - return fmt.Errorf("error reading 'stack': %w", err) - } - delete(object, "stack") - } - - if len(object) != 0 { - a.AdditionalProperties = make(map[string]interface{}) - for fieldName, fieldBuf := range object { - var fieldVal interface{} - err := json.Unmarshal(fieldBuf, &fieldVal) - if err != nil { - return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) - } - a.AdditionalProperties[fieldName] = fieldVal - } - } - return nil -} - -// Override default JSON handling for PackageListItem_InstallationInfo_LatestInstallFailedAttempts_Error to handle AdditionalProperties -func (a PackageListItem_InstallationInfo_LatestInstallFailedAttempts_Error) MarshalJSON() ([]byte, error) { - var err error - object := make(map[string]json.RawMessage) - - object["message"], err = json.Marshal(a.Message) - if err != nil { - return nil, fmt.Errorf("error marshaling 'message': %w", err) - } - - object["name"], err = json.Marshal(a.Name) - if err != nil { - return nil, fmt.Errorf("error marshaling 'name': %w", err) - } - - if a.Stack != nil { - object["stack"], err = json.Marshal(a.Stack) - if err != nil { - return nil, fmt.Errorf("error marshaling 'stack': %w", err) - } - } - - for fieldName, field := range a.AdditionalProperties { - object[fieldName], err = json.Marshal(field) - if err != nil { - return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) - } - } - return json.Marshal(object) -} - -// Getter for additional properties for PackageListItem_InstallationInfo_LatestInstallFailedAttempts_Item. Returns the specified -// element and whether it was found -func (a PackageListItem_InstallationInfo_LatestInstallFailedAttempts_Item) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for PackageListItem_InstallationInfo_LatestInstallFailedAttempts_Item -func (a *PackageListItem_InstallationInfo_LatestInstallFailedAttempts_Item) Set(fieldName string, value interface{}) { - if a.AdditionalProperties == nil { - a.AdditionalProperties = make(map[string]interface{}) - } - a.AdditionalProperties[fieldName] = value -} - -// Override default JSON handling for PackageListItem_InstallationInfo_LatestInstallFailedAttempts_Item to handle AdditionalProperties -func (a *PackageListItem_InstallationInfo_LatestInstallFailedAttempts_Item) UnmarshalJSON(b []byte) error { - object := make(map[string]json.RawMessage) - err := json.Unmarshal(b, &object) - if err != nil { - return err - } - - if raw, found := object["created_at"]; found { - err = json.Unmarshal(raw, &a.CreatedAt) - if err != nil { - return fmt.Errorf("error reading 'created_at': %w", err) - } - delete(object, "created_at") - } - - if raw, found := object["error"]; found { - err = json.Unmarshal(raw, &a.Error) - if err != nil { - return fmt.Errorf("error reading 'error': %w", err) - } - delete(object, "error") - } - - if raw, found := object["target_version"]; found { - err = json.Unmarshal(raw, &a.TargetVersion) - if err != nil { - return fmt.Errorf("error reading 'target_version': %w", err) - } - delete(object, "target_version") - } - - if len(object) != 0 { - a.AdditionalProperties = make(map[string]interface{}) - for fieldName, fieldBuf := range object { - var fieldVal interface{} - err := json.Unmarshal(fieldBuf, &fieldVal) - if err != nil { - return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) - } - a.AdditionalProperties[fieldName] = fieldVal - } - } - return nil -} - -// Override default JSON handling for PackageListItem_InstallationInfo_LatestInstallFailedAttempts_Item to handle AdditionalProperties -func (a PackageListItem_InstallationInfo_LatestInstallFailedAttempts_Item) MarshalJSON() ([]byte, error) { - var err error - object := make(map[string]json.RawMessage) - - object["created_at"], err = json.Marshal(a.CreatedAt) - if err != nil { - return nil, fmt.Errorf("error marshaling 'created_at': %w", err) - } - - object["error"], err = json.Marshal(a.Error) - if err != nil { - return nil, fmt.Errorf("error marshaling 'error': %w", err) - } - - object["target_version"], err = json.Marshal(a.TargetVersion) - if err != nil { - return nil, fmt.Errorf("error marshaling 'target_version': %w", err) - } - - for fieldName, field := range a.AdditionalProperties { - object[fieldName], err = json.Marshal(field) - if err != nil { - return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) - } - } - return json.Marshal(object) -} - -// Getter for additional properties for PackageListItem_InstallationInfo. Returns the specified -// element and whether it was found -func (a PackageListItem_InstallationInfo) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for PackageListItem_InstallationInfo -func (a *PackageListItem_InstallationInfo) Set(fieldName string, value interface{}) { - if a.AdditionalProperties == nil { - a.AdditionalProperties = make(map[string]interface{}) - } - a.AdditionalProperties[fieldName] = value -} - -// Override default JSON handling for PackageListItem_InstallationInfo to handle AdditionalProperties -func (a *PackageListItem_InstallationInfo) UnmarshalJSON(b []byte) error { - object := make(map[string]json.RawMessage) - err := json.Unmarshal(b, &object) - if err != nil { - return err - } - - if raw, found := object["additional_spaces_installed_kibana"]; found { - err = json.Unmarshal(raw, &a.AdditionalSpacesInstalledKibana) - if err != nil { - return fmt.Errorf("error reading 'additional_spaces_installed_kibana': %w", err) - } - delete(object, "additional_spaces_installed_kibana") - } - - if raw, found := object["created_at"]; found { - err = json.Unmarshal(raw, &a.CreatedAt) - if err != nil { - return fmt.Errorf("error reading 'created_at': %w", err) - } - delete(object, "created_at") - } - - if raw, found := object["experimental_data_stream_features"]; found { - err = json.Unmarshal(raw, &a.ExperimentalDataStreamFeatures) - if err != nil { - return fmt.Errorf("error reading 'experimental_data_stream_features': %w", err) - } - delete(object, "experimental_data_stream_features") - } - - if raw, found := object["install_format_schema_version"]; found { - err = json.Unmarshal(raw, &a.InstallFormatSchemaVersion) - if err != nil { - return fmt.Errorf("error reading 'install_format_schema_version': %w", err) - } - delete(object, "install_format_schema_version") - } - - if raw, found := object["install_source"]; found { - err = json.Unmarshal(raw, &a.InstallSource) - if err != nil { - return fmt.Errorf("error reading 'install_source': %w", err) - } - delete(object, "install_source") - } - - if raw, found := object["install_status"]; found { - err = json.Unmarshal(raw, &a.InstallStatus) - if err != nil { - return fmt.Errorf("error reading 'install_status': %w", err) - } - delete(object, "install_status") - } - - if raw, found := object["installed_es"]; found { - err = json.Unmarshal(raw, &a.InstalledEs) - if err != nil { - return fmt.Errorf("error reading 'installed_es': %w", err) - } - delete(object, "installed_es") - } - - if raw, found := object["installed_kibana"]; found { - err = json.Unmarshal(raw, &a.InstalledKibana) - if err != nil { - return fmt.Errorf("error reading 'installed_kibana': %w", err) - } - delete(object, "installed_kibana") - } - - if raw, found := object["installed_kibana_space_id"]; found { - err = json.Unmarshal(raw, &a.InstalledKibanaSpaceId) - if err != nil { - return fmt.Errorf("error reading 'installed_kibana_space_id': %w", err) - } - delete(object, "installed_kibana_space_id") - } - - if raw, found := object["latest_executed_state"]; found { - err = json.Unmarshal(raw, &a.LatestExecutedState) - if err != nil { - return fmt.Errorf("error reading 'latest_executed_state': %w", err) - } - delete(object, "latest_executed_state") - } - - if raw, found := object["latest_install_failed_attempts"]; found { - err = json.Unmarshal(raw, &a.LatestInstallFailedAttempts) - if err != nil { - return fmt.Errorf("error reading 'latest_install_failed_attempts': %w", err) - } - delete(object, "latest_install_failed_attempts") - } - - if raw, found := object["name"]; found { - err = json.Unmarshal(raw, &a.Name) - if err != nil { - return fmt.Errorf("error reading 'name': %w", err) - } - delete(object, "name") - } - - if raw, found := object["namespaces"]; found { - err = json.Unmarshal(raw, &a.Namespaces) - if err != nil { - return fmt.Errorf("error reading 'namespaces': %w", err) - } - delete(object, "namespaces") - } - - if raw, found := object["type"]; found { - err = json.Unmarshal(raw, &a.Type) - if err != nil { - return fmt.Errorf("error reading 'type': %w", err) - } - delete(object, "type") - } - - if raw, found := object["updated_at"]; found { - err = json.Unmarshal(raw, &a.UpdatedAt) - if err != nil { - return fmt.Errorf("error reading 'updated_at': %w", err) - } - delete(object, "updated_at") - } - - if raw, found := object["verification_key_id"]; found { - err = json.Unmarshal(raw, &a.VerificationKeyId) - if err != nil { - return fmt.Errorf("error reading 'verification_key_id': %w", err) - } - delete(object, "verification_key_id") - } - - if raw, found := object["verification_status"]; found { - err = json.Unmarshal(raw, &a.VerificationStatus) - if err != nil { - return fmt.Errorf("error reading 'verification_status': %w", err) - } - delete(object, "verification_status") - } - - if raw, found := object["version"]; found { - err = json.Unmarshal(raw, &a.Version) - if err != nil { - return fmt.Errorf("error reading 'version': %w", err) - } - delete(object, "version") - } - - if len(object) != 0 { - a.AdditionalProperties = make(map[string]interface{}) - for fieldName, fieldBuf := range object { - var fieldVal interface{} - err := json.Unmarshal(fieldBuf, &fieldVal) - if err != nil { - return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) - } - a.AdditionalProperties[fieldName] = fieldVal - } - } - return nil -} - -// Override default JSON handling for PackageListItem_InstallationInfo to handle AdditionalProperties -func (a PackageListItem_InstallationInfo) MarshalJSON() ([]byte, error) { - var err error - object := make(map[string]json.RawMessage) - - if a.AdditionalSpacesInstalledKibana != nil { - object["additional_spaces_installed_kibana"], err = json.Marshal(a.AdditionalSpacesInstalledKibana) - if err != nil { - return nil, fmt.Errorf("error marshaling 'additional_spaces_installed_kibana': %w", err) - } - } - - if a.CreatedAt != nil { - object["created_at"], err = json.Marshal(a.CreatedAt) - if err != nil { - return nil, fmt.Errorf("error marshaling 'created_at': %w", err) - } - } - - if a.ExperimentalDataStreamFeatures != nil { - object["experimental_data_stream_features"], err = json.Marshal(a.ExperimentalDataStreamFeatures) - if err != nil { - return nil, fmt.Errorf("error marshaling 'experimental_data_stream_features': %w", err) - } - } - - if a.InstallFormatSchemaVersion != nil { - object["install_format_schema_version"], err = json.Marshal(a.InstallFormatSchemaVersion) - if err != nil { - return nil, fmt.Errorf("error marshaling 'install_format_schema_version': %w", err) - } - } - - object["install_source"], err = json.Marshal(a.InstallSource) - if err != nil { - return nil, fmt.Errorf("error marshaling 'install_source': %w", err) - } - - object["install_status"], err = json.Marshal(a.InstallStatus) - if err != nil { - return nil, fmt.Errorf("error marshaling 'install_status': %w", err) - } - - object["installed_es"], err = json.Marshal(a.InstalledEs) - if err != nil { - return nil, fmt.Errorf("error marshaling 'installed_es': %w", err) - } - - object["installed_kibana"], err = json.Marshal(a.InstalledKibana) - if err != nil { - return nil, fmt.Errorf("error marshaling 'installed_kibana': %w", err) - } - - if a.InstalledKibanaSpaceId != nil { - object["installed_kibana_space_id"], err = json.Marshal(a.InstalledKibanaSpaceId) - if err != nil { - return nil, fmt.Errorf("error marshaling 'installed_kibana_space_id': %w", err) - } - } - - if a.LatestExecutedState != nil { - object["latest_executed_state"], err = json.Marshal(a.LatestExecutedState) - if err != nil { - return nil, fmt.Errorf("error marshaling 'latest_executed_state': %w", err) - } - } - - if a.LatestInstallFailedAttempts != nil { - object["latest_install_failed_attempts"], err = json.Marshal(a.LatestInstallFailedAttempts) - if err != nil { - return nil, fmt.Errorf("error marshaling 'latest_install_failed_attempts': %w", err) - } - } - - object["name"], err = json.Marshal(a.Name) - if err != nil { - return nil, fmt.Errorf("error marshaling 'name': %w", err) - } - - if a.Namespaces != nil { - object["namespaces"], err = json.Marshal(a.Namespaces) - if err != nil { - return nil, fmt.Errorf("error marshaling 'namespaces': %w", err) - } - } - - object["type"], err = json.Marshal(a.Type) - if err != nil { - return nil, fmt.Errorf("error marshaling 'type': %w", err) - } - - if a.UpdatedAt != nil { - object["updated_at"], err = json.Marshal(a.UpdatedAt) - if err != nil { - return nil, fmt.Errorf("error marshaling 'updated_at': %w", err) - } - } - - if a.VerificationKeyId != nil { - object["verification_key_id"], err = json.Marshal(a.VerificationKeyId) - if err != nil { - return nil, fmt.Errorf("error marshaling 'verification_key_id': %w", err) - } - } - - object["verification_status"], err = json.Marshal(a.VerificationStatus) - if err != nil { - return nil, fmt.Errorf("error marshaling 'verification_status': %w", err) - } - - object["version"], err = json.Marshal(a.Version) - if err != nil { - return nil, fmt.Errorf("error marshaling 'version': %w", err) - } - - for fieldName, field := range a.AdditionalProperties { - object[fieldName], err = json.Marshal(field) - if err != nil { - return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) - } - } - return json.Marshal(object) -} - -// Getter for additional properties for PackageListItem_Owner. Returns the specified -// element and whether it was found -func (a PackageListItem_Owner) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for PackageListItem_Owner -func (a *PackageListItem_Owner) Set(fieldName string, value interface{}) { - if a.AdditionalProperties == nil { - a.AdditionalProperties = make(map[string]interface{}) - } - a.AdditionalProperties[fieldName] = value -} - -// Override default JSON handling for PackageListItem_Owner to handle AdditionalProperties -func (a *PackageListItem_Owner) UnmarshalJSON(b []byte) error { - object := make(map[string]json.RawMessage) - err := json.Unmarshal(b, &object) - if err != nil { - return err - } - - if raw, found := object["github"]; found { - err = json.Unmarshal(raw, &a.Github) - if err != nil { - return fmt.Errorf("error reading 'github': %w", err) - } - delete(object, "github") - } - - if raw, found := object["type"]; found { - err = json.Unmarshal(raw, &a.Type) - if err != nil { - return fmt.Errorf("error reading 'type': %w", err) - } - delete(object, "type") - } - - if len(object) != 0 { - a.AdditionalProperties = make(map[string]interface{}) - for fieldName, fieldBuf := range object { - var fieldVal interface{} - err := json.Unmarshal(fieldBuf, &fieldVal) - if err != nil { - return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) - } - a.AdditionalProperties[fieldName] = fieldVal - } - } - return nil -} - -// Override default JSON handling for PackageListItem_Owner to handle AdditionalProperties -func (a PackageListItem_Owner) MarshalJSON() ([]byte, error) { - var err error - object := make(map[string]json.RawMessage) - - if a.Github != nil { - object["github"], err = json.Marshal(a.Github) - if err != nil { - return nil, fmt.Errorf("error marshaling 'github': %w", err) - } - } - - if a.Type != nil { - object["type"], err = json.Marshal(a.Type) - if err != nil { - return nil, fmt.Errorf("error marshaling 'type': %w", err) - } - } - - for fieldName, field := range a.AdditionalProperties { - object[fieldName], err = json.Marshal(field) - if err != nil { - return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) - } - } - return json.Marshal(object) -} - -// Getter for additional properties for PackageListItem_Source. Returns the specified -// element and whether it was found -func (a PackageListItem_Source) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for PackageListItem_Source -func (a *PackageListItem_Source) Set(fieldName string, value interface{}) { - if a.AdditionalProperties == nil { - a.AdditionalProperties = make(map[string]interface{}) - } - a.AdditionalProperties[fieldName] = value -} - -// Override default JSON handling for PackageListItem_Source to handle AdditionalProperties -func (a *PackageListItem_Source) UnmarshalJSON(b []byte) error { - object := make(map[string]json.RawMessage) - err := json.Unmarshal(b, &object) - if err != nil { - return err - } - - if raw, found := object["license"]; found { - err = json.Unmarshal(raw, &a.License) - if err != nil { - return fmt.Errorf("error reading 'license': %w", err) - } - delete(object, "license") - } - - if len(object) != 0 { - a.AdditionalProperties = make(map[string]interface{}) - for fieldName, fieldBuf := range object { - var fieldVal interface{} - err := json.Unmarshal(fieldBuf, &fieldVal) - if err != nil { - return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) - } - a.AdditionalProperties[fieldName] = fieldVal - } - } - return nil -} - -// Override default JSON handling for PackageListItem_Source to handle AdditionalProperties -func (a PackageListItem_Source) MarshalJSON() ([]byte, error) { - var err error - object := make(map[string]json.RawMessage) - - object["license"], err = json.Marshal(a.License) - if err != nil { - return nil, fmt.Errorf("error marshaling 'license': %w", err) - } - - for fieldName, field := range a.AdditionalProperties { - object[fieldName], err = json.Marshal(field) - if err != nil { - return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) - } - } - return json.Marshal(object) -} - -// Getter for additional properties for PackagePolicy_Elasticsearch_Privileges. Returns the specified -// element and whether it was found -func (a PackagePolicy_Elasticsearch_Privileges) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for PackagePolicy_Elasticsearch_Privileges -func (a *PackagePolicy_Elasticsearch_Privileges) Set(fieldName string, value interface{}) { - if a.AdditionalProperties == nil { - a.AdditionalProperties = make(map[string]interface{}) - } - a.AdditionalProperties[fieldName] = value -} - -// Override default JSON handling for PackagePolicy_Elasticsearch_Privileges to handle AdditionalProperties -func (a *PackagePolicy_Elasticsearch_Privileges) UnmarshalJSON(b []byte) error { - object := make(map[string]json.RawMessage) - err := json.Unmarshal(b, &object) - if err != nil { - return err - } - - if raw, found := object["cluster"]; found { - err = json.Unmarshal(raw, &a.Cluster) - if err != nil { - return fmt.Errorf("error reading 'cluster': %w", err) - } - delete(object, "cluster") - } - - if len(object) != 0 { - a.AdditionalProperties = make(map[string]interface{}) - for fieldName, fieldBuf := range object { - var fieldVal interface{} - err := json.Unmarshal(fieldBuf, &fieldVal) - if err != nil { - return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) - } - a.AdditionalProperties[fieldName] = fieldVal - } - } - return nil -} - -// Override default JSON handling for PackagePolicy_Elasticsearch_Privileges to handle AdditionalProperties -func (a PackagePolicy_Elasticsearch_Privileges) MarshalJSON() ([]byte, error) { - var err error - object := make(map[string]json.RawMessage) - - if a.Cluster != nil { - object["cluster"], err = json.Marshal(a.Cluster) - if err != nil { - return nil, fmt.Errorf("error marshaling 'cluster': %w", err) - } - } - - for fieldName, field := range a.AdditionalProperties { - object[fieldName], err = json.Marshal(field) - if err != nil { - return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) - } - } - return json.Marshal(object) -} - -// Getter for additional properties for PackagePolicy_Elasticsearch. Returns the specified -// element and whether it was found -func (a PackagePolicy_Elasticsearch) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for PackagePolicy_Elasticsearch -func (a *PackagePolicy_Elasticsearch) Set(fieldName string, value interface{}) { - if a.AdditionalProperties == nil { - a.AdditionalProperties = make(map[string]interface{}) - } - a.AdditionalProperties[fieldName] = value -} - -// Override default JSON handling for PackagePolicy_Elasticsearch to handle AdditionalProperties -func (a *PackagePolicy_Elasticsearch) UnmarshalJSON(b []byte) error { - object := make(map[string]json.RawMessage) - err := json.Unmarshal(b, &object) - if err != nil { - return err - } - - if raw, found := object["privileges"]; found { - err = json.Unmarshal(raw, &a.Privileges) - if err != nil { - return fmt.Errorf("error reading 'privileges': %w", err) - } - delete(object, "privileges") - } - - if len(object) != 0 { - a.AdditionalProperties = make(map[string]interface{}) - for fieldName, fieldBuf := range object { - var fieldVal interface{} - err := json.Unmarshal(fieldBuf, &fieldVal) - if err != nil { - return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) - } - a.AdditionalProperties[fieldName] = fieldVal - } - } - return nil -} - -// Override default JSON handling for PackagePolicy_Elasticsearch to handle AdditionalProperties -func (a PackagePolicy_Elasticsearch) MarshalJSON() ([]byte, error) { - var err error - object := make(map[string]json.RawMessage) - - if a.Privileges != nil { - object["privileges"], err = json.Marshal(a.Privileges) - if err != nil { - return nil, fmt.Errorf("error marshaling 'privileges': %w", err) - } - } - - for fieldName, field := range a.AdditionalProperties { - object[fieldName], err = json.Marshal(field) - if err != nil { - return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) - } - } - return json.Marshal(object) -} - -// AsAgentPolicyGlobalDataTagsValue0 returns the union data inside the AgentPolicy_GlobalDataTags_Value as a AgentPolicyGlobalDataTagsValue0 -func (t AgentPolicy_GlobalDataTags_Value) AsAgentPolicyGlobalDataTagsValue0() (AgentPolicyGlobalDataTagsValue0, error) { - var body AgentPolicyGlobalDataTagsValue0 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromAgentPolicyGlobalDataTagsValue0 overwrites any union data inside the AgentPolicy_GlobalDataTags_Value as the provided AgentPolicyGlobalDataTagsValue0 -func (t *AgentPolicy_GlobalDataTags_Value) FromAgentPolicyGlobalDataTagsValue0(v AgentPolicyGlobalDataTagsValue0) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeAgentPolicyGlobalDataTagsValue0 performs a merge with any union data inside the AgentPolicy_GlobalDataTags_Value, using the provided AgentPolicyGlobalDataTagsValue0 -func (t *AgentPolicy_GlobalDataTags_Value) MergeAgentPolicyGlobalDataTagsValue0(v AgentPolicyGlobalDataTagsValue0) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsAgentPolicyGlobalDataTagsValue1 returns the union data inside the AgentPolicy_GlobalDataTags_Value as a AgentPolicyGlobalDataTagsValue1 -func (t AgentPolicy_GlobalDataTags_Value) AsAgentPolicyGlobalDataTagsValue1() (AgentPolicyGlobalDataTagsValue1, error) { - var body AgentPolicyGlobalDataTagsValue1 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromAgentPolicyGlobalDataTagsValue1 overwrites any union data inside the AgentPolicy_GlobalDataTags_Value as the provided AgentPolicyGlobalDataTagsValue1 -func (t *AgentPolicy_GlobalDataTags_Value) FromAgentPolicyGlobalDataTagsValue1(v AgentPolicyGlobalDataTagsValue1) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeAgentPolicyGlobalDataTagsValue1 performs a merge with any union data inside the AgentPolicy_GlobalDataTags_Value, using the provided AgentPolicyGlobalDataTagsValue1 -func (t *AgentPolicy_GlobalDataTags_Value) MergeAgentPolicyGlobalDataTagsValue1(v AgentPolicyGlobalDataTagsValue1) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -func (t AgentPolicy_GlobalDataTags_Value) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *AgentPolicy_GlobalDataTags_Value) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsAgentPolicyPackagePolicies0 returns the union data inside the AgentPolicy_PackagePolicies as a AgentPolicyPackagePolicies0 -func (t AgentPolicy_PackagePolicies) AsAgentPolicyPackagePolicies0() (AgentPolicyPackagePolicies0, error) { - var body AgentPolicyPackagePolicies0 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromAgentPolicyPackagePolicies0 overwrites any union data inside the AgentPolicy_PackagePolicies as the provided AgentPolicyPackagePolicies0 -func (t *AgentPolicy_PackagePolicies) FromAgentPolicyPackagePolicies0(v AgentPolicyPackagePolicies0) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeAgentPolicyPackagePolicies0 performs a merge with any union data inside the AgentPolicy_PackagePolicies, using the provided AgentPolicyPackagePolicies0 -func (t *AgentPolicy_PackagePolicies) MergeAgentPolicyPackagePolicies0(v AgentPolicyPackagePolicies0) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsAgentPolicyPackagePolicies1 returns the union data inside the AgentPolicy_PackagePolicies as a AgentPolicyPackagePolicies1 -func (t AgentPolicy_PackagePolicies) AsAgentPolicyPackagePolicies1() (AgentPolicyPackagePolicies1, error) { - var body AgentPolicyPackagePolicies1 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromAgentPolicyPackagePolicies1 overwrites any union data inside the AgentPolicy_PackagePolicies as the provided AgentPolicyPackagePolicies1 -func (t *AgentPolicy_PackagePolicies) FromAgentPolicyPackagePolicies1(v AgentPolicyPackagePolicies1) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeAgentPolicyPackagePolicies1 performs a merge with any union data inside the AgentPolicy_PackagePolicies, using the provided AgentPolicyPackagePolicies1 -func (t *AgentPolicy_PackagePolicies) MergeAgentPolicyPackagePolicies1(v AgentPolicyPackagePolicies1) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -func (t AgentPolicy_PackagePolicies) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *AgentPolicy_PackagePolicies) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsNewOutputKafkaSecretsPassword0 returns the union data inside the NewOutputKafka_Secrets_Password as a NewOutputKafkaSecretsPassword0 -func (t NewOutputKafka_Secrets_Password) AsNewOutputKafkaSecretsPassword0() (NewOutputKafkaSecretsPassword0, error) { - var body NewOutputKafkaSecretsPassword0 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromNewOutputKafkaSecretsPassword0 overwrites any union data inside the NewOutputKafka_Secrets_Password as the provided NewOutputKafkaSecretsPassword0 -func (t *NewOutputKafka_Secrets_Password) FromNewOutputKafkaSecretsPassword0(v NewOutputKafkaSecretsPassword0) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeNewOutputKafkaSecretsPassword0 performs a merge with any union data inside the NewOutputKafka_Secrets_Password, using the provided NewOutputKafkaSecretsPassword0 -func (t *NewOutputKafka_Secrets_Password) MergeNewOutputKafkaSecretsPassword0(v NewOutputKafkaSecretsPassword0) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsNewOutputKafkaSecretsPassword1 returns the union data inside the NewOutputKafka_Secrets_Password as a NewOutputKafkaSecretsPassword1 -func (t NewOutputKafka_Secrets_Password) AsNewOutputKafkaSecretsPassword1() (NewOutputKafkaSecretsPassword1, error) { - var body NewOutputKafkaSecretsPassword1 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromNewOutputKafkaSecretsPassword1 overwrites any union data inside the NewOutputKafka_Secrets_Password as the provided NewOutputKafkaSecretsPassword1 -func (t *NewOutputKafka_Secrets_Password) FromNewOutputKafkaSecretsPassword1(v NewOutputKafkaSecretsPassword1) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeNewOutputKafkaSecretsPassword1 performs a merge with any union data inside the NewOutputKafka_Secrets_Password, using the provided NewOutputKafkaSecretsPassword1 -func (t *NewOutputKafka_Secrets_Password) MergeNewOutputKafkaSecretsPassword1(v NewOutputKafkaSecretsPassword1) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -func (t NewOutputKafka_Secrets_Password) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *NewOutputKafka_Secrets_Password) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsNewOutputKafkaSecretsSslKey0 returns the union data inside the NewOutputKafka_Secrets_Ssl_Key as a NewOutputKafkaSecretsSslKey0 -func (t NewOutputKafka_Secrets_Ssl_Key) AsNewOutputKafkaSecretsSslKey0() (NewOutputKafkaSecretsSslKey0, error) { - var body NewOutputKafkaSecretsSslKey0 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromNewOutputKafkaSecretsSslKey0 overwrites any union data inside the NewOutputKafka_Secrets_Ssl_Key as the provided NewOutputKafkaSecretsSslKey0 -func (t *NewOutputKafka_Secrets_Ssl_Key) FromNewOutputKafkaSecretsSslKey0(v NewOutputKafkaSecretsSslKey0) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeNewOutputKafkaSecretsSslKey0 performs a merge with any union data inside the NewOutputKafka_Secrets_Ssl_Key, using the provided NewOutputKafkaSecretsSslKey0 -func (t *NewOutputKafka_Secrets_Ssl_Key) MergeNewOutputKafkaSecretsSslKey0(v NewOutputKafkaSecretsSslKey0) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsNewOutputKafkaSecretsSslKey1 returns the union data inside the NewOutputKafka_Secrets_Ssl_Key as a NewOutputKafkaSecretsSslKey1 -func (t NewOutputKafka_Secrets_Ssl_Key) AsNewOutputKafkaSecretsSslKey1() (NewOutputKafkaSecretsSslKey1, error) { - var body NewOutputKafkaSecretsSslKey1 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromNewOutputKafkaSecretsSslKey1 overwrites any union data inside the NewOutputKafka_Secrets_Ssl_Key as the provided NewOutputKafkaSecretsSslKey1 -func (t *NewOutputKafka_Secrets_Ssl_Key) FromNewOutputKafkaSecretsSslKey1(v NewOutputKafkaSecretsSslKey1) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeNewOutputKafkaSecretsSslKey1 performs a merge with any union data inside the NewOutputKafka_Secrets_Ssl_Key, using the provided NewOutputKafkaSecretsSslKey1 -func (t *NewOutputKafka_Secrets_Ssl_Key) MergeNewOutputKafkaSecretsSslKey1(v NewOutputKafkaSecretsSslKey1) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -func (t NewOutputKafka_Secrets_Ssl_Key) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *NewOutputKafka_Secrets_Ssl_Key) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsNewOutputLogstashSecretsSslKey0 returns the union data inside the NewOutputLogstash_Secrets_Ssl_Key as a NewOutputLogstashSecretsSslKey0 -func (t NewOutputLogstash_Secrets_Ssl_Key) AsNewOutputLogstashSecretsSslKey0() (NewOutputLogstashSecretsSslKey0, error) { - var body NewOutputLogstashSecretsSslKey0 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromNewOutputLogstashSecretsSslKey0 overwrites any union data inside the NewOutputLogstash_Secrets_Ssl_Key as the provided NewOutputLogstashSecretsSslKey0 -func (t *NewOutputLogstash_Secrets_Ssl_Key) FromNewOutputLogstashSecretsSslKey0(v NewOutputLogstashSecretsSslKey0) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeNewOutputLogstashSecretsSslKey0 performs a merge with any union data inside the NewOutputLogstash_Secrets_Ssl_Key, using the provided NewOutputLogstashSecretsSslKey0 -func (t *NewOutputLogstash_Secrets_Ssl_Key) MergeNewOutputLogstashSecretsSslKey0(v NewOutputLogstashSecretsSslKey0) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsNewOutputLogstashSecretsSslKey1 returns the union data inside the NewOutputLogstash_Secrets_Ssl_Key as a NewOutputLogstashSecretsSslKey1 -func (t NewOutputLogstash_Secrets_Ssl_Key) AsNewOutputLogstashSecretsSslKey1() (NewOutputLogstashSecretsSslKey1, error) { - var body NewOutputLogstashSecretsSslKey1 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromNewOutputLogstashSecretsSslKey1 overwrites any union data inside the NewOutputLogstash_Secrets_Ssl_Key as the provided NewOutputLogstashSecretsSslKey1 -func (t *NewOutputLogstash_Secrets_Ssl_Key) FromNewOutputLogstashSecretsSslKey1(v NewOutputLogstashSecretsSslKey1) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeNewOutputLogstashSecretsSslKey1 performs a merge with any union data inside the NewOutputLogstash_Secrets_Ssl_Key, using the provided NewOutputLogstashSecretsSslKey1 -func (t *NewOutputLogstash_Secrets_Ssl_Key) MergeNewOutputLogstashSecretsSslKey1(v NewOutputLogstashSecretsSslKey1) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -func (t NewOutputLogstash_Secrets_Ssl_Key) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *NewOutputLogstash_Secrets_Ssl_Key) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsNewOutputRemoteElasticsearchSecretsServiceToken0 returns the union data inside the NewOutputRemoteElasticsearch_Secrets_ServiceToken as a NewOutputRemoteElasticsearchSecretsServiceToken0 -func (t NewOutputRemoteElasticsearch_Secrets_ServiceToken) AsNewOutputRemoteElasticsearchSecretsServiceToken0() (NewOutputRemoteElasticsearchSecretsServiceToken0, error) { - var body NewOutputRemoteElasticsearchSecretsServiceToken0 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromNewOutputRemoteElasticsearchSecretsServiceToken0 overwrites any union data inside the NewOutputRemoteElasticsearch_Secrets_ServiceToken as the provided NewOutputRemoteElasticsearchSecretsServiceToken0 -func (t *NewOutputRemoteElasticsearch_Secrets_ServiceToken) FromNewOutputRemoteElasticsearchSecretsServiceToken0(v NewOutputRemoteElasticsearchSecretsServiceToken0) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeNewOutputRemoteElasticsearchSecretsServiceToken0 performs a merge with any union data inside the NewOutputRemoteElasticsearch_Secrets_ServiceToken, using the provided NewOutputRemoteElasticsearchSecretsServiceToken0 -func (t *NewOutputRemoteElasticsearch_Secrets_ServiceToken) MergeNewOutputRemoteElasticsearchSecretsServiceToken0(v NewOutputRemoteElasticsearchSecretsServiceToken0) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsNewOutputRemoteElasticsearchSecretsServiceToken1 returns the union data inside the NewOutputRemoteElasticsearch_Secrets_ServiceToken as a NewOutputRemoteElasticsearchSecretsServiceToken1 -func (t NewOutputRemoteElasticsearch_Secrets_ServiceToken) AsNewOutputRemoteElasticsearchSecretsServiceToken1() (NewOutputRemoteElasticsearchSecretsServiceToken1, error) { - var body NewOutputRemoteElasticsearchSecretsServiceToken1 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromNewOutputRemoteElasticsearchSecretsServiceToken1 overwrites any union data inside the NewOutputRemoteElasticsearch_Secrets_ServiceToken as the provided NewOutputRemoteElasticsearchSecretsServiceToken1 -func (t *NewOutputRemoteElasticsearch_Secrets_ServiceToken) FromNewOutputRemoteElasticsearchSecretsServiceToken1(v NewOutputRemoteElasticsearchSecretsServiceToken1) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeNewOutputRemoteElasticsearchSecretsServiceToken1 performs a merge with any union data inside the NewOutputRemoteElasticsearch_Secrets_ServiceToken, using the provided NewOutputRemoteElasticsearchSecretsServiceToken1 -func (t *NewOutputRemoteElasticsearch_Secrets_ServiceToken) MergeNewOutputRemoteElasticsearchSecretsServiceToken1(v NewOutputRemoteElasticsearchSecretsServiceToken1) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -func (t NewOutputRemoteElasticsearch_Secrets_ServiceToken) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *NewOutputRemoteElasticsearch_Secrets_ServiceToken) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsNewOutputElasticsearch returns the union data inside the NewOutputUnion as a NewOutputElasticsearch -func (t NewOutputUnion) AsNewOutputElasticsearch() (NewOutputElasticsearch, error) { - var body NewOutputElasticsearch - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromNewOutputElasticsearch overwrites any union data inside the NewOutputUnion as the provided NewOutputElasticsearch -func (t *NewOutputUnion) FromNewOutputElasticsearch(v NewOutputElasticsearch) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeNewOutputElasticsearch performs a merge with any union data inside the NewOutputUnion, using the provided NewOutputElasticsearch -func (t *NewOutputUnion) MergeNewOutputElasticsearch(v NewOutputElasticsearch) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsNewOutputRemoteElasticsearch returns the union data inside the NewOutputUnion as a NewOutputRemoteElasticsearch -func (t NewOutputUnion) AsNewOutputRemoteElasticsearch() (NewOutputRemoteElasticsearch, error) { - var body NewOutputRemoteElasticsearch - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromNewOutputRemoteElasticsearch overwrites any union data inside the NewOutputUnion as the provided NewOutputRemoteElasticsearch -func (t *NewOutputUnion) FromNewOutputRemoteElasticsearch(v NewOutputRemoteElasticsearch) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeNewOutputRemoteElasticsearch performs a merge with any union data inside the NewOutputUnion, using the provided NewOutputRemoteElasticsearch -func (t *NewOutputUnion) MergeNewOutputRemoteElasticsearch(v NewOutputRemoteElasticsearch) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsNewOutputLogstash returns the union data inside the NewOutputUnion as a NewOutputLogstash -func (t NewOutputUnion) AsNewOutputLogstash() (NewOutputLogstash, error) { - var body NewOutputLogstash - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromNewOutputLogstash overwrites any union data inside the NewOutputUnion as the provided NewOutputLogstash -func (t *NewOutputUnion) FromNewOutputLogstash(v NewOutputLogstash) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeNewOutputLogstash performs a merge with any union data inside the NewOutputUnion, using the provided NewOutputLogstash -func (t *NewOutputUnion) MergeNewOutputLogstash(v NewOutputLogstash) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsNewOutputKafka returns the union data inside the NewOutputUnion as a NewOutputKafka -func (t NewOutputUnion) AsNewOutputKafka() (NewOutputKafka, error) { - var body NewOutputKafka - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromNewOutputKafka overwrites any union data inside the NewOutputUnion as the provided NewOutputKafka -func (t *NewOutputUnion) FromNewOutputKafka(v NewOutputKafka) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeNewOutputKafka performs a merge with any union data inside the NewOutputUnion, using the provided NewOutputKafka -func (t *NewOutputUnion) MergeNewOutputKafka(v NewOutputKafka) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -func (t NewOutputUnion) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *NewOutputUnion) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsOutputKafkaSecretsPassword0 returns the union data inside the OutputKafka_Secrets_Password as a OutputKafkaSecretsPassword0 -func (t OutputKafka_Secrets_Password) AsOutputKafkaSecretsPassword0() (OutputKafkaSecretsPassword0, error) { - var body OutputKafkaSecretsPassword0 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromOutputKafkaSecretsPassword0 overwrites any union data inside the OutputKafka_Secrets_Password as the provided OutputKafkaSecretsPassword0 -func (t *OutputKafka_Secrets_Password) FromOutputKafkaSecretsPassword0(v OutputKafkaSecretsPassword0) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeOutputKafkaSecretsPassword0 performs a merge with any union data inside the OutputKafka_Secrets_Password, using the provided OutputKafkaSecretsPassword0 -func (t *OutputKafka_Secrets_Password) MergeOutputKafkaSecretsPassword0(v OutputKafkaSecretsPassword0) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsOutputKafkaSecretsPassword1 returns the union data inside the OutputKafka_Secrets_Password as a OutputKafkaSecretsPassword1 -func (t OutputKafka_Secrets_Password) AsOutputKafkaSecretsPassword1() (OutputKafkaSecretsPassword1, error) { - var body OutputKafkaSecretsPassword1 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromOutputKafkaSecretsPassword1 overwrites any union data inside the OutputKafka_Secrets_Password as the provided OutputKafkaSecretsPassword1 -func (t *OutputKafka_Secrets_Password) FromOutputKafkaSecretsPassword1(v OutputKafkaSecretsPassword1) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeOutputKafkaSecretsPassword1 performs a merge with any union data inside the OutputKafka_Secrets_Password, using the provided OutputKafkaSecretsPassword1 -func (t *OutputKafka_Secrets_Password) MergeOutputKafkaSecretsPassword1(v OutputKafkaSecretsPassword1) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -func (t OutputKafka_Secrets_Password) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *OutputKafka_Secrets_Password) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsOutputKafkaSecretsSslKey0 returns the union data inside the OutputKafka_Secrets_Ssl_Key as a OutputKafkaSecretsSslKey0 -func (t OutputKafka_Secrets_Ssl_Key) AsOutputKafkaSecretsSslKey0() (OutputKafkaSecretsSslKey0, error) { - var body OutputKafkaSecretsSslKey0 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromOutputKafkaSecretsSslKey0 overwrites any union data inside the OutputKafka_Secrets_Ssl_Key as the provided OutputKafkaSecretsSslKey0 -func (t *OutputKafka_Secrets_Ssl_Key) FromOutputKafkaSecretsSslKey0(v OutputKafkaSecretsSslKey0) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeOutputKafkaSecretsSslKey0 performs a merge with any union data inside the OutputKafka_Secrets_Ssl_Key, using the provided OutputKafkaSecretsSslKey0 -func (t *OutputKafka_Secrets_Ssl_Key) MergeOutputKafkaSecretsSslKey0(v OutputKafkaSecretsSslKey0) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsOutputKafkaSecretsSslKey1 returns the union data inside the OutputKafka_Secrets_Ssl_Key as a OutputKafkaSecretsSslKey1 -func (t OutputKafka_Secrets_Ssl_Key) AsOutputKafkaSecretsSslKey1() (OutputKafkaSecretsSslKey1, error) { - var body OutputKafkaSecretsSslKey1 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromOutputKafkaSecretsSslKey1 overwrites any union data inside the OutputKafka_Secrets_Ssl_Key as the provided OutputKafkaSecretsSslKey1 -func (t *OutputKafka_Secrets_Ssl_Key) FromOutputKafkaSecretsSslKey1(v OutputKafkaSecretsSslKey1) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeOutputKafkaSecretsSslKey1 performs a merge with any union data inside the OutputKafka_Secrets_Ssl_Key, using the provided OutputKafkaSecretsSslKey1 -func (t *OutputKafka_Secrets_Ssl_Key) MergeOutputKafkaSecretsSslKey1(v OutputKafkaSecretsSslKey1) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -func (t OutputKafka_Secrets_Ssl_Key) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *OutputKafka_Secrets_Ssl_Key) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsOutputLogstashSecretsSslKey0 returns the union data inside the OutputLogstash_Secrets_Ssl_Key as a OutputLogstashSecretsSslKey0 -func (t OutputLogstash_Secrets_Ssl_Key) AsOutputLogstashSecretsSslKey0() (OutputLogstashSecretsSslKey0, error) { - var body OutputLogstashSecretsSslKey0 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromOutputLogstashSecretsSslKey0 overwrites any union data inside the OutputLogstash_Secrets_Ssl_Key as the provided OutputLogstashSecretsSslKey0 -func (t *OutputLogstash_Secrets_Ssl_Key) FromOutputLogstashSecretsSslKey0(v OutputLogstashSecretsSslKey0) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeOutputLogstashSecretsSslKey0 performs a merge with any union data inside the OutputLogstash_Secrets_Ssl_Key, using the provided OutputLogstashSecretsSslKey0 -func (t *OutputLogstash_Secrets_Ssl_Key) MergeOutputLogstashSecretsSslKey0(v OutputLogstashSecretsSslKey0) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsOutputLogstashSecretsSslKey1 returns the union data inside the OutputLogstash_Secrets_Ssl_Key as a OutputLogstashSecretsSslKey1 -func (t OutputLogstash_Secrets_Ssl_Key) AsOutputLogstashSecretsSslKey1() (OutputLogstashSecretsSslKey1, error) { - var body OutputLogstashSecretsSslKey1 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromOutputLogstashSecretsSslKey1 overwrites any union data inside the OutputLogstash_Secrets_Ssl_Key as the provided OutputLogstashSecretsSslKey1 -func (t *OutputLogstash_Secrets_Ssl_Key) FromOutputLogstashSecretsSslKey1(v OutputLogstashSecretsSslKey1) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeOutputLogstashSecretsSslKey1 performs a merge with any union data inside the OutputLogstash_Secrets_Ssl_Key, using the provided OutputLogstashSecretsSslKey1 -func (t *OutputLogstash_Secrets_Ssl_Key) MergeOutputLogstashSecretsSslKey1(v OutputLogstashSecretsSslKey1) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -func (t OutputLogstash_Secrets_Ssl_Key) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *OutputLogstash_Secrets_Ssl_Key) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsOutputRemoteElasticsearchSecretsServiceToken0 returns the union data inside the OutputRemoteElasticsearch_Secrets_ServiceToken as a OutputRemoteElasticsearchSecretsServiceToken0 -func (t OutputRemoteElasticsearch_Secrets_ServiceToken) AsOutputRemoteElasticsearchSecretsServiceToken0() (OutputRemoteElasticsearchSecretsServiceToken0, error) { - var body OutputRemoteElasticsearchSecretsServiceToken0 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromOutputRemoteElasticsearchSecretsServiceToken0 overwrites any union data inside the OutputRemoteElasticsearch_Secrets_ServiceToken as the provided OutputRemoteElasticsearchSecretsServiceToken0 -func (t *OutputRemoteElasticsearch_Secrets_ServiceToken) FromOutputRemoteElasticsearchSecretsServiceToken0(v OutputRemoteElasticsearchSecretsServiceToken0) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeOutputRemoteElasticsearchSecretsServiceToken0 performs a merge with any union data inside the OutputRemoteElasticsearch_Secrets_ServiceToken, using the provided OutputRemoteElasticsearchSecretsServiceToken0 -func (t *OutputRemoteElasticsearch_Secrets_ServiceToken) MergeOutputRemoteElasticsearchSecretsServiceToken0(v OutputRemoteElasticsearchSecretsServiceToken0) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsOutputRemoteElasticsearchSecretsServiceToken1 returns the union data inside the OutputRemoteElasticsearch_Secrets_ServiceToken as a OutputRemoteElasticsearchSecretsServiceToken1 -func (t OutputRemoteElasticsearch_Secrets_ServiceToken) AsOutputRemoteElasticsearchSecretsServiceToken1() (OutputRemoteElasticsearchSecretsServiceToken1, error) { - var body OutputRemoteElasticsearchSecretsServiceToken1 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromOutputRemoteElasticsearchSecretsServiceToken1 overwrites any union data inside the OutputRemoteElasticsearch_Secrets_ServiceToken as the provided OutputRemoteElasticsearchSecretsServiceToken1 -func (t *OutputRemoteElasticsearch_Secrets_ServiceToken) FromOutputRemoteElasticsearchSecretsServiceToken1(v OutputRemoteElasticsearchSecretsServiceToken1) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeOutputRemoteElasticsearchSecretsServiceToken1 performs a merge with any union data inside the OutputRemoteElasticsearch_Secrets_ServiceToken, using the provided OutputRemoteElasticsearchSecretsServiceToken1 -func (t *OutputRemoteElasticsearch_Secrets_ServiceToken) MergeOutputRemoteElasticsearchSecretsServiceToken1(v OutputRemoteElasticsearchSecretsServiceToken1) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -func (t OutputRemoteElasticsearch_Secrets_ServiceToken) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *OutputRemoteElasticsearch_Secrets_ServiceToken) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsOutputElasticsearch returns the union data inside the OutputUnion as a OutputElasticsearch -func (t OutputUnion) AsOutputElasticsearch() (OutputElasticsearch, error) { - var body OutputElasticsearch - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromOutputElasticsearch overwrites any union data inside the OutputUnion as the provided OutputElasticsearch -func (t *OutputUnion) FromOutputElasticsearch(v OutputElasticsearch) error { - v.Type = "elasticsearch" - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeOutputElasticsearch performs a merge with any union data inside the OutputUnion, using the provided OutputElasticsearch -func (t *OutputUnion) MergeOutputElasticsearch(v OutputElasticsearch) error { - v.Type = "elasticsearch" - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsOutputRemoteElasticsearch returns the union data inside the OutputUnion as a OutputRemoteElasticsearch -func (t OutputUnion) AsOutputRemoteElasticsearch() (OutputRemoteElasticsearch, error) { - var body OutputRemoteElasticsearch - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromOutputRemoteElasticsearch overwrites any union data inside the OutputUnion as the provided OutputRemoteElasticsearch -func (t *OutputUnion) FromOutputRemoteElasticsearch(v OutputRemoteElasticsearch) error { - v.Type = "remote_elasticsearch" - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeOutputRemoteElasticsearch performs a merge with any union data inside the OutputUnion, using the provided OutputRemoteElasticsearch -func (t *OutputUnion) MergeOutputRemoteElasticsearch(v OutputRemoteElasticsearch) error { - v.Type = "remote_elasticsearch" - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsOutputLogstash returns the union data inside the OutputUnion as a OutputLogstash -func (t OutputUnion) AsOutputLogstash() (OutputLogstash, error) { - var body OutputLogstash - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromOutputLogstash overwrites any union data inside the OutputUnion as the provided OutputLogstash -func (t *OutputUnion) FromOutputLogstash(v OutputLogstash) error { - v.Type = "logstash" - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeOutputLogstash performs a merge with any union data inside the OutputUnion, using the provided OutputLogstash -func (t *OutputUnion) MergeOutputLogstash(v OutputLogstash) error { - v.Type = "logstash" - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsOutputKafka returns the union data inside the OutputUnion as a OutputKafka -func (t OutputUnion) AsOutputKafka() (OutputKafka, error) { - var body OutputKafka - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromOutputKafka overwrites any union data inside the OutputUnion as the provided OutputKafka -func (t *OutputUnion) FromOutputKafka(v OutputKafka) error { - v.Type = "kafka" - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeOutputKafka performs a merge with any union data inside the OutputUnion, using the provided OutputKafka -func (t *OutputUnion) MergeOutputKafka(v OutputKafka) error { - v.Type = "kafka" - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -func (t OutputUnion) Discriminator() (string, error) { - var discriminator struct { - Discriminator string `json:"type"` - } - err := json.Unmarshal(t.union, &discriminator) - return discriminator.Discriminator, err -} - -func (t OutputUnion) ValueByDiscriminator() (interface{}, error) { - discriminator, err := t.Discriminator() - if err != nil { - return nil, err - } - switch discriminator { - case "elasticsearch": - return t.AsOutputElasticsearch() - case "kafka": - return t.AsOutputKafka() - case "logstash": - return t.AsOutputLogstash() - case "remote_elasticsearch": - return t.AsOutputRemoteElasticsearch() - default: - return nil, errors.New("unknown discriminator value: " + discriminator) - } -} - -func (t OutputUnion) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *OutputUnion) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsUpdateOutputKafkaSecretsPassword0 returns the union data inside the UpdateOutputKafka_Secrets_Password as a UpdateOutputKafkaSecretsPassword0 -func (t UpdateOutputKafka_Secrets_Password) AsUpdateOutputKafkaSecretsPassword0() (UpdateOutputKafkaSecretsPassword0, error) { - var body UpdateOutputKafkaSecretsPassword0 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromUpdateOutputKafkaSecretsPassword0 overwrites any union data inside the UpdateOutputKafka_Secrets_Password as the provided UpdateOutputKafkaSecretsPassword0 -func (t *UpdateOutputKafka_Secrets_Password) FromUpdateOutputKafkaSecretsPassword0(v UpdateOutputKafkaSecretsPassword0) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeUpdateOutputKafkaSecretsPassword0 performs a merge with any union data inside the UpdateOutputKafka_Secrets_Password, using the provided UpdateOutputKafkaSecretsPassword0 -func (t *UpdateOutputKafka_Secrets_Password) MergeUpdateOutputKafkaSecretsPassword0(v UpdateOutputKafkaSecretsPassword0) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsUpdateOutputKafkaSecretsPassword1 returns the union data inside the UpdateOutputKafka_Secrets_Password as a UpdateOutputKafkaSecretsPassword1 -func (t UpdateOutputKafka_Secrets_Password) AsUpdateOutputKafkaSecretsPassword1() (UpdateOutputKafkaSecretsPassword1, error) { - var body UpdateOutputKafkaSecretsPassword1 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromUpdateOutputKafkaSecretsPassword1 overwrites any union data inside the UpdateOutputKafka_Secrets_Password as the provided UpdateOutputKafkaSecretsPassword1 -func (t *UpdateOutputKafka_Secrets_Password) FromUpdateOutputKafkaSecretsPassword1(v UpdateOutputKafkaSecretsPassword1) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeUpdateOutputKafkaSecretsPassword1 performs a merge with any union data inside the UpdateOutputKafka_Secrets_Password, using the provided UpdateOutputKafkaSecretsPassword1 -func (t *UpdateOutputKafka_Secrets_Password) MergeUpdateOutputKafkaSecretsPassword1(v UpdateOutputKafkaSecretsPassword1) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -func (t UpdateOutputKafka_Secrets_Password) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *UpdateOutputKafka_Secrets_Password) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsUpdateOutputKafkaSecretsSslKey0 returns the union data inside the UpdateOutputKafka_Secrets_Ssl_Key as a UpdateOutputKafkaSecretsSslKey0 -func (t UpdateOutputKafka_Secrets_Ssl_Key) AsUpdateOutputKafkaSecretsSslKey0() (UpdateOutputKafkaSecretsSslKey0, error) { - var body UpdateOutputKafkaSecretsSslKey0 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromUpdateOutputKafkaSecretsSslKey0 overwrites any union data inside the UpdateOutputKafka_Secrets_Ssl_Key as the provided UpdateOutputKafkaSecretsSslKey0 -func (t *UpdateOutputKafka_Secrets_Ssl_Key) FromUpdateOutputKafkaSecretsSslKey0(v UpdateOutputKafkaSecretsSslKey0) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeUpdateOutputKafkaSecretsSslKey0 performs a merge with any union data inside the UpdateOutputKafka_Secrets_Ssl_Key, using the provided UpdateOutputKafkaSecretsSslKey0 -func (t *UpdateOutputKafka_Secrets_Ssl_Key) MergeUpdateOutputKafkaSecretsSslKey0(v UpdateOutputKafkaSecretsSslKey0) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsUpdateOutputKafkaSecretsSslKey1 returns the union data inside the UpdateOutputKafka_Secrets_Ssl_Key as a UpdateOutputKafkaSecretsSslKey1 -func (t UpdateOutputKafka_Secrets_Ssl_Key) AsUpdateOutputKafkaSecretsSslKey1() (UpdateOutputKafkaSecretsSslKey1, error) { - var body UpdateOutputKafkaSecretsSslKey1 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromUpdateOutputKafkaSecretsSslKey1 overwrites any union data inside the UpdateOutputKafka_Secrets_Ssl_Key as the provided UpdateOutputKafkaSecretsSslKey1 -func (t *UpdateOutputKafka_Secrets_Ssl_Key) FromUpdateOutputKafkaSecretsSslKey1(v UpdateOutputKafkaSecretsSslKey1) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeUpdateOutputKafkaSecretsSslKey1 performs a merge with any union data inside the UpdateOutputKafka_Secrets_Ssl_Key, using the provided UpdateOutputKafkaSecretsSslKey1 -func (t *UpdateOutputKafka_Secrets_Ssl_Key) MergeUpdateOutputKafkaSecretsSslKey1(v UpdateOutputKafkaSecretsSslKey1) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -func (t UpdateOutputKafka_Secrets_Ssl_Key) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *UpdateOutputKafka_Secrets_Ssl_Key) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsUpdateOutputLogstashSecretsSslKey0 returns the union data inside the UpdateOutputLogstash_Secrets_Ssl_Key as a UpdateOutputLogstashSecretsSslKey0 -func (t UpdateOutputLogstash_Secrets_Ssl_Key) AsUpdateOutputLogstashSecretsSslKey0() (UpdateOutputLogstashSecretsSslKey0, error) { - var body UpdateOutputLogstashSecretsSslKey0 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromUpdateOutputLogstashSecretsSslKey0 overwrites any union data inside the UpdateOutputLogstash_Secrets_Ssl_Key as the provided UpdateOutputLogstashSecretsSslKey0 -func (t *UpdateOutputLogstash_Secrets_Ssl_Key) FromUpdateOutputLogstashSecretsSslKey0(v UpdateOutputLogstashSecretsSslKey0) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeUpdateOutputLogstashSecretsSslKey0 performs a merge with any union data inside the UpdateOutputLogstash_Secrets_Ssl_Key, using the provided UpdateOutputLogstashSecretsSslKey0 -func (t *UpdateOutputLogstash_Secrets_Ssl_Key) MergeUpdateOutputLogstashSecretsSslKey0(v UpdateOutputLogstashSecretsSslKey0) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsUpdateOutputLogstashSecretsSslKey1 returns the union data inside the UpdateOutputLogstash_Secrets_Ssl_Key as a UpdateOutputLogstashSecretsSslKey1 -func (t UpdateOutputLogstash_Secrets_Ssl_Key) AsUpdateOutputLogstashSecretsSslKey1() (UpdateOutputLogstashSecretsSslKey1, error) { - var body UpdateOutputLogstashSecretsSslKey1 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromUpdateOutputLogstashSecretsSslKey1 overwrites any union data inside the UpdateOutputLogstash_Secrets_Ssl_Key as the provided UpdateOutputLogstashSecretsSslKey1 -func (t *UpdateOutputLogstash_Secrets_Ssl_Key) FromUpdateOutputLogstashSecretsSslKey1(v UpdateOutputLogstashSecretsSslKey1) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeUpdateOutputLogstashSecretsSslKey1 performs a merge with any union data inside the UpdateOutputLogstash_Secrets_Ssl_Key, using the provided UpdateOutputLogstashSecretsSslKey1 -func (t *UpdateOutputLogstash_Secrets_Ssl_Key) MergeUpdateOutputLogstashSecretsSslKey1(v UpdateOutputLogstashSecretsSslKey1) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -func (t UpdateOutputLogstash_Secrets_Ssl_Key) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *UpdateOutputLogstash_Secrets_Ssl_Key) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsUpdateOutputRemoteElasticsearchSecretsServiceToken0 returns the union data inside the UpdateOutputRemoteElasticsearch_Secrets_ServiceToken as a UpdateOutputRemoteElasticsearchSecretsServiceToken0 -func (t UpdateOutputRemoteElasticsearch_Secrets_ServiceToken) AsUpdateOutputRemoteElasticsearchSecretsServiceToken0() (UpdateOutputRemoteElasticsearchSecretsServiceToken0, error) { - var body UpdateOutputRemoteElasticsearchSecretsServiceToken0 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromUpdateOutputRemoteElasticsearchSecretsServiceToken0 overwrites any union data inside the UpdateOutputRemoteElasticsearch_Secrets_ServiceToken as the provided UpdateOutputRemoteElasticsearchSecretsServiceToken0 -func (t *UpdateOutputRemoteElasticsearch_Secrets_ServiceToken) FromUpdateOutputRemoteElasticsearchSecretsServiceToken0(v UpdateOutputRemoteElasticsearchSecretsServiceToken0) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeUpdateOutputRemoteElasticsearchSecretsServiceToken0 performs a merge with any union data inside the UpdateOutputRemoteElasticsearch_Secrets_ServiceToken, using the provided UpdateOutputRemoteElasticsearchSecretsServiceToken0 -func (t *UpdateOutputRemoteElasticsearch_Secrets_ServiceToken) MergeUpdateOutputRemoteElasticsearchSecretsServiceToken0(v UpdateOutputRemoteElasticsearchSecretsServiceToken0) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsUpdateOutputRemoteElasticsearchSecretsServiceToken1 returns the union data inside the UpdateOutputRemoteElasticsearch_Secrets_ServiceToken as a UpdateOutputRemoteElasticsearchSecretsServiceToken1 -func (t UpdateOutputRemoteElasticsearch_Secrets_ServiceToken) AsUpdateOutputRemoteElasticsearchSecretsServiceToken1() (UpdateOutputRemoteElasticsearchSecretsServiceToken1, error) { - var body UpdateOutputRemoteElasticsearchSecretsServiceToken1 - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromUpdateOutputRemoteElasticsearchSecretsServiceToken1 overwrites any union data inside the UpdateOutputRemoteElasticsearch_Secrets_ServiceToken as the provided UpdateOutputRemoteElasticsearchSecretsServiceToken1 -func (t *UpdateOutputRemoteElasticsearch_Secrets_ServiceToken) FromUpdateOutputRemoteElasticsearchSecretsServiceToken1(v UpdateOutputRemoteElasticsearchSecretsServiceToken1) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeUpdateOutputRemoteElasticsearchSecretsServiceToken1 performs a merge with any union data inside the UpdateOutputRemoteElasticsearch_Secrets_ServiceToken, using the provided UpdateOutputRemoteElasticsearchSecretsServiceToken1 -func (t *UpdateOutputRemoteElasticsearch_Secrets_ServiceToken) MergeUpdateOutputRemoteElasticsearchSecretsServiceToken1(v UpdateOutputRemoteElasticsearchSecretsServiceToken1) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -func (t UpdateOutputRemoteElasticsearch_Secrets_ServiceToken) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *UpdateOutputRemoteElasticsearch_Secrets_ServiceToken) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// AsUpdateOutputElasticsearch returns the union data inside the UpdateOutputUnion as a UpdateOutputElasticsearch -func (t UpdateOutputUnion) AsUpdateOutputElasticsearch() (UpdateOutputElasticsearch, error) { - var body UpdateOutputElasticsearch - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromUpdateOutputElasticsearch overwrites any union data inside the UpdateOutputUnion as the provided UpdateOutputElasticsearch -func (t *UpdateOutputUnion) FromUpdateOutputElasticsearch(v UpdateOutputElasticsearch) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeUpdateOutputElasticsearch performs a merge with any union data inside the UpdateOutputUnion, using the provided UpdateOutputElasticsearch -func (t *UpdateOutputUnion) MergeUpdateOutputElasticsearch(v UpdateOutputElasticsearch) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsUpdateOutputRemoteElasticsearch returns the union data inside the UpdateOutputUnion as a UpdateOutputRemoteElasticsearch -func (t UpdateOutputUnion) AsUpdateOutputRemoteElasticsearch() (UpdateOutputRemoteElasticsearch, error) { - var body UpdateOutputRemoteElasticsearch - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromUpdateOutputRemoteElasticsearch overwrites any union data inside the UpdateOutputUnion as the provided UpdateOutputRemoteElasticsearch -func (t *UpdateOutputUnion) FromUpdateOutputRemoteElasticsearch(v UpdateOutputRemoteElasticsearch) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeUpdateOutputRemoteElasticsearch performs a merge with any union data inside the UpdateOutputUnion, using the provided UpdateOutputRemoteElasticsearch -func (t *UpdateOutputUnion) MergeUpdateOutputRemoteElasticsearch(v UpdateOutputRemoteElasticsearch) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsUpdateOutputLogstash returns the union data inside the UpdateOutputUnion as a UpdateOutputLogstash -func (t UpdateOutputUnion) AsUpdateOutputLogstash() (UpdateOutputLogstash, error) { - var body UpdateOutputLogstash - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromUpdateOutputLogstash overwrites any union data inside the UpdateOutputUnion as the provided UpdateOutputLogstash -func (t *UpdateOutputUnion) FromUpdateOutputLogstash(v UpdateOutputLogstash) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeUpdateOutputLogstash performs a merge with any union data inside the UpdateOutputUnion, using the provided UpdateOutputLogstash -func (t *UpdateOutputUnion) MergeUpdateOutputLogstash(v UpdateOutputLogstash) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -// AsUpdateOutputKafka returns the union data inside the UpdateOutputUnion as a UpdateOutputKafka -func (t UpdateOutputUnion) AsUpdateOutputKafka() (UpdateOutputKafka, error) { - var body UpdateOutputKafka - err := json.Unmarshal(t.union, &body) - return body, err -} - -// FromUpdateOutputKafka overwrites any union data inside the UpdateOutputUnion as the provided UpdateOutputKafka -func (t *UpdateOutputUnion) FromUpdateOutputKafka(v UpdateOutputKafka) error { - b, err := json.Marshal(v) - t.union = b - return err -} - -// MergeUpdateOutputKafka performs a merge with any union data inside the UpdateOutputUnion, using the provided UpdateOutputKafka -func (t *UpdateOutputUnion) MergeUpdateOutputKafka(v UpdateOutputKafka) error { - b, err := json.Marshal(v) - if err != nil { - return err - } - - merged, err := runtime.JSONMerge(t.union, b) - t.union = merged - return err -} - -func (t UpdateOutputUnion) MarshalJSON() ([]byte, error) { - b, err := t.union.MarshalJSON() - return b, err -} - -func (t *UpdateOutputUnion) UnmarshalJSON(b []byte) error { - err := t.union.UnmarshalJSON(b) - return err -} - -// RequestEditorFn is the function signature for the RequestEditor callback function -type RequestEditorFn func(ctx context.Context, req *http.Request) error - -// Doer performs HTTP requests. -// -// The standard http.Client implements this interface. -type HttpRequestDoer interface { - Do(req *http.Request) (*http.Response, error) -} - -// Client which conforms to the OpenAPI3 specification for this service. -type Client struct { - // The endpoint of the server conforming to this interface, with scheme, - // https://api.deepmap.com for example. This can contain a path relative - // to the server, such as https://api.deepmap.com/dev-test, and all the - // paths in the swagger spec will be appended to the server. - Server string - - // Doer for performing requests, typically a *http.Client with any - // customized settings, such as certificate chains. - Client HttpRequestDoer - - // A list of callbacks for modifying requests which are generated before sending over - // the network. - RequestEditors []RequestEditorFn -} - -// ClientOption allows setting custom parameters during construction -type ClientOption func(*Client) error - -// Creates a new Client, with reasonable defaults -func NewClient(server string, opts ...ClientOption) (*Client, error) { - // create a client with sane default values - client := Client{ - Server: server, - } - // mutate client and add all optional params - for _, o := range opts { - if err := o(&client); err != nil { - return nil, err - } - } - // ensure the server URL always has a trailing slash - if !strings.HasSuffix(client.Server, "/") { - client.Server += "/" - } - // create httpClient, if not already present - if client.Client == nil { - client.Client = &http.Client{} - } - return &client, nil -} - -// WithHTTPClient allows overriding the default Doer, which is -// automatically created using http.Client. This is useful for tests. -func WithHTTPClient(doer HttpRequestDoer) ClientOption { - return func(c *Client) error { - c.Client = doer - return nil - } -} - -// WithRequestEditorFn allows setting up a callback function, which will be -// called right before sending the request. This can be used to mutate the request. -func WithRequestEditorFn(fn RequestEditorFn) ClientOption { - return func(c *Client) error { - c.RequestEditors = append(c.RequestEditors, fn) - return nil - } -} - -// The interface specification for the client above. -type ClientInterface interface { - // GetAgentPolicies request - GetAgentPolicies(ctx context.Context, params *GetAgentPoliciesParams, reqEditors ...RequestEditorFn) (*http.Response, error) - - // CreateAgentPolicyWithBody request with any body - CreateAgentPolicyWithBody(ctx context.Context, params *CreateAgentPolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - CreateAgentPolicy(ctx context.Context, params *CreateAgentPolicyParams, body CreateAgentPolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // DeleteAgentPolicyWithBody request with any body - DeleteAgentPolicyWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - DeleteAgentPolicy(ctx context.Context, body DeleteAgentPolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // GetAgentPolicy request - GetAgentPolicy(ctx context.Context, agentPolicyId string, params *GetAgentPolicyParams, reqEditors ...RequestEditorFn) (*http.Response, error) - - // UpdateAgentPolicyWithBody request with any body - UpdateAgentPolicyWithBody(ctx context.Context, agentPolicyId string, params *UpdateAgentPolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - UpdateAgentPolicy(ctx context.Context, agentPolicyId string, params *UpdateAgentPolicyParams, body UpdateAgentPolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // GetEnrollmentApiKeys request - GetEnrollmentApiKeys(ctx context.Context, params *GetEnrollmentApiKeysParams, reqEditors ...RequestEditorFn) (*http.Response, error) - - // ListPackages request - ListPackages(ctx context.Context, params *ListPackagesParams, reqEditors ...RequestEditorFn) (*http.Response, error) - - // InstallPackageByUploadWithBody request with any body - InstallPackageByUploadWithBody(ctx context.Context, params *InstallPackageByUploadParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - // DeletePackageWithBody request with any body - DeletePackageWithBody(ctx context.Context, pkgName string, pkgVersion string, params *DeletePackageParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - DeletePackage(ctx context.Context, pkgName string, pkgVersion string, params *DeletePackageParams, body DeletePackageJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // GetPackage request - GetPackage(ctx context.Context, pkgName string, pkgVersion string, params *GetPackageParams, reqEditors ...RequestEditorFn) (*http.Response, error) - - // InstallPackageWithBody request with any body - InstallPackageWithBody(ctx context.Context, pkgName string, pkgVersion string, params *InstallPackageParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - InstallPackage(ctx context.Context, pkgName string, pkgVersion string, params *InstallPackageParams, body InstallPackageJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // GetFleetServerHosts request - GetFleetServerHosts(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - - // CreateFleetServerHostWithBody request with any body - CreateFleetServerHostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - CreateFleetServerHost(ctx context.Context, body CreateFleetServerHostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // DeleteFleetServerHost request - DeleteFleetServerHost(ctx context.Context, itemId string, reqEditors ...RequestEditorFn) (*http.Response, error) - - // GetFleetServerHost request - GetFleetServerHost(ctx context.Context, itemId string, reqEditors ...RequestEditorFn) (*http.Response, error) - - // UpdateFleetServerHostWithBody request with any body - UpdateFleetServerHostWithBody(ctx context.Context, itemId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - UpdateFleetServerHost(ctx context.Context, itemId string, body UpdateFleetServerHostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // GetOutputs request - GetOutputs(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - - // CreateOutputWithBody request with any body - CreateOutputWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - CreateOutput(ctx context.Context, body CreateOutputJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // DeleteOutput request - DeleteOutput(ctx context.Context, outputId string, reqEditors ...RequestEditorFn) (*http.Response, error) - - // GetOutput request - GetOutput(ctx context.Context, outputId string, reqEditors ...RequestEditorFn) (*http.Response, error) - - // UpdateOutputWithBody request with any body - UpdateOutputWithBody(ctx context.Context, outputId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - UpdateOutput(ctx context.Context, outputId string, body UpdateOutputJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // GetPackagePolicies request - GetPackagePolicies(ctx context.Context, params *GetPackagePoliciesParams, reqEditors ...RequestEditorFn) (*http.Response, error) - - // CreatePackagePolicyWithBody request with any body - CreatePackagePolicyWithBody(ctx context.Context, params *CreatePackagePolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - CreatePackagePolicy(ctx context.Context, params *CreatePackagePolicyParams, body CreatePackagePolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // DeletePackagePolicy request - DeletePackagePolicy(ctx context.Context, packagePolicyId string, params *DeletePackagePolicyParams, reqEditors ...RequestEditorFn) (*http.Response, error) - - // GetPackagePolicy request - GetPackagePolicy(ctx context.Context, packagePolicyId string, params *GetPackagePolicyParams, reqEditors ...RequestEditorFn) (*http.Response, error) - - // UpdatePackagePolicyWithBody request with any body - UpdatePackagePolicyWithBody(ctx context.Context, packagePolicyId string, params *UpdatePackagePolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - UpdatePackagePolicy(ctx context.Context, packagePolicyId string, params *UpdatePackagePolicyParams, body UpdatePackagePolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) -} - -func (c *Client) GetAgentPolicies(ctx context.Context, params *GetAgentPoliciesParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetAgentPoliciesRequest(c.Server, params) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) CreateAgentPolicyWithBody(ctx context.Context, params *CreateAgentPolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateAgentPolicyRequestWithBody(c.Server, params, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) CreateAgentPolicy(ctx context.Context, params *CreateAgentPolicyParams, body CreateAgentPolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateAgentPolicyRequest(c.Server, params, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) DeleteAgentPolicyWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewDeleteAgentPolicyRequestWithBody(c.Server, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) DeleteAgentPolicy(ctx context.Context, body DeleteAgentPolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewDeleteAgentPolicyRequest(c.Server, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) GetAgentPolicy(ctx context.Context, agentPolicyId string, params *GetAgentPolicyParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetAgentPolicyRequest(c.Server, agentPolicyId, params) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) UpdateAgentPolicyWithBody(ctx context.Context, agentPolicyId string, params *UpdateAgentPolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewUpdateAgentPolicyRequestWithBody(c.Server, agentPolicyId, params, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) UpdateAgentPolicy(ctx context.Context, agentPolicyId string, params *UpdateAgentPolicyParams, body UpdateAgentPolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewUpdateAgentPolicyRequest(c.Server, agentPolicyId, params, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) GetEnrollmentApiKeys(ctx context.Context, params *GetEnrollmentApiKeysParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetEnrollmentApiKeysRequest(c.Server, params) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) ListPackages(ctx context.Context, params *ListPackagesParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewListPackagesRequest(c.Server, params) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) InstallPackageByUploadWithBody(ctx context.Context, params *InstallPackageByUploadParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewInstallPackageByUploadRequestWithBody(c.Server, params, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) DeletePackageWithBody(ctx context.Context, pkgName string, pkgVersion string, params *DeletePackageParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewDeletePackageRequestWithBody(c.Server, pkgName, pkgVersion, params, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) DeletePackage(ctx context.Context, pkgName string, pkgVersion string, params *DeletePackageParams, body DeletePackageJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewDeletePackageRequest(c.Server, pkgName, pkgVersion, params, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) GetPackage(ctx context.Context, pkgName string, pkgVersion string, params *GetPackageParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetPackageRequest(c.Server, pkgName, pkgVersion, params) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) InstallPackageWithBody(ctx context.Context, pkgName string, pkgVersion string, params *InstallPackageParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewInstallPackageRequestWithBody(c.Server, pkgName, pkgVersion, params, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) InstallPackage(ctx context.Context, pkgName string, pkgVersion string, params *InstallPackageParams, body InstallPackageJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewInstallPackageRequest(c.Server, pkgName, pkgVersion, params, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) GetFleetServerHosts(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetFleetServerHostsRequest(c.Server) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) CreateFleetServerHostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateFleetServerHostRequestWithBody(c.Server, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) CreateFleetServerHost(ctx context.Context, body CreateFleetServerHostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateFleetServerHostRequest(c.Server, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) DeleteFleetServerHost(ctx context.Context, itemId string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewDeleteFleetServerHostRequest(c.Server, itemId) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) GetFleetServerHost(ctx context.Context, itemId string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetFleetServerHostRequest(c.Server, itemId) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) UpdateFleetServerHostWithBody(ctx context.Context, itemId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewUpdateFleetServerHostRequestWithBody(c.Server, itemId, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) UpdateFleetServerHost(ctx context.Context, itemId string, body UpdateFleetServerHostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewUpdateFleetServerHostRequest(c.Server, itemId, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) GetOutputs(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetOutputsRequest(c.Server) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) CreateOutputWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateOutputRequestWithBody(c.Server, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) CreateOutput(ctx context.Context, body CreateOutputJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateOutputRequest(c.Server, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) DeleteOutput(ctx context.Context, outputId string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewDeleteOutputRequest(c.Server, outputId) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) GetOutput(ctx context.Context, outputId string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetOutputRequest(c.Server, outputId) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) UpdateOutputWithBody(ctx context.Context, outputId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewUpdateOutputRequestWithBody(c.Server, outputId, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) UpdateOutput(ctx context.Context, outputId string, body UpdateOutputJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewUpdateOutputRequest(c.Server, outputId, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) GetPackagePolicies(ctx context.Context, params *GetPackagePoliciesParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetPackagePoliciesRequest(c.Server, params) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) CreatePackagePolicyWithBody(ctx context.Context, params *CreatePackagePolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreatePackagePolicyRequestWithBody(c.Server, params, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) CreatePackagePolicy(ctx context.Context, params *CreatePackagePolicyParams, body CreatePackagePolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreatePackagePolicyRequest(c.Server, params, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) DeletePackagePolicy(ctx context.Context, packagePolicyId string, params *DeletePackagePolicyParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewDeletePackagePolicyRequest(c.Server, packagePolicyId, params) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) GetPackagePolicy(ctx context.Context, packagePolicyId string, params *GetPackagePolicyParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetPackagePolicyRequest(c.Server, packagePolicyId, params) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) UpdatePackagePolicyWithBody(ctx context.Context, packagePolicyId string, params *UpdatePackagePolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewUpdatePackagePolicyRequestWithBody(c.Server, packagePolicyId, params, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) UpdatePackagePolicy(ctx context.Context, packagePolicyId string, params *UpdatePackagePolicyParams, body UpdatePackagePolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewUpdatePackagePolicyRequest(c.Server, packagePolicyId, params, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -// NewGetAgentPoliciesRequest generates requests for GetAgentPolicies -func NewGetAgentPoliciesRequest(server string, params *GetAgentPoliciesParams) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/fleet/agent_policies") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - if params != nil { - queryValues := queryURL.Query() - - if params.Page != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "page", runtime.ParamLocationQuery, *params.Page); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.PerPage != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "perPage", runtime.ParamLocationQuery, *params.PerPage); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.SortField != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "sortField", runtime.ParamLocationQuery, *params.SortField); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.SortOrder != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "sortOrder", runtime.ParamLocationQuery, *params.SortOrder); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.ShowUpgradeable != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "showUpgradeable", runtime.ParamLocationQuery, *params.ShowUpgradeable); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.Kuery != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "kuery", runtime.ParamLocationQuery, *params.Kuery); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.NoAgentCount != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "noAgentCount", runtime.ParamLocationQuery, *params.NoAgentCount); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.WithAgentCount != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "withAgentCount", runtime.ParamLocationQuery, *params.WithAgentCount); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.Full != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "full", runtime.ParamLocationQuery, *params.Full); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.Format != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "format", runtime.ParamLocationQuery, *params.Format); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewCreateAgentPolicyRequest calls the generic CreateAgentPolicy builder with application/json body -func NewCreateAgentPolicyRequest(server string, params *CreateAgentPolicyParams, body CreateAgentPolicyJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewCreateAgentPolicyRequestWithBody(server, params, "application/json", bodyReader) -} - -// NewCreateAgentPolicyRequestWithBody generates requests for CreateAgentPolicy with any type of body -func NewCreateAgentPolicyRequestWithBody(server string, params *CreateAgentPolicyParams, contentType string, body io.Reader) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/fleet/agent_policies") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - if params != nil { - queryValues := queryURL.Query() - - if params.SysMonitoring != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "sys_monitoring", runtime.ParamLocationQuery, *params.SysMonitoring); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewDeleteAgentPolicyRequest calls the generic DeleteAgentPolicy builder with application/json body -func NewDeleteAgentPolicyRequest(server string, body DeleteAgentPolicyJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewDeleteAgentPolicyRequestWithBody(server, "application/json", bodyReader) -} - -// NewDeleteAgentPolicyRequestWithBody generates requests for DeleteAgentPolicy with any type of body -func NewDeleteAgentPolicyRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/fleet/agent_policies/delete") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewGetAgentPolicyRequest generates requests for GetAgentPolicy -func NewGetAgentPolicyRequest(server string, agentPolicyId string, params *GetAgentPolicyParams) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "agentPolicyId", runtime.ParamLocationPath, agentPolicyId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/fleet/agent_policies/%s", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - if params != nil { - queryValues := queryURL.Query() - - if params.Format != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "format", runtime.ParamLocationQuery, *params.Format); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewUpdateAgentPolicyRequest calls the generic UpdateAgentPolicy builder with application/json body -func NewUpdateAgentPolicyRequest(server string, agentPolicyId string, params *UpdateAgentPolicyParams, body UpdateAgentPolicyJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewUpdateAgentPolicyRequestWithBody(server, agentPolicyId, params, "application/json", bodyReader) -} - -// NewUpdateAgentPolicyRequestWithBody generates requests for UpdateAgentPolicy with any type of body -func NewUpdateAgentPolicyRequestWithBody(server string, agentPolicyId string, params *UpdateAgentPolicyParams, contentType string, body io.Reader) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "agentPolicyId", runtime.ParamLocationPath, agentPolicyId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/fleet/agent_policies/%s", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - if params != nil { - queryValues := queryURL.Query() - - if params.Format != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "format", runtime.ParamLocationQuery, *params.Format); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - } - - req, err := http.NewRequest("PUT", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewGetEnrollmentApiKeysRequest generates requests for GetEnrollmentApiKeys -func NewGetEnrollmentApiKeysRequest(server string, params *GetEnrollmentApiKeysParams) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/fleet/enrollment_api_keys") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - if params != nil { - queryValues := queryURL.Query() - - if params.Page != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "page", runtime.ParamLocationQuery, *params.Page); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.PerPage != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "perPage", runtime.ParamLocationQuery, *params.PerPage); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.Kuery != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "kuery", runtime.ParamLocationQuery, *params.Kuery); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewListPackagesRequest generates requests for ListPackages -func NewListPackagesRequest(server string, params *ListPackagesParams) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/fleet/epm/packages") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - if params != nil { - queryValues := queryURL.Query() - - if params.Category != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "category", runtime.ParamLocationQuery, *params.Category); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.Prerelease != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "prerelease", runtime.ParamLocationQuery, *params.Prerelease); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.Experimental != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "experimental", runtime.ParamLocationQuery, *params.Experimental); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.ExcludeInstallStatus != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "excludeInstallStatus", runtime.ParamLocationQuery, *params.ExcludeInstallStatus); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewInstallPackageByUploadRequestWithBody generates requests for InstallPackageByUpload with any type of body -func NewInstallPackageByUploadRequestWithBody(server string, params *InstallPackageByUploadParams, contentType string, body io.Reader) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/fleet/epm/packages") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - if params != nil { - queryValues := queryURL.Query() - - if params.IgnoreMappingUpdateErrors != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "ignoreMappingUpdateErrors", runtime.ParamLocationQuery, *params.IgnoreMappingUpdateErrors); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.SkipDataStreamRollover != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "skipDataStreamRollover", runtime.ParamLocationQuery, *params.SkipDataStreamRollover); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewDeletePackageRequest calls the generic DeletePackage builder with application/json body -func NewDeletePackageRequest(server string, pkgName string, pkgVersion string, params *DeletePackageParams, body DeletePackageJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewDeletePackageRequestWithBody(server, pkgName, pkgVersion, params, "application/json", bodyReader) -} - -// NewDeletePackageRequestWithBody generates requests for DeletePackage with any type of body -func NewDeletePackageRequestWithBody(server string, pkgName string, pkgVersion string, params *DeletePackageParams, contentType string, body io.Reader) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "pkgName", runtime.ParamLocationPath, pkgName) - if err != nil { - return nil, err - } - - var pathParam1 string - - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "pkgVersion", runtime.ParamLocationPath, pkgVersion) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/fleet/epm/packages/%s/%s", pathParam0, pathParam1) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - if params != nil { - queryValues := queryURL.Query() - - if params.Force != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "force", runtime.ParamLocationQuery, *params.Force); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - } - - req, err := http.NewRequest("DELETE", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewGetPackageRequest generates requests for GetPackage -func NewGetPackageRequest(server string, pkgName string, pkgVersion string, params *GetPackageParams) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "pkgName", runtime.ParamLocationPath, pkgName) - if err != nil { - return nil, err - } - - var pathParam1 string - - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "pkgVersion", runtime.ParamLocationPath, pkgVersion) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/fleet/epm/packages/%s/%s", pathParam0, pathParam1) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - if params != nil { - queryValues := queryURL.Query() - - if params.IgnoreUnverified != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "ignoreUnverified", runtime.ParamLocationQuery, *params.IgnoreUnverified); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.Prerelease != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "prerelease", runtime.ParamLocationQuery, *params.Prerelease); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.Full != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "full", runtime.ParamLocationQuery, *params.Full); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.WithMetadata != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "withMetadata", runtime.ParamLocationQuery, *params.WithMetadata); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewInstallPackageRequest calls the generic InstallPackage builder with application/json body -func NewInstallPackageRequest(server string, pkgName string, pkgVersion string, params *InstallPackageParams, body InstallPackageJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewInstallPackageRequestWithBody(server, pkgName, pkgVersion, params, "application/json", bodyReader) -} - -// NewInstallPackageRequestWithBody generates requests for InstallPackage with any type of body -func NewInstallPackageRequestWithBody(server string, pkgName string, pkgVersion string, params *InstallPackageParams, contentType string, body io.Reader) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "pkgName", runtime.ParamLocationPath, pkgName) - if err != nil { - return nil, err - } - - var pathParam1 string - - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "pkgVersion", runtime.ParamLocationPath, pkgVersion) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/fleet/epm/packages/%s/%s", pathParam0, pathParam1) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - if params != nil { - queryValues := queryURL.Query() - - if params.Prerelease != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "prerelease", runtime.ParamLocationQuery, *params.Prerelease); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.IgnoreMappingUpdateErrors != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "ignoreMappingUpdateErrors", runtime.ParamLocationQuery, *params.IgnoreMappingUpdateErrors); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.SkipDataStreamRollover != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "skipDataStreamRollover", runtime.ParamLocationQuery, *params.SkipDataStreamRollover); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewGetFleetServerHostsRequest generates requests for GetFleetServerHosts -func NewGetFleetServerHostsRequest(server string) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/fleet/fleet_server_hosts") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewCreateFleetServerHostRequest calls the generic CreateFleetServerHost builder with application/json body -func NewCreateFleetServerHostRequest(server string, body CreateFleetServerHostJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewCreateFleetServerHostRequestWithBody(server, "application/json", bodyReader) -} - -// NewCreateFleetServerHostRequestWithBody generates requests for CreateFleetServerHost with any type of body -func NewCreateFleetServerHostRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/fleet/fleet_server_hosts") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewDeleteFleetServerHostRequest generates requests for DeleteFleetServerHost -func NewDeleteFleetServerHostRequest(server string, itemId string) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "itemId", runtime.ParamLocationPath, itemId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/fleet/fleet_server_hosts/%s", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("DELETE", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewGetFleetServerHostRequest generates requests for GetFleetServerHost -func NewGetFleetServerHostRequest(server string, itemId string) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "itemId", runtime.ParamLocationPath, itemId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/fleet/fleet_server_hosts/%s", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewUpdateFleetServerHostRequest calls the generic UpdateFleetServerHost builder with application/json body -func NewUpdateFleetServerHostRequest(server string, itemId string, body UpdateFleetServerHostJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewUpdateFleetServerHostRequestWithBody(server, itemId, "application/json", bodyReader) -} - -// NewUpdateFleetServerHostRequestWithBody generates requests for UpdateFleetServerHost with any type of body -func NewUpdateFleetServerHostRequestWithBody(server string, itemId string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "itemId", runtime.ParamLocationPath, itemId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/fleet/fleet_server_hosts/%s", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("PUT", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewGetOutputsRequest generates requests for GetOutputs -func NewGetOutputsRequest(server string) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/fleet/outputs") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewCreateOutputRequest calls the generic CreateOutput builder with application/json body -func NewCreateOutputRequest(server string, body CreateOutputJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewCreateOutputRequestWithBody(server, "application/json", bodyReader) -} - -// NewCreateOutputRequestWithBody generates requests for CreateOutput with any type of body -func NewCreateOutputRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/fleet/outputs") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewDeleteOutputRequest generates requests for DeleteOutput -func NewDeleteOutputRequest(server string, outputId string) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "outputId", runtime.ParamLocationPath, outputId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/fleet/outputs/%s", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("DELETE", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewGetOutputRequest generates requests for GetOutput -func NewGetOutputRequest(server string, outputId string) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "outputId", runtime.ParamLocationPath, outputId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/fleet/outputs/%s", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewUpdateOutputRequest calls the generic UpdateOutput builder with application/json body -func NewUpdateOutputRequest(server string, outputId string, body UpdateOutputJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewUpdateOutputRequestWithBody(server, outputId, "application/json", bodyReader) -} - -// NewUpdateOutputRequestWithBody generates requests for UpdateOutput with any type of body -func NewUpdateOutputRequestWithBody(server string, outputId string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "outputId", runtime.ParamLocationPath, outputId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/fleet/outputs/%s", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("PUT", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewGetPackagePoliciesRequest generates requests for GetPackagePolicies -func NewGetPackagePoliciesRequest(server string, params *GetPackagePoliciesParams) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/fleet/package_policies") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - if params != nil { - queryValues := queryURL.Query() - - if params.Page != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "page", runtime.ParamLocationQuery, *params.Page); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.PerPage != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "perPage", runtime.ParamLocationQuery, *params.PerPage); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.SortField != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "sortField", runtime.ParamLocationQuery, *params.SortField); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.SortOrder != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "sortOrder", runtime.ParamLocationQuery, *params.SortOrder); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.ShowUpgradeable != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "showUpgradeable", runtime.ParamLocationQuery, *params.ShowUpgradeable); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.Kuery != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "kuery", runtime.ParamLocationQuery, *params.Kuery); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.Format != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "format", runtime.ParamLocationQuery, *params.Format); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.WithAgentCount != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "withAgentCount", runtime.ParamLocationQuery, *params.WithAgentCount); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewCreatePackagePolicyRequest calls the generic CreatePackagePolicy builder with application/json body -func NewCreatePackagePolicyRequest(server string, params *CreatePackagePolicyParams, body CreatePackagePolicyJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewCreatePackagePolicyRequestWithBody(server, params, "application/json", bodyReader) -} - -// NewCreatePackagePolicyRequestWithBody generates requests for CreatePackagePolicy with any type of body -func NewCreatePackagePolicyRequestWithBody(server string, params *CreatePackagePolicyParams, contentType string, body io.Reader) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/fleet/package_policies") - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - if params != nil { - queryValues := queryURL.Query() - - if params.Format != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "format", runtime.ParamLocationQuery, *params.Format); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewDeletePackagePolicyRequest generates requests for DeletePackagePolicy -func NewDeletePackagePolicyRequest(server string, packagePolicyId string, params *DeletePackagePolicyParams) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "packagePolicyId", runtime.ParamLocationPath, packagePolicyId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/fleet/package_policies/%s", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - if params != nil { - queryValues := queryURL.Query() - - if params.Force != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "force", runtime.ParamLocationQuery, *params.Force); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - } - - req, err := http.NewRequest("DELETE", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewGetPackagePolicyRequest generates requests for GetPackagePolicy -func NewGetPackagePolicyRequest(server string, packagePolicyId string, params *GetPackagePolicyParams) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "packagePolicyId", runtime.ParamLocationPath, packagePolicyId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/fleet/package_policies/%s", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - if params != nil { - queryValues := queryURL.Query() - - if params.Format != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "format", runtime.ParamLocationQuery, *params.Format); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewUpdatePackagePolicyRequest calls the generic UpdatePackagePolicy builder with application/json body -func NewUpdatePackagePolicyRequest(server string, packagePolicyId string, params *UpdatePackagePolicyParams, body UpdatePackagePolicyJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewUpdatePackagePolicyRequestWithBody(server, packagePolicyId, params, "application/json", bodyReader) -} - -// NewUpdatePackagePolicyRequestWithBody generates requests for UpdatePackagePolicy with any type of body -func NewUpdatePackagePolicyRequestWithBody(server string, packagePolicyId string, params *UpdatePackagePolicyParams, contentType string, body io.Reader) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "packagePolicyId", runtime.ParamLocationPath, packagePolicyId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/api/fleet/package_policies/%s", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - if params != nil { - queryValues := queryURL.Query() - - if params.Format != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "format", runtime.ParamLocationQuery, *params.Format); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - } - - req, err := http.NewRequest("PUT", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -func (c *Client) applyEditors(ctx context.Context, req *http.Request, additionalEditors []RequestEditorFn) error { - for _, r := range c.RequestEditors { - if err := r(ctx, req); err != nil { - return err - } - } - for _, r := range additionalEditors { - if err := r(ctx, req); err != nil { - return err - } - } - return nil -} - -// ClientWithResponses builds on ClientInterface to offer response payloads -type ClientWithResponses struct { - ClientInterface -} - -// NewClientWithResponses creates a new ClientWithResponses, which wraps -// Client with return type handling -func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error) { - client, err := NewClient(server, opts...) - if err != nil { - return nil, err - } - return &ClientWithResponses{client}, nil -} - -// WithBaseURL overrides the baseURL. -func WithBaseURL(baseURL string) ClientOption { - return func(c *Client) error { - newBaseURL, err := url.Parse(baseURL) - if err != nil { - return err - } - c.Server = newBaseURL.String() - return nil - } -} - -// ClientWithResponsesInterface is the interface specification for the client with responses above. -type ClientWithResponsesInterface interface { - // GetAgentPoliciesWithResponse request - GetAgentPoliciesWithResponse(ctx context.Context, params *GetAgentPoliciesParams, reqEditors ...RequestEditorFn) (*GetAgentPoliciesResponse, error) - - // CreateAgentPolicyWithBodyWithResponse request with any body - CreateAgentPolicyWithBodyWithResponse(ctx context.Context, params *CreateAgentPolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateAgentPolicyResponse, error) - - CreateAgentPolicyWithResponse(ctx context.Context, params *CreateAgentPolicyParams, body CreateAgentPolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateAgentPolicyResponse, error) - - // DeleteAgentPolicyWithBodyWithResponse request with any body - DeleteAgentPolicyWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DeleteAgentPolicyResponse, error) - - DeleteAgentPolicyWithResponse(ctx context.Context, body DeleteAgentPolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*DeleteAgentPolicyResponse, error) - - // GetAgentPolicyWithResponse request - GetAgentPolicyWithResponse(ctx context.Context, agentPolicyId string, params *GetAgentPolicyParams, reqEditors ...RequestEditorFn) (*GetAgentPolicyResponse, error) - - // UpdateAgentPolicyWithBodyWithResponse request with any body - UpdateAgentPolicyWithBodyWithResponse(ctx context.Context, agentPolicyId string, params *UpdateAgentPolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateAgentPolicyResponse, error) - - UpdateAgentPolicyWithResponse(ctx context.Context, agentPolicyId string, params *UpdateAgentPolicyParams, body UpdateAgentPolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateAgentPolicyResponse, error) - - // GetEnrollmentApiKeysWithResponse request - GetEnrollmentApiKeysWithResponse(ctx context.Context, params *GetEnrollmentApiKeysParams, reqEditors ...RequestEditorFn) (*GetEnrollmentApiKeysResponse, error) - - // ListPackagesWithResponse request - ListPackagesWithResponse(ctx context.Context, params *ListPackagesParams, reqEditors ...RequestEditorFn) (*ListPackagesResponse, error) - - // InstallPackageByUploadWithBodyWithResponse request with any body - InstallPackageByUploadWithBodyWithResponse(ctx context.Context, params *InstallPackageByUploadParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*InstallPackageByUploadResponse, error) - - // DeletePackageWithBodyWithResponse request with any body - DeletePackageWithBodyWithResponse(ctx context.Context, pkgName string, pkgVersion string, params *DeletePackageParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DeletePackageResponse, error) - - DeletePackageWithResponse(ctx context.Context, pkgName string, pkgVersion string, params *DeletePackageParams, body DeletePackageJSONRequestBody, reqEditors ...RequestEditorFn) (*DeletePackageResponse, error) - - // GetPackageWithResponse request - GetPackageWithResponse(ctx context.Context, pkgName string, pkgVersion string, params *GetPackageParams, reqEditors ...RequestEditorFn) (*GetPackageResponse, error) - - // InstallPackageWithBodyWithResponse request with any body - InstallPackageWithBodyWithResponse(ctx context.Context, pkgName string, pkgVersion string, params *InstallPackageParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*InstallPackageResponse, error) - - InstallPackageWithResponse(ctx context.Context, pkgName string, pkgVersion string, params *InstallPackageParams, body InstallPackageJSONRequestBody, reqEditors ...RequestEditorFn) (*InstallPackageResponse, error) - - // GetFleetServerHostsWithResponse request - GetFleetServerHostsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetFleetServerHostsResponse, error) - - // CreateFleetServerHostWithBodyWithResponse request with any body - CreateFleetServerHostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateFleetServerHostResponse, error) - - CreateFleetServerHostWithResponse(ctx context.Context, body CreateFleetServerHostJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateFleetServerHostResponse, error) - - // DeleteFleetServerHostWithResponse request - DeleteFleetServerHostWithResponse(ctx context.Context, itemId string, reqEditors ...RequestEditorFn) (*DeleteFleetServerHostResponse, error) - - // GetFleetServerHostWithResponse request - GetFleetServerHostWithResponse(ctx context.Context, itemId string, reqEditors ...RequestEditorFn) (*GetFleetServerHostResponse, error) - - // UpdateFleetServerHostWithBodyWithResponse request with any body - UpdateFleetServerHostWithBodyWithResponse(ctx context.Context, itemId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateFleetServerHostResponse, error) - - UpdateFleetServerHostWithResponse(ctx context.Context, itemId string, body UpdateFleetServerHostJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateFleetServerHostResponse, error) - - // GetOutputsWithResponse request - GetOutputsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetOutputsResponse, error) - - // CreateOutputWithBodyWithResponse request with any body - CreateOutputWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateOutputResponse, error) - - CreateOutputWithResponse(ctx context.Context, body CreateOutputJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateOutputResponse, error) - - // DeleteOutputWithResponse request - DeleteOutputWithResponse(ctx context.Context, outputId string, reqEditors ...RequestEditorFn) (*DeleteOutputResponse, error) - - // GetOutputWithResponse request - GetOutputWithResponse(ctx context.Context, outputId string, reqEditors ...RequestEditorFn) (*GetOutputResponse, error) - - // UpdateOutputWithBodyWithResponse request with any body - UpdateOutputWithBodyWithResponse(ctx context.Context, outputId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateOutputResponse, error) - - UpdateOutputWithResponse(ctx context.Context, outputId string, body UpdateOutputJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateOutputResponse, error) - - // GetPackagePoliciesWithResponse request - GetPackagePoliciesWithResponse(ctx context.Context, params *GetPackagePoliciesParams, reqEditors ...RequestEditorFn) (*GetPackagePoliciesResponse, error) - - // CreatePackagePolicyWithBodyWithResponse request with any body - CreatePackagePolicyWithBodyWithResponse(ctx context.Context, params *CreatePackagePolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreatePackagePolicyResponse, error) - - CreatePackagePolicyWithResponse(ctx context.Context, params *CreatePackagePolicyParams, body CreatePackagePolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*CreatePackagePolicyResponse, error) - - // DeletePackagePolicyWithResponse request - DeletePackagePolicyWithResponse(ctx context.Context, packagePolicyId string, params *DeletePackagePolicyParams, reqEditors ...RequestEditorFn) (*DeletePackagePolicyResponse, error) - - // GetPackagePolicyWithResponse request - GetPackagePolicyWithResponse(ctx context.Context, packagePolicyId string, params *GetPackagePolicyParams, reqEditors ...RequestEditorFn) (*GetPackagePolicyResponse, error) - - // UpdatePackagePolicyWithBodyWithResponse request with any body - UpdatePackagePolicyWithBodyWithResponse(ctx context.Context, packagePolicyId string, params *UpdatePackagePolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdatePackagePolicyResponse, error) - - UpdatePackagePolicyWithResponse(ctx context.Context, packagePolicyId string, params *UpdatePackagePolicyParams, body UpdatePackagePolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdatePackagePolicyResponse, error) -} - -type GetAgentPoliciesResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *struct { - Items []AgentPolicy `json:"items"` - Page float32 `json:"page"` - PerPage float32 `json:"perPage"` - Total float32 `json:"total"` - } - JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` - } -} - -// Status returns HTTPResponse.Status -func (r GetAgentPoliciesResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r GetAgentPoliciesResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type CreateAgentPolicyResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *struct { - Item AgentPolicy `json:"item"` - } - JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` - } -} - -// Status returns HTTPResponse.Status -func (r CreateAgentPolicyResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r CreateAgentPolicyResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type DeleteAgentPolicyResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *struct { - Id string `json:"id"` - Name string `json:"name"` - } - JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` - } -} - -// Status returns HTTPResponse.Status -func (r DeleteAgentPolicyResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r DeleteAgentPolicyResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type GetAgentPolicyResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *struct { - Item AgentPolicy `json:"item"` - } - JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` - } -} - -// Status returns HTTPResponse.Status -func (r GetAgentPolicyResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r GetAgentPolicyResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type UpdateAgentPolicyResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *struct { - Item AgentPolicy `json:"item"` - } - JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` - } -} - -// Status returns HTTPResponse.Status -func (r UpdateAgentPolicyResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r UpdateAgentPolicyResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type GetEnrollmentApiKeysResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *struct { - Items []EnrollmentApiKey `json:"items"` - // Deprecated: - List []struct { - // Active When false, the enrollment API key is revoked and cannot be used for enrolling Elastic Agents. - Active bool `json:"active"` - - // ApiKey The enrollment API key (token) used for enrolling Elastic Agents. - ApiKey string `json:"api_key"` - - // ApiKeyId The ID of the API key in the Security API. - ApiKeyId string `json:"api_key_id"` - CreatedAt string `json:"created_at"` - Id string `json:"id"` - - // Name The name of the enrollment API key. - Name *string `json:"name,omitempty"` - - // PolicyId The ID of the agent policy the Elastic Agent will be enrolled in. - PolicyId *string `json:"policy_id,omitempty"` - } `json:"list"` - Page float32 `json:"page"` - PerPage float32 `json:"perPage"` - Total float32 `json:"total"` - } - JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` - } -} - -// Status returns HTTPResponse.Status -func (r GetEnrollmentApiKeysResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r GetEnrollmentApiKeysResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type ListPackagesResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *struct { - Items []PackageListItem `json:"items"` - Response *[]ListPackages_200_Response_Item `json:"response,omitempty"` - } - JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` - } -} -type ListPackages_200_Response_Conditions_Elastic struct { - Capabilities *[]string `json:"capabilities,omitempty"` - Subscription *string `json:"subscription,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type ListPackages_200_Response_Conditions_Kibana struct { - Version *string `json:"version,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type ListPackages_200_Response_Conditions struct { - Elastic *ListPackages_200_Response_Conditions_Elastic `json:"elastic,omitempty"` - Kibana *ListPackages_200_Response_Conditions_Kibana `json:"kibana,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type ListPackages_200_Response_Discovery_Fields_Item struct { - Name string `json:"name"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type ListPackages_200_Response_Discovery struct { - Fields *[]ListPackages_200_Response_Discovery_Fields_Item `json:"fields,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type ListPackages_200_Response_Icons_Item struct { - DarkMode *bool `json:"dark_mode,omitempty"` - Path *string `json:"path,omitempty"` - Size *string `json:"size,omitempty"` - Src string `json:"src"` - Title *string `json:"title,omitempty"` - Type *string `json:"type,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type ListPackages200ResponseInstallationInfoAdditionalSpacesInstalledKibanaType string -type ListPackages_200_Response_InstallationInfo_AdditionalSpacesInstalledKibana_Item struct { - Id string `json:"id"` - OriginId *string `json:"originId,omitempty"` - Type ListPackages200ResponseInstallationInfoAdditionalSpacesInstalledKibanaType `json:"type"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type ListPackages_200_Response_InstallationInfo_ExperimentalDataStreamFeatures_Features struct { - DocValueOnlyNumeric *bool `json:"doc_value_only_numeric,omitempty"` - DocValueOnlyOther *bool `json:"doc_value_only_other,omitempty"` - SyntheticSource *bool `json:"synthetic_source,omitempty"` - Tsdb *bool `json:"tsdb,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type ListPackages_200_Response_InstallationInfo_ExperimentalDataStreamFeatures_Item struct { - DataStream string `json:"data_stream"` - Features ListPackages_200_Response_InstallationInfo_ExperimentalDataStreamFeatures_Features `json:"features"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type ListPackages200ResponseInstallationInfoInstallSource string -type ListPackages200ResponseInstallationInfoInstallStatus string -type ListPackages200ResponseInstallationInfoInstalledEsType string -type ListPackages_200_Response_InstallationInfo_InstalledEs_Item struct { - Deferred *bool `json:"deferred,omitempty"` - Id string `json:"id"` - Type ListPackages200ResponseInstallationInfoInstalledEsType `json:"type"` - Version *string `json:"version,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type ListPackages200ResponseInstallationInfoInstalledKibanaType string -type ListPackages_200_Response_InstallationInfo_InstalledKibana_Item struct { - Id string `json:"id"` - OriginId *string `json:"originId,omitempty"` - Type ListPackages200ResponseInstallationInfoInstalledKibanaType `json:"type"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type ListPackages_200_Response_InstallationInfo_LatestExecutedState struct { - Error *string `json:"error,omitempty"` - Name string `json:"name"` - StartedAt string `json:"started_at"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type ListPackages_200_Response_InstallationInfo_LatestInstallFailedAttempts_Error struct { - Message string `json:"message"` - Name string `json:"name"` - Stack *string `json:"stack,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type ListPackages_200_Response_InstallationInfo_LatestInstallFailedAttempts_Item struct { - CreatedAt string `json:"created_at"` - Error ListPackages_200_Response_InstallationInfo_LatestInstallFailedAttempts_Error `json:"error"` - TargetVersion string `json:"target_version"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type ListPackages200ResponseInstallationInfoVerificationStatus string -type ListPackages_200_Response_InstallationInfo struct { - AdditionalSpacesInstalledKibana *map[string][]ListPackages_200_Response_InstallationInfo_AdditionalSpacesInstalledKibana_Item `json:"additional_spaces_installed_kibana,omitempty"` - CreatedAt *string `json:"created_at,omitempty"` - ExperimentalDataStreamFeatures *[]ListPackages_200_Response_InstallationInfo_ExperimentalDataStreamFeatures_Item `json:"experimental_data_stream_features,omitempty"` - InstallFormatSchemaVersion *string `json:"install_format_schema_version,omitempty"` - InstallSource ListPackages200ResponseInstallationInfoInstallSource `json:"install_source"` - InstallStatus ListPackages200ResponseInstallationInfoInstallStatus `json:"install_status"` - InstalledEs []ListPackages_200_Response_InstallationInfo_InstalledEs_Item `json:"installed_es"` - InstalledKibana []ListPackages_200_Response_InstallationInfo_InstalledKibana_Item `json:"installed_kibana"` - InstalledKibanaSpaceId *string `json:"installed_kibana_space_id,omitempty"` - LatestExecutedState *ListPackages_200_Response_InstallationInfo_LatestExecutedState `json:"latest_executed_state,omitempty"` - LatestInstallFailedAttempts *[]ListPackages_200_Response_InstallationInfo_LatestInstallFailedAttempts_Item `json:"latest_install_failed_attempts,omitempty"` - Name string `json:"name"` - Namespaces *[]string `json:"namespaces,omitempty"` - Type string `json:"type"` - UpdatedAt *string `json:"updated_at,omitempty"` - VerificationKeyId *string `json:"verification_key_id"` - VerificationStatus ListPackages200ResponseInstallationInfoVerificationStatus `json:"verification_status"` - Version string `json:"version"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type ListPackages200ResponseOwnerType string -type ListPackages_200_Response_Owner struct { - Github *string `json:"github,omitempty"` - Type *ListPackages200ResponseOwnerType `json:"type,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type ListPackages200ResponseRelease string -type ListPackages_200_Response_Source struct { - License string `json:"license"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type ListPackages200ResponseType string -type ListPackages_200_Response_Item struct { - Categories *[]string `json:"categories,omitempty"` - Conditions *ListPackages_200_Response_Conditions `json:"conditions,omitempty"` - DataStreams *[]map[string]interface{} `json:"data_streams,omitempty"` - Description *string `json:"description,omitempty"` - Discovery *ListPackages_200_Response_Discovery `json:"discovery,omitempty"` - Download *string `json:"download,omitempty"` - FormatVersion *string `json:"format_version,omitempty"` - Icons *[]ListPackages_200_Response_Icons_Item `json:"icons,omitempty"` - Id string `json:"id"` - InstallationInfo *ListPackages_200_Response_InstallationInfo `json:"installationInfo,omitempty"` - Integration *string `json:"integration,omitempty"` - Internal *bool `json:"internal,omitempty"` - LatestVersion *string `json:"latestVersion,omitempty"` - Name string `json:"name"` - Owner *ListPackages_200_Response_Owner `json:"owner,omitempty"` - Path *string `json:"path,omitempty"` - PolicyTemplates *[]map[string]interface{} `json:"policy_templates,omitempty"` - Readme *string `json:"readme,omitempty"` - Release *ListPackages200ResponseRelease `json:"release,omitempty"` - SavedObject interface{} `json:"savedObject"` - SignaturePath *string `json:"signature_path,omitempty"` - Source *ListPackages_200_Response_Source `json:"source,omitempty"` - Status *string `json:"status,omitempty"` - Title string `json:"title"` - Type *ListPackages200ResponseType `json:"type,omitempty"` - Vars *[]map[string]interface{} `json:"vars,omitempty"` - Version string `json:"version"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// Status returns HTTPResponse.Status -func (r ListPackagesResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r ListPackagesResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type InstallPackageByUploadResponse struct { - Body []byte - HTTPResponse *http.Response -} - -// Status returns HTTPResponse.Status -func (r InstallPackageByUploadResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r InstallPackageByUploadResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type DeletePackageResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *struct { - Items []DeletePackage_200_Items_Item `json:"items"` - // Deprecated: - Response *[]DeletePackage_200_Response_Item `json:"response,omitempty"` - } - JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` - } -} -type DeletePackage200Items0 struct { - Id string `json:"id"` - OriginId *string `json:"originId,omitempty"` - Type DeletePackage200Items0Type `json:"type"` -} -type DeletePackage200Items0Type string -type DeletePackage200Items1 struct { - Deferred *bool `json:"deferred,omitempty"` - Id string `json:"id"` - Type DeletePackage200Items1Type `json:"type"` - Version *string `json:"version,omitempty"` -} -type DeletePackage200Items1Type string -type DeletePackage_200_Items_Item struct { - union json.RawMessage -} -type DeletePackage200Response0 struct { - Id string `json:"id"` - OriginId *string `json:"originId,omitempty"` - Type DeletePackage200Response0Type `json:"type"` -} -type DeletePackage200Response0Type string -type DeletePackage200Response1 struct { - Deferred *bool `json:"deferred,omitempty"` - Id string `json:"id"` - Type DeletePackage200Response1Type `json:"type"` - Version *string `json:"version,omitempty"` -} -type DeletePackage200Response1Type string -type DeletePackage_200_Response_Item struct { - union json.RawMessage -} - -// Status returns HTTPResponse.Status -func (r DeletePackageResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r DeletePackageResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type GetPackageResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *struct { - Item PackageInfo `json:"item"` - Metadata *struct { - HasPolicies bool `json:"has_policies"` - } `json:"metadata,omitempty"` - // Deprecated: - Response *GetPackage_200_Response `json:"response,omitempty"` - } - JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` - } -} -type GetPackage_200_Response_Conditions_Elastic struct { - Capabilities *[]string `json:"capabilities,omitempty"` - Subscription *string `json:"subscription,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type GetPackage_200_Response_Conditions_Kibana struct { - Version *string `json:"version,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type GetPackage_200_Response_Conditions struct { - Elastic *GetPackage_200_Response_Conditions_Elastic `json:"elastic,omitempty"` - Kibana *GetPackage_200_Response_Conditions_Kibana `json:"kibana,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type GetPackage_200_Response_Discovery_Fields_Item struct { - Name string `json:"name"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type GetPackage_200_Response_Discovery struct { - Fields *[]GetPackage_200_Response_Discovery_Fields_Item `json:"fields,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type GetPackage_200_Response_Icons_Item struct { - DarkMode *bool `json:"dark_mode,omitempty"` - Path *string `json:"path,omitempty"` - Size *string `json:"size,omitempty"` - Src string `json:"src"` - Title *string `json:"title,omitempty"` - Type *string `json:"type,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type GetPackage200ResponseInstallationInfoAdditionalSpacesInstalledKibanaType string -type GetPackage_200_Response_InstallationInfo_AdditionalSpacesInstalledKibana_Item struct { - Id string `json:"id"` - OriginId *string `json:"originId,omitempty"` - Type GetPackage200ResponseInstallationInfoAdditionalSpacesInstalledKibanaType `json:"type"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type GetPackage_200_Response_InstallationInfo_ExperimentalDataStreamFeatures_Features struct { - DocValueOnlyNumeric *bool `json:"doc_value_only_numeric,omitempty"` - DocValueOnlyOther *bool `json:"doc_value_only_other,omitempty"` - SyntheticSource *bool `json:"synthetic_source,omitempty"` - Tsdb *bool `json:"tsdb,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type GetPackage_200_Response_InstallationInfo_ExperimentalDataStreamFeatures_Item struct { - DataStream string `json:"data_stream"` - Features GetPackage_200_Response_InstallationInfo_ExperimentalDataStreamFeatures_Features `json:"features"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type GetPackage200ResponseInstallationInfoInstallSource string -type GetPackage200ResponseInstallationInfoInstallStatus string -type GetPackage200ResponseInstallationInfoInstalledEsType string -type GetPackage_200_Response_InstallationInfo_InstalledEs_Item struct { - Deferred *bool `json:"deferred,omitempty"` - Id string `json:"id"` - Type GetPackage200ResponseInstallationInfoInstalledEsType `json:"type"` - Version *string `json:"version,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type GetPackage200ResponseInstallationInfoInstalledKibanaType string -type GetPackage_200_Response_InstallationInfo_InstalledKibana_Item struct { - Id string `json:"id"` - OriginId *string `json:"originId,omitempty"` - Type GetPackage200ResponseInstallationInfoInstalledKibanaType `json:"type"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type GetPackage_200_Response_InstallationInfo_LatestExecutedState struct { - Error *string `json:"error,omitempty"` - Name string `json:"name"` - StartedAt string `json:"started_at"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type GetPackage_200_Response_InstallationInfo_LatestInstallFailedAttempts_Error struct { - Message string `json:"message"` - Name string `json:"name"` - Stack *string `json:"stack,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type GetPackage_200_Response_InstallationInfo_LatestInstallFailedAttempts_Item struct { - CreatedAt string `json:"created_at"` - Error GetPackage_200_Response_InstallationInfo_LatestInstallFailedAttempts_Error `json:"error"` - TargetVersion string `json:"target_version"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type GetPackage200ResponseInstallationInfoVerificationStatus string -type GetPackage_200_Response_InstallationInfo struct { - AdditionalSpacesInstalledKibana *map[string][]GetPackage_200_Response_InstallationInfo_AdditionalSpacesInstalledKibana_Item `json:"additional_spaces_installed_kibana,omitempty"` - CreatedAt *string `json:"created_at,omitempty"` - ExperimentalDataStreamFeatures *[]GetPackage_200_Response_InstallationInfo_ExperimentalDataStreamFeatures_Item `json:"experimental_data_stream_features,omitempty"` - InstallFormatSchemaVersion *string `json:"install_format_schema_version,omitempty"` - InstallSource GetPackage200ResponseInstallationInfoInstallSource `json:"install_source"` - InstallStatus GetPackage200ResponseInstallationInfoInstallStatus `json:"install_status"` - InstalledEs []GetPackage_200_Response_InstallationInfo_InstalledEs_Item `json:"installed_es"` - InstalledKibana []GetPackage_200_Response_InstallationInfo_InstalledKibana_Item `json:"installed_kibana"` - InstalledKibanaSpaceId *string `json:"installed_kibana_space_id,omitempty"` - LatestExecutedState *GetPackage_200_Response_InstallationInfo_LatestExecutedState `json:"latest_executed_state,omitempty"` - LatestInstallFailedAttempts *[]GetPackage_200_Response_InstallationInfo_LatestInstallFailedAttempts_Item `json:"latest_install_failed_attempts,omitempty"` - Name string `json:"name"` - Namespaces *[]string `json:"namespaces,omitempty"` - Type string `json:"type"` - UpdatedAt *string `json:"updated_at,omitempty"` - VerificationKeyId *string `json:"verification_key_id"` - VerificationStatus GetPackage200ResponseInstallationInfoVerificationStatus `json:"verification_status"` - Version string `json:"version"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type GetPackage200ResponseOwnerType string -type GetPackage_200_Response_Owner struct { - Github *string `json:"github,omitempty"` - Type *GetPackage200ResponseOwnerType `json:"type,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type GetPackage200ResponseRelease string -type GetPackage_200_Response_Source struct { - License string `json:"license"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type GetPackage200ResponseType string -type GetPackage_200_Response struct { - Agent *struct { - Privileges *struct { - Root *bool `json:"root,omitempty"` - } `json:"privileges,omitempty"` - } `json:"agent,omitempty"` - AssetTags *[]struct { - AssetIds *[]string `json:"asset_ids,omitempty"` - AssetTypes *[]string `json:"asset_types,omitempty"` - Text string `json:"text"` - } `json:"asset_tags,omitempty"` - Assets map[string]interface{} `json:"assets"` - Categories *[]string `json:"categories,omitempty"` - Conditions *GetPackage_200_Response_Conditions `json:"conditions,omitempty"` - DataStreams *[]map[string]interface{} `json:"data_streams,omitempty"` - Description *string `json:"description,omitempty"` - Discovery *GetPackage_200_Response_Discovery `json:"discovery,omitempty"` - Download *string `json:"download,omitempty"` - Elasticsearch *map[string]interface{} `json:"elasticsearch,omitempty"` - FormatVersion *string `json:"format_version,omitempty"` - Icons *[]GetPackage_200_Response_Icons_Item `json:"icons,omitempty"` - InstallationInfo *GetPackage_200_Response_InstallationInfo `json:"installationInfo,omitempty"` - Internal *bool `json:"internal,omitempty"` - KeepPoliciesUpToDate *bool `json:"keepPoliciesUpToDate,omitempty"` - LatestVersion *string `json:"latestVersion,omitempty"` - License *string `json:"license,omitempty"` - LicensePath *string `json:"licensePath,omitempty"` - Name string `json:"name"` - Notice *string `json:"notice,omitempty"` - Owner *GetPackage_200_Response_Owner `json:"owner,omitempty"` - Path *string `json:"path,omitempty"` - PolicyTemplates *[]map[string]interface{} `json:"policy_templates,omitempty"` - Readme *string `json:"readme,omitempty"` - Release *GetPackage200ResponseRelease `json:"release,omitempty"` - SavedObject interface{} `json:"savedObject"` - Screenshots *[]struct { - DarkMode *bool `json:"dark_mode,omitempty"` - Path *string `json:"path,omitempty"` - Size *string `json:"size,omitempty"` - Src string `json:"src"` - Title *string `json:"title,omitempty"` - Type *string `json:"type,omitempty"` - } `json:"screenshots,omitempty"` - SignaturePath *string `json:"signature_path,omitempty"` - Source *GetPackage_200_Response_Source `json:"source,omitempty"` - Status *string `json:"status,omitempty"` - Title string `json:"title"` - Type *GetPackage200ResponseType `json:"type,omitempty"` - Vars *[]map[string]interface{} `json:"vars,omitempty"` - Version string `json:"version"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// Status returns HTTPResponse.Status -func (r GetPackageResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r GetPackageResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type InstallPackageResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *struct { - Meta struct { - InstallSource string `json:"install_source"` - } `json:"_meta"` - Items []InstallPackage_200_Items_Item `json:"items"` - // Deprecated: - Response *[]InstallPackage_200_Response_Item `json:"response,omitempty"` - } - JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` - } -} -type InstallPackage200Items0 struct { - Id string `json:"id"` - OriginId *string `json:"originId,omitempty"` - Type InstallPackage200Items0Type `json:"type"` -} -type InstallPackage200Items0Type string -type InstallPackage200Items1 struct { - Deferred *bool `json:"deferred,omitempty"` - Id string `json:"id"` - Type InstallPackage200Items1Type `json:"type"` - Version *string `json:"version,omitempty"` -} -type InstallPackage200Items1Type string -type InstallPackage_200_Items_Item struct { - union json.RawMessage -} -type InstallPackage200Response0 struct { - Id string `json:"id"` - OriginId *string `json:"originId,omitempty"` - Type InstallPackage200Response0Type `json:"type"` -} -type InstallPackage200Response0Type string -type InstallPackage200Response1 struct { - Deferred *bool `json:"deferred,omitempty"` - Id string `json:"id"` - Type InstallPackage200Response1Type `json:"type"` - Version *string `json:"version,omitempty"` -} -type InstallPackage200Response1Type string -type InstallPackage_200_Response_Item struct { - union json.RawMessage -} - -// Status returns HTTPResponse.Status -func (r InstallPackageResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r InstallPackageResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type GetFleetServerHostsResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *struct { - Items []ServerHost `json:"items"` - Page float32 `json:"page"` - PerPage float32 `json:"perPage"` - Total float32 `json:"total"` - } - JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` - } -} - -// Status returns HTTPResponse.Status -func (r GetFleetServerHostsResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r GetFleetServerHostsResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type CreateFleetServerHostResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *struct { - Item ServerHost `json:"item"` - } - JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` - } -} - -// Status returns HTTPResponse.Status -func (r CreateFleetServerHostResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r CreateFleetServerHostResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type DeleteFleetServerHostResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *struct { - Id string `json:"id"` - } - JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` - } -} - -// Status returns HTTPResponse.Status -func (r DeleteFleetServerHostResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r DeleteFleetServerHostResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type GetFleetServerHostResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *struct { - Item ServerHost `json:"item"` - } - JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` - } -} - -// Status returns HTTPResponse.Status -func (r GetFleetServerHostResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r GetFleetServerHostResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type UpdateFleetServerHostResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *struct { - Item ServerHost `json:"item"` - } - JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` - } -} - -// Status returns HTTPResponse.Status -func (r UpdateFleetServerHostResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r UpdateFleetServerHostResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type GetOutputsResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *struct { - Items []OutputUnion `json:"items"` - Page float32 `json:"page"` - PerPage float32 `json:"perPage"` - Total float32 `json:"total"` - } - JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` - } -} - -// Status returns HTTPResponse.Status -func (r GetOutputsResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r GetOutputsResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type CreateOutputResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *struct { - Item OutputUnion `json:"item"` - } - JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` - } -} - -// Status returns HTTPResponse.Status -func (r CreateOutputResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r CreateOutputResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type DeleteOutputResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *struct { - Id string `json:"id"` - } - JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` - } - JSON404 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` - } -} - -// Status returns HTTPResponse.Status -func (r DeleteOutputResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r DeleteOutputResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type GetOutputResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *struct { - Item OutputUnion `json:"item"` - } - JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` - } -} - -// Status returns HTTPResponse.Status -func (r GetOutputResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r GetOutputResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type UpdateOutputResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *struct { - Item OutputUnion `json:"item"` - } - JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` - } -} - -// Status returns HTTPResponse.Status -func (r UpdateOutputResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r UpdateOutputResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type GetPackagePoliciesResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *struct { - Items []PackagePolicy `json:"items"` - Page float32 `json:"page"` - PerPage float32 `json:"perPage"` - Total float32 `json:"total"` - } - JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` - } -} - -// Status returns HTTPResponse.Status -func (r GetPackagePoliciesResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r GetPackagePoliciesResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type CreatePackagePolicyResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *struct { - Item PackagePolicy `json:"item"` - } - JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` - } - JSON409 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` - } -} - -// Status returns HTTPResponse.Status -func (r CreatePackagePolicyResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r CreatePackagePolicyResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type DeletePackagePolicyResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *struct { - Id string `json:"id"` - } - JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` - } -} - -// Status returns HTTPResponse.Status -func (r DeletePackagePolicyResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r DeletePackagePolicyResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type GetPackagePolicyResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *struct { - Item PackagePolicy `json:"item"` - } - JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` - } - JSON404 *struct { - Message string `json:"message"` - } -} - -// Status returns HTTPResponse.Status -func (r GetPackagePolicyResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r GetPackagePolicyResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type UpdatePackagePolicyResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *struct { - Item PackagePolicy `json:"item"` - } - JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` - } - JSON403 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` - } -} - -// Status returns HTTPResponse.Status -func (r UpdatePackagePolicyResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r UpdatePackagePolicyResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -// GetAgentPoliciesWithResponse request returning *GetAgentPoliciesResponse -func (c *ClientWithResponses) GetAgentPoliciesWithResponse(ctx context.Context, params *GetAgentPoliciesParams, reqEditors ...RequestEditorFn) (*GetAgentPoliciesResponse, error) { - rsp, err := c.GetAgentPolicies(ctx, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetAgentPoliciesResponse(rsp) -} - -// CreateAgentPolicyWithBodyWithResponse request with arbitrary body returning *CreateAgentPolicyResponse -func (c *ClientWithResponses) CreateAgentPolicyWithBodyWithResponse(ctx context.Context, params *CreateAgentPolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateAgentPolicyResponse, error) { - rsp, err := c.CreateAgentPolicyWithBody(ctx, params, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseCreateAgentPolicyResponse(rsp) -} - -func (c *ClientWithResponses) CreateAgentPolicyWithResponse(ctx context.Context, params *CreateAgentPolicyParams, body CreateAgentPolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateAgentPolicyResponse, error) { - rsp, err := c.CreateAgentPolicy(ctx, params, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseCreateAgentPolicyResponse(rsp) -} - -// DeleteAgentPolicyWithBodyWithResponse request with arbitrary body returning *DeleteAgentPolicyResponse -func (c *ClientWithResponses) DeleteAgentPolicyWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DeleteAgentPolicyResponse, error) { - rsp, err := c.DeleteAgentPolicyWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseDeleteAgentPolicyResponse(rsp) -} - -func (c *ClientWithResponses) DeleteAgentPolicyWithResponse(ctx context.Context, body DeleteAgentPolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*DeleteAgentPolicyResponse, error) { - rsp, err := c.DeleteAgentPolicy(ctx, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseDeleteAgentPolicyResponse(rsp) -} - -// GetAgentPolicyWithResponse request returning *GetAgentPolicyResponse -func (c *ClientWithResponses) GetAgentPolicyWithResponse(ctx context.Context, agentPolicyId string, params *GetAgentPolicyParams, reqEditors ...RequestEditorFn) (*GetAgentPolicyResponse, error) { - rsp, err := c.GetAgentPolicy(ctx, agentPolicyId, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetAgentPolicyResponse(rsp) -} - -// UpdateAgentPolicyWithBodyWithResponse request with arbitrary body returning *UpdateAgentPolicyResponse -func (c *ClientWithResponses) UpdateAgentPolicyWithBodyWithResponse(ctx context.Context, agentPolicyId string, params *UpdateAgentPolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateAgentPolicyResponse, error) { - rsp, err := c.UpdateAgentPolicyWithBody(ctx, agentPolicyId, params, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseUpdateAgentPolicyResponse(rsp) -} - -func (c *ClientWithResponses) UpdateAgentPolicyWithResponse(ctx context.Context, agentPolicyId string, params *UpdateAgentPolicyParams, body UpdateAgentPolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateAgentPolicyResponse, error) { - rsp, err := c.UpdateAgentPolicy(ctx, agentPolicyId, params, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseUpdateAgentPolicyResponse(rsp) -} - -// GetEnrollmentApiKeysWithResponse request returning *GetEnrollmentApiKeysResponse -func (c *ClientWithResponses) GetEnrollmentApiKeysWithResponse(ctx context.Context, params *GetEnrollmentApiKeysParams, reqEditors ...RequestEditorFn) (*GetEnrollmentApiKeysResponse, error) { - rsp, err := c.GetEnrollmentApiKeys(ctx, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetEnrollmentApiKeysResponse(rsp) -} - -// ListPackagesWithResponse request returning *ListPackagesResponse -func (c *ClientWithResponses) ListPackagesWithResponse(ctx context.Context, params *ListPackagesParams, reqEditors ...RequestEditorFn) (*ListPackagesResponse, error) { - rsp, err := c.ListPackages(ctx, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseListPackagesResponse(rsp) -} - -// InstallPackageByUploadWithBodyWithResponse request with arbitrary body returning *InstallPackageByUploadResponse -func (c *ClientWithResponses) InstallPackageByUploadWithBodyWithResponse(ctx context.Context, params *InstallPackageByUploadParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*InstallPackageByUploadResponse, error) { - rsp, err := c.InstallPackageByUploadWithBody(ctx, params, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseInstallPackageByUploadResponse(rsp) -} - -// DeletePackageWithBodyWithResponse request with arbitrary body returning *DeletePackageResponse -func (c *ClientWithResponses) DeletePackageWithBodyWithResponse(ctx context.Context, pkgName string, pkgVersion string, params *DeletePackageParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DeletePackageResponse, error) { - rsp, err := c.DeletePackageWithBody(ctx, pkgName, pkgVersion, params, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseDeletePackageResponse(rsp) -} - -func (c *ClientWithResponses) DeletePackageWithResponse(ctx context.Context, pkgName string, pkgVersion string, params *DeletePackageParams, body DeletePackageJSONRequestBody, reqEditors ...RequestEditorFn) (*DeletePackageResponse, error) { - rsp, err := c.DeletePackage(ctx, pkgName, pkgVersion, params, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseDeletePackageResponse(rsp) -} - -// GetPackageWithResponse request returning *GetPackageResponse -func (c *ClientWithResponses) GetPackageWithResponse(ctx context.Context, pkgName string, pkgVersion string, params *GetPackageParams, reqEditors ...RequestEditorFn) (*GetPackageResponse, error) { - rsp, err := c.GetPackage(ctx, pkgName, pkgVersion, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetPackageResponse(rsp) -} - -// InstallPackageWithBodyWithResponse request with arbitrary body returning *InstallPackageResponse -func (c *ClientWithResponses) InstallPackageWithBodyWithResponse(ctx context.Context, pkgName string, pkgVersion string, params *InstallPackageParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*InstallPackageResponse, error) { - rsp, err := c.InstallPackageWithBody(ctx, pkgName, pkgVersion, params, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseInstallPackageResponse(rsp) -} - -func (c *ClientWithResponses) InstallPackageWithResponse(ctx context.Context, pkgName string, pkgVersion string, params *InstallPackageParams, body InstallPackageJSONRequestBody, reqEditors ...RequestEditorFn) (*InstallPackageResponse, error) { - rsp, err := c.InstallPackage(ctx, pkgName, pkgVersion, params, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseInstallPackageResponse(rsp) -} - -// GetFleetServerHostsWithResponse request returning *GetFleetServerHostsResponse -func (c *ClientWithResponses) GetFleetServerHostsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetFleetServerHostsResponse, error) { - rsp, err := c.GetFleetServerHosts(ctx, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetFleetServerHostsResponse(rsp) -} - -// CreateFleetServerHostWithBodyWithResponse request with arbitrary body returning *CreateFleetServerHostResponse -func (c *ClientWithResponses) CreateFleetServerHostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateFleetServerHostResponse, error) { - rsp, err := c.CreateFleetServerHostWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseCreateFleetServerHostResponse(rsp) -} - -func (c *ClientWithResponses) CreateFleetServerHostWithResponse(ctx context.Context, body CreateFleetServerHostJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateFleetServerHostResponse, error) { - rsp, err := c.CreateFleetServerHost(ctx, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseCreateFleetServerHostResponse(rsp) -} - -// DeleteFleetServerHostWithResponse request returning *DeleteFleetServerHostResponse -func (c *ClientWithResponses) DeleteFleetServerHostWithResponse(ctx context.Context, itemId string, reqEditors ...RequestEditorFn) (*DeleteFleetServerHostResponse, error) { - rsp, err := c.DeleteFleetServerHost(ctx, itemId, reqEditors...) - if err != nil { - return nil, err - } - return ParseDeleteFleetServerHostResponse(rsp) -} - -// GetFleetServerHostWithResponse request returning *GetFleetServerHostResponse -func (c *ClientWithResponses) GetFleetServerHostWithResponse(ctx context.Context, itemId string, reqEditors ...RequestEditorFn) (*GetFleetServerHostResponse, error) { - rsp, err := c.GetFleetServerHost(ctx, itemId, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetFleetServerHostResponse(rsp) -} - -// UpdateFleetServerHostWithBodyWithResponse request with arbitrary body returning *UpdateFleetServerHostResponse -func (c *ClientWithResponses) UpdateFleetServerHostWithBodyWithResponse(ctx context.Context, itemId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateFleetServerHostResponse, error) { - rsp, err := c.UpdateFleetServerHostWithBody(ctx, itemId, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseUpdateFleetServerHostResponse(rsp) -} - -func (c *ClientWithResponses) UpdateFleetServerHostWithResponse(ctx context.Context, itemId string, body UpdateFleetServerHostJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateFleetServerHostResponse, error) { - rsp, err := c.UpdateFleetServerHost(ctx, itemId, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseUpdateFleetServerHostResponse(rsp) -} - -// GetOutputsWithResponse request returning *GetOutputsResponse -func (c *ClientWithResponses) GetOutputsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetOutputsResponse, error) { - rsp, err := c.GetOutputs(ctx, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetOutputsResponse(rsp) -} - -// CreateOutputWithBodyWithResponse request with arbitrary body returning *CreateOutputResponse -func (c *ClientWithResponses) CreateOutputWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateOutputResponse, error) { - rsp, err := c.CreateOutputWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseCreateOutputResponse(rsp) -} - -func (c *ClientWithResponses) CreateOutputWithResponse(ctx context.Context, body CreateOutputJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateOutputResponse, error) { - rsp, err := c.CreateOutput(ctx, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseCreateOutputResponse(rsp) -} - -// DeleteOutputWithResponse request returning *DeleteOutputResponse -func (c *ClientWithResponses) DeleteOutputWithResponse(ctx context.Context, outputId string, reqEditors ...RequestEditorFn) (*DeleteOutputResponse, error) { - rsp, err := c.DeleteOutput(ctx, outputId, reqEditors...) - if err != nil { - return nil, err - } - return ParseDeleteOutputResponse(rsp) -} - -// GetOutputWithResponse request returning *GetOutputResponse -func (c *ClientWithResponses) GetOutputWithResponse(ctx context.Context, outputId string, reqEditors ...RequestEditorFn) (*GetOutputResponse, error) { - rsp, err := c.GetOutput(ctx, outputId, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetOutputResponse(rsp) -} - -// UpdateOutputWithBodyWithResponse request with arbitrary body returning *UpdateOutputResponse -func (c *ClientWithResponses) UpdateOutputWithBodyWithResponse(ctx context.Context, outputId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateOutputResponse, error) { - rsp, err := c.UpdateOutputWithBody(ctx, outputId, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseUpdateOutputResponse(rsp) -} - -func (c *ClientWithResponses) UpdateOutputWithResponse(ctx context.Context, outputId string, body UpdateOutputJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateOutputResponse, error) { - rsp, err := c.UpdateOutput(ctx, outputId, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseUpdateOutputResponse(rsp) -} - -// GetPackagePoliciesWithResponse request returning *GetPackagePoliciesResponse -func (c *ClientWithResponses) GetPackagePoliciesWithResponse(ctx context.Context, params *GetPackagePoliciesParams, reqEditors ...RequestEditorFn) (*GetPackagePoliciesResponse, error) { - rsp, err := c.GetPackagePolicies(ctx, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetPackagePoliciesResponse(rsp) -} - -// CreatePackagePolicyWithBodyWithResponse request with arbitrary body returning *CreatePackagePolicyResponse -func (c *ClientWithResponses) CreatePackagePolicyWithBodyWithResponse(ctx context.Context, params *CreatePackagePolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreatePackagePolicyResponse, error) { - rsp, err := c.CreatePackagePolicyWithBody(ctx, params, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseCreatePackagePolicyResponse(rsp) -} - -func (c *ClientWithResponses) CreatePackagePolicyWithResponse(ctx context.Context, params *CreatePackagePolicyParams, body CreatePackagePolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*CreatePackagePolicyResponse, error) { - rsp, err := c.CreatePackagePolicy(ctx, params, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseCreatePackagePolicyResponse(rsp) -} - -// DeletePackagePolicyWithResponse request returning *DeletePackagePolicyResponse -func (c *ClientWithResponses) DeletePackagePolicyWithResponse(ctx context.Context, packagePolicyId string, params *DeletePackagePolicyParams, reqEditors ...RequestEditorFn) (*DeletePackagePolicyResponse, error) { - rsp, err := c.DeletePackagePolicy(ctx, packagePolicyId, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseDeletePackagePolicyResponse(rsp) -} - -// GetPackagePolicyWithResponse request returning *GetPackagePolicyResponse -func (c *ClientWithResponses) GetPackagePolicyWithResponse(ctx context.Context, packagePolicyId string, params *GetPackagePolicyParams, reqEditors ...RequestEditorFn) (*GetPackagePolicyResponse, error) { - rsp, err := c.GetPackagePolicy(ctx, packagePolicyId, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetPackagePolicyResponse(rsp) -} - -// UpdatePackagePolicyWithBodyWithResponse request with arbitrary body returning *UpdatePackagePolicyResponse -func (c *ClientWithResponses) UpdatePackagePolicyWithBodyWithResponse(ctx context.Context, packagePolicyId string, params *UpdatePackagePolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdatePackagePolicyResponse, error) { - rsp, err := c.UpdatePackagePolicyWithBody(ctx, packagePolicyId, params, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseUpdatePackagePolicyResponse(rsp) -} - -func (c *ClientWithResponses) UpdatePackagePolicyWithResponse(ctx context.Context, packagePolicyId string, params *UpdatePackagePolicyParams, body UpdatePackagePolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdatePackagePolicyResponse, error) { - rsp, err := c.UpdatePackagePolicy(ctx, packagePolicyId, params, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseUpdatePackagePolicyResponse(rsp) -} - -// ParseGetAgentPoliciesResponse parses an HTTP response from a GetAgentPoliciesWithResponse call -func ParseGetAgentPoliciesResponse(rsp *http.Response) (*GetAgentPoliciesResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &GetAgentPoliciesResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest struct { - Items []AgentPolicy `json:"items"` - Page float32 `json:"page"` - PerPage float32 `json:"perPage"` - Total float32 `json:"total"` - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON400 = &dest - - } - - return response, nil -} - -// ParseCreateAgentPolicyResponse parses an HTTP response from a CreateAgentPolicyWithResponse call -func ParseCreateAgentPolicyResponse(rsp *http.Response) (*CreateAgentPolicyResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &CreateAgentPolicyResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest struct { - Item AgentPolicy `json:"item"` - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON400 = &dest - - } - - return response, nil -} - -// ParseDeleteAgentPolicyResponse parses an HTTP response from a DeleteAgentPolicyWithResponse call -func ParseDeleteAgentPolicyResponse(rsp *http.Response) (*DeleteAgentPolicyResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &DeleteAgentPolicyResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest struct { - Id string `json:"id"` - Name string `json:"name"` - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON400 = &dest - - } - - return response, nil -} - -// ParseGetAgentPolicyResponse parses an HTTP response from a GetAgentPolicyWithResponse call -func ParseGetAgentPolicyResponse(rsp *http.Response) (*GetAgentPolicyResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &GetAgentPolicyResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest struct { - Item AgentPolicy `json:"item"` - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON400 = &dest - - } - - return response, nil -} - -// ParseUpdateAgentPolicyResponse parses an HTTP response from a UpdateAgentPolicyWithResponse call -func ParseUpdateAgentPolicyResponse(rsp *http.Response) (*UpdateAgentPolicyResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &UpdateAgentPolicyResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest struct { - Item AgentPolicy `json:"item"` - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON400 = &dest - - } - - return response, nil -} - -// ParseGetEnrollmentApiKeysResponse parses an HTTP response from a GetEnrollmentApiKeysWithResponse call -func ParseGetEnrollmentApiKeysResponse(rsp *http.Response) (*GetEnrollmentApiKeysResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &GetEnrollmentApiKeysResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest struct { - Items []EnrollmentApiKey `json:"items"` - // Deprecated: - List []struct { - // Active When false, the enrollment API key is revoked and cannot be used for enrolling Elastic Agents. - Active bool `json:"active"` - - // ApiKey The enrollment API key (token) used for enrolling Elastic Agents. - ApiKey string `json:"api_key"` - - // ApiKeyId The ID of the API key in the Security API. - ApiKeyId string `json:"api_key_id"` - CreatedAt string `json:"created_at"` - Id string `json:"id"` - - // Name The name of the enrollment API key. - Name *string `json:"name,omitempty"` - - // PolicyId The ID of the agent policy the Elastic Agent will be enrolled in. - PolicyId *string `json:"policy_id,omitempty"` - } `json:"list"` - Page float32 `json:"page"` - PerPage float32 `json:"perPage"` - Total float32 `json:"total"` - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON400 = &dest - - } - - return response, nil -} - -// ParseListPackagesResponse parses an HTTP response from a ListPackagesWithResponse call -func ParseListPackagesResponse(rsp *http.Response) (*ListPackagesResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &ListPackagesResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest struct { - Items []PackageListItem `json:"items"` - Response *[]ListPackages_200_Response_Item `json:"response,omitempty"` - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON400 = &dest - - } - - return response, nil -} - -// ParseInstallPackageByUploadResponse parses an HTTP response from a InstallPackageByUploadWithResponse call -func ParseInstallPackageByUploadResponse(rsp *http.Response) (*InstallPackageByUploadResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &InstallPackageByUploadResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - return response, nil -} - -// ParseDeletePackageResponse parses an HTTP response from a DeletePackageWithResponse call -func ParseDeletePackageResponse(rsp *http.Response) (*DeletePackageResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &DeletePackageResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest struct { - Items []DeletePackage_200_Items_Item `json:"items"` - // Deprecated: - Response *[]DeletePackage_200_Response_Item `json:"response,omitempty"` - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON400 = &dest - - } - - return response, nil -} - -// ParseGetPackageResponse parses an HTTP response from a GetPackageWithResponse call -func ParseGetPackageResponse(rsp *http.Response) (*GetPackageResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &GetPackageResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest struct { - Item PackageInfo `json:"item"` - Metadata *struct { - HasPolicies bool `json:"has_policies"` - } `json:"metadata,omitempty"` - // Deprecated: - Response *GetPackage_200_Response `json:"response,omitempty"` - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON400 = &dest - - } - - return response, nil -} - -// ParseInstallPackageResponse parses an HTTP response from a InstallPackageWithResponse call -func ParseInstallPackageResponse(rsp *http.Response) (*InstallPackageResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &InstallPackageResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest struct { - Meta struct { - InstallSource string `json:"install_source"` - } `json:"_meta"` - Items []InstallPackage_200_Items_Item `json:"items"` - // Deprecated: - Response *[]InstallPackage_200_Response_Item `json:"response,omitempty"` - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON400 = &dest - - } - - return response, nil -} - -// ParseGetFleetServerHostsResponse parses an HTTP response from a GetFleetServerHostsWithResponse call -func ParseGetFleetServerHostsResponse(rsp *http.Response) (*GetFleetServerHostsResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &GetFleetServerHostsResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest struct { - Items []ServerHost `json:"items"` - Page float32 `json:"page"` - PerPage float32 `json:"perPage"` - Total float32 `json:"total"` - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON400 = &dest - - } - - return response, nil -} - -// ParseCreateFleetServerHostResponse parses an HTTP response from a CreateFleetServerHostWithResponse call -func ParseCreateFleetServerHostResponse(rsp *http.Response) (*CreateFleetServerHostResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &CreateFleetServerHostResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest struct { - Item ServerHost `json:"item"` - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON400 = &dest - - } - - return response, nil -} - -// ParseDeleteFleetServerHostResponse parses an HTTP response from a DeleteFleetServerHostWithResponse call -func ParseDeleteFleetServerHostResponse(rsp *http.Response) (*DeleteFleetServerHostResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &DeleteFleetServerHostResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest struct { - Id string `json:"id"` - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON400 = &dest - - } - - return response, nil -} - -// ParseGetFleetServerHostResponse parses an HTTP response from a GetFleetServerHostWithResponse call -func ParseGetFleetServerHostResponse(rsp *http.Response) (*GetFleetServerHostResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &GetFleetServerHostResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest struct { - Item ServerHost `json:"item"` - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON400 = &dest - - } - - return response, nil -} - -// ParseUpdateFleetServerHostResponse parses an HTTP response from a UpdateFleetServerHostWithResponse call -func ParseUpdateFleetServerHostResponse(rsp *http.Response) (*UpdateFleetServerHostResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &UpdateFleetServerHostResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest struct { - Item ServerHost `json:"item"` - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON400 = &dest - - } - - return response, nil -} - -// ParseGetOutputsResponse parses an HTTP response from a GetOutputsWithResponse call -func ParseGetOutputsResponse(rsp *http.Response) (*GetOutputsResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &GetOutputsResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest struct { - Items []OutputUnion `json:"items"` - Page float32 `json:"page"` - PerPage float32 `json:"perPage"` - Total float32 `json:"total"` - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON400 = &dest - - } - - return response, nil -} - -// ParseCreateOutputResponse parses an HTTP response from a CreateOutputWithResponse call -func ParseCreateOutputResponse(rsp *http.Response) (*CreateOutputResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &CreateOutputResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest struct { - Item OutputUnion `json:"item"` - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON400 = &dest - - } - - return response, nil -} - -// ParseDeleteOutputResponse parses an HTTP response from a DeleteOutputWithResponse call -func ParseDeleteOutputResponse(rsp *http.Response) (*DeleteOutputResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &DeleteOutputResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest struct { - Id string `json:"id"` - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON400 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: - var dest struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON404 = &dest - - } - - return response, nil -} - -// ParseGetOutputResponse parses an HTTP response from a GetOutputWithResponse call -func ParseGetOutputResponse(rsp *http.Response) (*GetOutputResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &GetOutputResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest struct { - Item OutputUnion `json:"item"` - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON400 = &dest - - } - - return response, nil -} - -// ParseUpdateOutputResponse parses an HTTP response from a UpdateOutputWithResponse call -func ParseUpdateOutputResponse(rsp *http.Response) (*UpdateOutputResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &UpdateOutputResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest struct { - Item OutputUnion `json:"item"` - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON400 = &dest - - } - - return response, nil -} - -// ParseGetPackagePoliciesResponse parses an HTTP response from a GetPackagePoliciesWithResponse call -func ParseGetPackagePoliciesResponse(rsp *http.Response) (*GetPackagePoliciesResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &GetPackagePoliciesResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest struct { - Items []PackagePolicy `json:"items"` - Page float32 `json:"page"` - PerPage float32 `json:"perPage"` - Total float32 `json:"total"` - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON400 = &dest - - } - - return response, nil -} - -// ParseCreatePackagePolicyResponse parses an HTTP response from a CreatePackagePolicyWithResponse call -func ParseCreatePackagePolicyResponse(rsp *http.Response) (*CreatePackagePolicyResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &CreatePackagePolicyResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest struct { - Item PackagePolicy `json:"item"` - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON400 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: - var dest struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON409 = &dest - - } - - return response, nil -} - -// ParseDeletePackagePolicyResponse parses an HTTP response from a DeletePackagePolicyWithResponse call -func ParseDeletePackagePolicyResponse(rsp *http.Response) (*DeletePackagePolicyResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &DeletePackagePolicyResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest struct { - Id string `json:"id"` - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON400 = &dest - - } - - return response, nil -} - -// ParseGetPackagePolicyResponse parses an HTTP response from a GetPackagePolicyWithResponse call -func ParseGetPackagePolicyResponse(rsp *http.Response) (*GetPackagePolicyResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &GetPackagePolicyResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest struct { - Item PackagePolicy `json:"item"` - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON400 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: - var dest struct { - Message string `json:"message"` - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON404 = &dest - - } - - return response, nil -} - -// ParseUpdatePackagePolicyResponse parses an HTTP response from a UpdatePackagePolicyWithResponse call -func ParseUpdatePackagePolicyResponse(rsp *http.Response) (*UpdatePackagePolicyResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &UpdatePackagePolicyResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest struct { - Item PackagePolicy `json:"item"` - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON400 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: - var dest struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON403 = &dest - - } - - return response, nil -} diff --git a/generated/fleet/oapi-config.yaml b/generated/fleet/oapi-config.yaml deleted file mode 100644 index 4885498aa..000000000 --- a/generated/fleet/oapi-config.yaml +++ /dev/null @@ -1,9 +0,0 @@ -# yaml-language-server: $schema=https://raw.githubusercontent.com/oapi-codegen/oapi-codegen/HEAD/configuration-schema.json - -package: fleetapi -output: fleet.gen.go -generate: - client: true - models: true -# output-options: -# nullable-type: true diff --git a/generated/fleet/transform_schema.go b/generated/fleet/transform_schema.go deleted file mode 100644 index 9417797f3..000000000 --- a/generated/fleet/transform_schema.go +++ /dev/null @@ -1,1054 +0,0 @@ -//go:build ignore -// +build ignore - -package main - -import ( - "bytes" - "errors" - "flag" - "fmt" - "log" - "maps" - "os" - "path" - "reflect" - "slices" - "strconv" - "strings" - - "gopkg.in/yaml.v3" -) - -func main() { - _inFile := flag.String("i", "", "input file") - _outFile := flag.String("o", "", "output file") - flag.Parse() - - inFile := *_inFile - outFile := *_outFile - - if inFile == "" || outFile == "" { - flag.Usage() - os.Exit(1) - } - - outDir, _ := path.Split(outFile) - if !pathExists(outDir) { - if err := os.MkdirAll(outDir, 0755); err != nil { - log.Fatalf("failed to create directory %q: %v", outDir, err) - } - } - - bytes, err := os.ReadFile(inFile) - if err != nil { - log.Fatalf("failed to read file %q: %v", inFile, err) - } - - var schema Schema - err = yaml.Unmarshal(bytes, &schema) - if err != nil { - log.Fatalf("failed to unmarshal schema from %q: %v", inFile, err) - } - - // Run each transform - for _, fn := range transformers { - fn(&schema) - } - - saveFile(schema, outFile) -} - -// pathExists checks if path exists. -func pathExists(path string) bool { - _, err := os.Stat(path) - return !errors.Is(err, os.ErrNotExist) -} - -// saveFile marshal and writes obj to path. -func saveFile(obj any, path string) { - var buf bytes.Buffer - enc := yaml.NewEncoder(&buf) - enc.SetIndent(2) - if err := enc.Encode(obj); err != nil { - log.Fatalf("failed to marshal to file %q: %v", path, err) - } - - if err := os.WriteFile(path, buf.Bytes(), 0664); err != nil { - log.Fatalf("failed to write file %q: %v", path, err) - } -} - -// ============================================================================ - -type Schema struct { - Paths map[string]*Path `yaml:"paths"` - Version string `yaml:"openapi"` - Tags []Map `yaml:"tags,omitempty"` - Servers []Map `yaml:"servers,omitempty"` - Components Map `yaml:"components,omitempty"` - Security []Map `yaml:"security,omitempty"` - Info Map `yaml:"info"` -} - -func (s Schema) GetPath(path string) *Path { - return s.Paths[path] -} - -func (s Schema) MustGetPath(path string) *Path { - p := s.GetPath(path) - if p == nil { - log.Panicf("Path not found: %q", path) - } - return p -} - -// ============================================================================ - -type Path struct { - Parameters []Map `yaml:"parameters,omitempty"` - Get Map `yaml:"get,omitempty"` - Post Map `yaml:"post,omitempty"` - Put Map `yaml:"put,omitempty"` - Delete Map `yaml:"delete,omitempty"` -} - -func (p Path) Endpoints(yield func(key string, endpoint Map) bool) { - if p.Get != nil { - yield("get", p.Get) - } - if p.Post != nil { - yield("post", p.Post) - } - if p.Put != nil { - yield("put", p.Put) - } - if p.Delete != nil { - yield("delete", p.Delete) - } -} - -func (p Path) GetEndpoint(method string) Map { - switch method { - case "get": - return p.Get - case "post": - return p.Post - case "put": - return p.Put - case "delete": - return p.Delete - default: - log.Panicf("Unhandled method: %q", method) - } - return nil -} - -func (p Path) MustGetEndpoint(method string) Map { - endpoint := p.GetEndpoint(method) - if endpoint == nil { - log.Panicf("Method not found: %q", method) - } - return endpoint -} - -func (p *Path) SetEndpoint(method string, endpoint Map) { - switch method { - case "get": - p.Get = endpoint - case "post": - p.Post = endpoint - case "put": - p.Put = endpoint - case "delete": - p.Delete = endpoint - default: - log.Panicf("Invalid method %q", method) - } -} - -// ============================================================================ - -type Map map[string]any - -func (m Map) Keys() []string { - keys := slices.Collect(maps.Keys(m)) - slices.Sort(keys) - return keys -} - -func (m Map) Has(key string) bool { - _, ok := m.Get(key) - return ok -} - -func (m Map) Get(key string) (any, bool) { - rootKey, subKeys, found := strings.Cut(key, ".") - if found { - switch t := m[rootKey].(type) { - case Map: - return t.Get(subKeys) - case map[string]any: - return Map(t).Get(subKeys) - case Slice: - return t.Get(subKeys) - case []any: - return Slice(t).Get(subKeys) - default: - rootKey = key - } - } - - value, ok := m[rootKey] - return value, ok -} - -func (m Map) MustGet(key string) any { - v, ok := m.Get(key) - if !ok { - log.Panicf("%q not found", key) - } - return v -} - -func (m Map) GetSlice(key string) (Slice, bool) { - value, ok := m.Get(key) - if !ok { - return nil, false - } - - switch t := value.(type) { - case Slice: - return t, true - case []any: - return t, true - } - - log.Panicf("%q is not a slice", key) - return nil, false -} - -func (m Map) MustGetSlice(key string) Slice { - v, ok := m.GetSlice(key) - if !ok { - log.Panicf("%q not found", key) - } - return v -} - -func (m Map) GetMap(key string) (Map, bool) { - value, ok := m.Get(key) - if !ok { - return nil, false - } - - switch t := value.(type) { - case Map: - return t, true - case map[string]any: - return t, true - } - - log.Panicf("%q is not a map", key) - return nil, false -} - -func (m Map) MustGetMap(key string) Map { - v, ok := m.GetMap(key) - if !ok { - log.Panicf("%q not found", key) - } - return v -} - -func (m Map) Set(key string, value any) { - rootKey, subKeys, found := strings.Cut(key, ".") - if found { - if v, ok := m[rootKey]; ok { - switch t := v.(type) { - case Slice: - t.Set(subKeys, value) - case []any: - Slice(t).Set(subKeys, value) - case Map: - t.Set(subKeys, value) - case map[string]any: - Map(t).Set(subKeys, value) - } - } else { - subMap := Map{} - subMap.Set(subKeys, value) - m[rootKey] = subMap - } - } else { - m[rootKey] = value - } -} - -func (m Map) Move(src string, dst string) { - value := m.MustGet(src) - m.Set(dst, value) - m.Delete(src) -} - -func (m Map) Delete(key string) bool { - rootKey, subKeys, found := strings.Cut(key, ".") - if found { - if v, ok := m[rootKey]; ok { - switch t := v.(type) { - case Slice: - return t.Delete(subKeys) - case []any: - return Slice(t).Delete(subKeys) - case Map: - return t.Delete(subKeys) - case map[string]any: - return Map(t).Delete(subKeys) - } - } - } else { - delete(m, rootKey) - return true - } - return false -} - -func (m Map) MustDelete(key string) { - if !m.Delete(key) { - log.Panicf("%q not found", key) - } -} - -func (m Map) CreateRef(schema *Schema, name string, key string) Map { - refTarget := m.MustGet(key) // Check the full path - refPath := fmt.Sprintf("schemas.%s", name) - refValue := Map{"$ref": fmt.Sprintf("#/components/schemas/%s", name)} - - // If the component schema already exists and is not the same, panic - writeComponent := true - if existing, ok := schema.Components.Get(refPath); ok { - if reflect.DeepEqual(refTarget, existing) { - writeComponent = false - } else { - log.Panicf("Component schema key already in use and not an exact duplicate: %q", refPath) - return nil - } - } - - var parent any - var childKey string - // Get the parent of the refTarget - i := strings.LastIndex(key, ".") - if i == -1 { - parent = m - childKey = key - } else { - parent = m.MustGet(key[:i]) - childKey = key[i+1:] - } - - doMap := func(target Map, key string) { - if writeComponent { - schema.Components.Set(refPath, target.MustGet(key)) - } - target.Set(key, refValue) - } - - doSlice := func(target Slice, key string) { - index := target.atoi(key) - if writeComponent { - schema.Components.Set(refPath, target[index]) - } - target[index] = refValue - } - - switch t := parent.(type) { - case map[string]any: - doMap(Map(t), childKey) - case Map: - doMap(t, childKey) - case []any: - doSlice(Slice(t), childKey) - case Slice: - doSlice(t, childKey) - default: - log.Panicf("Cannot create a ref of target type %T at %q", parent, key) - } - - return refValue -} - -func (m Map) Iterate(iteratee func(key string, node Map)) { - joinPath := func(existing string, next string) string { - if existing == "" { - return next - } else { - return fmt.Sprintf("%s.%s", existing, next) - } - } - joinIndex := func(existing string, next int) string { - if existing == "" { - return fmt.Sprintf("%d", next) - } else { - return fmt.Sprintf("%s.%d", existing, next) - } - } - - var iterate func(key string, val any) - iterate = func(key string, val any) { - switch tval := val.(type) { - case []any: - iterate(key, Slice(tval)) - case Slice: - for i, v := range tval { - iterate(joinIndex(key, i), v) - } - case map[string]any: - iterate(key, Map(tval)) - case Map: - for _, k := range tval.Keys() { - iterate(joinPath(key, k), tval[k]) - } - iteratee(key, tval) - } - } - - iterate("", m) -} - -// ============================================================================ - -type Slice []any - -func (s Slice) Get(key string) (any, bool) { - rootKey, subKeys, found := strings.Cut(key, ".") - index := s.atoi(rootKey) - - if found { - switch t := s[index].(type) { - case Slice: - return t.Get(subKeys) - case []any: - return Slice(t).Get(subKeys) - case Map: - return t.Get(subKeys) - case map[string]any: - return Map(t).Get(subKeys) - } - } - - value := s[index] - return value, true -} - -func (s Slice) GetMap(key string) (Map, bool) { - value, ok := s.Get(key) - if !ok { - return nil, false - } - - switch t := value.(type) { - case Map: - return t, true - case map[string]any: - return t, true - } - - log.Panicf("%q is not a map", key) - return nil, false -} - -func (s Slice) MustGetMap(key string) Map { - v, ok := s.GetMap(key) - if !ok { - log.Panicf("%q not found", key) - } - return v -} - -func (s Slice) Set(key string, value any) { - rootKey, subKeys, found := strings.Cut(key, ".") - index := s.atoi(rootKey) - if found { - v := s[index] - switch t := v.(type) { - case Slice: - t.Set(subKeys, value) - case []any: - Slice(t).Set(subKeys, value) - case Map: - t.Set(subKeys, value) - case map[string]any: - Map(t).Set(subKeys, value) - } - } else { - s[index] = value - } -} - -func (s Slice) Delete(key string) bool { - rootKey, subKeys, found := strings.Cut(key, ".") - index := s.atoi(rootKey) - if found { - item := (s)[index] - switch t := item.(type) { - case Slice: - return t.Delete(subKeys) - case []any: - return Slice(t).Delete(subKeys) - case Map: - return t.Delete(subKeys) - case map[string]any: - return Map(t).Delete(subKeys) - } - } else { - log.Panicf("Unable to delete from slice directly") - return true - } - return false -} - -func (s Slice) Contains(value string) bool { - for _, v := range s { - s, ok := v.(string) - if !ok { - continue - } - if value == s { - return true - } - } - - return false -} - -func (s Slice) atoi(key string) int { - index, err := strconv.Atoi(key) - if err != nil { - log.Panicf("Failed to parse slice index key %q: %v", key, err) - } - if index < 0 || index >= len(s) { - log.Panicf("Slice index is out of bounds (%d, target slice len: %d)", index, len(s)) - } - return index -} - -// ============================================================================ - -type TransformFunc func(schema *Schema) - -var transformers = []TransformFunc{ - transformFilterPaths, - transformRemoveKbnXsrf, - transformRemoveApiVersionParam, - transformSimplifyContentType, - transformFleetPaths, - // transformRemoveEnums, - // transformAddGoPointersFlag, - transformRemoveExamples, - transformRemoveUnusedComponents, -} - -// transformFilterPaths filters the paths in a schema down to a specified list -// of endpoints and methods. -func transformFilterPaths(schema *Schema) { - var includePaths = map[string][]string{ - "/api/fleet/agent_policies": {"get", "post"}, - "/api/fleet/agent_policies/delete": {"post"}, - "/api/fleet/agent_policies/{agentPolicyId}": {"get", "put"}, - "/api/fleet/enrollment_api_keys": {"get"}, - "/api/fleet/epm/packages": {"get", "post"}, - "/api/fleet/epm/packages/{pkgName}/{pkgVersion}": {"get", "post", "delete"}, - "/api/fleet/fleet_server_hosts": {"get", "post"}, - "/api/fleet/fleet_server_hosts/{itemId}": {"get", "put", "delete"}, - "/api/fleet/outputs": {"get", "post"}, - "/api/fleet/outputs/{outputId}": {"get", "put", "delete"}, - "/api/fleet/package_policies": {"get", "post"}, - "/api/fleet/package_policies/{packagePolicyId}": {"get", "put", "delete"}, - } - - for path, pathInfo := range schema.Paths { - if allowedMethods, ok := includePaths[path]; ok { - // Filter out endpoints not if filter list - for method := range pathInfo.Endpoints { - if !slices.Contains(allowedMethods, method) { - pathInfo.SetEndpoint(method, nil) - } - } - } else { - // Remove paths not in filter list. - delete(schema.Paths, path) - } - } - - // Go through again, verify each entry exists - for path, methods := range includePaths { - pathInfo := schema.GetPath(path) - if pathInfo == nil { - log.Panicf("Missing path %q", path) - } - - for _, method := range methods { - endpoint := pathInfo.GetEndpoint(method) - if endpoint == nil { - log.Panicf("Missing method %q of %q", method, path) - } - } - } -} - -// transformRemoveKbnXsrf removes the kbn-xsrf header as it is already applied -// in the client. -func transformRemoveKbnXsrf(schema *Schema) { - removeKbnXsrf := func(node any) bool { - param := node.(Map) - if v, ok := param["name"]; ok { - name := v.(string) - if strings.HasSuffix(name, "kbn_xsrf") || strings.HasSuffix(name, "kbn-xsrf") { - return true - } - } - // Data_views_kbn_xsrf, Saved_objects_kbn_xsrf, etc - if v, ok := param["$ref"]; ok { - ref := v.(string) - if strings.HasSuffix(ref, "kbn_xsrf") || strings.HasSuffix(ref, "kbn-xsrf") { - return true - } - } - return false - } - - for _, pathInfo := range schema.Paths { - for _, endpoint := range pathInfo.Endpoints { - if params, ok := endpoint.GetSlice("parameters"); ok { - params = slices.DeleteFunc(params, removeKbnXsrf) - endpoint["parameters"] = params - } - } - } -} - -// transformRemoveApiVersionParam removes the Elastic API Version query -// parameter header. -func transformRemoveApiVersionParam(schema *Schema) { - removeApiVersion := func(node any) bool { - param := node.(Map) - if name, ok := param["name"]; ok && name == "elastic-api-version" { - return true - } - return false - } - - for _, pathInfo := range schema.Paths { - for _, endpoint := range pathInfo.Endpoints { - if params, ok := endpoint.GetSlice("parameters"); ok { - params = slices.DeleteFunc(params, removeApiVersion) - endpoint["parameters"] = params - } - } - } -} - -// transformSimplifyContentType simplifies Content-Type headers such as -// 'application/json; Elastic-Api-Version=2023-10-31' by stripping everything -// after the ';'. -func transformSimplifyContentType(schema *Schema) { - simplifyContentType := func(fields Map) { - if content, ok := fields.GetMap("content"); ok { - for key := range content { - newKey, _, found := strings.Cut(key, ";") - if found { - content.Move(key, newKey) - } - } - } - } - - for _, pathInfo := range schema.Paths { - for _, endpoint := range pathInfo.Endpoints { - if req, ok := endpoint.GetMap("requestBody"); ok { - simplifyContentType(req) - } - if resp, ok := endpoint.GetMap("responses"); ok { - for code := range resp { - simplifyContentType(resp.MustGetMap(code)) - } - } - } - } - - if responses, ok := schema.Components.GetMap("responses"); ok { - for key := range responses { - resp := responses.MustGetMap(key) - simplifyContentType(resp) - } - } -} - -// transformFleetPaths fixes the fleet paths. -func transformFleetPaths(schema *Schema) { - operationIds := map[string]map[string]string{ - "/api/fleet/agent_policies": { - "get": "get_agent_policies", - "post": "create_agent_policy", - }, - "/api/fleet/agent_policies/delete": { - "post": "delete_agent_policy", - }, - "/api/fleet/agent_policies/{agentPolicyId}": { - "get": "get_agent_policy", - "put": "update_agent_policy", - }, - "/api/fleet/enrollment_api_keys": { - "get": "get_enrollment_api_keys", - }, - "/api/fleet/epm/packages": { - "get": "list_packages", - "post": "install_package_by_upload", - }, - "/api/fleet/epm/packages/{pkgName}/{pkgVersion}": { - "get": "get_package", - "post": "install_package", - "delete": "delete_package", - }, - "/api/fleet/fleet_server_hosts": { - "get": "get_fleet_server_hosts", - "post": "create_fleet_server_host", - }, - "/api/fleet/fleet_server_hosts/{itemId}": { - "get": "get_fleet_server_host", - "put": "update_fleet_server_host", - "delete": "delete_fleet_server_host", - }, - "/api/fleet/outputs": { - "get": "get_outputs", - "post": "create_output", - }, - "/api/fleet/outputs/{outputId}": { - "get": "get_output", - "put": "update_output", - "delete": "delete_output", - }, - "/api/fleet/package_policies": { - "get": "get_package_policies", - "post": "create_package_policy", - }, - "/api/fleet/package_policies/{packagePolicyId}": { - "get": "get_package_policy", - "put": "update_package_policy", - "delete": "delete_package_policy", - }, - } - - // Set each missing operationId - for path, methods := range operationIds { - pathInfo := schema.MustGetPath(path) - for method, operationId := range methods { - endpoint := pathInfo.GetEndpoint(method) - endpoint.Set("operationId", operationId) - } - } - - // Fix OpenAPI error: set each missing description - for _, pathInfo := range schema.Paths { - for _, endpoint := range pathInfo.Endpoints { - responses := endpoint.MustGetMap("responses") - for code := range responses { - response := responses.MustGetMap(code) - if _, ok := response["description"]; !ok { - response["description"] = "" - } - } - } - } - - // Agent policies - // https://github.com/elastic/kibana/blob/main/x-pack/plugins/fleet/common/types/models/agent_policy.ts - // https://github.com/elastic/kibana/blob/main/x-pack/plugins/fleet/common/types/rest_spec/agent_policy.ts - - agentPoliciesPath := schema.MustGetPath("/api/fleet/agent_policies") - agentPolicyPath := schema.MustGetPath("/api/fleet/agent_policies/{agentPolicyId}") - - agentPoliciesPath.Get.CreateRef(schema, "agent_policy", "responses.200.content.application/json.schema.properties.items.items") - agentPoliciesPath.Post.CreateRef(schema, "agent_policy", "responses.200.content.application/json.schema.properties.item") - agentPolicyPath.Get.CreateRef(schema, "agent_policy", "responses.200.content.application/json.schema.properties.item") - agentPolicyPath.Put.CreateRef(schema, "agent_policy", "responses.200.content.application/json.schema.properties.item") - - // See: https://github.com/elastic/kibana/issues/197155 - // [request body.keep_monitoring_alive]: expected value of type [boolean] but got [null] - // [request body.supports_agentless]: expected value of type [boolean] but got [null] - // [request body.overrides]: expected value of type [boolean] but got [null] - for _, key := range []string{"keep_monitoring_alive", "supports_agentless", "overrides"} { - agentPoliciesPath.Post.Set(fmt.Sprintf("requestBody.content.application/json.schema.properties.%s.x-omitempty", key), true) - agentPolicyPath.Put.Set(fmt.Sprintf("requestBody.content.application/json.schema.properties.%s.x-omitempty", key), true) - } - - // Enrollment api keys - // https://github.com/elastic/kibana/blob/main/x-pack/plugins/fleet/common/types/models/enrollment_api_key.ts - // https://github.com/elastic/kibana/blob/main/x-pack/plugins/fleet/common/types/rest_spec/enrollment_api_key.ts - - apiKeysPath := schema.MustGetPath("/api/fleet/enrollment_api_keys") - apiKeysPath.Get.CreateRef(schema, "enrollment_api_key", "responses.200.content.application/json.schema.properties.items.items") - - // EPM - // https://github.com/elastic/kibana/blob/main/x-pack/plugins/fleet/common/types/models/epm.ts - // https://github.com/elastic/kibana/blob/main/x-pack/plugins/fleet/common/types/rest_spec/epm.ts - - packagesPath := schema.MustGetPath("/api/fleet/epm/packages") - packagePath := schema.MustGetPath("/api/fleet/epm/packages/{pkgName}/{pkgVersion}") - packagesPath.Get.CreateRef(schema, "package_list_item", "responses.200.content.application/json.schema.properties.items.items") - packagePath.Get.CreateRef(schema, "package_info", "responses.200.content.application/json.schema.properties.item") - - // Server hosts - // https://github.com/elastic/kibana/blob/main/x-pack/plugins/fleet/common/types/models/fleet_server_policy_config.ts - // https://github.com/elastic/kibana/blob/main/x-pack/plugins/fleet/common/types/rest_spec/fleet_server_hosts.ts - - hostsPath := schema.MustGetPath("/api/fleet/fleet_server_hosts") - hostPath := schema.MustGetPath("/api/fleet/fleet_server_hosts/{itemId}") - - hostsPath.Get.CreateRef(schema, "server_host", "responses.200.content.application/json.schema.properties.items.items") - hostsPath.Post.CreateRef(schema, "server_host", "responses.200.content.application/json.schema.properties.item") - hostPath.Get.CreateRef(schema, "server_host", "responses.200.content.application/json.schema.properties.item") - hostPath.Put.CreateRef(schema, "server_host", "responses.200.content.application/json.schema.properties.item") - - // 8.6.2 regression - // [request body.proxy_id]: definition for this key is missing - // See: https://github.com/elastic/kibana/issues/197155 - hostsPath.Post.Set("requestBody.content.application/json.schema.properties.proxy_id.x-omitempty", true) - hostPath.Put.Set("requestBody.content.application/json.schema.properties.proxy_id.x-omitempty", true) - - // Outputs - // https://github.com/elastic/kibana/blob/main/x-pack/plugins/fleet/common/types/models/output.ts - // https://github.com/elastic/kibana/blob/main/x-pack/plugins/fleet/common/types/rest_spec/output.ts - - outputByIdPath := schema.MustGetPath("/api/fleet/outputs/{outputId}") - outputsPath := schema.MustGetPath("/api/fleet/outputs") - - outputsPath.Post.CreateRef(schema, "new_output_union", "requestBody.content.application/json.schema") - outputByIdPath.Put.CreateRef(schema, "update_output_union", "requestBody.content.application/json.schema") - outputsPath.Get.CreateRef(schema, "output_union", "responses.200.content.application/json.schema.properties.items.items") - outputByIdPath.Get.CreateRef(schema, "output_union", "responses.200.content.application/json.schema.properties.item") - outputsPath.Post.CreateRef(schema, "output_union", "responses.200.content.application/json.schema.properties.item") - outputByIdPath.Put.CreateRef(schema, "output_union", "responses.200.content.application/json.schema.properties.item") - - for _, name := range []string{"output", "new_output", "update_output"} { - // Ref each index in the anyOf union - schema.Components.CreateRef(schema, fmt.Sprintf("%s_elasticsearch", name), fmt.Sprintf("schemas.%s_union.anyOf.0", name)) - schema.Components.CreateRef(schema, fmt.Sprintf("%s_remote_elasticsearch", name), fmt.Sprintf("schemas.%s_union.anyOf.1", name)) - schema.Components.CreateRef(schema, fmt.Sprintf("%s_logstash", name), fmt.Sprintf("schemas.%s_union.anyOf.2", name)) - schema.Components.CreateRef(schema, fmt.Sprintf("%s_kafka", name), fmt.Sprintf("schemas.%s_union.anyOf.3", name)) - - // Extract child structs - for _, typ := range []string{"elasticsearch", "remote_elasticsearch", "logstash", "kafka"} { - schema.Components.CreateRef(schema, fmt.Sprintf("%s_shipper", name), fmt.Sprintf("schemas.%s_%s.properties.shipper", name, typ)) - schema.Components.CreateRef(schema, fmt.Sprintf("%s_ssl", name), fmt.Sprintf("schemas.%s_%s.properties.ssl", name, typ)) - } - - // Ideally just remove the "anyOf", however then we would need to make - // refs for each of the "oneOf" options. So turn them into an "any" instead. - // See: https://github.com/elastic/kibana/issues/197153 - /* - anyOf: - - items: {} - type: array - - type: boolean - - type: number - - type: object - - type: string - nullable: true - oneOf: - - type: number - - not: {} - */ - - props := schema.Components.MustGetMap(fmt.Sprintf("schemas.%s_kafka.properties", name)) - for _, key := range []string{"compression_level", "connection_type", "password", "username"} { - props.Set(key, Map{}) - } - } - - // Add the missing discriminator to the response union - // See: https://github.com/elastic/kibana/issues/181994 - schema.Components.Set("schemas.output_union.discriminator", Map{ - "propertyName": "type", - "mapping": Map{ - "elasticsearch": "#/components/schemas/output_elasticsearch", - "remote_elasticsearch": "#/components/schemas/output_remote_elasticsearch", - "logstash": "#/components/schemas/output_logstash", - "kafka": "#/components/schemas/output_kafka", - }, - }) - - for _, name := range []string{"new_output", "update_output"} { - for _, typ := range []string{"elasticsearch", "remote_elasticsearch", "logstash", "kafka"} { - // [request body.1.ca_sha256]: expected value of type [string] but got [null]" - // See: https://github.com/elastic/kibana/issues/197155 - schema.Components.Set(fmt.Sprintf("schemas.%s_%s.properties.ca_sha256.x-omitempty", name, typ), true) - - // [request body.1.ca_trusted_fingerprint]: expected value of type [string] but got [null] - // See: https://github.com/elastic/kibana/issues/197155 - schema.Components.Set(fmt.Sprintf("schemas.%s_%s.properties.ca_trusted_fingerprint.x-omitempty", name, typ), true) - - // 8.6.2 regression - // [request body.proxy_id]: definition for this key is missing" - // See: https://github.com/elastic/kibana/issues/197155 - schema.Components.Set(fmt.Sprintf("schemas.%s_%s.properties.proxy_id.x-omitempty", name, typ), true) - } - - // [request body.1.shipper]: expected a plain object value, but found [null] instead - // See: https://github.com/elastic/kibana/issues/197155 - schema.Components.Set(fmt.Sprintf("schemas.%s_shipper.x-omitempty", name), true) - - // [request body.1.ssl]: expected a plain object value, but found [null] instead - // See: https://github.com/elastic/kibana/issues/197155 - schema.Components.Set(fmt.Sprintf("schemas.%s_ssl.x-omitempty", name), true) - - } - - for _, typ := range []string{"elasticsearch", "remote_elasticsearch", "logstash", "kafka"} { - // strict_dynamic_mapping_exception: [1:345] mapping set to strict, dynamic introduction of [id] within [ingest-outputs] is not allowed" - // See: https://github.com/elastic/kibana/issues/197155 - schema.Components.MustDelete(fmt.Sprintf("schemas.update_output_%s.properties.id", typ)) - } - - // Package policies - // https://github.com/elastic/kibana/blob/main/x-pack/plugins/fleet/common/types/models/package_policy.ts - // https://github.com/elastic/kibana/blob/main/x-pack/plugins/fleet/common/types/rest_spec/package_policy.ts - - epmPoliciesPath := schema.MustGetPath("/api/fleet/package_policies") - epmPolicyPath := schema.MustGetPath("/api/fleet/package_policies/{packagePolicyId}") - - epmPoliciesPath.Get.CreateRef(schema, "package_policy", "responses.200.content.application/json.schema.properties.items.items") - epmPoliciesPath.Post.CreateRef(schema, "package_policy", "responses.200.content.application/json.schema.properties.item") - - epmPoliciesPath.Post.Move("requestBody.content.application/json.schema.anyOf.1", "requestBody.content.application/json.schema") // anyOf.0 is the deprecated array format - epmPolicyPath.Put.Move("requestBody.content.application/json.schema.anyOf.1", "requestBody.content.application/json.schema") // anyOf.0 is the deprecated array format - epmPoliciesPath.Post.CreateRef(schema, "package_policy_request", "requestBody.content.application/json.schema") - epmPolicyPath.Put.CreateRef(schema, "package_policy_request", "requestBody.content.application/json.schema") - - epmPolicyPath.Get.CreateRef(schema, "package_policy", "responses.200.content.application/json.schema.properties.item") - epmPolicyPath.Put.CreateRef(schema, "package_policy", "responses.200.content.application/json.schema.properties.item") - - schema.Components.CreateRef(schema, "package_policy_secret_ref", "schemas.package_policy.properties.secret_references.items") - schema.Components.Move("schemas.package_policy.properties.inputs.anyOf.1", "schemas.package_policy.properties.inputs") // anyOf.0 is the deprecated array format - - schema.Components.CreateRef(schema, "package_policy_input", "schemas.package_policy.properties.inputs.additionalProperties") - schema.Components.CreateRef(schema, "package_policy_input_stream", "schemas.package_policy_input.properties.streams.additionalProperties") - - schema.Components.CreateRef(schema, "package_policy_request_package", "schemas.package_policy_request.properties.package") - schema.Components.CreateRef(schema, "package_policy_request_input", "schemas.package_policy_request.properties.inputs.additionalProperties") - schema.Components.CreateRef(schema, "package_policy_request_input_stream", "schemas.package_policy_request_input.properties.streams.additionalProperties") - - // Simplify all of the vars - schema.Components.Set("schemas.package_policy.properties.vars", Map{"type": "object"}) - schema.Components.Set("schemas.package_policy_input.properties.vars", Map{"type": "object"}) - schema.Components.Set("schemas.package_policy_input_stream.properties.vars", Map{"type": "object"}) - schema.Components.Set("schemas.package_policy_request.properties.vars", Map{"type": "object"}) - schema.Components.Set("schemas.package_policy_request_input.properties.vars", Map{"type": "object"}) - schema.Components.Set("schemas.package_policy_request_input_stream.properties.vars", Map{"type": "object"}) - - // [request body.0.output_id]: expected value of type [string] but got [null] - // [request body.1.output_id]: definition for this key is missing" - // See: https://github.com/elastic/kibana/issues/197155 - schema.Components.Set("schemas.package_policy_request.properties.output_id.x-omitempty", true) -} - -// transformRemoveEnums remove all enums. -func transformRemoveEnums(schema *Schema) { - deleteEnumFn := func(key string, node Map) { - if node.Has("enum") { - delete(node, "enum") - } - } - - for _, pathInfo := range schema.Paths { - for _, methInfo := range pathInfo.Endpoints { - methInfo.Iterate(deleteEnumFn) - } - } - schema.Components.Iterate(deleteEnumFn) -} - -// transformRemoveExamples removes all examples. -func transformRemoveExamples(schema *Schema) { - deleteExampleFn := func(key string, node Map) { - if node.Has("example") { - delete(node, "example") - } - if node.Has("examples") { - delete(node, "examples") - } - } - - for _, pathInfo := range schema.Paths { - for _, methInfo := range pathInfo.Endpoints { - methInfo.Iterate(deleteExampleFn) - } - } - schema.Components.Iterate(deleteExampleFn) - schema.Components.Set("examples", Map{}) -} - -// transformAddOptionalPointersFlag adds a x-go-type-skip-optional-pointer -// flag to maps and arrays, since they are already nullable types. -func transformAddOptionalPointersFlag(schema *Schema) { - addFlagFn := func(key string, node Map) { - if node["type"] == "array" { - node["x-go-type-skip-optional-pointer"] = true - } else if node["type"] == "object" { - if _, ok := node["properties"]; !ok { - node["x-go-type-skip-optional-pointer"] = true - } - } - } - - for _, pathInfo := range schema.Paths { - for _, methInfo := range pathInfo.Endpoints { - methInfo.Iterate(addFlagFn) - } - } - schema.Components.Iterate(addFlagFn) -} - -// transformRemoveUnusedComponents removes all unused schema components. -func transformRemoveUnusedComponents(schema *Schema) { - var refs map[string]any - collectRefsFn := func(key string, node Map) { - if ref, ok := node["$ref"].(string); ok { - i := strings.LastIndex(ref, "/") - ref = ref[i+1:] - refs[ref] = nil - } - } - - componentParams := schema.Components.MustGetMap("parameters") - componentSchemas := schema.Components.MustGetMap("schemas") - - for { - // Collect refs - refs = make(map[string]any) - for _, pathInfo := range schema.Paths { - for _, methInfo := range pathInfo.Endpoints { - methInfo.Iterate(collectRefsFn) - } - } - schema.Components.Iterate(collectRefsFn) - - loop := false - for key := range componentSchemas { - if _, ok := refs[key]; !ok { - delete(componentSchemas, key) - loop = true - } - } - for key := range componentParams { - if _, ok := refs[key]; !ok { - delete(componentParams, key) - loop = true - } - } - if !loop { - break - } - } -} diff --git a/generated/kibana/kibana.gen.go b/generated/kibana/kibana.gen.go index b2e22c872..9dab8fdff 100644 --- a/generated/kibana/kibana.gen.go +++ b/generated/kibana/kibana.gen.go @@ -7,6 +7,7 @@ import ( "bytes" "context" "encoding/json" + "errors" "fmt" "io" "net/http" @@ -272,99 +273,6 @@ type CreateDataViewJSONRequestBody = DataViewsCreateDataViewRequestObject // UpdateDataViewJSONRequestBody defines body for UpdateDataView for application/json ContentType. type UpdateDataViewJSONRequestBody = DataViewsUpdateDataViewRequestObject -// RequestEditorFn is the function signature for the RequestEditor callback function -type RequestEditorFn func(ctx context.Context, req *http.Request) error - -// Doer performs HTTP requests. -// -// The standard http.Client implements this interface. -type HttpRequestDoer interface { - Do(req *http.Request) (*http.Response, error) -} - -// Client which conforms to the OpenAPI3 specification for this service. -type Client struct { - // The endpoint of the server conforming to this interface, with scheme, - // https://api.deepmap.com for example. This can contain a path relative - // to the server, such as https://api.deepmap.com/dev-test, and all the - // paths in the swagger spec will be appended to the server. - Server string - - // Doer for performing requests, typically a *http.Client with any - // customized settings, such as certificate chains. - Client HttpRequestDoer - - // A list of callbacks for modifying requests which are generated before sending over - // the network. - RequestEditors []RequestEditorFn -} - -// ClientOption allows setting custom parameters during construction -type ClientOption func(*Client) error - -// Creates a new Client, with reasonable defaults -func NewClient(server string, opts ...ClientOption) (*Client, error) { - // create a client with sane default values - client := Client{ - Server: server, - } - // mutate client and add all optional params - for _, o := range opts { - if err := o(&client); err != nil { - return nil, err - } - } - // ensure the server URL always has a trailing slash - if !strings.HasSuffix(client.Server, "/") { - client.Server += "/" - } - // create httpClient, if not already present - if client.Client == nil { - client.Client = &http.Client{} - } - return &client, nil -} - -// WithHTTPClient allows overriding the default Doer, which is -// automatically created using http.Client. This is useful for tests. -func WithHTTPClient(doer HttpRequestDoer) ClientOption { - return func(c *Client) error { - c.Client = doer - return nil - } -} - -// WithRequestEditorFn allows setting up a callback function, which will be -// called right before sending the request. This can be used to mutate the request. -func WithRequestEditorFn(fn RequestEditorFn) ClientOption { - return func(c *Client) error { - c.RequestEditors = append(c.RequestEditors, fn) - return nil - } -} - -// The interface specification for the client above. -type ClientInterface interface { - // GetDataViews request - GetDataViews(ctx context.Context, spaceId SpaceId, reqEditors ...RequestEditorFn) (*http.Response, error) - - // CreateDataViewWithBody request with any body - CreateDataViewWithBody(ctx context.Context, spaceId SpaceId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - CreateDataView(ctx context.Context, spaceId SpaceId, body CreateDataViewJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // DeleteDataView request - DeleteDataView(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, reqEditors ...RequestEditorFn) (*http.Response, error) - - // GetDataView request - GetDataView(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, reqEditors ...RequestEditorFn) (*http.Response, error) - - // UpdateDataViewWithBody request with any body - UpdateDataViewWithBody(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - UpdateDataView(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, body UpdateDataViewJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) -} - func (c *Client) GetDataViews(ctx context.Context, spaceId SpaceId, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetDataViewsRequest(c.Server, spaceId) if err != nil { @@ -707,28 +615,6 @@ func WithBaseURL(baseURL string) ClientOption { } } -// ClientWithResponsesInterface is the interface specification for the client with responses above. -type ClientWithResponsesInterface interface { - // GetDataViewsWithResponse request - GetDataViewsWithResponse(ctx context.Context, spaceId SpaceId, reqEditors ...RequestEditorFn) (*GetDataViewsResponse, error) - - // CreateDataViewWithBodyWithResponse request with any body - CreateDataViewWithBodyWithResponse(ctx context.Context, spaceId SpaceId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateDataViewResponse, error) - - CreateDataViewWithResponse(ctx context.Context, spaceId SpaceId, body CreateDataViewJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateDataViewResponse, error) - - // DeleteDataViewWithResponse request - DeleteDataViewWithResponse(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, reqEditors ...RequestEditorFn) (*DeleteDataViewResponse, error) - - // GetDataViewWithResponse request - GetDataViewWithResponse(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, reqEditors ...RequestEditorFn) (*GetDataViewResponse, error) - - // UpdateDataViewWithBodyWithResponse request with any body - UpdateDataViewWithBodyWithResponse(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateDataViewResponse, error) - - UpdateDataViewWithResponse(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, body UpdateDataViewJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateDataViewResponse, error) -} - type GetDataViewsResponse struct { Body []byte HTTPResponse *http.Response @@ -1065,3 +951,16536 @@ func ParseUpdateDataViewResponse(rsp *http.Response) (*UpdateDataViewResponse, e return response, nil } + +// Defines values for AgentPolicyMonitoringEnabled. +const ( + AgentPolicyMonitoringEnabledLogs AgentPolicyMonitoringEnabled = "logs" + AgentPolicyMonitoringEnabledMetrics AgentPolicyMonitoringEnabled = "metrics" + AgentPolicyMonitoringEnabledTraces AgentPolicyMonitoringEnabled = "traces" +) + +// Defines values for AgentPolicyPackagePolicies1InputsStreamsRelease. +const ( + AgentPolicyPackagePolicies1InputsStreamsReleaseBeta AgentPolicyPackagePolicies1InputsStreamsRelease = "beta" + AgentPolicyPackagePolicies1InputsStreamsReleaseExperimental AgentPolicyPackagePolicies1InputsStreamsRelease = "experimental" + AgentPolicyPackagePolicies1InputsStreamsReleaseGa AgentPolicyPackagePolicies1InputsStreamsRelease = "ga" +) + +// Defines values for AgentPolicyStatus. +const ( + Active AgentPolicyStatus = "active" + Inactive AgentPolicyStatus = "inactive" +) + +// Defines values for NewOutputElasticsearchPreset. +const ( + NewOutputElasticsearchPresetBalanced NewOutputElasticsearchPreset = "balanced" + NewOutputElasticsearchPresetCustom NewOutputElasticsearchPreset = "custom" + NewOutputElasticsearchPresetLatency NewOutputElasticsearchPreset = "latency" + NewOutputElasticsearchPresetScale NewOutputElasticsearchPreset = "scale" + NewOutputElasticsearchPresetThroughput NewOutputElasticsearchPreset = "throughput" +) + +// Defines values for NewOutputElasticsearchType. +const ( + NewOutputElasticsearchTypeElasticsearch NewOutputElasticsearchType = "elasticsearch" +) + +// Defines values for NewOutputKafkaAuthType. +const ( + NewOutputKafkaAuthTypeKerberos NewOutputKafkaAuthType = "kerberos" + NewOutputKafkaAuthTypeNone NewOutputKafkaAuthType = "none" + NewOutputKafkaAuthTypeSsl NewOutputKafkaAuthType = "ssl" + NewOutputKafkaAuthTypeUserPass NewOutputKafkaAuthType = "user_pass" +) + +// Defines values for NewOutputKafkaCompression. +const ( + NewOutputKafkaCompressionGzip NewOutputKafkaCompression = "gzip" + NewOutputKafkaCompressionLz4 NewOutputKafkaCompression = "lz4" + NewOutputKafkaCompressionNone NewOutputKafkaCompression = "none" + NewOutputKafkaCompressionSnappy NewOutputKafkaCompression = "snappy" +) + +// Defines values for NewOutputKafkaPartition. +const ( + NewOutputKafkaPartitionHash NewOutputKafkaPartition = "hash" + NewOutputKafkaPartitionRandom NewOutputKafkaPartition = "random" + NewOutputKafkaPartitionRoundRobin NewOutputKafkaPartition = "round_robin" +) + +// Defines values for NewOutputKafkaRequiredAcks. +const ( + NewOutputKafkaRequiredAcksMinus1 NewOutputKafkaRequiredAcks = -1 + NewOutputKafkaRequiredAcksN0 NewOutputKafkaRequiredAcks = 0 + NewOutputKafkaRequiredAcksN1 NewOutputKafkaRequiredAcks = 1 +) + +// Defines values for NewOutputKafkaSaslMechanism. +const ( + NewOutputKafkaSaslMechanismPLAIN NewOutputKafkaSaslMechanism = "PLAIN" + NewOutputKafkaSaslMechanismSCRAMSHA256 NewOutputKafkaSaslMechanism = "SCRAM-SHA-256" + NewOutputKafkaSaslMechanismSCRAMSHA512 NewOutputKafkaSaslMechanism = "SCRAM-SHA-512" +) + +// Defines values for NewOutputKafkaTopicsWhenType. +const ( + NewOutputKafkaTopicsWhenTypeContains NewOutputKafkaTopicsWhenType = "contains" + NewOutputKafkaTopicsWhenTypeEquals NewOutputKafkaTopicsWhenType = "equals" + NewOutputKafkaTopicsWhenTypeRegexp NewOutputKafkaTopicsWhenType = "regexp" +) + +// Defines values for NewOutputKafkaType. +const ( + NewOutputKafkaTypeKafka NewOutputKafkaType = "kafka" +) + +// Defines values for NewOutputLogstashType. +const ( + NewOutputLogstashTypeLogstash NewOutputLogstashType = "logstash" +) + +// Defines values for NewOutputRemoteElasticsearchPreset. +const ( + NewOutputRemoteElasticsearchPresetBalanced NewOutputRemoteElasticsearchPreset = "balanced" + NewOutputRemoteElasticsearchPresetCustom NewOutputRemoteElasticsearchPreset = "custom" + NewOutputRemoteElasticsearchPresetLatency NewOutputRemoteElasticsearchPreset = "latency" + NewOutputRemoteElasticsearchPresetScale NewOutputRemoteElasticsearchPreset = "scale" + NewOutputRemoteElasticsearchPresetThroughput NewOutputRemoteElasticsearchPreset = "throughput" +) + +// Defines values for NewOutputRemoteElasticsearchType. +const ( + NewOutputRemoteElasticsearchTypeRemoteElasticsearch NewOutputRemoteElasticsearchType = "remote_elasticsearch" +) + +// Defines values for NewOutputSslVerificationMode. +const ( + NewOutputSslVerificationModeCertificate NewOutputSslVerificationMode = "certificate" + NewOutputSslVerificationModeFull NewOutputSslVerificationMode = "full" + NewOutputSslVerificationModeNone NewOutputSslVerificationMode = "none" + NewOutputSslVerificationModeStrict NewOutputSslVerificationMode = "strict" +) + +// Defines values for OutputElasticsearchPreset. +const ( + OutputElasticsearchPresetBalanced OutputElasticsearchPreset = "balanced" + OutputElasticsearchPresetCustom OutputElasticsearchPreset = "custom" + OutputElasticsearchPresetLatency OutputElasticsearchPreset = "latency" + OutputElasticsearchPresetScale OutputElasticsearchPreset = "scale" + OutputElasticsearchPresetThroughput OutputElasticsearchPreset = "throughput" +) + +// Defines values for OutputElasticsearchType. +const ( + OutputElasticsearchTypeElasticsearch OutputElasticsearchType = "elasticsearch" +) + +// Defines values for OutputKafkaAuthType. +const ( + OutputKafkaAuthTypeKerberos OutputKafkaAuthType = "kerberos" + OutputKafkaAuthTypeNone OutputKafkaAuthType = "none" + OutputKafkaAuthTypeSsl OutputKafkaAuthType = "ssl" + OutputKafkaAuthTypeUserPass OutputKafkaAuthType = "user_pass" +) + +// Defines values for OutputKafkaCompression. +const ( + OutputKafkaCompressionGzip OutputKafkaCompression = "gzip" + OutputKafkaCompressionLz4 OutputKafkaCompression = "lz4" + OutputKafkaCompressionNone OutputKafkaCompression = "none" + OutputKafkaCompressionSnappy OutputKafkaCompression = "snappy" +) + +// Defines values for OutputKafkaPartition. +const ( + OutputKafkaPartitionHash OutputKafkaPartition = "hash" + OutputKafkaPartitionRandom OutputKafkaPartition = "random" + OutputKafkaPartitionRoundRobin OutputKafkaPartition = "round_robin" +) + +// Defines values for OutputKafkaRequiredAcks. +const ( + OutputKafkaRequiredAcksMinus1 OutputKafkaRequiredAcks = -1 + OutputKafkaRequiredAcksN0 OutputKafkaRequiredAcks = 0 + OutputKafkaRequiredAcksN1 OutputKafkaRequiredAcks = 1 +) + +// Defines values for OutputKafkaSaslMechanism. +const ( + OutputKafkaSaslMechanismPLAIN OutputKafkaSaslMechanism = "PLAIN" + OutputKafkaSaslMechanismSCRAMSHA256 OutputKafkaSaslMechanism = "SCRAM-SHA-256" + OutputKafkaSaslMechanismSCRAMSHA512 OutputKafkaSaslMechanism = "SCRAM-SHA-512" +) + +// Defines values for OutputKafkaTopicsWhenType. +const ( + OutputKafkaTopicsWhenTypeContains OutputKafkaTopicsWhenType = "contains" + OutputKafkaTopicsWhenTypeEquals OutputKafkaTopicsWhenType = "equals" + OutputKafkaTopicsWhenTypeRegexp OutputKafkaTopicsWhenType = "regexp" +) + +// Defines values for OutputKafkaType. +const ( + OutputKafkaTypeKafka OutputKafkaType = "kafka" +) + +// Defines values for OutputLogstashType. +const ( + OutputLogstashTypeLogstash OutputLogstashType = "logstash" +) + +// Defines values for OutputRemoteElasticsearchPreset. +const ( + OutputRemoteElasticsearchPresetBalanced OutputRemoteElasticsearchPreset = "balanced" + OutputRemoteElasticsearchPresetCustom OutputRemoteElasticsearchPreset = "custom" + OutputRemoteElasticsearchPresetLatency OutputRemoteElasticsearchPreset = "latency" + OutputRemoteElasticsearchPresetScale OutputRemoteElasticsearchPreset = "scale" + OutputRemoteElasticsearchPresetThroughput OutputRemoteElasticsearchPreset = "throughput" +) + +// Defines values for OutputRemoteElasticsearchType. +const ( + OutputRemoteElasticsearchTypeRemoteElasticsearch OutputRemoteElasticsearchType = "remote_elasticsearch" +) + +// Defines values for OutputSslVerificationMode. +const ( + OutputSslVerificationModeCertificate OutputSslVerificationMode = "certificate" + OutputSslVerificationModeFull OutputSslVerificationMode = "full" + OutputSslVerificationModeNone OutputSslVerificationMode = "none" + OutputSslVerificationModeStrict OutputSslVerificationMode = "strict" +) + +// Defines values for PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType. +const ( + PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaTypeCspRuleTemplate PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType = "csp-rule-template" + PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaTypeDashboard PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType = "dashboard" + PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaTypeIndexPattern PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType = "index-pattern" + PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaTypeLens PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType = "lens" + PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaTypeMap PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType = "map" + PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaTypeMlModule PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType = "ml-module" + PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaTypeOsqueryPackAsset PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType = "osquery-pack-asset" + PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaTypeOsquerySavedQuery PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType = "osquery-saved-query" + PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaTypeSearch PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType = "search" + PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaTypeSecurityRule PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType = "security-rule" + PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaTypeTag PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType = "tag" + PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaTypeVisualization PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType = "visualization" +) + +// Defines values for PackageInfoInstallationInfoInstallSource. +const ( + PackageInfoInstallationInfoInstallSourceBundled PackageInfoInstallationInfoInstallSource = "bundled" + PackageInfoInstallationInfoInstallSourceCustom PackageInfoInstallationInfoInstallSource = "custom" + PackageInfoInstallationInfoInstallSourceRegistry PackageInfoInstallationInfoInstallSource = "registry" + PackageInfoInstallationInfoInstallSourceUpload PackageInfoInstallationInfoInstallSource = "upload" +) + +// Defines values for PackageInfoInstallationInfoInstallStatus. +const ( + PackageInfoInstallationInfoInstallStatusInstallFailed PackageInfoInstallationInfoInstallStatus = "install_failed" + PackageInfoInstallationInfoInstallStatusInstalled PackageInfoInstallationInfoInstallStatus = "installed" + PackageInfoInstallationInfoInstallStatusInstalling PackageInfoInstallationInfoInstallStatus = "installing" +) + +// Defines values for PackageInfoInstallationInfoInstalledEsType. +const ( + PackageInfoInstallationInfoInstalledEsTypeComponentTemplate PackageInfoInstallationInfoInstalledEsType = "component_template" + PackageInfoInstallationInfoInstalledEsTypeDataStreamIlmPolicy PackageInfoInstallationInfoInstalledEsType = "data_stream_ilm_policy" + PackageInfoInstallationInfoInstalledEsTypeIlmPolicy PackageInfoInstallationInfoInstalledEsType = "ilm_policy" + PackageInfoInstallationInfoInstalledEsTypeIndex PackageInfoInstallationInfoInstalledEsType = "index" + PackageInfoInstallationInfoInstalledEsTypeIndexTemplate PackageInfoInstallationInfoInstalledEsType = "index_template" + PackageInfoInstallationInfoInstalledEsTypeIngestPipeline PackageInfoInstallationInfoInstalledEsType = "ingest_pipeline" + PackageInfoInstallationInfoInstalledEsTypeMlModel PackageInfoInstallationInfoInstalledEsType = "ml_model" + PackageInfoInstallationInfoInstalledEsTypeTransform PackageInfoInstallationInfoInstalledEsType = "transform" +) + +// Defines values for PackageInfoInstallationInfoInstalledKibanaType. +const ( + PackageInfoInstallationInfoInstalledKibanaTypeCspRuleTemplate PackageInfoInstallationInfoInstalledKibanaType = "csp-rule-template" + PackageInfoInstallationInfoInstalledKibanaTypeDashboard PackageInfoInstallationInfoInstalledKibanaType = "dashboard" + PackageInfoInstallationInfoInstalledKibanaTypeIndexPattern PackageInfoInstallationInfoInstalledKibanaType = "index-pattern" + PackageInfoInstallationInfoInstalledKibanaTypeLens PackageInfoInstallationInfoInstalledKibanaType = "lens" + PackageInfoInstallationInfoInstalledKibanaTypeMap PackageInfoInstallationInfoInstalledKibanaType = "map" + PackageInfoInstallationInfoInstalledKibanaTypeMlModule PackageInfoInstallationInfoInstalledKibanaType = "ml-module" + PackageInfoInstallationInfoInstalledKibanaTypeOsqueryPackAsset PackageInfoInstallationInfoInstalledKibanaType = "osquery-pack-asset" + PackageInfoInstallationInfoInstalledKibanaTypeOsquerySavedQuery PackageInfoInstallationInfoInstalledKibanaType = "osquery-saved-query" + PackageInfoInstallationInfoInstalledKibanaTypeSearch PackageInfoInstallationInfoInstalledKibanaType = "search" + PackageInfoInstallationInfoInstalledKibanaTypeSecurityRule PackageInfoInstallationInfoInstalledKibanaType = "security-rule" + PackageInfoInstallationInfoInstalledKibanaTypeTag PackageInfoInstallationInfoInstalledKibanaType = "tag" + PackageInfoInstallationInfoInstalledKibanaTypeVisualization PackageInfoInstallationInfoInstalledKibanaType = "visualization" +) + +// Defines values for PackageInfoInstallationInfoVerificationStatus. +const ( + PackageInfoInstallationInfoVerificationStatusUnknown PackageInfoInstallationInfoVerificationStatus = "unknown" + PackageInfoInstallationInfoVerificationStatusUnverified PackageInfoInstallationInfoVerificationStatus = "unverified" + PackageInfoInstallationInfoVerificationStatusVerified PackageInfoInstallationInfoVerificationStatus = "verified" +) + +// Defines values for PackageInfoOwnerType. +const ( + PackageInfoOwnerTypeCommunity PackageInfoOwnerType = "community" + PackageInfoOwnerTypeElastic PackageInfoOwnerType = "elastic" + PackageInfoOwnerTypePartner PackageInfoOwnerType = "partner" +) + +// Defines values for PackageInfoRelease. +const ( + PackageInfoReleaseBeta PackageInfoRelease = "beta" + PackageInfoReleaseExperimental PackageInfoRelease = "experimental" + PackageInfoReleaseGa PackageInfoRelease = "ga" +) + +// Defines values for PackageInfoType. +const ( + PackageInfoTypeContent PackageInfoType = "content" + PackageInfoTypeInput PackageInfoType = "input" + PackageInfoTypeIntegration PackageInfoType = "integration" +) + +// Defines values for PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType. +const ( + PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaTypeCspRuleTemplate PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType = "csp-rule-template" + PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaTypeDashboard PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType = "dashboard" + PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaTypeIndexPattern PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType = "index-pattern" + PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaTypeLens PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType = "lens" + PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaTypeMap PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType = "map" + PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaTypeMlModule PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType = "ml-module" + PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaTypeOsqueryPackAsset PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType = "osquery-pack-asset" + PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaTypeOsquerySavedQuery PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType = "osquery-saved-query" + PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaTypeSearch PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType = "search" + PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaTypeSecurityRule PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType = "security-rule" + PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaTypeTag PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType = "tag" + PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaTypeVisualization PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType = "visualization" +) + +// Defines values for PackageListItemInstallationInfoInstallSource. +const ( + PackageListItemInstallationInfoInstallSourceBundled PackageListItemInstallationInfoInstallSource = "bundled" + PackageListItemInstallationInfoInstallSourceCustom PackageListItemInstallationInfoInstallSource = "custom" + PackageListItemInstallationInfoInstallSourceRegistry PackageListItemInstallationInfoInstallSource = "registry" + PackageListItemInstallationInfoInstallSourceUpload PackageListItemInstallationInfoInstallSource = "upload" +) + +// Defines values for PackageListItemInstallationInfoInstallStatus. +const ( + PackageListItemInstallationInfoInstallStatusInstallFailed PackageListItemInstallationInfoInstallStatus = "install_failed" + PackageListItemInstallationInfoInstallStatusInstalled PackageListItemInstallationInfoInstallStatus = "installed" + PackageListItemInstallationInfoInstallStatusInstalling PackageListItemInstallationInfoInstallStatus = "installing" +) + +// Defines values for PackageListItemInstallationInfoInstalledEsType. +const ( + PackageListItemInstallationInfoInstalledEsTypeComponentTemplate PackageListItemInstallationInfoInstalledEsType = "component_template" + PackageListItemInstallationInfoInstalledEsTypeDataStreamIlmPolicy PackageListItemInstallationInfoInstalledEsType = "data_stream_ilm_policy" + PackageListItemInstallationInfoInstalledEsTypeIlmPolicy PackageListItemInstallationInfoInstalledEsType = "ilm_policy" + PackageListItemInstallationInfoInstalledEsTypeIndex PackageListItemInstallationInfoInstalledEsType = "index" + PackageListItemInstallationInfoInstalledEsTypeIndexTemplate PackageListItemInstallationInfoInstalledEsType = "index_template" + PackageListItemInstallationInfoInstalledEsTypeIngestPipeline PackageListItemInstallationInfoInstalledEsType = "ingest_pipeline" + PackageListItemInstallationInfoInstalledEsTypeMlModel PackageListItemInstallationInfoInstalledEsType = "ml_model" + PackageListItemInstallationInfoInstalledEsTypeTransform PackageListItemInstallationInfoInstalledEsType = "transform" +) + +// Defines values for PackageListItemInstallationInfoInstalledKibanaType. +const ( + PackageListItemInstallationInfoInstalledKibanaTypeCspRuleTemplate PackageListItemInstallationInfoInstalledKibanaType = "csp-rule-template" + PackageListItemInstallationInfoInstalledKibanaTypeDashboard PackageListItemInstallationInfoInstalledKibanaType = "dashboard" + PackageListItemInstallationInfoInstalledKibanaTypeIndexPattern PackageListItemInstallationInfoInstalledKibanaType = "index-pattern" + PackageListItemInstallationInfoInstalledKibanaTypeLens PackageListItemInstallationInfoInstalledKibanaType = "lens" + PackageListItemInstallationInfoInstalledKibanaTypeMap PackageListItemInstallationInfoInstalledKibanaType = "map" + PackageListItemInstallationInfoInstalledKibanaTypeMlModule PackageListItemInstallationInfoInstalledKibanaType = "ml-module" + PackageListItemInstallationInfoInstalledKibanaTypeOsqueryPackAsset PackageListItemInstallationInfoInstalledKibanaType = "osquery-pack-asset" + PackageListItemInstallationInfoInstalledKibanaTypeOsquerySavedQuery PackageListItemInstallationInfoInstalledKibanaType = "osquery-saved-query" + PackageListItemInstallationInfoInstalledKibanaTypeSearch PackageListItemInstallationInfoInstalledKibanaType = "search" + PackageListItemInstallationInfoInstalledKibanaTypeSecurityRule PackageListItemInstallationInfoInstalledKibanaType = "security-rule" + PackageListItemInstallationInfoInstalledKibanaTypeTag PackageListItemInstallationInfoInstalledKibanaType = "tag" + PackageListItemInstallationInfoInstalledKibanaTypeVisualization PackageListItemInstallationInfoInstalledKibanaType = "visualization" +) + +// Defines values for PackageListItemInstallationInfoVerificationStatus. +const ( + PackageListItemInstallationInfoVerificationStatusUnknown PackageListItemInstallationInfoVerificationStatus = "unknown" + PackageListItemInstallationInfoVerificationStatusUnverified PackageListItemInstallationInfoVerificationStatus = "unverified" + PackageListItemInstallationInfoVerificationStatusVerified PackageListItemInstallationInfoVerificationStatus = "verified" +) + +// Defines values for PackageListItemOwnerType. +const ( + PackageListItemOwnerTypeCommunity PackageListItemOwnerType = "community" + PackageListItemOwnerTypeElastic PackageListItemOwnerType = "elastic" + PackageListItemOwnerTypePartner PackageListItemOwnerType = "partner" +) + +// Defines values for PackageListItemRelease. +const ( + Beta PackageListItemRelease = "beta" + Experimental PackageListItemRelease = "experimental" + Ga PackageListItemRelease = "ga" +) + +// Defines values for PackageListItemType. +const ( + PackageListItemTypeContent PackageListItemType = "content" + PackageListItemTypeInput PackageListItemType = "input" + PackageListItemTypeIntegration PackageListItemType = "integration" +) + +// Defines values for UpdateOutputElasticsearchPreset. +const ( + UpdateOutputElasticsearchPresetBalanced UpdateOutputElasticsearchPreset = "balanced" + UpdateOutputElasticsearchPresetCustom UpdateOutputElasticsearchPreset = "custom" + UpdateOutputElasticsearchPresetLatency UpdateOutputElasticsearchPreset = "latency" + UpdateOutputElasticsearchPresetScale UpdateOutputElasticsearchPreset = "scale" + UpdateOutputElasticsearchPresetThroughput UpdateOutputElasticsearchPreset = "throughput" +) + +// Defines values for UpdateOutputElasticsearchType. +const ( + Elasticsearch UpdateOutputElasticsearchType = "elasticsearch" +) + +// Defines values for UpdateOutputKafkaAuthType. +const ( + UpdateOutputKafkaAuthTypeKerberos UpdateOutputKafkaAuthType = "kerberos" + UpdateOutputKafkaAuthTypeNone UpdateOutputKafkaAuthType = "none" + UpdateOutputKafkaAuthTypeSsl UpdateOutputKafkaAuthType = "ssl" + UpdateOutputKafkaAuthTypeUserPass UpdateOutputKafkaAuthType = "user_pass" +) + +// Defines values for UpdateOutputKafkaCompression. +const ( + UpdateOutputKafkaCompressionGzip UpdateOutputKafkaCompression = "gzip" + UpdateOutputKafkaCompressionLz4 UpdateOutputKafkaCompression = "lz4" + UpdateOutputKafkaCompressionNone UpdateOutputKafkaCompression = "none" + UpdateOutputKafkaCompressionSnappy UpdateOutputKafkaCompression = "snappy" +) + +// Defines values for UpdateOutputKafkaPartition. +const ( + Hash UpdateOutputKafkaPartition = "hash" + Random UpdateOutputKafkaPartition = "random" + RoundRobin UpdateOutputKafkaPartition = "round_robin" +) + +// Defines values for UpdateOutputKafkaRequiredAcks. +const ( + Minus1 UpdateOutputKafkaRequiredAcks = -1 + N0 UpdateOutputKafkaRequiredAcks = 0 + N1 UpdateOutputKafkaRequiredAcks = 1 +) + +// Defines values for UpdateOutputKafkaSaslMechanism. +const ( + PLAIN UpdateOutputKafkaSaslMechanism = "PLAIN" + SCRAMSHA256 UpdateOutputKafkaSaslMechanism = "SCRAM-SHA-256" + SCRAMSHA512 UpdateOutputKafkaSaslMechanism = "SCRAM-SHA-512" +) + +// Defines values for UpdateOutputKafkaTopicsWhenType. +const ( + Contains UpdateOutputKafkaTopicsWhenType = "contains" + Equals UpdateOutputKafkaTopicsWhenType = "equals" + Regexp UpdateOutputKafkaTopicsWhenType = "regexp" +) + +// Defines values for UpdateOutputKafkaType. +const ( + Kafka UpdateOutputKafkaType = "kafka" +) + +// Defines values for UpdateOutputLogstashType. +const ( + Logstash UpdateOutputLogstashType = "logstash" +) + +// Defines values for UpdateOutputRemoteElasticsearchPreset. +const ( + UpdateOutputRemoteElasticsearchPresetBalanced UpdateOutputRemoteElasticsearchPreset = "balanced" + UpdateOutputRemoteElasticsearchPresetCustom UpdateOutputRemoteElasticsearchPreset = "custom" + UpdateOutputRemoteElasticsearchPresetLatency UpdateOutputRemoteElasticsearchPreset = "latency" + UpdateOutputRemoteElasticsearchPresetScale UpdateOutputRemoteElasticsearchPreset = "scale" + UpdateOutputRemoteElasticsearchPresetThroughput UpdateOutputRemoteElasticsearchPreset = "throughput" +) + +// Defines values for UpdateOutputRemoteElasticsearchType. +const ( + RemoteElasticsearch UpdateOutputRemoteElasticsearchType = "remote_elasticsearch" +) + +// Defines values for UpdateOutputSslVerificationMode. +const ( + Certificate UpdateOutputSslVerificationMode = "certificate" + Full UpdateOutputSslVerificationMode = "full" + None UpdateOutputSslVerificationMode = "none" + Strict UpdateOutputSslVerificationMode = "strict" +) + +// Defines values for GetAgentPoliciesParamsSortOrder. +const ( + GetAgentPoliciesParamsSortOrderAsc GetAgentPoliciesParamsSortOrder = "asc" + GetAgentPoliciesParamsSortOrderDesc GetAgentPoliciesParamsSortOrder = "desc" +) + +// Defines values for GetAgentPoliciesParamsFormat. +const ( + GetAgentPoliciesParamsFormatLegacy GetAgentPoliciesParamsFormat = "legacy" + GetAgentPoliciesParamsFormatSimplified GetAgentPoliciesParamsFormat = "simplified" +) + +// Defines values for CreateAgentPolicyJSONBodyMonitoringEnabled. +const ( + CreateAgentPolicyJSONBodyMonitoringEnabledLogs CreateAgentPolicyJSONBodyMonitoringEnabled = "logs" + CreateAgentPolicyJSONBodyMonitoringEnabledMetrics CreateAgentPolicyJSONBodyMonitoringEnabled = "metrics" + CreateAgentPolicyJSONBodyMonitoringEnabledTraces CreateAgentPolicyJSONBodyMonitoringEnabled = "traces" +) + +// Defines values for GetAgentPolicyParamsFormat. +const ( + GetAgentPolicyParamsFormatLegacy GetAgentPolicyParamsFormat = "legacy" + GetAgentPolicyParamsFormatSimplified GetAgentPolicyParamsFormat = "simplified" +) + +// Defines values for UpdateAgentPolicyParamsFormat. +const ( + UpdateAgentPolicyParamsFormatLegacy UpdateAgentPolicyParamsFormat = "legacy" + UpdateAgentPolicyParamsFormatSimplified UpdateAgentPolicyParamsFormat = "simplified" +) + +// Defines values for UpdateAgentPolicyJSONBodyMonitoringEnabled. +const ( + Logs UpdateAgentPolicyJSONBodyMonitoringEnabled = "logs" + Metrics UpdateAgentPolicyJSONBodyMonitoringEnabled = "metrics" + Traces UpdateAgentPolicyJSONBodyMonitoringEnabled = "traces" +) + +// Defines values for GetPackagePoliciesParamsSortOrder. +const ( + GetPackagePoliciesParamsSortOrderAsc GetPackagePoliciesParamsSortOrder = "asc" + GetPackagePoliciesParamsSortOrderDesc GetPackagePoliciesParamsSortOrder = "desc" +) + +// Defines values for GetPackagePoliciesParamsFormat. +const ( + GetPackagePoliciesParamsFormatLegacy GetPackagePoliciesParamsFormat = "legacy" + GetPackagePoliciesParamsFormatSimplified GetPackagePoliciesParamsFormat = "simplified" +) + +// Defines values for CreatePackagePolicyParamsFormat. +const ( + CreatePackagePolicyParamsFormatLegacy CreatePackagePolicyParamsFormat = "legacy" + CreatePackagePolicyParamsFormatSimplified CreatePackagePolicyParamsFormat = "simplified" +) + +// Defines values for GetPackagePolicyParamsFormat. +const ( + GetPackagePolicyParamsFormatLegacy GetPackagePolicyParamsFormat = "legacy" + GetPackagePolicyParamsFormatSimplified GetPackagePolicyParamsFormat = "simplified" +) + +// Defines values for UpdatePackagePolicyParamsFormat. +const ( + Legacy UpdatePackagePolicyParamsFormat = "legacy" + Simplified UpdatePackagePolicyParamsFormat = "simplified" +) + +// AgentPolicy defines model for agent_policy. +type AgentPolicy struct { + AdvancedSettings *struct { + AgentDownloadTargetDirectory *interface{} `json:"agent_download_target_directory"` + AgentDownloadTimeout *interface{} `json:"agent_download_timeout"` + AgentLimitsGoMaxProcs *interface{} `json:"agent_limits_go_max_procs"` + AgentLoggingLevel *interface{} `json:"agent_logging_level"` + AgentLoggingMetricsPeriod *interface{} `json:"agent_logging_metrics_period"` + } `json:"advanced_settings,omitempty"` + AgentFeatures *[]struct { + Enabled bool `json:"enabled"` + Name string `json:"name"` + } `json:"agent_features,omitempty"` + Agents *float32 `json:"agents,omitempty"` + DataOutputId *string `json:"data_output_id"` + Description *string `json:"description,omitempty"` + DownloadSourceId *string `json:"download_source_id"` + FleetServerHostId *string `json:"fleet_server_host_id"` + + // GlobalDataTags User defined data tags that are added to all of the inputs. The values can be strings or numbers. + GlobalDataTags *[]struct { + Name string `json:"name"` + Value AgentPolicy_GlobalDataTags_Value `json:"value"` + } `json:"global_data_tags,omitempty"` + HasFleetServer *bool `json:"has_fleet_server,omitempty"` + Id string `json:"id"` + InactivityTimeout *float32 `json:"inactivity_timeout,omitempty"` + IsDefault *bool `json:"is_default,omitempty"` + IsDefaultFleetServer *bool `json:"is_default_fleet_server,omitempty"` + IsManaged bool `json:"is_managed"` + IsPreconfigured *bool `json:"is_preconfigured,omitempty"` + + // IsProtected Indicates whether the agent policy has tamper protection enabled. Default false. + IsProtected bool `json:"is_protected"` + + // KeepMonitoringAlive When set to true, monitoring will be enabled but logs/metrics collection will be disabled + KeepMonitoringAlive *bool `json:"keep_monitoring_alive"` + MonitoringDiagnostics *struct { + Limit *struct { + Burst *float32 `json:"burst,omitempty"` + Interval *string `json:"interval,omitempty"` + } `json:"limit,omitempty"` + Uploader *struct { + InitDur *string `json:"init_dur,omitempty"` + MaxDur *string `json:"max_dur,omitempty"` + MaxRetries *float32 `json:"max_retries,omitempty"` + } `json:"uploader,omitempty"` + } `json:"monitoring_diagnostics,omitempty"` + MonitoringEnabled *[]AgentPolicyMonitoringEnabled `json:"monitoring_enabled,omitempty"` + MonitoringHttp *struct { + Buffer *struct { + Enabled *bool `json:"enabled,omitempty"` + } `json:"buffer,omitempty"` + Enabled bool `json:"enabled"` + Host *string `json:"host,omitempty"` + Port *float32 `json:"port,omitempty"` + } `json:"monitoring_http,omitempty"` + MonitoringOutputId *string `json:"monitoring_output_id"` + MonitoringPprofEnabled *bool `json:"monitoring_pprof_enabled,omitempty"` + Name string `json:"name"` + Namespace string `json:"namespace"` + + // Overrides Override settings that are defined in the agent policy. Input settings cannot be overridden. The override option should be used only in unusual circumstances and not as a routine procedure. + Overrides *map[string]interface{} `json:"overrides"` + PackagePolicies *AgentPolicy_PackagePolicies `json:"package_policies,omitempty"` + Revision float32 `json:"revision"` + SchemaVersion *string `json:"schema_version,omitempty"` + SpaceIds *[]string `json:"space_ids,omitempty"` + Status AgentPolicyStatus `json:"status"` + + // SupportsAgentless Indicates whether the agent policy supports agentless integrations. + SupportsAgentless *bool `json:"supports_agentless"` + UnenrollTimeout *float32 `json:"unenroll_timeout,omitempty"` + UnprivilegedAgents *float32 `json:"unprivileged_agents,omitempty"` + UpdatedAt string `json:"updated_at"` + UpdatedBy string `json:"updated_by"` + Version *string `json:"version,omitempty"` +} + +// AgentPolicyGlobalDataTagsValue0 defines model for . +type AgentPolicyGlobalDataTagsValue0 = string + +// AgentPolicyGlobalDataTagsValue1 defines model for . +type AgentPolicyGlobalDataTagsValue1 = float32 + +// AgentPolicy_GlobalDataTags_Value defines model for AgentPolicy.GlobalDataTags.Value. +type AgentPolicy_GlobalDataTags_Value struct { + union json.RawMessage +} + +// AgentPolicyMonitoringEnabled defines model for AgentPolicy.MonitoringEnabled. +type AgentPolicyMonitoringEnabled string + +// AgentPolicyPackagePolicies0 defines model for . +type AgentPolicyPackagePolicies0 = []string + +// AgentPolicyPackagePolicies1 This field is present only when retrieving a single agent policy, or when retrieving a list of agent policies with the ?full=true parameter +type AgentPolicyPackagePolicies1 = []struct { + CreatedAt string `json:"created_at"` + CreatedBy string `json:"created_by"` + + // Description Package policy description + Description *string `json:"description,omitempty"` + Elasticsearch *AgentPolicy_PackagePolicies_1_Elasticsearch `json:"elasticsearch,omitempty"` + Enabled bool `json:"enabled"` + Id string `json:"id"` + Inputs []struct { + CompiledInput interface{} `json:"compiled_input"` + + // Config Package variable (see integration documentation for more information) + Config *map[string]struct { + Frozen *bool `json:"frozen,omitempty"` + Type *string `json:"type,omitempty"` + Value interface{} `json:"value"` + } `json:"config,omitempty"` + Enabled bool `json:"enabled"` + Id *string `json:"id,omitempty"` + KeepEnabled *bool `json:"keep_enabled,omitempty"` + PolicyTemplate *string `json:"policy_template,omitempty"` + Streams []struct { + CompiledStream interface{} `json:"compiled_stream"` + + // Config Package variable (see integration documentation for more information) + Config *map[string]struct { + Frozen *bool `json:"frozen,omitempty"` + Type *string `json:"type,omitempty"` + Value interface{} `json:"value"` + } `json:"config,omitempty"` + DataStream struct { + Dataset string `json:"dataset"` + Elasticsearch *struct { + DynamicDataset *bool `json:"dynamic_dataset,omitempty"` + DynamicNamespace *bool `json:"dynamic_namespace,omitempty"` + Privileges *struct { + Indices *[]string `json:"indices,omitempty"` + } `json:"privileges,omitempty"` + } `json:"elasticsearch,omitempty"` + Type string `json:"type"` + } `json:"data_stream"` + Enabled bool `json:"enabled"` + Id *string `json:"id,omitempty"` + KeepEnabled *bool `json:"keep_enabled,omitempty"` + Release *AgentPolicyPackagePolicies1InputsStreamsRelease `json:"release,omitempty"` + + // Vars Package variable (see integration documentation for more information) + Vars *map[string]struct { + Frozen *bool `json:"frozen,omitempty"` + Type *string `json:"type,omitempty"` + Value interface{} `json:"value"` + } `json:"vars,omitempty"` + } `json:"streams"` + Type string `json:"type"` + + // Vars Package variable (see integration documentation for more information) + Vars *map[string]struct { + Frozen *bool `json:"frozen,omitempty"` + Type *string `json:"type,omitempty"` + Value interface{} `json:"value"` + } `json:"vars,omitempty"` + } `json:"inputs"` + IsManaged *bool `json:"is_managed,omitempty"` + + // Name Package policy name (should be unique) + Name string `json:"name"` + + // Namespace The package policy namespace. Leave blank to inherit the agent policy's namespace. + Namespace *string `json:"namespace,omitempty"` + OutputId *string `json:"output_id"` + + // Overrides Override settings that are defined in the package policy. The override option should be used only in unusual circumstances and not as a routine procedure. + Overrides *struct { + Inputs *map[string]interface{} `json:"inputs,omitempty"` + } `json:"overrides"` + Package *struct { + ExperimentalDataStreamFeatures *[]struct { + DataStream string `json:"data_stream"` + Features struct { + DocValueOnlyNumeric *bool `json:"doc_value_only_numeric,omitempty"` + DocValueOnlyOther *bool `json:"doc_value_only_other,omitempty"` + SyntheticSource *bool `json:"synthetic_source,omitempty"` + Tsdb *bool `json:"tsdb,omitempty"` + } `json:"features"` + } `json:"experimental_data_stream_features,omitempty"` + + // Name Package name + Name string `json:"name"` + RequiresRoot *bool `json:"requires_root,omitempty"` + Title *string `json:"title,omitempty"` + + // Version Package version + Version string `json:"version"` + } `json:"package,omitempty"` + + // PolicyId Agent policy ID where that package policy will be added + // Deprecated: + PolicyId *string `json:"policy_id"` + PolicyIds *[]string `json:"policy_ids,omitempty"` + Revision float32 `json:"revision"` + SecretReferences *[]struct { + Id string `json:"id"` + } `json:"secret_references,omitempty"` + UpdatedAt string `json:"updated_at"` + UpdatedBy string `json:"updated_by"` + + // Vars Package variable (see integration documentation for more information) + Vars *map[string]struct { + Frozen *bool `json:"frozen,omitempty"` + Type *string `json:"type,omitempty"` + Value interface{} `json:"value"` + } `json:"vars,omitempty"` + Version *string `json:"version,omitempty"` +} + +// AgentPolicy_PackagePolicies_1_Elasticsearch_Privileges defines model for AgentPolicy.PackagePolicies.1.Elasticsearch.Privileges. +type AgentPolicy_PackagePolicies_1_Elasticsearch_Privileges struct { + Cluster *[]string `json:"cluster,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// AgentPolicy_PackagePolicies_1_Elasticsearch defines model for AgentPolicy.PackagePolicies.1.Elasticsearch. +type AgentPolicy_PackagePolicies_1_Elasticsearch struct { + Privileges *AgentPolicy_PackagePolicies_1_Elasticsearch_Privileges `json:"privileges,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// AgentPolicyPackagePolicies1InputsStreamsRelease defines model for AgentPolicy.PackagePolicies.1.Inputs.Streams.Release. +type AgentPolicyPackagePolicies1InputsStreamsRelease string + +// AgentPolicy_PackagePolicies defines model for AgentPolicy.PackagePolicies. +type AgentPolicy_PackagePolicies struct { + union json.RawMessage +} + +// AgentPolicyStatus defines model for AgentPolicy.Status. +type AgentPolicyStatus string + +// EnrollmentApiKey defines model for enrollment_api_key. +type EnrollmentApiKey struct { + // Active When false, the enrollment API key is revoked and cannot be used for enrolling Elastic Agents. + Active bool `json:"active"` + + // ApiKey The enrollment API key (token) used for enrolling Elastic Agents. + ApiKey string `json:"api_key"` + + // ApiKeyId The ID of the API key in the Security API. + ApiKeyId string `json:"api_key_id"` + CreatedAt string `json:"created_at"` + Id string `json:"id"` + + // Name The name of the enrollment API key. + Name *string `json:"name,omitempty"` + + // PolicyId The ID of the agent policy the Elastic Agent will be enrolled in. + PolicyId *string `json:"policy_id,omitempty"` +} + +// NewOutputElasticsearch defines model for new_output_elasticsearch. +type NewOutputElasticsearch struct { + AllowEdit *[]string `json:"allow_edit,omitempty"` + CaSha256 *string `json:"ca_sha256,omitempty"` + CaTrustedFingerprint *string `json:"ca_trusted_fingerprint,omitempty"` + ConfigYaml *string `json:"config_yaml"` + Hosts []string `json:"hosts"` + Id *string `json:"id,omitempty"` + IsDefault *bool `json:"is_default,omitempty"` + IsDefaultMonitoring *bool `json:"is_default_monitoring,omitempty"` + IsInternal *bool `json:"is_internal,omitempty"` + IsPreconfigured *bool `json:"is_preconfigured,omitempty"` + Name string `json:"name"` + Preset *NewOutputElasticsearchPreset `json:"preset,omitempty"` + ProxyId *string `json:"proxy_id,omitempty"` + Shipper *NewOutputShipper `json:"shipper,omitempty"` + Ssl *NewOutputSsl `json:"ssl,omitempty"` + Type NewOutputElasticsearchType `json:"type"` +} + +// NewOutputElasticsearchPreset defines model for NewOutputElasticsearch.Preset. +type NewOutputElasticsearchPreset string + +// NewOutputElasticsearchType defines model for NewOutputElasticsearch.Type. +type NewOutputElasticsearchType string + +// NewOutputKafka defines model for new_output_kafka. +type NewOutputKafka struct { + AllowEdit *[]string `json:"allow_edit,omitempty"` + AuthType NewOutputKafkaAuthType `json:"auth_type"` + BrokerTimeout *float32 `json:"broker_timeout,omitempty"` + CaSha256 *string `json:"ca_sha256,omitempty"` + CaTrustedFingerprint *string `json:"ca_trusted_fingerprint,omitempty"` + ClientId *string `json:"client_id,omitempty"` + Compression *NewOutputKafkaCompression `json:"compression,omitempty"` + CompressionLevel interface{} `json:"compression_level"` + ConfigYaml *string `json:"config_yaml"` + ConnectionType interface{} `json:"connection_type"` + Hash *struct { + Hash *string `json:"hash,omitempty"` + Random *bool `json:"random,omitempty"` + } `json:"hash,omitempty"` + Headers *[]struct { + Key string `json:"key"` + Value string `json:"value"` + } `json:"headers,omitempty"` + Hosts []string `json:"hosts"` + Id *string `json:"id,omitempty"` + IsDefault *bool `json:"is_default,omitempty"` + IsDefaultMonitoring *bool `json:"is_default_monitoring,omitempty"` + IsInternal *bool `json:"is_internal,omitempty"` + IsPreconfigured *bool `json:"is_preconfigured,omitempty"` + Key *string `json:"key,omitempty"` + Name string `json:"name"` + Partition *NewOutputKafkaPartition `json:"partition,omitempty"` + Password interface{} `json:"password"` + ProxyId *string `json:"proxy_id,omitempty"` + Random *struct { + GroupEvents *float32 `json:"group_events,omitempty"` + } `json:"random,omitempty"` + RequiredAcks *NewOutputKafkaRequiredAcks `json:"required_acks,omitempty"` + RoundRobin *struct { + GroupEvents *float32 `json:"group_events,omitempty"` + } `json:"round_robin,omitempty"` + Sasl *struct { + Mechanism *NewOutputKafkaSaslMechanism `json:"mechanism,omitempty"` + } `json:"sasl"` + Secrets *struct { + Password *NewOutputKafka_Secrets_Password `json:"password,omitempty"` + Ssl *struct { + Key NewOutputKafka_Secrets_Ssl_Key `json:"key"` + } `json:"ssl,omitempty"` + } `json:"secrets,omitempty"` + Shipper *NewOutputShipper `json:"shipper,omitempty"` + Ssl *NewOutputSsl `json:"ssl,omitempty"` + Timeout *float32 `json:"timeout,omitempty"` + Topic *string `json:"topic,omitempty"` + Topics *[]struct { + Topic string `json:"topic"` + When *struct { + Condition *string `json:"condition,omitempty"` + Type *NewOutputKafkaTopicsWhenType `json:"type,omitempty"` + } `json:"when,omitempty"` + } `json:"topics,omitempty"` + Type NewOutputKafkaType `json:"type"` + Username interface{} `json:"username"` + Version *string `json:"version,omitempty"` +} + +// NewOutputKafkaAuthType defines model for NewOutputKafka.AuthType. +type NewOutputKafkaAuthType string + +// NewOutputKafkaCompression defines model for NewOutputKafka.Compression. +type NewOutputKafkaCompression string + +// NewOutputKafkaPartition defines model for NewOutputKafka.Partition. +type NewOutputKafkaPartition string + +// NewOutputKafkaRequiredAcks defines model for NewOutputKafka.RequiredAcks. +type NewOutputKafkaRequiredAcks int + +// NewOutputKafkaSaslMechanism defines model for NewOutputKafka.Sasl.Mechanism. +type NewOutputKafkaSaslMechanism string + +// NewOutputKafkaSecretsPassword0 defines model for . +type NewOutputKafkaSecretsPassword0 struct { + Id string `json:"id"` +} + +// NewOutputKafkaSecretsPassword1 defines model for . +type NewOutputKafkaSecretsPassword1 = string + +// NewOutputKafka_Secrets_Password defines model for NewOutputKafka.Secrets.Password. +type NewOutputKafka_Secrets_Password struct { + union json.RawMessage +} + +// NewOutputKafkaSecretsSslKey0 defines model for . +type NewOutputKafkaSecretsSslKey0 struct { + Id string `json:"id"` +} + +// NewOutputKafkaSecretsSslKey1 defines model for . +type NewOutputKafkaSecretsSslKey1 = string + +// NewOutputKafka_Secrets_Ssl_Key defines model for NewOutputKafka.Secrets.Ssl.Key. +type NewOutputKafka_Secrets_Ssl_Key struct { + union json.RawMessage +} + +// NewOutputKafkaTopicsWhenType defines model for NewOutputKafka.Topics.When.Type. +type NewOutputKafkaTopicsWhenType string + +// NewOutputKafkaType defines model for NewOutputKafka.Type. +type NewOutputKafkaType string + +// NewOutputLogstash defines model for new_output_logstash. +type NewOutputLogstash struct { + AllowEdit *[]string `json:"allow_edit,omitempty"` + CaSha256 *string `json:"ca_sha256,omitempty"` + CaTrustedFingerprint *string `json:"ca_trusted_fingerprint,omitempty"` + ConfigYaml *string `json:"config_yaml"` + Hosts []string `json:"hosts"` + Id *string `json:"id,omitempty"` + IsDefault *bool `json:"is_default,omitempty"` + IsDefaultMonitoring *bool `json:"is_default_monitoring,omitempty"` + IsInternal *bool `json:"is_internal,omitempty"` + IsPreconfigured *bool `json:"is_preconfigured,omitempty"` + Name string `json:"name"` + ProxyId *string `json:"proxy_id,omitempty"` + Secrets *struct { + Ssl *struct { + Key *NewOutputLogstash_Secrets_Ssl_Key `json:"key,omitempty"` + } `json:"ssl,omitempty"` + } `json:"secrets,omitempty"` + Shipper *NewOutputShipper `json:"shipper,omitempty"` + Ssl *NewOutputSsl `json:"ssl,omitempty"` + Type NewOutputLogstashType `json:"type"` +} + +// NewOutputLogstashSecretsSslKey0 defines model for . +type NewOutputLogstashSecretsSslKey0 struct { + Id string `json:"id"` +} + +// NewOutputLogstashSecretsSslKey1 defines model for . +type NewOutputLogstashSecretsSslKey1 = string + +// NewOutputLogstash_Secrets_Ssl_Key defines model for NewOutputLogstash.Secrets.Ssl.Key. +type NewOutputLogstash_Secrets_Ssl_Key struct { + union json.RawMessage +} + +// NewOutputLogstashType defines model for NewOutputLogstash.Type. +type NewOutputLogstashType string + +// NewOutputRemoteElasticsearch defines model for new_output_remote_elasticsearch. +type NewOutputRemoteElasticsearch struct { + AllowEdit *[]string `json:"allow_edit,omitempty"` + CaSha256 *string `json:"ca_sha256,omitempty"` + CaTrustedFingerprint *string `json:"ca_trusted_fingerprint,omitempty"` + ConfigYaml *string `json:"config_yaml"` + Hosts []string `json:"hosts"` + Id *string `json:"id,omitempty"` + IsDefault *bool `json:"is_default,omitempty"` + IsDefaultMonitoring *bool `json:"is_default_monitoring,omitempty"` + IsInternal *bool `json:"is_internal,omitempty"` + IsPreconfigured *bool `json:"is_preconfigured,omitempty"` + Name string `json:"name"` + Preset *NewOutputRemoteElasticsearchPreset `json:"preset,omitempty"` + ProxyId *string `json:"proxy_id,omitempty"` + Secrets *struct { + ServiceToken *NewOutputRemoteElasticsearch_Secrets_ServiceToken `json:"service_token,omitempty"` + } `json:"secrets,omitempty"` + ServiceToken *string `json:"service_token"` + Shipper *NewOutputShipper `json:"shipper,omitempty"` + Ssl *NewOutputSsl `json:"ssl,omitempty"` + Type NewOutputRemoteElasticsearchType `json:"type"` +} + +// NewOutputRemoteElasticsearchPreset defines model for NewOutputRemoteElasticsearch.Preset. +type NewOutputRemoteElasticsearchPreset string + +// NewOutputRemoteElasticsearchSecretsServiceToken0 defines model for . +type NewOutputRemoteElasticsearchSecretsServiceToken0 struct { + Id string `json:"id"` +} + +// NewOutputRemoteElasticsearchSecretsServiceToken1 defines model for . +type NewOutputRemoteElasticsearchSecretsServiceToken1 = string + +// NewOutputRemoteElasticsearch_Secrets_ServiceToken defines model for NewOutputRemoteElasticsearch.Secrets.ServiceToken. +type NewOutputRemoteElasticsearch_Secrets_ServiceToken struct { + union json.RawMessage +} + +// NewOutputRemoteElasticsearchType defines model for NewOutputRemoteElasticsearch.Type. +type NewOutputRemoteElasticsearchType string + +// NewOutputShipper defines model for new_output_shipper. +type NewOutputShipper struct { + CompressionLevel *float32 `json:"compression_level"` + DiskQueueCompressionEnabled *bool `json:"disk_queue_compression_enabled"` + DiskQueueEnabled *bool `json:"disk_queue_enabled"` + DiskQueueEncryptionEnabled *bool `json:"disk_queue_encryption_enabled"` + DiskQueueMaxSize *float32 `json:"disk_queue_max_size"` + DiskQueuePath *string `json:"disk_queue_path"` + Loadbalance *bool `json:"loadbalance"` + MaxBatchBytes *float32 `json:"max_batch_bytes"` + MemQueueEvents *float32 `json:"mem_queue_events"` + QueueFlushTimeout *float32 `json:"queue_flush_timeout"` +} + +// NewOutputSsl defines model for new_output_ssl. +type NewOutputSsl struct { + Certificate *string `json:"certificate,omitempty"` + CertificateAuthorities *[]string `json:"certificate_authorities,omitempty"` + Key *string `json:"key,omitempty"` + VerificationMode *NewOutputSslVerificationMode `json:"verification_mode,omitempty"` +} + +// NewOutputSslVerificationMode defines model for NewOutputSsl.VerificationMode. +type NewOutputSslVerificationMode string + +// NewOutputUnion defines model for new_output_union. +type NewOutputUnion struct { + union json.RawMessage +} + +// OutputElasticsearch defines model for output_elasticsearch. +type OutputElasticsearch struct { + AllowEdit *[]string `json:"allow_edit,omitempty"` + CaSha256 *string `json:"ca_sha256"` + CaTrustedFingerprint *string `json:"ca_trusted_fingerprint"` + ConfigYaml *string `json:"config_yaml"` + Hosts []string `json:"hosts"` + Id *string `json:"id,omitempty"` + IsDefault *bool `json:"is_default,omitempty"` + IsDefaultMonitoring *bool `json:"is_default_monitoring,omitempty"` + IsInternal *bool `json:"is_internal,omitempty"` + IsPreconfigured *bool `json:"is_preconfigured,omitempty"` + Name string `json:"name"` + Preset *OutputElasticsearchPreset `json:"preset,omitempty"` + ProxyId *string `json:"proxy_id"` + Shipper *OutputShipper `json:"shipper"` + Ssl *OutputSsl `json:"ssl"` + Type OutputElasticsearchType `json:"type"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// OutputElasticsearchPreset defines model for OutputElasticsearch.Preset. +type OutputElasticsearchPreset string + +// OutputElasticsearchType defines model for OutputElasticsearch.Type. +type OutputElasticsearchType string + +// OutputKafka defines model for output_kafka. +type OutputKafka struct { + AllowEdit *[]string `json:"allow_edit,omitempty"` + AuthType OutputKafkaAuthType `json:"auth_type"` + BrokerTimeout *float32 `json:"broker_timeout,omitempty"` + CaSha256 *string `json:"ca_sha256"` + CaTrustedFingerprint *string `json:"ca_trusted_fingerprint"` + ClientId *string `json:"client_id,omitempty"` + Compression *OutputKafkaCompression `json:"compression,omitempty"` + CompressionLevel interface{} `json:"compression_level"` + ConfigYaml *string `json:"config_yaml"` + ConnectionType interface{} `json:"connection_type"` + Hash *OutputKafka_Hash `json:"hash,omitempty"` + Headers *[]OutputKafka_Headers_Item `json:"headers,omitempty"` + Hosts []string `json:"hosts"` + Id *string `json:"id,omitempty"` + IsDefault *bool `json:"is_default,omitempty"` + IsDefaultMonitoring *bool `json:"is_default_monitoring,omitempty"` + IsInternal *bool `json:"is_internal,omitempty"` + IsPreconfigured *bool `json:"is_preconfigured,omitempty"` + Key *string `json:"key,omitempty"` + Name string `json:"name"` + Partition *OutputKafkaPartition `json:"partition,omitempty"` + Password interface{} `json:"password"` + ProxyId *string `json:"proxy_id"` + Random *OutputKafka_Random `json:"random,omitempty"` + RequiredAcks *OutputKafkaRequiredAcks `json:"required_acks,omitempty"` + RoundRobin *OutputKafka_RoundRobin `json:"round_robin,omitempty"` + Sasl *OutputKafka_Sasl `json:"sasl"` + Secrets *OutputKafka_Secrets `json:"secrets,omitempty"` + Shipper *OutputShipper `json:"shipper"` + Ssl *OutputSsl `json:"ssl"` + Timeout *float32 `json:"timeout,omitempty"` + Topic *string `json:"topic,omitempty"` + Topics *[]OutputKafka_Topics_Item `json:"topics,omitempty"` + Type OutputKafkaType `json:"type"` + Username interface{} `json:"username"` + Version *string `json:"version,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// OutputKafkaAuthType defines model for OutputKafka.AuthType. +type OutputKafkaAuthType string + +// OutputKafkaCompression defines model for OutputKafka.Compression. +type OutputKafkaCompression string + +// OutputKafka_Hash defines model for OutputKafka.Hash. +type OutputKafka_Hash struct { + Hash *string `json:"hash,omitempty"` + Random *bool `json:"random,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// OutputKafka_Headers_Item defines model for output_kafka.headers.Item. +type OutputKafka_Headers_Item struct { + Key string `json:"key"` + Value string `json:"value"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// OutputKafkaPartition defines model for OutputKafka.Partition. +type OutputKafkaPartition string + +// OutputKafka_Random defines model for OutputKafka.Random. +type OutputKafka_Random struct { + GroupEvents *float32 `json:"group_events,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// OutputKafkaRequiredAcks defines model for OutputKafka.RequiredAcks. +type OutputKafkaRequiredAcks int + +// OutputKafka_RoundRobin defines model for OutputKafka.RoundRobin. +type OutputKafka_RoundRobin struct { + GroupEvents *float32 `json:"group_events,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// OutputKafkaSaslMechanism defines model for OutputKafka.Sasl.Mechanism. +type OutputKafkaSaslMechanism string + +// OutputKafka_Sasl defines model for OutputKafka.Sasl. +type OutputKafka_Sasl struct { + Mechanism *OutputKafkaSaslMechanism `json:"mechanism,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// OutputKafkaSecretsPassword0 defines model for . +type OutputKafkaSecretsPassword0 struct { + Id string `json:"id"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// OutputKafkaSecretsPassword1 defines model for . +type OutputKafkaSecretsPassword1 = string + +// OutputKafka_Secrets_Password defines model for OutputKafka.Secrets.Password. +type OutputKafka_Secrets_Password struct { + union json.RawMessage +} + +// OutputKafkaSecretsSslKey0 defines model for . +type OutputKafkaSecretsSslKey0 struct { + Id string `json:"id"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// OutputKafkaSecretsSslKey1 defines model for . +type OutputKafkaSecretsSslKey1 = string + +// OutputKafka_Secrets_Ssl_Key defines model for OutputKafka.Secrets.Ssl.Key. +type OutputKafka_Secrets_Ssl_Key struct { + union json.RawMessage +} + +// OutputKafka_Secrets_Ssl defines model for OutputKafka.Secrets.Ssl. +type OutputKafka_Secrets_Ssl struct { + Key OutputKafka_Secrets_Ssl_Key `json:"key"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// OutputKafka_Secrets defines model for OutputKafka.Secrets. +type OutputKafka_Secrets struct { + Password *OutputKafka_Secrets_Password `json:"password,omitempty"` + Ssl *OutputKafka_Secrets_Ssl `json:"ssl,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// OutputKafkaTopicsWhenType defines model for OutputKafka.Topics.When.Type. +type OutputKafkaTopicsWhenType string + +// OutputKafka_Topics_When defines model for OutputKafka.Topics.When. +type OutputKafka_Topics_When struct { + Condition *string `json:"condition,omitempty"` + Type *OutputKafkaTopicsWhenType `json:"type,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// OutputKafka_Topics_Item defines model for output_kafka.topics.Item. +type OutputKafka_Topics_Item struct { + Topic string `json:"topic"` + When *OutputKafka_Topics_When `json:"when,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// OutputKafkaType defines model for OutputKafka.Type. +type OutputKafkaType string + +// OutputLogstash defines model for output_logstash. +type OutputLogstash struct { + AllowEdit *[]string `json:"allow_edit,omitempty"` + CaSha256 *string `json:"ca_sha256"` + CaTrustedFingerprint *string `json:"ca_trusted_fingerprint"` + ConfigYaml *string `json:"config_yaml"` + Hosts []string `json:"hosts"` + Id *string `json:"id,omitempty"` + IsDefault *bool `json:"is_default,omitempty"` + IsDefaultMonitoring *bool `json:"is_default_monitoring,omitempty"` + IsInternal *bool `json:"is_internal,omitempty"` + IsPreconfigured *bool `json:"is_preconfigured,omitempty"` + Name string `json:"name"` + ProxyId *string `json:"proxy_id"` + Secrets *OutputLogstash_Secrets `json:"secrets,omitempty"` + Shipper *OutputShipper `json:"shipper"` + Ssl *OutputSsl `json:"ssl"` + Type OutputLogstashType `json:"type"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// OutputLogstashSecretsSslKey0 defines model for . +type OutputLogstashSecretsSslKey0 struct { + Id string `json:"id"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// OutputLogstashSecretsSslKey1 defines model for . +type OutputLogstashSecretsSslKey1 = string + +// OutputLogstash_Secrets_Ssl_Key defines model for OutputLogstash.Secrets.Ssl.Key. +type OutputLogstash_Secrets_Ssl_Key struct { + union json.RawMessage +} + +// OutputLogstash_Secrets_Ssl defines model for OutputLogstash.Secrets.Ssl. +type OutputLogstash_Secrets_Ssl struct { + Key *OutputLogstash_Secrets_Ssl_Key `json:"key,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// OutputLogstash_Secrets defines model for OutputLogstash.Secrets. +type OutputLogstash_Secrets struct { + Ssl *OutputLogstash_Secrets_Ssl `json:"ssl,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// OutputLogstashType defines model for OutputLogstash.Type. +type OutputLogstashType string + +// OutputRemoteElasticsearch defines model for output_remote_elasticsearch. +type OutputRemoteElasticsearch struct { + AllowEdit *[]string `json:"allow_edit,omitempty"` + CaSha256 *string `json:"ca_sha256"` + CaTrustedFingerprint *string `json:"ca_trusted_fingerprint"` + ConfigYaml *string `json:"config_yaml"` + Hosts []string `json:"hosts"` + Id *string `json:"id,omitempty"` + IsDefault *bool `json:"is_default,omitempty"` + IsDefaultMonitoring *bool `json:"is_default_monitoring,omitempty"` + IsInternal *bool `json:"is_internal,omitempty"` + IsPreconfigured *bool `json:"is_preconfigured,omitempty"` + Name string `json:"name"` + Preset *OutputRemoteElasticsearchPreset `json:"preset,omitempty"` + ProxyId *string `json:"proxy_id"` + Secrets *OutputRemoteElasticsearch_Secrets `json:"secrets,omitempty"` + ServiceToken *string `json:"service_token"` + Shipper *OutputShipper `json:"shipper"` + Ssl *OutputSsl `json:"ssl"` + Type OutputRemoteElasticsearchType `json:"type"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// OutputRemoteElasticsearchPreset defines model for OutputRemoteElasticsearch.Preset. +type OutputRemoteElasticsearchPreset string + +// OutputRemoteElasticsearchSecretsServiceToken0 defines model for . +type OutputRemoteElasticsearchSecretsServiceToken0 struct { + Id string `json:"id"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// OutputRemoteElasticsearchSecretsServiceToken1 defines model for . +type OutputRemoteElasticsearchSecretsServiceToken1 = string + +// OutputRemoteElasticsearch_Secrets_ServiceToken defines model for OutputRemoteElasticsearch.Secrets.ServiceToken. +type OutputRemoteElasticsearch_Secrets_ServiceToken struct { + union json.RawMessage +} + +// OutputRemoteElasticsearch_Secrets defines model for OutputRemoteElasticsearch.Secrets. +type OutputRemoteElasticsearch_Secrets struct { + ServiceToken *OutputRemoteElasticsearch_Secrets_ServiceToken `json:"service_token,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// OutputRemoteElasticsearchType defines model for OutputRemoteElasticsearch.Type. +type OutputRemoteElasticsearchType string + +// OutputShipper defines model for output_shipper. +type OutputShipper struct { + CompressionLevel *float32 `json:"compression_level"` + DiskQueueCompressionEnabled *bool `json:"disk_queue_compression_enabled"` + DiskQueueEnabled *bool `json:"disk_queue_enabled"` + DiskQueueEncryptionEnabled *bool `json:"disk_queue_encryption_enabled"` + DiskQueueMaxSize *float32 `json:"disk_queue_max_size"` + DiskQueuePath *string `json:"disk_queue_path"` + Loadbalance *bool `json:"loadbalance"` + MaxBatchBytes *float32 `json:"max_batch_bytes"` + MemQueueEvents *float32 `json:"mem_queue_events"` + QueueFlushTimeout *float32 `json:"queue_flush_timeout"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// OutputSsl defines model for output_ssl. +type OutputSsl struct { + Certificate *string `json:"certificate,omitempty"` + CertificateAuthorities *[]string `json:"certificate_authorities,omitempty"` + Key *string `json:"key,omitempty"` + VerificationMode *OutputSslVerificationMode `json:"verification_mode,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// OutputSslVerificationMode defines model for OutputSsl.VerificationMode. +type OutputSslVerificationMode string + +// OutputUnion defines model for output_union. +type OutputUnion struct { + union json.RawMessage +} + +// PackageInfo defines model for package_info. +type PackageInfo struct { + Agent *struct { + Privileges *struct { + Root *bool `json:"root,omitempty"` + } `json:"privileges,omitempty"` + } `json:"agent,omitempty"` + AssetTags *[]struct { + AssetIds *[]string `json:"asset_ids,omitempty"` + AssetTypes *[]string `json:"asset_types,omitempty"` + Text string `json:"text"` + } `json:"asset_tags,omitempty"` + Assets map[string]interface{} `json:"assets"` + Categories *[]string `json:"categories,omitempty"` + Conditions *PackageInfo_Conditions `json:"conditions,omitempty"` + DataStreams *[]map[string]interface{} `json:"data_streams,omitempty"` + Description *string `json:"description,omitempty"` + Discovery *PackageInfo_Discovery `json:"discovery,omitempty"` + Download *string `json:"download,omitempty"` + Elasticsearch *map[string]interface{} `json:"elasticsearch,omitempty"` + FormatVersion *string `json:"format_version,omitempty"` + Icons *[]PackageInfo_Icons_Item `json:"icons,omitempty"` + InstallationInfo *PackageInfo_InstallationInfo `json:"installationInfo,omitempty"` + Internal *bool `json:"internal,omitempty"` + KeepPoliciesUpToDate *bool `json:"keepPoliciesUpToDate,omitempty"` + LatestVersion *string `json:"latestVersion,omitempty"` + License *string `json:"license,omitempty"` + LicensePath *string `json:"licensePath,omitempty"` + Name string `json:"name"` + Notice *string `json:"notice,omitempty"` + Owner *PackageInfo_Owner `json:"owner,omitempty"` + Path *string `json:"path,omitempty"` + PolicyTemplates *[]map[string]interface{} `json:"policy_templates,omitempty"` + Readme *string `json:"readme,omitempty"` + Release *PackageInfoRelease `json:"release,omitempty"` + SavedObject interface{} `json:"savedObject"` + Screenshots *[]struct { + DarkMode *bool `json:"dark_mode,omitempty"` + Path *string `json:"path,omitempty"` + Size *string `json:"size,omitempty"` + Src string `json:"src"` + Title *string `json:"title,omitempty"` + Type *string `json:"type,omitempty"` + } `json:"screenshots,omitempty"` + SignaturePath *string `json:"signature_path,omitempty"` + Source *PackageInfo_Source `json:"source,omitempty"` + Status *string `json:"status,omitempty"` + Title string `json:"title"` + Type *PackageInfoType `json:"type,omitempty"` + Vars *[]map[string]interface{} `json:"vars,omitempty"` + Version string `json:"version"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// PackageInfo_Conditions_Elastic defines model for PackageInfo.Conditions.Elastic. +type PackageInfo_Conditions_Elastic struct { + Capabilities *[]string `json:"capabilities,omitempty"` + Subscription *string `json:"subscription,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// PackageInfo_Conditions_Kibana defines model for PackageInfo.Conditions.Kibana. +type PackageInfo_Conditions_Kibana struct { + Version *string `json:"version,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// PackageInfo_Conditions defines model for PackageInfo.Conditions. +type PackageInfo_Conditions struct { + Elastic *PackageInfo_Conditions_Elastic `json:"elastic,omitempty"` + Kibana *PackageInfo_Conditions_Kibana `json:"kibana,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// PackageInfo_Discovery_Fields_Item defines model for PackageInfo.Discovery.Fields.Item. +type PackageInfo_Discovery_Fields_Item struct { + Name string `json:"name"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// PackageInfo_Discovery defines model for PackageInfo.Discovery. +type PackageInfo_Discovery struct { + Fields *[]PackageInfo_Discovery_Fields_Item `json:"fields,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// PackageInfo_Icons_Item defines model for package_info.icons.Item. +type PackageInfo_Icons_Item struct { + DarkMode *bool `json:"dark_mode,omitempty"` + Path *string `json:"path,omitempty"` + Size *string `json:"size,omitempty"` + Src string `json:"src"` + Title *string `json:"title,omitempty"` + Type *string `json:"type,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType defines model for PackageInfo.InstallationInfo.AdditionalSpacesInstalledKibana.Type. +type PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType string + +// PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Item defines model for PackageInfo.InstallationInfo.AdditionalSpacesInstalledKibana.Item. +type PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Item struct { + Id string `json:"id"` + OriginId *string `json:"originId,omitempty"` + Type PackageInfoInstallationInfoAdditionalSpacesInstalledKibanaType `json:"type"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// PackageInfo_InstallationInfo_ExperimentalDataStreamFeatures_Features defines model for PackageInfo.InstallationInfo.ExperimentalDataStreamFeatures.Features. +type PackageInfo_InstallationInfo_ExperimentalDataStreamFeatures_Features struct { + DocValueOnlyNumeric *bool `json:"doc_value_only_numeric,omitempty"` + DocValueOnlyOther *bool `json:"doc_value_only_other,omitempty"` + SyntheticSource *bool `json:"synthetic_source,omitempty"` + Tsdb *bool `json:"tsdb,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// PackageInfo_InstallationInfo_ExperimentalDataStreamFeatures_Item defines model for PackageInfo.InstallationInfo.ExperimentalDataStreamFeatures.Item. +type PackageInfo_InstallationInfo_ExperimentalDataStreamFeatures_Item struct { + DataStream string `json:"data_stream"` + Features PackageInfo_InstallationInfo_ExperimentalDataStreamFeatures_Features `json:"features"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// PackageInfoInstallationInfoInstallSource defines model for PackageInfo.InstallationInfo.InstallSource. +type PackageInfoInstallationInfoInstallSource string + +// PackageInfoInstallationInfoInstallStatus defines model for PackageInfo.InstallationInfo.InstallStatus. +type PackageInfoInstallationInfoInstallStatus string + +// PackageInfoInstallationInfoInstalledEsType defines model for PackageInfo.InstallationInfo.InstalledEs.Type. +type PackageInfoInstallationInfoInstalledEsType string + +// PackageInfo_InstallationInfo_InstalledEs_Item defines model for PackageInfo.InstallationInfo.InstalledEs.Item. +type PackageInfo_InstallationInfo_InstalledEs_Item struct { + Deferred *bool `json:"deferred,omitempty"` + Id string `json:"id"` + Type PackageInfoInstallationInfoInstalledEsType `json:"type"` + Version *string `json:"version,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// PackageInfoInstallationInfoInstalledKibanaType defines model for PackageInfo.InstallationInfo.InstalledKibana.Type. +type PackageInfoInstallationInfoInstalledKibanaType string + +// PackageInfo_InstallationInfo_InstalledKibana_Item defines model for PackageInfo.InstallationInfo.InstalledKibana.Item. +type PackageInfo_InstallationInfo_InstalledKibana_Item struct { + Id string `json:"id"` + OriginId *string `json:"originId,omitempty"` + Type PackageInfoInstallationInfoInstalledKibanaType `json:"type"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// PackageInfo_InstallationInfo_LatestExecutedState defines model for PackageInfo.InstallationInfo.LatestExecutedState. +type PackageInfo_InstallationInfo_LatestExecutedState struct { + Error *string `json:"error,omitempty"` + Name string `json:"name"` + StartedAt string `json:"started_at"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// PackageInfo_InstallationInfo_LatestInstallFailedAttempts_Error defines model for PackageInfo.InstallationInfo.LatestInstallFailedAttempts.Error. +type PackageInfo_InstallationInfo_LatestInstallFailedAttempts_Error struct { + Message string `json:"message"` + Name string `json:"name"` + Stack *string `json:"stack,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// PackageInfo_InstallationInfo_LatestInstallFailedAttempts_Item defines model for PackageInfo.InstallationInfo.LatestInstallFailedAttempts.Item. +type PackageInfo_InstallationInfo_LatestInstallFailedAttempts_Item struct { + CreatedAt string `json:"created_at"` + Error PackageInfo_InstallationInfo_LatestInstallFailedAttempts_Error `json:"error"` + TargetVersion string `json:"target_version"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// PackageInfoInstallationInfoVerificationStatus defines model for PackageInfo.InstallationInfo.VerificationStatus. +type PackageInfoInstallationInfoVerificationStatus string + +// PackageInfo_InstallationInfo defines model for PackageInfo.InstallationInfo. +type PackageInfo_InstallationInfo struct { + AdditionalSpacesInstalledKibana *map[string][]PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Item `json:"additional_spaces_installed_kibana,omitempty"` + CreatedAt *string `json:"created_at,omitempty"` + ExperimentalDataStreamFeatures *[]PackageInfo_InstallationInfo_ExperimentalDataStreamFeatures_Item `json:"experimental_data_stream_features,omitempty"` + InstallFormatSchemaVersion *string `json:"install_format_schema_version,omitempty"` + InstallSource PackageInfoInstallationInfoInstallSource `json:"install_source"` + InstallStatus PackageInfoInstallationInfoInstallStatus `json:"install_status"` + InstalledEs []PackageInfo_InstallationInfo_InstalledEs_Item `json:"installed_es"` + InstalledKibana []PackageInfo_InstallationInfo_InstalledKibana_Item `json:"installed_kibana"` + InstalledKibanaSpaceId *string `json:"installed_kibana_space_id,omitempty"` + LatestExecutedState *PackageInfo_InstallationInfo_LatestExecutedState `json:"latest_executed_state,omitempty"` + LatestInstallFailedAttempts *[]PackageInfo_InstallationInfo_LatestInstallFailedAttempts_Item `json:"latest_install_failed_attempts,omitempty"` + Name string `json:"name"` + Namespaces *[]string `json:"namespaces,omitempty"` + Type string `json:"type"` + UpdatedAt *string `json:"updated_at,omitempty"` + VerificationKeyId *string `json:"verification_key_id"` + VerificationStatus PackageInfoInstallationInfoVerificationStatus `json:"verification_status"` + Version string `json:"version"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// PackageInfoOwnerType defines model for PackageInfo.Owner.Type. +type PackageInfoOwnerType string + +// PackageInfo_Owner defines model for PackageInfo.Owner. +type PackageInfo_Owner struct { + Github *string `json:"github,omitempty"` + Type *PackageInfoOwnerType `json:"type,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// PackageInfoRelease defines model for PackageInfo.Release. +type PackageInfoRelease string + +// PackageInfo_Source defines model for PackageInfo.Source. +type PackageInfo_Source struct { + License string `json:"license"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// PackageInfoType defines model for PackageInfo.Type. +type PackageInfoType string + +// PackageListItem defines model for package_list_item. +type PackageListItem struct { + Categories *[]string `json:"categories,omitempty"` + Conditions *PackageListItem_Conditions `json:"conditions,omitempty"` + DataStreams *[]map[string]interface{} `json:"data_streams,omitempty"` + Description *string `json:"description,omitempty"` + Discovery *PackageListItem_Discovery `json:"discovery,omitempty"` + Download *string `json:"download,omitempty"` + FormatVersion *string `json:"format_version,omitempty"` + Icons *[]PackageListItem_Icons_Item `json:"icons,omitempty"` + Id string `json:"id"` + InstallationInfo *PackageListItem_InstallationInfo `json:"installationInfo,omitempty"` + Integration *string `json:"integration,omitempty"` + Internal *bool `json:"internal,omitempty"` + LatestVersion *string `json:"latestVersion,omitempty"` + Name string `json:"name"` + Owner *PackageListItem_Owner `json:"owner,omitempty"` + Path *string `json:"path,omitempty"` + PolicyTemplates *[]map[string]interface{} `json:"policy_templates,omitempty"` + Readme *string `json:"readme,omitempty"` + Release *PackageListItemRelease `json:"release,omitempty"` + SavedObject interface{} `json:"savedObject"` + SignaturePath *string `json:"signature_path,omitempty"` + Source *PackageListItem_Source `json:"source,omitempty"` + Status *string `json:"status,omitempty"` + Title string `json:"title"` + Type *PackageListItemType `json:"type,omitempty"` + Vars *[]map[string]interface{} `json:"vars,omitempty"` + Version string `json:"version"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// PackageListItem_Conditions_Elastic defines model for PackageListItem.Conditions.Elastic. +type PackageListItem_Conditions_Elastic struct { + Capabilities *[]string `json:"capabilities,omitempty"` + Subscription *string `json:"subscription,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// PackageListItem_Conditions_Kibana defines model for PackageListItem.Conditions.Kibana. +type PackageListItem_Conditions_Kibana struct { + Version *string `json:"version,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// PackageListItem_Conditions defines model for PackageListItem.Conditions. +type PackageListItem_Conditions struct { + Elastic *PackageListItem_Conditions_Elastic `json:"elastic,omitempty"` + Kibana *PackageListItem_Conditions_Kibana `json:"kibana,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// PackageListItem_Discovery_Fields_Item defines model for PackageListItem.Discovery.Fields.Item. +type PackageListItem_Discovery_Fields_Item struct { + Name string `json:"name"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// PackageListItem_Discovery defines model for PackageListItem.Discovery. +type PackageListItem_Discovery struct { + Fields *[]PackageListItem_Discovery_Fields_Item `json:"fields,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// PackageListItem_Icons_Item defines model for package_list_item.icons.Item. +type PackageListItem_Icons_Item struct { + DarkMode *bool `json:"dark_mode,omitempty"` + Path *string `json:"path,omitempty"` + Size *string `json:"size,omitempty"` + Src string `json:"src"` + Title *string `json:"title,omitempty"` + Type *string `json:"type,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType defines model for PackageListItem.InstallationInfo.AdditionalSpacesInstalledKibana.Type. +type PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType string + +// PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Item defines model for PackageListItem.InstallationInfo.AdditionalSpacesInstalledKibana.Item. +type PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Item struct { + Id string `json:"id"` + OriginId *string `json:"originId,omitempty"` + Type PackageListItemInstallationInfoAdditionalSpacesInstalledKibanaType `json:"type"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// PackageListItem_InstallationInfo_ExperimentalDataStreamFeatures_Features defines model for PackageListItem.InstallationInfo.ExperimentalDataStreamFeatures.Features. +type PackageListItem_InstallationInfo_ExperimentalDataStreamFeatures_Features struct { + DocValueOnlyNumeric *bool `json:"doc_value_only_numeric,omitempty"` + DocValueOnlyOther *bool `json:"doc_value_only_other,omitempty"` + SyntheticSource *bool `json:"synthetic_source,omitempty"` + Tsdb *bool `json:"tsdb,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// PackageListItem_InstallationInfo_ExperimentalDataStreamFeatures_Item defines model for PackageListItem.InstallationInfo.ExperimentalDataStreamFeatures.Item. +type PackageListItem_InstallationInfo_ExperimentalDataStreamFeatures_Item struct { + DataStream string `json:"data_stream"` + Features PackageListItem_InstallationInfo_ExperimentalDataStreamFeatures_Features `json:"features"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// PackageListItemInstallationInfoInstallSource defines model for PackageListItem.InstallationInfo.InstallSource. +type PackageListItemInstallationInfoInstallSource string + +// PackageListItemInstallationInfoInstallStatus defines model for PackageListItem.InstallationInfo.InstallStatus. +type PackageListItemInstallationInfoInstallStatus string + +// PackageListItemInstallationInfoInstalledEsType defines model for PackageListItem.InstallationInfo.InstalledEs.Type. +type PackageListItemInstallationInfoInstalledEsType string + +// PackageListItem_InstallationInfo_InstalledEs_Item defines model for PackageListItem.InstallationInfo.InstalledEs.Item. +type PackageListItem_InstallationInfo_InstalledEs_Item struct { + Deferred *bool `json:"deferred,omitempty"` + Id string `json:"id"` + Type PackageListItemInstallationInfoInstalledEsType `json:"type"` + Version *string `json:"version,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// PackageListItemInstallationInfoInstalledKibanaType defines model for PackageListItem.InstallationInfo.InstalledKibana.Type. +type PackageListItemInstallationInfoInstalledKibanaType string + +// PackageListItem_InstallationInfo_InstalledKibana_Item defines model for PackageListItem.InstallationInfo.InstalledKibana.Item. +type PackageListItem_InstallationInfo_InstalledKibana_Item struct { + Id string `json:"id"` + OriginId *string `json:"originId,omitempty"` + Type PackageListItemInstallationInfoInstalledKibanaType `json:"type"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// PackageListItem_InstallationInfo_LatestExecutedState defines model for PackageListItem.InstallationInfo.LatestExecutedState. +type PackageListItem_InstallationInfo_LatestExecutedState struct { + Error *string `json:"error,omitempty"` + Name string `json:"name"` + StartedAt string `json:"started_at"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// PackageListItem_InstallationInfo_LatestInstallFailedAttempts_Error defines model for PackageListItem.InstallationInfo.LatestInstallFailedAttempts.Error. +type PackageListItem_InstallationInfo_LatestInstallFailedAttempts_Error struct { + Message string `json:"message"` + Name string `json:"name"` + Stack *string `json:"stack,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// PackageListItem_InstallationInfo_LatestInstallFailedAttempts_Item defines model for PackageListItem.InstallationInfo.LatestInstallFailedAttempts.Item. +type PackageListItem_InstallationInfo_LatestInstallFailedAttempts_Item struct { + CreatedAt string `json:"created_at"` + Error PackageListItem_InstallationInfo_LatestInstallFailedAttempts_Error `json:"error"` + TargetVersion string `json:"target_version"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// PackageListItemInstallationInfoVerificationStatus defines model for PackageListItem.InstallationInfo.VerificationStatus. +type PackageListItemInstallationInfoVerificationStatus string + +// PackageListItem_InstallationInfo defines model for PackageListItem.InstallationInfo. +type PackageListItem_InstallationInfo struct { + AdditionalSpacesInstalledKibana *map[string][]PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Item `json:"additional_spaces_installed_kibana,omitempty"` + CreatedAt *string `json:"created_at,omitempty"` + ExperimentalDataStreamFeatures *[]PackageListItem_InstallationInfo_ExperimentalDataStreamFeatures_Item `json:"experimental_data_stream_features,omitempty"` + InstallFormatSchemaVersion *string `json:"install_format_schema_version,omitempty"` + InstallSource PackageListItemInstallationInfoInstallSource `json:"install_source"` + InstallStatus PackageListItemInstallationInfoInstallStatus `json:"install_status"` + InstalledEs []PackageListItem_InstallationInfo_InstalledEs_Item `json:"installed_es"` + InstalledKibana []PackageListItem_InstallationInfo_InstalledKibana_Item `json:"installed_kibana"` + InstalledKibanaSpaceId *string `json:"installed_kibana_space_id,omitempty"` + LatestExecutedState *PackageListItem_InstallationInfo_LatestExecutedState `json:"latest_executed_state,omitempty"` + LatestInstallFailedAttempts *[]PackageListItem_InstallationInfo_LatestInstallFailedAttempts_Item `json:"latest_install_failed_attempts,omitempty"` + Name string `json:"name"` + Namespaces *[]string `json:"namespaces,omitempty"` + Type string `json:"type"` + UpdatedAt *string `json:"updated_at,omitempty"` + VerificationKeyId *string `json:"verification_key_id"` + VerificationStatus PackageListItemInstallationInfoVerificationStatus `json:"verification_status"` + Version string `json:"version"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// PackageListItemOwnerType defines model for PackageListItem.Owner.Type. +type PackageListItemOwnerType string + +// PackageListItem_Owner defines model for PackageListItem.Owner. +type PackageListItem_Owner struct { + Github *string `json:"github,omitempty"` + Type *PackageListItemOwnerType `json:"type,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// PackageListItemRelease defines model for PackageListItem.Release. +type PackageListItemRelease string + +// PackageListItem_Source defines model for PackageListItem.Source. +type PackageListItem_Source struct { + License string `json:"license"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// PackageListItemType defines model for PackageListItem.Type. +type PackageListItemType string + +// PackagePolicy defines model for package_policy. +type PackagePolicy struct { + Agents *float32 `json:"agents,omitempty"` + CreatedAt string `json:"created_at"` + CreatedBy string `json:"created_by"` + + // Description Package policy description + Description *string `json:"description,omitempty"` + Elasticsearch *PackagePolicy_Elasticsearch `json:"elasticsearch,omitempty"` + Enabled bool `json:"enabled"` + Id string `json:"id"` + + // Inputs Package policy inputs (see integration documentation to know what inputs are available) + Inputs map[string]PackagePolicyInput `json:"inputs"` + IsManaged *bool `json:"is_managed,omitempty"` + + // Name Package policy name (should be unique) + Name string `json:"name"` + + // Namespace The package policy namespace. Leave blank to inherit the agent policy's namespace. + Namespace *string `json:"namespace,omitempty"` + OutputId *string `json:"output_id"` + + // Overrides Override settings that are defined in the package policy. The override option should be used only in unusual circumstances and not as a routine procedure. + Overrides *struct { + Inputs *map[string]interface{} `json:"inputs,omitempty"` + } `json:"overrides"` + Package *struct { + ExperimentalDataStreamFeatures *[]struct { + DataStream string `json:"data_stream"` + Features struct { + DocValueOnlyNumeric *bool `json:"doc_value_only_numeric,omitempty"` + DocValueOnlyOther *bool `json:"doc_value_only_other,omitempty"` + SyntheticSource *bool `json:"synthetic_source,omitempty"` + Tsdb *bool `json:"tsdb,omitempty"` + } `json:"features"` + } `json:"experimental_data_stream_features,omitempty"` + + // Name Package name + Name string `json:"name"` + RequiresRoot *bool `json:"requires_root,omitempty"` + Title *string `json:"title,omitempty"` + + // Version Package version + Version string `json:"version"` + } `json:"package,omitempty"` + + // PolicyId Agent policy ID where that package policy will be added + // Deprecated: + PolicyId *string `json:"policy_id"` + PolicyIds *[]string `json:"policy_ids,omitempty"` + Revision float32 `json:"revision"` + SecretReferences *[]PackagePolicySecretRef `json:"secret_references,omitempty"` + SpaceIds *[]string `json:"spaceIds,omitempty"` + UpdatedAt string `json:"updated_at"` + UpdatedBy string `json:"updated_by"` + Vars *map[string]interface{} `json:"vars,omitempty"` + Version *string `json:"version,omitempty"` +} + +// PackagePolicy_Elasticsearch_Privileges defines model for PackagePolicy.Elasticsearch.Privileges. +type PackagePolicy_Elasticsearch_Privileges struct { + Cluster *[]string `json:"cluster,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// PackagePolicy_Elasticsearch defines model for PackagePolicy.Elasticsearch. +type PackagePolicy_Elasticsearch struct { + Privileges *PackagePolicy_Elasticsearch_Privileges `json:"privileges,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// PackagePolicyInput defines model for package_policy_input. +type PackagePolicyInput struct { + // Enabled enable or disable that input, (default to true) + Enabled *bool `json:"enabled,omitempty"` + + // Streams Input streams (see integration documentation to know what streams are available) + Streams *map[string]PackagePolicyInputStream `json:"streams,omitempty"` + Vars *map[string]interface{} `json:"vars,omitempty"` +} + +// PackagePolicyInputStream defines model for package_policy_input_stream. +type PackagePolicyInputStream struct { + // Enabled enable or disable that stream, (default to true) + Enabled *bool `json:"enabled,omitempty"` + Vars *map[string]interface{} `json:"vars,omitempty"` +} + +// PackagePolicyRequest defines model for package_policy_request. +type PackagePolicyRequest struct { + Description *string `json:"description,omitempty"` + Force *bool `json:"force,omitempty"` + Id *string `json:"id,omitempty"` + + // Inputs Package policy inputs (see integration documentation to know what inputs are available) + Inputs *map[string]PackagePolicyRequestInput `json:"inputs,omitempty"` + Name string `json:"name"` + Namespace *string `json:"namespace,omitempty"` + OutputId *string `json:"output_id,omitempty"` + Package PackagePolicyRequestPackage `json:"package"` + PolicyId *string `json:"policy_id"` + PolicyIds *[]string `json:"policy_ids,omitempty"` + Vars *map[string]interface{} `json:"vars,omitempty"` +} + +// PackagePolicyRequestInput defines model for package_policy_request_input. +type PackagePolicyRequestInput struct { + // Enabled enable or disable that input, (default to true) + Enabled *bool `json:"enabled,omitempty"` + + // Streams Input streams (see integration documentation to know what streams are available) + Streams *map[string]PackagePolicyRequestInputStream `json:"streams,omitempty"` + Vars *map[string]interface{} `json:"vars,omitempty"` +} + +// PackagePolicyRequestInputStream defines model for package_policy_request_input_stream. +type PackagePolicyRequestInputStream struct { + // Enabled enable or disable that stream, (default to true) + Enabled *bool `json:"enabled,omitempty"` + Vars *map[string]interface{} `json:"vars,omitempty"` +} + +// PackagePolicyRequestPackage defines model for package_policy_request_package. +type PackagePolicyRequestPackage struct { + ExperimentalDataStreamFeatures *[]struct { + DataStream string `json:"data_stream"` + Features struct { + DocValueOnlyNumeric *bool `json:"doc_value_only_numeric,omitempty"` + DocValueOnlyOther *bool `json:"doc_value_only_other,omitempty"` + SyntheticSource *bool `json:"synthetic_source,omitempty"` + Tsdb *bool `json:"tsdb,omitempty"` + } `json:"features"` + } `json:"experimental_data_stream_features,omitempty"` + + // Name Package name + Name string `json:"name"` + RequiresRoot *bool `json:"requires_root,omitempty"` + Title *string `json:"title,omitempty"` + + // Version Package version + Version string `json:"version"` +} + +// PackagePolicySecretRef defines model for package_policy_secret_ref. +type PackagePolicySecretRef struct { + Id string `json:"id"` +} + +// ServerHost defines model for server_host. +type ServerHost struct { + HostUrls []string `json:"host_urls"` + Id string `json:"id"` + IsDefault *bool `json:"is_default,omitempty"` + IsInternal *bool `json:"is_internal,omitempty"` + IsPreconfigured *bool `json:"is_preconfigured,omitempty"` + Name string `json:"name"` + ProxyId *string `json:"proxy_id"` +} + +// UpdateOutputElasticsearch defines model for update_output_elasticsearch. +type UpdateOutputElasticsearch struct { + AllowEdit *[]string `json:"allow_edit,omitempty"` + CaSha256 *string `json:"ca_sha256,omitempty"` + CaTrustedFingerprint *string `json:"ca_trusted_fingerprint,omitempty"` + ConfigYaml *string `json:"config_yaml"` + Hosts *[]string `json:"hosts,omitempty"` + IsDefault *bool `json:"is_default,omitempty"` + IsDefaultMonitoring *bool `json:"is_default_monitoring,omitempty"` + IsInternal *bool `json:"is_internal,omitempty"` + IsPreconfigured *bool `json:"is_preconfigured,omitempty"` + Name *string `json:"name,omitempty"` + Preset *UpdateOutputElasticsearchPreset `json:"preset,omitempty"` + ProxyId *string `json:"proxy_id,omitempty"` + Shipper *UpdateOutputShipper `json:"shipper,omitempty"` + Ssl *UpdateOutputSsl `json:"ssl,omitempty"` + Type *UpdateOutputElasticsearchType `json:"type,omitempty"` +} + +// UpdateOutputElasticsearchPreset defines model for UpdateOutputElasticsearch.Preset. +type UpdateOutputElasticsearchPreset string + +// UpdateOutputElasticsearchType defines model for UpdateOutputElasticsearch.Type. +type UpdateOutputElasticsearchType string + +// UpdateOutputKafka defines model for update_output_kafka. +type UpdateOutputKafka struct { + AllowEdit *[]string `json:"allow_edit,omitempty"` + AuthType *UpdateOutputKafkaAuthType `json:"auth_type,omitempty"` + BrokerTimeout *float32 `json:"broker_timeout,omitempty"` + CaSha256 *string `json:"ca_sha256,omitempty"` + CaTrustedFingerprint *string `json:"ca_trusted_fingerprint,omitempty"` + ClientId *string `json:"client_id,omitempty"` + Compression *UpdateOutputKafkaCompression `json:"compression,omitempty"` + CompressionLevel interface{} `json:"compression_level"` + ConfigYaml *string `json:"config_yaml"` + ConnectionType interface{} `json:"connection_type"` + Hash *struct { + Hash *string `json:"hash,omitempty"` + Random *bool `json:"random,omitempty"` + } `json:"hash,omitempty"` + Headers *[]struct { + Key string `json:"key"` + Value string `json:"value"` + } `json:"headers,omitempty"` + Hosts *[]string `json:"hosts,omitempty"` + IsDefault *bool `json:"is_default,omitempty"` + IsDefaultMonitoring *bool `json:"is_default_monitoring,omitempty"` + IsInternal *bool `json:"is_internal,omitempty"` + IsPreconfigured *bool `json:"is_preconfigured,omitempty"` + Key *string `json:"key,omitempty"` + Name string `json:"name"` + Partition *UpdateOutputKafkaPartition `json:"partition,omitempty"` + Password interface{} `json:"password"` + ProxyId *string `json:"proxy_id,omitempty"` + Random *struct { + GroupEvents *float32 `json:"group_events,omitempty"` + } `json:"random,omitempty"` + RequiredAcks *UpdateOutputKafkaRequiredAcks `json:"required_acks,omitempty"` + RoundRobin *struct { + GroupEvents *float32 `json:"group_events,omitempty"` + } `json:"round_robin,omitempty"` + Sasl *struct { + Mechanism *UpdateOutputKafkaSaslMechanism `json:"mechanism,omitempty"` + } `json:"sasl"` + Secrets *struct { + Password *UpdateOutputKafka_Secrets_Password `json:"password,omitempty"` + Ssl *struct { + Key UpdateOutputKafka_Secrets_Ssl_Key `json:"key"` + } `json:"ssl,omitempty"` + } `json:"secrets,omitempty"` + Shipper *UpdateOutputShipper `json:"shipper,omitempty"` + Ssl *UpdateOutputSsl `json:"ssl,omitempty"` + Timeout *float32 `json:"timeout,omitempty"` + Topic *string `json:"topic,omitempty"` + Topics *[]struct { + Topic string `json:"topic"` + When *struct { + Condition *string `json:"condition,omitempty"` + Type *UpdateOutputKafkaTopicsWhenType `json:"type,omitempty"` + } `json:"when,omitempty"` + } `json:"topics,omitempty"` + Type *UpdateOutputKafkaType `json:"type,omitempty"` + Username interface{} `json:"username"` + Version *string `json:"version,omitempty"` +} + +// UpdateOutputKafkaAuthType defines model for UpdateOutputKafka.AuthType. +type UpdateOutputKafkaAuthType string + +// UpdateOutputKafkaCompression defines model for UpdateOutputKafka.Compression. +type UpdateOutputKafkaCompression string + +// UpdateOutputKafkaPartition defines model for UpdateOutputKafka.Partition. +type UpdateOutputKafkaPartition string + +// UpdateOutputKafkaRequiredAcks defines model for UpdateOutputKafka.RequiredAcks. +type UpdateOutputKafkaRequiredAcks int + +// UpdateOutputKafkaSaslMechanism defines model for UpdateOutputKafka.Sasl.Mechanism. +type UpdateOutputKafkaSaslMechanism string + +// UpdateOutputKafkaSecretsPassword0 defines model for . +type UpdateOutputKafkaSecretsPassword0 struct { + Id string `json:"id"` +} + +// UpdateOutputKafkaSecretsPassword1 defines model for . +type UpdateOutputKafkaSecretsPassword1 = string + +// UpdateOutputKafka_Secrets_Password defines model for UpdateOutputKafka.Secrets.Password. +type UpdateOutputKafka_Secrets_Password struct { + union json.RawMessage +} + +// UpdateOutputKafkaSecretsSslKey0 defines model for . +type UpdateOutputKafkaSecretsSslKey0 struct { + Id string `json:"id"` +} + +// UpdateOutputKafkaSecretsSslKey1 defines model for . +type UpdateOutputKafkaSecretsSslKey1 = string + +// UpdateOutputKafka_Secrets_Ssl_Key defines model for UpdateOutputKafka.Secrets.Ssl.Key. +type UpdateOutputKafka_Secrets_Ssl_Key struct { + union json.RawMessage +} + +// UpdateOutputKafkaTopicsWhenType defines model for UpdateOutputKafka.Topics.When.Type. +type UpdateOutputKafkaTopicsWhenType string + +// UpdateOutputKafkaType defines model for UpdateOutputKafka.Type. +type UpdateOutputKafkaType string + +// UpdateOutputLogstash defines model for update_output_logstash. +type UpdateOutputLogstash struct { + AllowEdit *[]string `json:"allow_edit,omitempty"` + CaSha256 *string `json:"ca_sha256,omitempty"` + CaTrustedFingerprint *string `json:"ca_trusted_fingerprint,omitempty"` + ConfigYaml *string `json:"config_yaml"` + Hosts *[]string `json:"hosts,omitempty"` + IsDefault *bool `json:"is_default,omitempty"` + IsDefaultMonitoring *bool `json:"is_default_monitoring,omitempty"` + IsInternal *bool `json:"is_internal,omitempty"` + IsPreconfigured *bool `json:"is_preconfigured,omitempty"` + Name *string `json:"name,omitempty"` + ProxyId *string `json:"proxy_id,omitempty"` + Secrets *struct { + Ssl *struct { + Key *UpdateOutputLogstash_Secrets_Ssl_Key `json:"key,omitempty"` + } `json:"ssl,omitempty"` + } `json:"secrets,omitempty"` + Shipper *UpdateOutputShipper `json:"shipper,omitempty"` + Ssl *UpdateOutputSsl `json:"ssl,omitempty"` + Type *UpdateOutputLogstashType `json:"type,omitempty"` +} + +// UpdateOutputLogstashSecretsSslKey0 defines model for . +type UpdateOutputLogstashSecretsSslKey0 struct { + Id string `json:"id"` +} + +// UpdateOutputLogstashSecretsSslKey1 defines model for . +type UpdateOutputLogstashSecretsSslKey1 = string + +// UpdateOutputLogstash_Secrets_Ssl_Key defines model for UpdateOutputLogstash.Secrets.Ssl.Key. +type UpdateOutputLogstash_Secrets_Ssl_Key struct { + union json.RawMessage +} + +// UpdateOutputLogstashType defines model for UpdateOutputLogstash.Type. +type UpdateOutputLogstashType string + +// UpdateOutputRemoteElasticsearch defines model for update_output_remote_elasticsearch. +type UpdateOutputRemoteElasticsearch struct { + AllowEdit *[]string `json:"allow_edit,omitempty"` + CaSha256 *string `json:"ca_sha256,omitempty"` + CaTrustedFingerprint *string `json:"ca_trusted_fingerprint,omitempty"` + ConfigYaml *string `json:"config_yaml"` + Hosts *[]string `json:"hosts,omitempty"` + IsDefault *bool `json:"is_default,omitempty"` + IsDefaultMonitoring *bool `json:"is_default_monitoring,omitempty"` + IsInternal *bool `json:"is_internal,omitempty"` + IsPreconfigured *bool `json:"is_preconfigured,omitempty"` + Name *string `json:"name,omitempty"` + Preset *UpdateOutputRemoteElasticsearchPreset `json:"preset,omitempty"` + ProxyId *string `json:"proxy_id,omitempty"` + Secrets *struct { + ServiceToken *UpdateOutputRemoteElasticsearch_Secrets_ServiceToken `json:"service_token,omitempty"` + } `json:"secrets,omitempty"` + ServiceToken *string `json:"service_token"` + Shipper *UpdateOutputShipper `json:"shipper,omitempty"` + Ssl *UpdateOutputSsl `json:"ssl,omitempty"` + Type *UpdateOutputRemoteElasticsearchType `json:"type,omitempty"` +} + +// UpdateOutputRemoteElasticsearchPreset defines model for UpdateOutputRemoteElasticsearch.Preset. +type UpdateOutputRemoteElasticsearchPreset string + +// UpdateOutputRemoteElasticsearchSecretsServiceToken0 defines model for . +type UpdateOutputRemoteElasticsearchSecretsServiceToken0 struct { + Id string `json:"id"` +} + +// UpdateOutputRemoteElasticsearchSecretsServiceToken1 defines model for . +type UpdateOutputRemoteElasticsearchSecretsServiceToken1 = string + +// UpdateOutputRemoteElasticsearch_Secrets_ServiceToken defines model for UpdateOutputRemoteElasticsearch.Secrets.ServiceToken. +type UpdateOutputRemoteElasticsearch_Secrets_ServiceToken struct { + union json.RawMessage +} + +// UpdateOutputRemoteElasticsearchType defines model for UpdateOutputRemoteElasticsearch.Type. +type UpdateOutputRemoteElasticsearchType string + +// UpdateOutputShipper defines model for update_output_shipper. +type UpdateOutputShipper struct { + CompressionLevel *float32 `json:"compression_level"` + DiskQueueCompressionEnabled *bool `json:"disk_queue_compression_enabled"` + DiskQueueEnabled *bool `json:"disk_queue_enabled"` + DiskQueueEncryptionEnabled *bool `json:"disk_queue_encryption_enabled"` + DiskQueueMaxSize *float32 `json:"disk_queue_max_size"` + DiskQueuePath *string `json:"disk_queue_path"` + Loadbalance *bool `json:"loadbalance"` + MaxBatchBytes *float32 `json:"max_batch_bytes"` + MemQueueEvents *float32 `json:"mem_queue_events"` + QueueFlushTimeout *float32 `json:"queue_flush_timeout"` +} + +// UpdateOutputSsl defines model for update_output_ssl. +type UpdateOutputSsl struct { + Certificate *string `json:"certificate,omitempty"` + CertificateAuthorities *[]string `json:"certificate_authorities,omitempty"` + Key *string `json:"key,omitempty"` + VerificationMode *UpdateOutputSslVerificationMode `json:"verification_mode,omitempty"` +} + +// UpdateOutputSslVerificationMode defines model for UpdateOutputSsl.VerificationMode. +type UpdateOutputSslVerificationMode string + +// UpdateOutputUnion defines model for update_output_union. +type UpdateOutputUnion struct { + union json.RawMessage +} + +// GetAgentPoliciesParams defines parameters for GetAgentPolicies. +type GetAgentPoliciesParams struct { + Page *float32 `form:"page,omitempty" json:"page,omitempty"` + PerPage *float32 `form:"perPage,omitempty" json:"perPage,omitempty"` + SortField *string `form:"sortField,omitempty" json:"sortField,omitempty"` + SortOrder *GetAgentPoliciesParamsSortOrder `form:"sortOrder,omitempty" json:"sortOrder,omitempty"` + ShowUpgradeable *bool `form:"showUpgradeable,omitempty" json:"showUpgradeable,omitempty"` + Kuery *string `form:"kuery,omitempty" json:"kuery,omitempty"` + + // NoAgentCount use withAgentCount instead + NoAgentCount *bool `form:"noAgentCount,omitempty" json:"noAgentCount,omitempty"` + + // WithAgentCount get policies with agent count + WithAgentCount *bool `form:"withAgentCount,omitempty" json:"withAgentCount,omitempty"` + + // Full get full policies with package policies populated + Full *bool `form:"full,omitempty" json:"full,omitempty"` + Format *GetAgentPoliciesParamsFormat `form:"format,omitempty" json:"format,omitempty"` +} + +// GetAgentPoliciesParamsSortOrder defines parameters for GetAgentPolicies. +type GetAgentPoliciesParamsSortOrder string + +// GetAgentPoliciesParamsFormat defines parameters for GetAgentPolicies. +type GetAgentPoliciesParamsFormat string + +// CreateAgentPolicyJSONBody defines parameters for CreateAgentPolicy. +type CreateAgentPolicyJSONBody struct { + AdvancedSettings *struct { + AgentDownloadTargetDirectory *interface{} `json:"agent_download_target_directory"` + AgentDownloadTimeout *interface{} `json:"agent_download_timeout"` + AgentLimitsGoMaxProcs *interface{} `json:"agent_limits_go_max_procs"` + AgentLoggingLevel *interface{} `json:"agent_logging_level"` + AgentLoggingMetricsPeriod *interface{} `json:"agent_logging_metrics_period"` + } `json:"advanced_settings,omitempty"` + AgentFeatures *[]struct { + Enabled bool `json:"enabled"` + Name string `json:"name"` + } `json:"agent_features,omitempty"` + DataOutputId *string `json:"data_output_id"` + Description *string `json:"description,omitempty"` + DownloadSourceId *string `json:"download_source_id"` + FleetServerHostId *string `json:"fleet_server_host_id"` + Force *bool `json:"force,omitempty"` + + // GlobalDataTags User defined data tags that are added to all of the inputs. The values can be strings or numbers. + GlobalDataTags *[]struct { + Name string `json:"name"` + Value CreateAgentPolicyJSONBody_GlobalDataTags_Value `json:"value"` + } `json:"global_data_tags,omitempty"` + HasFleetServer *bool `json:"has_fleet_server,omitempty"` + Id *string `json:"id,omitempty"` + InactivityTimeout *float32 `json:"inactivity_timeout,omitempty"` + IsDefault *bool `json:"is_default,omitempty"` + IsDefaultFleetServer *bool `json:"is_default_fleet_server,omitempty"` + IsManaged *bool `json:"is_managed,omitempty"` + IsProtected *bool `json:"is_protected,omitempty"` + + // KeepMonitoringAlive When set to true, monitoring will be enabled but logs/metrics collection will be disabled + KeepMonitoringAlive *bool `json:"keep_monitoring_alive,omitempty"` + MonitoringDiagnostics *struct { + Limit *struct { + Burst *float32 `json:"burst,omitempty"` + Interval *string `json:"interval,omitempty"` + } `json:"limit,omitempty"` + Uploader *struct { + InitDur *string `json:"init_dur,omitempty"` + MaxDur *string `json:"max_dur,omitempty"` + MaxRetries *float32 `json:"max_retries,omitempty"` + } `json:"uploader,omitempty"` + } `json:"monitoring_diagnostics,omitempty"` + MonitoringEnabled *[]CreateAgentPolicyJSONBodyMonitoringEnabled `json:"monitoring_enabled,omitempty"` + MonitoringHttp *struct { + Buffer *struct { + Enabled *bool `json:"enabled,omitempty"` + } `json:"buffer,omitempty"` + Enabled bool `json:"enabled"` + Host *string `json:"host,omitempty"` + Port *float32 `json:"port,omitempty"` + } `json:"monitoring_http,omitempty"` + MonitoringOutputId *string `json:"monitoring_output_id"` + MonitoringPprofEnabled *bool `json:"monitoring_pprof_enabled,omitempty"` + Name string `json:"name"` + Namespace string `json:"namespace"` + + // Overrides Override settings that are defined in the agent policy. Input settings cannot be overridden. The override option should be used only in unusual circumstances and not as a routine procedure. + Overrides *map[string]interface{} `json:"overrides,omitempty"` + SpaceIds *[]string `json:"space_ids,omitempty"` + + // SupportsAgentless Indicates whether the agent policy supports agentless integrations. + SupportsAgentless *bool `json:"supports_agentless,omitempty"` + UnenrollTimeout *float32 `json:"unenroll_timeout,omitempty"` +} + +// CreateAgentPolicyParams defines parameters for CreateAgentPolicy. +type CreateAgentPolicyParams struct { + SysMonitoring *bool `form:"sys_monitoring,omitempty" json:"sys_monitoring,omitempty"` +} + +// CreateAgentPolicyJSONBodyGlobalDataTagsValue0 defines parameters for CreateAgentPolicy. +type CreateAgentPolicyJSONBodyGlobalDataTagsValue0 = string + +// CreateAgentPolicyJSONBodyGlobalDataTagsValue1 defines parameters for CreateAgentPolicy. +type CreateAgentPolicyJSONBodyGlobalDataTagsValue1 = float32 + +// CreateAgentPolicyJSONBody_GlobalDataTags_Value defines parameters for CreateAgentPolicy. +type CreateAgentPolicyJSONBody_GlobalDataTags_Value struct { + union json.RawMessage +} + +// CreateAgentPolicyJSONBodyMonitoringEnabled defines parameters for CreateAgentPolicy. +type CreateAgentPolicyJSONBodyMonitoringEnabled string + +// DeleteAgentPolicyJSONBody defines parameters for DeleteAgentPolicy. +type DeleteAgentPolicyJSONBody struct { + AgentPolicyId string `json:"agentPolicyId"` + + // Force bypass validation checks that can prevent agent policy deletion + Force *bool `json:"force,omitempty"` +} + +// GetAgentPolicyParams defines parameters for GetAgentPolicy. +type GetAgentPolicyParams struct { + Format *GetAgentPolicyParamsFormat `form:"format,omitempty" json:"format,omitempty"` +} + +// GetAgentPolicyParamsFormat defines parameters for GetAgentPolicy. +type GetAgentPolicyParamsFormat string + +// UpdateAgentPolicyJSONBody defines parameters for UpdateAgentPolicy. +type UpdateAgentPolicyJSONBody struct { + AdvancedSettings *struct { + AgentDownloadTargetDirectory *interface{} `json:"agent_download_target_directory"` + AgentDownloadTimeout *interface{} `json:"agent_download_timeout"` + AgentLimitsGoMaxProcs *interface{} `json:"agent_limits_go_max_procs"` + AgentLoggingLevel *interface{} `json:"agent_logging_level"` + AgentLoggingMetricsPeriod *interface{} `json:"agent_logging_metrics_period"` + } `json:"advanced_settings,omitempty"` + AgentFeatures *[]struct { + Enabled bool `json:"enabled"` + Name string `json:"name"` + } `json:"agent_features,omitempty"` + DataOutputId *string `json:"data_output_id"` + Description *string `json:"description,omitempty"` + DownloadSourceId *string `json:"download_source_id"` + FleetServerHostId *string `json:"fleet_server_host_id"` + Force *bool `json:"force,omitempty"` + + // GlobalDataTags User defined data tags that are added to all of the inputs. The values can be strings or numbers. + GlobalDataTags *[]struct { + Name string `json:"name"` + Value UpdateAgentPolicyJSONBody_GlobalDataTags_Value `json:"value"` + } `json:"global_data_tags,omitempty"` + HasFleetServer *bool `json:"has_fleet_server,omitempty"` + Id *string `json:"id,omitempty"` + InactivityTimeout *float32 `json:"inactivity_timeout,omitempty"` + IsDefault *bool `json:"is_default,omitempty"` + IsDefaultFleetServer *bool `json:"is_default_fleet_server,omitempty"` + IsManaged *bool `json:"is_managed,omitempty"` + IsProtected *bool `json:"is_protected,omitempty"` + + // KeepMonitoringAlive When set to true, monitoring will be enabled but logs/metrics collection will be disabled + KeepMonitoringAlive *bool `json:"keep_monitoring_alive,omitempty"` + MonitoringDiagnostics *struct { + Limit *struct { + Burst *float32 `json:"burst,omitempty"` + Interval *string `json:"interval,omitempty"` + } `json:"limit,omitempty"` + Uploader *struct { + InitDur *string `json:"init_dur,omitempty"` + MaxDur *string `json:"max_dur,omitempty"` + MaxRetries *float32 `json:"max_retries,omitempty"` + } `json:"uploader,omitempty"` + } `json:"monitoring_diagnostics,omitempty"` + MonitoringEnabled *[]UpdateAgentPolicyJSONBodyMonitoringEnabled `json:"monitoring_enabled,omitempty"` + MonitoringHttp *struct { + Buffer *struct { + Enabled *bool `json:"enabled,omitempty"` + } `json:"buffer,omitempty"` + Enabled bool `json:"enabled"` + Host *string `json:"host,omitempty"` + Port *float32 `json:"port,omitempty"` + } `json:"monitoring_http,omitempty"` + MonitoringOutputId *string `json:"monitoring_output_id"` + MonitoringPprofEnabled *bool `json:"monitoring_pprof_enabled,omitempty"` + Name string `json:"name"` + Namespace string `json:"namespace"` + + // Overrides Override settings that are defined in the agent policy. Input settings cannot be overridden. The override option should be used only in unusual circumstances and not as a routine procedure. + Overrides *map[string]interface{} `json:"overrides,omitempty"` + SpaceIds *[]string `json:"space_ids,omitempty"` + + // SupportsAgentless Indicates whether the agent policy supports agentless integrations. + SupportsAgentless *bool `json:"supports_agentless,omitempty"` + UnenrollTimeout *float32 `json:"unenroll_timeout,omitempty"` +} + +// UpdateAgentPolicyParams defines parameters for UpdateAgentPolicy. +type UpdateAgentPolicyParams struct { + Format *UpdateAgentPolicyParamsFormat `form:"format,omitempty" json:"format,omitempty"` +} + +// UpdateAgentPolicyParamsFormat defines parameters for UpdateAgentPolicy. +type UpdateAgentPolicyParamsFormat string + +// UpdateAgentPolicyJSONBodyGlobalDataTagsValue0 defines parameters for UpdateAgentPolicy. +type UpdateAgentPolicyJSONBodyGlobalDataTagsValue0 = string + +// UpdateAgentPolicyJSONBodyGlobalDataTagsValue1 defines parameters for UpdateAgentPolicy. +type UpdateAgentPolicyJSONBodyGlobalDataTagsValue1 = float32 + +// UpdateAgentPolicyJSONBody_GlobalDataTags_Value defines parameters for UpdateAgentPolicy. +type UpdateAgentPolicyJSONBody_GlobalDataTags_Value struct { + union json.RawMessage +} + +// UpdateAgentPolicyJSONBodyMonitoringEnabled defines parameters for UpdateAgentPolicy. +type UpdateAgentPolicyJSONBodyMonitoringEnabled string + +// GetEnrollmentApiKeysParams defines parameters for GetEnrollmentApiKeys. +type GetEnrollmentApiKeysParams struct { + Page *float32 `form:"page,omitempty" json:"page,omitempty"` + PerPage *float32 `form:"perPage,omitempty" json:"perPage,omitempty"` + Kuery *string `form:"kuery,omitempty" json:"kuery,omitempty"` +} + +// ListPackagesParams defines parameters for ListPackages. +type ListPackagesParams struct { + Category *string `form:"category,omitempty" json:"category,omitempty"` + Prerelease *bool `form:"prerelease,omitempty" json:"prerelease,omitempty"` + Experimental *bool `form:"experimental,omitempty" json:"experimental,omitempty"` + ExcludeInstallStatus *bool `form:"excludeInstallStatus,omitempty" json:"excludeInstallStatus,omitempty"` +} + +// InstallPackageByUploadParams defines parameters for InstallPackageByUpload. +type InstallPackageByUploadParams struct { + IgnoreMappingUpdateErrors *bool `form:"ignoreMappingUpdateErrors,omitempty" json:"ignoreMappingUpdateErrors,omitempty"` + SkipDataStreamRollover *bool `form:"skipDataStreamRollover,omitempty" json:"skipDataStreamRollover,omitempty"` +} + +// DeletePackageJSONBody defines parameters for DeletePackage. +type DeletePackageJSONBody struct { + Force bool `json:"force"` +} + +// DeletePackageParams defines parameters for DeletePackage. +type DeletePackageParams struct { + Force *bool `form:"force,omitempty" json:"force,omitempty"` +} + +// GetPackageParams defines parameters for GetPackage. +type GetPackageParams struct { + IgnoreUnverified *bool `form:"ignoreUnverified,omitempty" json:"ignoreUnverified,omitempty"` + Prerelease *bool `form:"prerelease,omitempty" json:"prerelease,omitempty"` + Full *bool `form:"full,omitempty" json:"full,omitempty"` + WithMetadata *bool `form:"withMetadata,omitempty" json:"withMetadata,omitempty"` +} + +// InstallPackageJSONBody defines parameters for InstallPackage. +type InstallPackageJSONBody struct { + Force *bool `json:"force,omitempty"` + IgnoreConstraints *bool `json:"ignore_constraints,omitempty"` +} + +// InstallPackageParams defines parameters for InstallPackage. +type InstallPackageParams struct { + Prerelease *bool `form:"prerelease,omitempty" json:"prerelease,omitempty"` + IgnoreMappingUpdateErrors *bool `form:"ignoreMappingUpdateErrors,omitempty" json:"ignoreMappingUpdateErrors,omitempty"` + SkipDataStreamRollover *bool `form:"skipDataStreamRollover,omitempty" json:"skipDataStreamRollover,omitempty"` +} + +// CreateFleetServerHostJSONBody defines parameters for CreateFleetServerHost. +type CreateFleetServerHostJSONBody struct { + HostUrls []string `json:"host_urls"` + Id *string `json:"id,omitempty"` + IsDefault *bool `json:"is_default,omitempty"` + IsInternal *bool `json:"is_internal,omitempty"` + IsPreconfigured *bool `json:"is_preconfigured,omitempty"` + Name string `json:"name"` + ProxyId *string `json:"proxy_id,omitempty"` +} + +// UpdateFleetServerHostJSONBody defines parameters for UpdateFleetServerHost. +type UpdateFleetServerHostJSONBody struct { + HostUrls *[]string `json:"host_urls,omitempty"` + IsDefault *bool `json:"is_default,omitempty"` + IsInternal *bool `json:"is_internal,omitempty"` + Name *string `json:"name,omitempty"` + ProxyId *string `json:"proxy_id,omitempty"` +} + +// GetPackagePoliciesParams defines parameters for GetPackagePolicies. +type GetPackagePoliciesParams struct { + Page *float32 `form:"page,omitempty" json:"page,omitempty"` + PerPage *float32 `form:"perPage,omitempty" json:"perPage,omitempty"` + SortField *string `form:"sortField,omitempty" json:"sortField,omitempty"` + SortOrder *GetPackagePoliciesParamsSortOrder `form:"sortOrder,omitempty" json:"sortOrder,omitempty"` + ShowUpgradeable *bool `form:"showUpgradeable,omitempty" json:"showUpgradeable,omitempty"` + Kuery *string `form:"kuery,omitempty" json:"kuery,omitempty"` + Format *GetPackagePoliciesParamsFormat `form:"format,omitempty" json:"format,omitempty"` + WithAgentCount *bool `form:"withAgentCount,omitempty" json:"withAgentCount,omitempty"` +} + +// GetPackagePoliciesParamsSortOrder defines parameters for GetPackagePolicies. +type GetPackagePoliciesParamsSortOrder string + +// GetPackagePoliciesParamsFormat defines parameters for GetPackagePolicies. +type GetPackagePoliciesParamsFormat string + +// CreatePackagePolicyParams defines parameters for CreatePackagePolicy. +type CreatePackagePolicyParams struct { + Format *CreatePackagePolicyParamsFormat `form:"format,omitempty" json:"format,omitempty"` +} + +// CreatePackagePolicyParamsFormat defines parameters for CreatePackagePolicy. +type CreatePackagePolicyParamsFormat string + +// DeletePackagePolicyParams defines parameters for DeletePackagePolicy. +type DeletePackagePolicyParams struct { + Force *bool `form:"force,omitempty" json:"force,omitempty"` +} + +// GetPackagePolicyParams defines parameters for GetPackagePolicy. +type GetPackagePolicyParams struct { + Format *GetPackagePolicyParamsFormat `form:"format,omitempty" json:"format,omitempty"` +} + +// GetPackagePolicyParamsFormat defines parameters for GetPackagePolicy. +type GetPackagePolicyParamsFormat string + +// UpdatePackagePolicyParams defines parameters for UpdatePackagePolicy. +type UpdatePackagePolicyParams struct { + Format *UpdatePackagePolicyParamsFormat `form:"format,omitempty" json:"format,omitempty"` +} + +// UpdatePackagePolicyParamsFormat defines parameters for UpdatePackagePolicy. +type UpdatePackagePolicyParamsFormat string + +// CreateAgentPolicyJSONRequestBody defines body for CreateAgentPolicy for application/json ContentType. +type CreateAgentPolicyJSONRequestBody CreateAgentPolicyJSONBody + +// DeleteAgentPolicyJSONRequestBody defines body for DeleteAgentPolicy for application/json ContentType. +type DeleteAgentPolicyJSONRequestBody DeleteAgentPolicyJSONBody + +// UpdateAgentPolicyJSONRequestBody defines body for UpdateAgentPolicy for application/json ContentType. +type UpdateAgentPolicyJSONRequestBody UpdateAgentPolicyJSONBody + +// DeletePackageJSONRequestBody defines body for DeletePackage for application/json ContentType. +type DeletePackageJSONRequestBody DeletePackageJSONBody + +// InstallPackageJSONRequestBody defines body for InstallPackage for application/json ContentType. +type InstallPackageJSONRequestBody InstallPackageJSONBody + +// CreateFleetServerHostJSONRequestBody defines body for CreateFleetServerHost for application/json ContentType. +type CreateFleetServerHostJSONRequestBody CreateFleetServerHostJSONBody + +// UpdateFleetServerHostJSONRequestBody defines body for UpdateFleetServerHost for application/json ContentType. +type UpdateFleetServerHostJSONRequestBody UpdateFleetServerHostJSONBody + +// CreateOutputJSONRequestBody defines body for CreateOutput for application/json ContentType. +type CreateOutputJSONRequestBody = NewOutputUnion + +// UpdateOutputJSONRequestBody defines body for UpdateOutput for application/json ContentType. +type UpdateOutputJSONRequestBody = UpdateOutputUnion + +// CreatePackagePolicyJSONRequestBody defines body for CreatePackagePolicy for application/json ContentType. +type CreatePackagePolicyJSONRequestBody = PackagePolicyRequest + +// UpdatePackagePolicyJSONRequestBody defines body for UpdatePackagePolicy for application/json ContentType. +type UpdatePackagePolicyJSONRequestBody = PackagePolicyRequest + +// Getter for additional properties for AgentPolicy_PackagePolicies_1_Elasticsearch_Privileges. Returns the specified +// element and whether it was found +func (a AgentPolicy_PackagePolicies_1_Elasticsearch_Privileges) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for AgentPolicy_PackagePolicies_1_Elasticsearch_Privileges +func (a *AgentPolicy_PackagePolicies_1_Elasticsearch_Privileges) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for AgentPolicy_PackagePolicies_1_Elasticsearch_Privileges to handle AdditionalProperties +func (a *AgentPolicy_PackagePolicies_1_Elasticsearch_Privileges) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["cluster"]; found { + err = json.Unmarshal(raw, &a.Cluster) + if err != nil { + return fmt.Errorf("error reading 'cluster': %w", err) + } + delete(object, "cluster") + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for AgentPolicy_PackagePolicies_1_Elasticsearch_Privileges to handle AdditionalProperties +func (a AgentPolicy_PackagePolicies_1_Elasticsearch_Privileges) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + if a.Cluster != nil { + object["cluster"], err = json.Marshal(a.Cluster) + if err != nil { + return nil, fmt.Errorf("error marshaling 'cluster': %w", err) + } + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + +// Getter for additional properties for AgentPolicy_PackagePolicies_1_Elasticsearch. Returns the specified +// element and whether it was found +func (a AgentPolicy_PackagePolicies_1_Elasticsearch) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for AgentPolicy_PackagePolicies_1_Elasticsearch +func (a *AgentPolicy_PackagePolicies_1_Elasticsearch) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for AgentPolicy_PackagePolicies_1_Elasticsearch to handle AdditionalProperties +func (a *AgentPolicy_PackagePolicies_1_Elasticsearch) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["privileges"]; found { + err = json.Unmarshal(raw, &a.Privileges) + if err != nil { + return fmt.Errorf("error reading 'privileges': %w", err) + } + delete(object, "privileges") + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for AgentPolicy_PackagePolicies_1_Elasticsearch to handle AdditionalProperties +func (a AgentPolicy_PackagePolicies_1_Elasticsearch) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + if a.Privileges != nil { + object["privileges"], err = json.Marshal(a.Privileges) + if err != nil { + return nil, fmt.Errorf("error marshaling 'privileges': %w", err) + } + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + +// Getter for additional properties for OutputElasticsearch. Returns the specified +// element and whether it was found +func (a OutputElasticsearch) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for OutputElasticsearch +func (a *OutputElasticsearch) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for OutputElasticsearch to handle AdditionalProperties +func (a *OutputElasticsearch) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["allow_edit"]; found { + err = json.Unmarshal(raw, &a.AllowEdit) + if err != nil { + return fmt.Errorf("error reading 'allow_edit': %w", err) + } + delete(object, "allow_edit") + } + + if raw, found := object["ca_sha256"]; found { + err = json.Unmarshal(raw, &a.CaSha256) + if err != nil { + return fmt.Errorf("error reading 'ca_sha256': %w", err) + } + delete(object, "ca_sha256") + } + + if raw, found := object["ca_trusted_fingerprint"]; found { + err = json.Unmarshal(raw, &a.CaTrustedFingerprint) + if err != nil { + return fmt.Errorf("error reading 'ca_trusted_fingerprint': %w", err) + } + delete(object, "ca_trusted_fingerprint") + } + + if raw, found := object["config_yaml"]; found { + err = json.Unmarshal(raw, &a.ConfigYaml) + if err != nil { + return fmt.Errorf("error reading 'config_yaml': %w", err) + } + delete(object, "config_yaml") + } + + if raw, found := object["hosts"]; found { + err = json.Unmarshal(raw, &a.Hosts) + if err != nil { + return fmt.Errorf("error reading 'hosts': %w", err) + } + delete(object, "hosts") + } + + if raw, found := object["id"]; found { + err = json.Unmarshal(raw, &a.Id) + if err != nil { + return fmt.Errorf("error reading 'id': %w", err) + } + delete(object, "id") + } + + if raw, found := object["is_default"]; found { + err = json.Unmarshal(raw, &a.IsDefault) + if err != nil { + return fmt.Errorf("error reading 'is_default': %w", err) + } + delete(object, "is_default") + } + + if raw, found := object["is_default_monitoring"]; found { + err = json.Unmarshal(raw, &a.IsDefaultMonitoring) + if err != nil { + return fmt.Errorf("error reading 'is_default_monitoring': %w", err) + } + delete(object, "is_default_monitoring") + } + + if raw, found := object["is_internal"]; found { + err = json.Unmarshal(raw, &a.IsInternal) + if err != nil { + return fmt.Errorf("error reading 'is_internal': %w", err) + } + delete(object, "is_internal") + } + + if raw, found := object["is_preconfigured"]; found { + err = json.Unmarshal(raw, &a.IsPreconfigured) + if err != nil { + return fmt.Errorf("error reading 'is_preconfigured': %w", err) + } + delete(object, "is_preconfigured") + } + + if raw, found := object["name"]; found { + err = json.Unmarshal(raw, &a.Name) + if err != nil { + return fmt.Errorf("error reading 'name': %w", err) + } + delete(object, "name") + } + + if raw, found := object["preset"]; found { + err = json.Unmarshal(raw, &a.Preset) + if err != nil { + return fmt.Errorf("error reading 'preset': %w", err) + } + delete(object, "preset") + } + + if raw, found := object["proxy_id"]; found { + err = json.Unmarshal(raw, &a.ProxyId) + if err != nil { + return fmt.Errorf("error reading 'proxy_id': %w", err) + } + delete(object, "proxy_id") + } + + if raw, found := object["shipper"]; found { + err = json.Unmarshal(raw, &a.Shipper) + if err != nil { + return fmt.Errorf("error reading 'shipper': %w", err) + } + delete(object, "shipper") + } + + if raw, found := object["ssl"]; found { + err = json.Unmarshal(raw, &a.Ssl) + if err != nil { + return fmt.Errorf("error reading 'ssl': %w", err) + } + delete(object, "ssl") + } + + if raw, found := object["type"]; found { + err = json.Unmarshal(raw, &a.Type) + if err != nil { + return fmt.Errorf("error reading 'type': %w", err) + } + delete(object, "type") + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for OutputElasticsearch to handle AdditionalProperties +func (a OutputElasticsearch) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + if a.AllowEdit != nil { + object["allow_edit"], err = json.Marshal(a.AllowEdit) + if err != nil { + return nil, fmt.Errorf("error marshaling 'allow_edit': %w", err) + } + } + + if a.CaSha256 != nil { + object["ca_sha256"], err = json.Marshal(a.CaSha256) + if err != nil { + return nil, fmt.Errorf("error marshaling 'ca_sha256': %w", err) + } + } + + if a.CaTrustedFingerprint != nil { + object["ca_trusted_fingerprint"], err = json.Marshal(a.CaTrustedFingerprint) + if err != nil { + return nil, fmt.Errorf("error marshaling 'ca_trusted_fingerprint': %w", err) + } + } + + if a.ConfigYaml != nil { + object["config_yaml"], err = json.Marshal(a.ConfigYaml) + if err != nil { + return nil, fmt.Errorf("error marshaling 'config_yaml': %w", err) + } + } + + object["hosts"], err = json.Marshal(a.Hosts) + if err != nil { + return nil, fmt.Errorf("error marshaling 'hosts': %w", err) + } + + if a.Id != nil { + object["id"], err = json.Marshal(a.Id) + if err != nil { + return nil, fmt.Errorf("error marshaling 'id': %w", err) + } + } + + if a.IsDefault != nil { + object["is_default"], err = json.Marshal(a.IsDefault) + if err != nil { + return nil, fmt.Errorf("error marshaling 'is_default': %w", err) + } + } + + if a.IsDefaultMonitoring != nil { + object["is_default_monitoring"], err = json.Marshal(a.IsDefaultMonitoring) + if err != nil { + return nil, fmt.Errorf("error marshaling 'is_default_monitoring': %w", err) + } + } + + if a.IsInternal != nil { + object["is_internal"], err = json.Marshal(a.IsInternal) + if err != nil { + return nil, fmt.Errorf("error marshaling 'is_internal': %w", err) + } + } + + if a.IsPreconfigured != nil { + object["is_preconfigured"], err = json.Marshal(a.IsPreconfigured) + if err != nil { + return nil, fmt.Errorf("error marshaling 'is_preconfigured': %w", err) + } + } + + object["name"], err = json.Marshal(a.Name) + if err != nil { + return nil, fmt.Errorf("error marshaling 'name': %w", err) + } + + if a.Preset != nil { + object["preset"], err = json.Marshal(a.Preset) + if err != nil { + return nil, fmt.Errorf("error marshaling 'preset': %w", err) + } + } + + if a.ProxyId != nil { + object["proxy_id"], err = json.Marshal(a.ProxyId) + if err != nil { + return nil, fmt.Errorf("error marshaling 'proxy_id': %w", err) + } + } + + if a.Shipper != nil { + object["shipper"], err = json.Marshal(a.Shipper) + if err != nil { + return nil, fmt.Errorf("error marshaling 'shipper': %w", err) + } + } + + if a.Ssl != nil { + object["ssl"], err = json.Marshal(a.Ssl) + if err != nil { + return nil, fmt.Errorf("error marshaling 'ssl': %w", err) + } + } + + object["type"], err = json.Marshal(a.Type) + if err != nil { + return nil, fmt.Errorf("error marshaling 'type': %w", err) + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + +// Getter for additional properties for OutputKafka. Returns the specified +// element and whether it was found +func (a OutputKafka) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for OutputKafka +func (a *OutputKafka) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for OutputKafka to handle AdditionalProperties +func (a *OutputKafka) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["allow_edit"]; found { + err = json.Unmarshal(raw, &a.AllowEdit) + if err != nil { + return fmt.Errorf("error reading 'allow_edit': %w", err) + } + delete(object, "allow_edit") + } + + if raw, found := object["auth_type"]; found { + err = json.Unmarshal(raw, &a.AuthType) + if err != nil { + return fmt.Errorf("error reading 'auth_type': %w", err) + } + delete(object, "auth_type") + } + + if raw, found := object["broker_timeout"]; found { + err = json.Unmarshal(raw, &a.BrokerTimeout) + if err != nil { + return fmt.Errorf("error reading 'broker_timeout': %w", err) + } + delete(object, "broker_timeout") + } + + if raw, found := object["ca_sha256"]; found { + err = json.Unmarshal(raw, &a.CaSha256) + if err != nil { + return fmt.Errorf("error reading 'ca_sha256': %w", err) + } + delete(object, "ca_sha256") + } + + if raw, found := object["ca_trusted_fingerprint"]; found { + err = json.Unmarshal(raw, &a.CaTrustedFingerprint) + if err != nil { + return fmt.Errorf("error reading 'ca_trusted_fingerprint': %w", err) + } + delete(object, "ca_trusted_fingerprint") + } + + if raw, found := object["client_id"]; found { + err = json.Unmarshal(raw, &a.ClientId) + if err != nil { + return fmt.Errorf("error reading 'client_id': %w", err) + } + delete(object, "client_id") + } + + if raw, found := object["compression"]; found { + err = json.Unmarshal(raw, &a.Compression) + if err != nil { + return fmt.Errorf("error reading 'compression': %w", err) + } + delete(object, "compression") + } + + if raw, found := object["compression_level"]; found { + err = json.Unmarshal(raw, &a.CompressionLevel) + if err != nil { + return fmt.Errorf("error reading 'compression_level': %w", err) + } + delete(object, "compression_level") + } + + if raw, found := object["config_yaml"]; found { + err = json.Unmarshal(raw, &a.ConfigYaml) + if err != nil { + return fmt.Errorf("error reading 'config_yaml': %w", err) + } + delete(object, "config_yaml") + } + + if raw, found := object["connection_type"]; found { + err = json.Unmarshal(raw, &a.ConnectionType) + if err != nil { + return fmt.Errorf("error reading 'connection_type': %w", err) + } + delete(object, "connection_type") + } + + if raw, found := object["hash"]; found { + err = json.Unmarshal(raw, &a.Hash) + if err != nil { + return fmt.Errorf("error reading 'hash': %w", err) + } + delete(object, "hash") + } + + if raw, found := object["headers"]; found { + err = json.Unmarshal(raw, &a.Headers) + if err != nil { + return fmt.Errorf("error reading 'headers': %w", err) + } + delete(object, "headers") + } + + if raw, found := object["hosts"]; found { + err = json.Unmarshal(raw, &a.Hosts) + if err != nil { + return fmt.Errorf("error reading 'hosts': %w", err) + } + delete(object, "hosts") + } + + if raw, found := object["id"]; found { + err = json.Unmarshal(raw, &a.Id) + if err != nil { + return fmt.Errorf("error reading 'id': %w", err) + } + delete(object, "id") + } + + if raw, found := object["is_default"]; found { + err = json.Unmarshal(raw, &a.IsDefault) + if err != nil { + return fmt.Errorf("error reading 'is_default': %w", err) + } + delete(object, "is_default") + } + + if raw, found := object["is_default_monitoring"]; found { + err = json.Unmarshal(raw, &a.IsDefaultMonitoring) + if err != nil { + return fmt.Errorf("error reading 'is_default_monitoring': %w", err) + } + delete(object, "is_default_monitoring") + } + + if raw, found := object["is_internal"]; found { + err = json.Unmarshal(raw, &a.IsInternal) + if err != nil { + return fmt.Errorf("error reading 'is_internal': %w", err) + } + delete(object, "is_internal") + } + + if raw, found := object["is_preconfigured"]; found { + err = json.Unmarshal(raw, &a.IsPreconfigured) + if err != nil { + return fmt.Errorf("error reading 'is_preconfigured': %w", err) + } + delete(object, "is_preconfigured") + } + + if raw, found := object["key"]; found { + err = json.Unmarshal(raw, &a.Key) + if err != nil { + return fmt.Errorf("error reading 'key': %w", err) + } + delete(object, "key") + } + + if raw, found := object["name"]; found { + err = json.Unmarshal(raw, &a.Name) + if err != nil { + return fmt.Errorf("error reading 'name': %w", err) + } + delete(object, "name") + } + + if raw, found := object["partition"]; found { + err = json.Unmarshal(raw, &a.Partition) + if err != nil { + return fmt.Errorf("error reading 'partition': %w", err) + } + delete(object, "partition") + } + + if raw, found := object["password"]; found { + err = json.Unmarshal(raw, &a.Password) + if err != nil { + return fmt.Errorf("error reading 'password': %w", err) + } + delete(object, "password") + } + + if raw, found := object["proxy_id"]; found { + err = json.Unmarshal(raw, &a.ProxyId) + if err != nil { + return fmt.Errorf("error reading 'proxy_id': %w", err) + } + delete(object, "proxy_id") + } + + if raw, found := object["random"]; found { + err = json.Unmarshal(raw, &a.Random) + if err != nil { + return fmt.Errorf("error reading 'random': %w", err) + } + delete(object, "random") + } + + if raw, found := object["required_acks"]; found { + err = json.Unmarshal(raw, &a.RequiredAcks) + if err != nil { + return fmt.Errorf("error reading 'required_acks': %w", err) + } + delete(object, "required_acks") + } + + if raw, found := object["round_robin"]; found { + err = json.Unmarshal(raw, &a.RoundRobin) + if err != nil { + return fmt.Errorf("error reading 'round_robin': %w", err) + } + delete(object, "round_robin") + } + + if raw, found := object["sasl"]; found { + err = json.Unmarshal(raw, &a.Sasl) + if err != nil { + return fmt.Errorf("error reading 'sasl': %w", err) + } + delete(object, "sasl") + } + + if raw, found := object["secrets"]; found { + err = json.Unmarshal(raw, &a.Secrets) + if err != nil { + return fmt.Errorf("error reading 'secrets': %w", err) + } + delete(object, "secrets") + } + + if raw, found := object["shipper"]; found { + err = json.Unmarshal(raw, &a.Shipper) + if err != nil { + return fmt.Errorf("error reading 'shipper': %w", err) + } + delete(object, "shipper") + } + + if raw, found := object["ssl"]; found { + err = json.Unmarshal(raw, &a.Ssl) + if err != nil { + return fmt.Errorf("error reading 'ssl': %w", err) + } + delete(object, "ssl") + } + + if raw, found := object["timeout"]; found { + err = json.Unmarshal(raw, &a.Timeout) + if err != nil { + return fmt.Errorf("error reading 'timeout': %w", err) + } + delete(object, "timeout") + } + + if raw, found := object["topic"]; found { + err = json.Unmarshal(raw, &a.Topic) + if err != nil { + return fmt.Errorf("error reading 'topic': %w", err) + } + delete(object, "topic") + } + + if raw, found := object["topics"]; found { + err = json.Unmarshal(raw, &a.Topics) + if err != nil { + return fmt.Errorf("error reading 'topics': %w", err) + } + delete(object, "topics") + } + + if raw, found := object["type"]; found { + err = json.Unmarshal(raw, &a.Type) + if err != nil { + return fmt.Errorf("error reading 'type': %w", err) + } + delete(object, "type") + } + + if raw, found := object["username"]; found { + err = json.Unmarshal(raw, &a.Username) + if err != nil { + return fmt.Errorf("error reading 'username': %w", err) + } + delete(object, "username") + } + + if raw, found := object["version"]; found { + err = json.Unmarshal(raw, &a.Version) + if err != nil { + return fmt.Errorf("error reading 'version': %w", err) + } + delete(object, "version") + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for OutputKafka to handle AdditionalProperties +func (a OutputKafka) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + if a.AllowEdit != nil { + object["allow_edit"], err = json.Marshal(a.AllowEdit) + if err != nil { + return nil, fmt.Errorf("error marshaling 'allow_edit': %w", err) + } + } + + object["auth_type"], err = json.Marshal(a.AuthType) + if err != nil { + return nil, fmt.Errorf("error marshaling 'auth_type': %w", err) + } + + if a.BrokerTimeout != nil { + object["broker_timeout"], err = json.Marshal(a.BrokerTimeout) + if err != nil { + return nil, fmt.Errorf("error marshaling 'broker_timeout': %w", err) + } + } + + if a.CaSha256 != nil { + object["ca_sha256"], err = json.Marshal(a.CaSha256) + if err != nil { + return nil, fmt.Errorf("error marshaling 'ca_sha256': %w", err) + } + } + + if a.CaTrustedFingerprint != nil { + object["ca_trusted_fingerprint"], err = json.Marshal(a.CaTrustedFingerprint) + if err != nil { + return nil, fmt.Errorf("error marshaling 'ca_trusted_fingerprint': %w", err) + } + } + + if a.ClientId != nil { + object["client_id"], err = json.Marshal(a.ClientId) + if err != nil { + return nil, fmt.Errorf("error marshaling 'client_id': %w", err) + } + } + + if a.Compression != nil { + object["compression"], err = json.Marshal(a.Compression) + if err != nil { + return nil, fmt.Errorf("error marshaling 'compression': %w", err) + } + } + + object["compression_level"], err = json.Marshal(a.CompressionLevel) + if err != nil { + return nil, fmt.Errorf("error marshaling 'compression_level': %w", err) + } + + if a.ConfigYaml != nil { + object["config_yaml"], err = json.Marshal(a.ConfigYaml) + if err != nil { + return nil, fmt.Errorf("error marshaling 'config_yaml': %w", err) + } + } + + object["connection_type"], err = json.Marshal(a.ConnectionType) + if err != nil { + return nil, fmt.Errorf("error marshaling 'connection_type': %w", err) + } + + if a.Hash != nil { + object["hash"], err = json.Marshal(a.Hash) + if err != nil { + return nil, fmt.Errorf("error marshaling 'hash': %w", err) + } + } + + if a.Headers != nil { + object["headers"], err = json.Marshal(a.Headers) + if err != nil { + return nil, fmt.Errorf("error marshaling 'headers': %w", err) + } + } + + object["hosts"], err = json.Marshal(a.Hosts) + if err != nil { + return nil, fmt.Errorf("error marshaling 'hosts': %w", err) + } + + if a.Id != nil { + object["id"], err = json.Marshal(a.Id) + if err != nil { + return nil, fmt.Errorf("error marshaling 'id': %w", err) + } + } + + if a.IsDefault != nil { + object["is_default"], err = json.Marshal(a.IsDefault) + if err != nil { + return nil, fmt.Errorf("error marshaling 'is_default': %w", err) + } + } + + if a.IsDefaultMonitoring != nil { + object["is_default_monitoring"], err = json.Marshal(a.IsDefaultMonitoring) + if err != nil { + return nil, fmt.Errorf("error marshaling 'is_default_monitoring': %w", err) + } + } + + if a.IsInternal != nil { + object["is_internal"], err = json.Marshal(a.IsInternal) + if err != nil { + return nil, fmt.Errorf("error marshaling 'is_internal': %w", err) + } + } + + if a.IsPreconfigured != nil { + object["is_preconfigured"], err = json.Marshal(a.IsPreconfigured) + if err != nil { + return nil, fmt.Errorf("error marshaling 'is_preconfigured': %w", err) + } + } + + if a.Key != nil { + object["key"], err = json.Marshal(a.Key) + if err != nil { + return nil, fmt.Errorf("error marshaling 'key': %w", err) + } + } + + object["name"], err = json.Marshal(a.Name) + if err != nil { + return nil, fmt.Errorf("error marshaling 'name': %w", err) + } + + if a.Partition != nil { + object["partition"], err = json.Marshal(a.Partition) + if err != nil { + return nil, fmt.Errorf("error marshaling 'partition': %w", err) + } + } + + object["password"], err = json.Marshal(a.Password) + if err != nil { + return nil, fmt.Errorf("error marshaling 'password': %w", err) + } + + if a.ProxyId != nil { + object["proxy_id"], err = json.Marshal(a.ProxyId) + if err != nil { + return nil, fmt.Errorf("error marshaling 'proxy_id': %w", err) + } + } + + if a.Random != nil { + object["random"], err = json.Marshal(a.Random) + if err != nil { + return nil, fmt.Errorf("error marshaling 'random': %w", err) + } + } + + if a.RequiredAcks != nil { + object["required_acks"], err = json.Marshal(a.RequiredAcks) + if err != nil { + return nil, fmt.Errorf("error marshaling 'required_acks': %w", err) + } + } + + if a.RoundRobin != nil { + object["round_robin"], err = json.Marshal(a.RoundRobin) + if err != nil { + return nil, fmt.Errorf("error marshaling 'round_robin': %w", err) + } + } + + if a.Sasl != nil { + object["sasl"], err = json.Marshal(a.Sasl) + if err != nil { + return nil, fmt.Errorf("error marshaling 'sasl': %w", err) + } + } + + if a.Secrets != nil { + object["secrets"], err = json.Marshal(a.Secrets) + if err != nil { + return nil, fmt.Errorf("error marshaling 'secrets': %w", err) + } + } + + if a.Shipper != nil { + object["shipper"], err = json.Marshal(a.Shipper) + if err != nil { + return nil, fmt.Errorf("error marshaling 'shipper': %w", err) + } + } + + if a.Ssl != nil { + object["ssl"], err = json.Marshal(a.Ssl) + if err != nil { + return nil, fmt.Errorf("error marshaling 'ssl': %w", err) + } + } + + if a.Timeout != nil { + object["timeout"], err = json.Marshal(a.Timeout) + if err != nil { + return nil, fmt.Errorf("error marshaling 'timeout': %w", err) + } + } + + if a.Topic != nil { + object["topic"], err = json.Marshal(a.Topic) + if err != nil { + return nil, fmt.Errorf("error marshaling 'topic': %w", err) + } + } + + if a.Topics != nil { + object["topics"], err = json.Marshal(a.Topics) + if err != nil { + return nil, fmt.Errorf("error marshaling 'topics': %w", err) + } + } + + object["type"], err = json.Marshal(a.Type) + if err != nil { + return nil, fmt.Errorf("error marshaling 'type': %w", err) + } + + object["username"], err = json.Marshal(a.Username) + if err != nil { + return nil, fmt.Errorf("error marshaling 'username': %w", err) + } + + if a.Version != nil { + object["version"], err = json.Marshal(a.Version) + if err != nil { + return nil, fmt.Errorf("error marshaling 'version': %w", err) + } + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + +// Getter for additional properties for OutputKafka_Hash. Returns the specified +// element and whether it was found +func (a OutputKafka_Hash) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for OutputKafka_Hash +func (a *OutputKafka_Hash) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for OutputKafka_Hash to handle AdditionalProperties +func (a *OutputKafka_Hash) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["hash"]; found { + err = json.Unmarshal(raw, &a.Hash) + if err != nil { + return fmt.Errorf("error reading 'hash': %w", err) + } + delete(object, "hash") + } + + if raw, found := object["random"]; found { + err = json.Unmarshal(raw, &a.Random) + if err != nil { + return fmt.Errorf("error reading 'random': %w", err) + } + delete(object, "random") + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for OutputKafka_Hash to handle AdditionalProperties +func (a OutputKafka_Hash) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + if a.Hash != nil { + object["hash"], err = json.Marshal(a.Hash) + if err != nil { + return nil, fmt.Errorf("error marshaling 'hash': %w", err) + } + } + + if a.Random != nil { + object["random"], err = json.Marshal(a.Random) + if err != nil { + return nil, fmt.Errorf("error marshaling 'random': %w", err) + } + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + +// Getter for additional properties for OutputKafka_Headers_Item. Returns the specified +// element and whether it was found +func (a OutputKafka_Headers_Item) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for OutputKafka_Headers_Item +func (a *OutputKafka_Headers_Item) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for OutputKafka_Headers_Item to handle AdditionalProperties +func (a *OutputKafka_Headers_Item) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["key"]; found { + err = json.Unmarshal(raw, &a.Key) + if err != nil { + return fmt.Errorf("error reading 'key': %w", err) + } + delete(object, "key") + } + + if raw, found := object["value"]; found { + err = json.Unmarshal(raw, &a.Value) + if err != nil { + return fmt.Errorf("error reading 'value': %w", err) + } + delete(object, "value") + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for OutputKafka_Headers_Item to handle AdditionalProperties +func (a OutputKafka_Headers_Item) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + object["key"], err = json.Marshal(a.Key) + if err != nil { + return nil, fmt.Errorf("error marshaling 'key': %w", err) + } + + object["value"], err = json.Marshal(a.Value) + if err != nil { + return nil, fmt.Errorf("error marshaling 'value': %w", err) + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + +// Getter for additional properties for OutputKafka_Random. Returns the specified +// element and whether it was found +func (a OutputKafka_Random) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for OutputKafka_Random +func (a *OutputKafka_Random) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for OutputKafka_Random to handle AdditionalProperties +func (a *OutputKafka_Random) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["group_events"]; found { + err = json.Unmarshal(raw, &a.GroupEvents) + if err != nil { + return fmt.Errorf("error reading 'group_events': %w", err) + } + delete(object, "group_events") + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for OutputKafka_Random to handle AdditionalProperties +func (a OutputKafka_Random) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + if a.GroupEvents != nil { + object["group_events"], err = json.Marshal(a.GroupEvents) + if err != nil { + return nil, fmt.Errorf("error marshaling 'group_events': %w", err) + } + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + +// Getter for additional properties for OutputKafka_RoundRobin. Returns the specified +// element and whether it was found +func (a OutputKafka_RoundRobin) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for OutputKafka_RoundRobin +func (a *OutputKafka_RoundRobin) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for OutputKafka_RoundRobin to handle AdditionalProperties +func (a *OutputKafka_RoundRobin) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["group_events"]; found { + err = json.Unmarshal(raw, &a.GroupEvents) + if err != nil { + return fmt.Errorf("error reading 'group_events': %w", err) + } + delete(object, "group_events") + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for OutputKafka_RoundRobin to handle AdditionalProperties +func (a OutputKafka_RoundRobin) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + if a.GroupEvents != nil { + object["group_events"], err = json.Marshal(a.GroupEvents) + if err != nil { + return nil, fmt.Errorf("error marshaling 'group_events': %w", err) + } + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + +// Getter for additional properties for OutputKafka_Sasl. Returns the specified +// element and whether it was found +func (a OutputKafka_Sasl) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for OutputKafka_Sasl +func (a *OutputKafka_Sasl) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for OutputKafka_Sasl to handle AdditionalProperties +func (a *OutputKafka_Sasl) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["mechanism"]; found { + err = json.Unmarshal(raw, &a.Mechanism) + if err != nil { + return fmt.Errorf("error reading 'mechanism': %w", err) + } + delete(object, "mechanism") + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for OutputKafka_Sasl to handle AdditionalProperties +func (a OutputKafka_Sasl) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + if a.Mechanism != nil { + object["mechanism"], err = json.Marshal(a.Mechanism) + if err != nil { + return nil, fmt.Errorf("error marshaling 'mechanism': %w", err) + } + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + +// Getter for additional properties for OutputKafkaSecretsPassword0. Returns the specified +// element and whether it was found +func (a OutputKafkaSecretsPassword0) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for OutputKafkaSecretsPassword0 +func (a *OutputKafkaSecretsPassword0) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for OutputKafkaSecretsPassword0 to handle AdditionalProperties +func (a *OutputKafkaSecretsPassword0) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["id"]; found { + err = json.Unmarshal(raw, &a.Id) + if err != nil { + return fmt.Errorf("error reading 'id': %w", err) + } + delete(object, "id") + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for OutputKafkaSecretsPassword0 to handle AdditionalProperties +func (a OutputKafkaSecretsPassword0) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + object["id"], err = json.Marshal(a.Id) + if err != nil { + return nil, fmt.Errorf("error marshaling 'id': %w", err) + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + +// Getter for additional properties for OutputKafkaSecretsSslKey0. Returns the specified +// element and whether it was found +func (a OutputKafkaSecretsSslKey0) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for OutputKafkaSecretsSslKey0 +func (a *OutputKafkaSecretsSslKey0) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for OutputKafkaSecretsSslKey0 to handle AdditionalProperties +func (a *OutputKafkaSecretsSslKey0) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["id"]; found { + err = json.Unmarshal(raw, &a.Id) + if err != nil { + return fmt.Errorf("error reading 'id': %w", err) + } + delete(object, "id") + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for OutputKafkaSecretsSslKey0 to handle AdditionalProperties +func (a OutputKafkaSecretsSslKey0) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + object["id"], err = json.Marshal(a.Id) + if err != nil { + return nil, fmt.Errorf("error marshaling 'id': %w", err) + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + +// Getter for additional properties for OutputKafka_Secrets_Ssl. Returns the specified +// element and whether it was found +func (a OutputKafka_Secrets_Ssl) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for OutputKafka_Secrets_Ssl +func (a *OutputKafka_Secrets_Ssl) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for OutputKafka_Secrets_Ssl to handle AdditionalProperties +func (a *OutputKafka_Secrets_Ssl) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["key"]; found { + err = json.Unmarshal(raw, &a.Key) + if err != nil { + return fmt.Errorf("error reading 'key': %w", err) + } + delete(object, "key") + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for OutputKafka_Secrets_Ssl to handle AdditionalProperties +func (a OutputKafka_Secrets_Ssl) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + object["key"], err = json.Marshal(a.Key) + if err != nil { + return nil, fmt.Errorf("error marshaling 'key': %w", err) + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + +// Getter for additional properties for OutputKafka_Secrets. Returns the specified +// element and whether it was found +func (a OutputKafka_Secrets) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for OutputKafka_Secrets +func (a *OutputKafka_Secrets) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for OutputKafka_Secrets to handle AdditionalProperties +func (a *OutputKafka_Secrets) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["password"]; found { + err = json.Unmarshal(raw, &a.Password) + if err != nil { + return fmt.Errorf("error reading 'password': %w", err) + } + delete(object, "password") + } + + if raw, found := object["ssl"]; found { + err = json.Unmarshal(raw, &a.Ssl) + if err != nil { + return fmt.Errorf("error reading 'ssl': %w", err) + } + delete(object, "ssl") + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for OutputKafka_Secrets to handle AdditionalProperties +func (a OutputKafka_Secrets) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + if a.Password != nil { + object["password"], err = json.Marshal(a.Password) + if err != nil { + return nil, fmt.Errorf("error marshaling 'password': %w", err) + } + } + + if a.Ssl != nil { + object["ssl"], err = json.Marshal(a.Ssl) + if err != nil { + return nil, fmt.Errorf("error marshaling 'ssl': %w", err) + } + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + +// Getter for additional properties for OutputKafka_Topics_When. Returns the specified +// element and whether it was found +func (a OutputKafka_Topics_When) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for OutputKafka_Topics_When +func (a *OutputKafka_Topics_When) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for OutputKafka_Topics_When to handle AdditionalProperties +func (a *OutputKafka_Topics_When) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["condition"]; found { + err = json.Unmarshal(raw, &a.Condition) + if err != nil { + return fmt.Errorf("error reading 'condition': %w", err) + } + delete(object, "condition") + } + + if raw, found := object["type"]; found { + err = json.Unmarshal(raw, &a.Type) + if err != nil { + return fmt.Errorf("error reading 'type': %w", err) + } + delete(object, "type") + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for OutputKafka_Topics_When to handle AdditionalProperties +func (a OutputKafka_Topics_When) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + if a.Condition != nil { + object["condition"], err = json.Marshal(a.Condition) + if err != nil { + return nil, fmt.Errorf("error marshaling 'condition': %w", err) + } + } + + if a.Type != nil { + object["type"], err = json.Marshal(a.Type) + if err != nil { + return nil, fmt.Errorf("error marshaling 'type': %w", err) + } + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + +// Getter for additional properties for OutputKafka_Topics_Item. Returns the specified +// element and whether it was found +func (a OutputKafka_Topics_Item) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for OutputKafka_Topics_Item +func (a *OutputKafka_Topics_Item) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for OutputKafka_Topics_Item to handle AdditionalProperties +func (a *OutputKafka_Topics_Item) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["topic"]; found { + err = json.Unmarshal(raw, &a.Topic) + if err != nil { + return fmt.Errorf("error reading 'topic': %w", err) + } + delete(object, "topic") + } + + if raw, found := object["when"]; found { + err = json.Unmarshal(raw, &a.When) + if err != nil { + return fmt.Errorf("error reading 'when': %w", err) + } + delete(object, "when") + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for OutputKafka_Topics_Item to handle AdditionalProperties +func (a OutputKafka_Topics_Item) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + object["topic"], err = json.Marshal(a.Topic) + if err != nil { + return nil, fmt.Errorf("error marshaling 'topic': %w", err) + } + + if a.When != nil { + object["when"], err = json.Marshal(a.When) + if err != nil { + return nil, fmt.Errorf("error marshaling 'when': %w", err) + } + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + +// Getter for additional properties for OutputLogstash. Returns the specified +// element and whether it was found +func (a OutputLogstash) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for OutputLogstash +func (a *OutputLogstash) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for OutputLogstash to handle AdditionalProperties +func (a *OutputLogstash) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["allow_edit"]; found { + err = json.Unmarshal(raw, &a.AllowEdit) + if err != nil { + return fmt.Errorf("error reading 'allow_edit': %w", err) + } + delete(object, "allow_edit") + } + + if raw, found := object["ca_sha256"]; found { + err = json.Unmarshal(raw, &a.CaSha256) + if err != nil { + return fmt.Errorf("error reading 'ca_sha256': %w", err) + } + delete(object, "ca_sha256") + } + + if raw, found := object["ca_trusted_fingerprint"]; found { + err = json.Unmarshal(raw, &a.CaTrustedFingerprint) + if err != nil { + return fmt.Errorf("error reading 'ca_trusted_fingerprint': %w", err) + } + delete(object, "ca_trusted_fingerprint") + } + + if raw, found := object["config_yaml"]; found { + err = json.Unmarshal(raw, &a.ConfigYaml) + if err != nil { + return fmt.Errorf("error reading 'config_yaml': %w", err) + } + delete(object, "config_yaml") + } + + if raw, found := object["hosts"]; found { + err = json.Unmarshal(raw, &a.Hosts) + if err != nil { + return fmt.Errorf("error reading 'hosts': %w", err) + } + delete(object, "hosts") + } + + if raw, found := object["id"]; found { + err = json.Unmarshal(raw, &a.Id) + if err != nil { + return fmt.Errorf("error reading 'id': %w", err) + } + delete(object, "id") + } + + if raw, found := object["is_default"]; found { + err = json.Unmarshal(raw, &a.IsDefault) + if err != nil { + return fmt.Errorf("error reading 'is_default': %w", err) + } + delete(object, "is_default") + } + + if raw, found := object["is_default_monitoring"]; found { + err = json.Unmarshal(raw, &a.IsDefaultMonitoring) + if err != nil { + return fmt.Errorf("error reading 'is_default_monitoring': %w", err) + } + delete(object, "is_default_monitoring") + } + + if raw, found := object["is_internal"]; found { + err = json.Unmarshal(raw, &a.IsInternal) + if err != nil { + return fmt.Errorf("error reading 'is_internal': %w", err) + } + delete(object, "is_internal") + } + + if raw, found := object["is_preconfigured"]; found { + err = json.Unmarshal(raw, &a.IsPreconfigured) + if err != nil { + return fmt.Errorf("error reading 'is_preconfigured': %w", err) + } + delete(object, "is_preconfigured") + } + + if raw, found := object["name"]; found { + err = json.Unmarshal(raw, &a.Name) + if err != nil { + return fmt.Errorf("error reading 'name': %w", err) + } + delete(object, "name") + } + + if raw, found := object["proxy_id"]; found { + err = json.Unmarshal(raw, &a.ProxyId) + if err != nil { + return fmt.Errorf("error reading 'proxy_id': %w", err) + } + delete(object, "proxy_id") + } + + if raw, found := object["secrets"]; found { + err = json.Unmarshal(raw, &a.Secrets) + if err != nil { + return fmt.Errorf("error reading 'secrets': %w", err) + } + delete(object, "secrets") + } + + if raw, found := object["shipper"]; found { + err = json.Unmarshal(raw, &a.Shipper) + if err != nil { + return fmt.Errorf("error reading 'shipper': %w", err) + } + delete(object, "shipper") + } + + if raw, found := object["ssl"]; found { + err = json.Unmarshal(raw, &a.Ssl) + if err != nil { + return fmt.Errorf("error reading 'ssl': %w", err) + } + delete(object, "ssl") + } + + if raw, found := object["type"]; found { + err = json.Unmarshal(raw, &a.Type) + if err != nil { + return fmt.Errorf("error reading 'type': %w", err) + } + delete(object, "type") + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for OutputLogstash to handle AdditionalProperties +func (a OutputLogstash) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + if a.AllowEdit != nil { + object["allow_edit"], err = json.Marshal(a.AllowEdit) + if err != nil { + return nil, fmt.Errorf("error marshaling 'allow_edit': %w", err) + } + } + + if a.CaSha256 != nil { + object["ca_sha256"], err = json.Marshal(a.CaSha256) + if err != nil { + return nil, fmt.Errorf("error marshaling 'ca_sha256': %w", err) + } + } + + if a.CaTrustedFingerprint != nil { + object["ca_trusted_fingerprint"], err = json.Marshal(a.CaTrustedFingerprint) + if err != nil { + return nil, fmt.Errorf("error marshaling 'ca_trusted_fingerprint': %w", err) + } + } + + if a.ConfigYaml != nil { + object["config_yaml"], err = json.Marshal(a.ConfigYaml) + if err != nil { + return nil, fmt.Errorf("error marshaling 'config_yaml': %w", err) + } + } + + object["hosts"], err = json.Marshal(a.Hosts) + if err != nil { + return nil, fmt.Errorf("error marshaling 'hosts': %w", err) + } + + if a.Id != nil { + object["id"], err = json.Marshal(a.Id) + if err != nil { + return nil, fmt.Errorf("error marshaling 'id': %w", err) + } + } + + if a.IsDefault != nil { + object["is_default"], err = json.Marshal(a.IsDefault) + if err != nil { + return nil, fmt.Errorf("error marshaling 'is_default': %w", err) + } + } + + if a.IsDefaultMonitoring != nil { + object["is_default_monitoring"], err = json.Marshal(a.IsDefaultMonitoring) + if err != nil { + return nil, fmt.Errorf("error marshaling 'is_default_monitoring': %w", err) + } + } + + if a.IsInternal != nil { + object["is_internal"], err = json.Marshal(a.IsInternal) + if err != nil { + return nil, fmt.Errorf("error marshaling 'is_internal': %w", err) + } + } + + if a.IsPreconfigured != nil { + object["is_preconfigured"], err = json.Marshal(a.IsPreconfigured) + if err != nil { + return nil, fmt.Errorf("error marshaling 'is_preconfigured': %w", err) + } + } + + object["name"], err = json.Marshal(a.Name) + if err != nil { + return nil, fmt.Errorf("error marshaling 'name': %w", err) + } + + if a.ProxyId != nil { + object["proxy_id"], err = json.Marshal(a.ProxyId) + if err != nil { + return nil, fmt.Errorf("error marshaling 'proxy_id': %w", err) + } + } + + if a.Secrets != nil { + object["secrets"], err = json.Marshal(a.Secrets) + if err != nil { + return nil, fmt.Errorf("error marshaling 'secrets': %w", err) + } + } + + if a.Shipper != nil { + object["shipper"], err = json.Marshal(a.Shipper) + if err != nil { + return nil, fmt.Errorf("error marshaling 'shipper': %w", err) + } + } + + if a.Ssl != nil { + object["ssl"], err = json.Marshal(a.Ssl) + if err != nil { + return nil, fmt.Errorf("error marshaling 'ssl': %w", err) + } + } + + object["type"], err = json.Marshal(a.Type) + if err != nil { + return nil, fmt.Errorf("error marshaling 'type': %w", err) + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + +// Getter for additional properties for OutputLogstashSecretsSslKey0. Returns the specified +// element and whether it was found +func (a OutputLogstashSecretsSslKey0) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for OutputLogstashSecretsSslKey0 +func (a *OutputLogstashSecretsSslKey0) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for OutputLogstashSecretsSslKey0 to handle AdditionalProperties +func (a *OutputLogstashSecretsSslKey0) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["id"]; found { + err = json.Unmarshal(raw, &a.Id) + if err != nil { + return fmt.Errorf("error reading 'id': %w", err) + } + delete(object, "id") + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for OutputLogstashSecretsSslKey0 to handle AdditionalProperties +func (a OutputLogstashSecretsSslKey0) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + object["id"], err = json.Marshal(a.Id) + if err != nil { + return nil, fmt.Errorf("error marshaling 'id': %w", err) + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + +// Getter for additional properties for OutputLogstash_Secrets_Ssl. Returns the specified +// element and whether it was found +func (a OutputLogstash_Secrets_Ssl) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for OutputLogstash_Secrets_Ssl +func (a *OutputLogstash_Secrets_Ssl) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for OutputLogstash_Secrets_Ssl to handle AdditionalProperties +func (a *OutputLogstash_Secrets_Ssl) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["key"]; found { + err = json.Unmarshal(raw, &a.Key) + if err != nil { + return fmt.Errorf("error reading 'key': %w", err) + } + delete(object, "key") + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for OutputLogstash_Secrets_Ssl to handle AdditionalProperties +func (a OutputLogstash_Secrets_Ssl) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + if a.Key != nil { + object["key"], err = json.Marshal(a.Key) + if err != nil { + return nil, fmt.Errorf("error marshaling 'key': %w", err) + } + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + +// Getter for additional properties for OutputLogstash_Secrets. Returns the specified +// element and whether it was found +func (a OutputLogstash_Secrets) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for OutputLogstash_Secrets +func (a *OutputLogstash_Secrets) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for OutputLogstash_Secrets to handle AdditionalProperties +func (a *OutputLogstash_Secrets) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["ssl"]; found { + err = json.Unmarshal(raw, &a.Ssl) + if err != nil { + return fmt.Errorf("error reading 'ssl': %w", err) + } + delete(object, "ssl") + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for OutputLogstash_Secrets to handle AdditionalProperties +func (a OutputLogstash_Secrets) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + if a.Ssl != nil { + object["ssl"], err = json.Marshal(a.Ssl) + if err != nil { + return nil, fmt.Errorf("error marshaling 'ssl': %w", err) + } + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + +// Getter for additional properties for OutputRemoteElasticsearch. Returns the specified +// element and whether it was found +func (a OutputRemoteElasticsearch) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for OutputRemoteElasticsearch +func (a *OutputRemoteElasticsearch) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for OutputRemoteElasticsearch to handle AdditionalProperties +func (a *OutputRemoteElasticsearch) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["allow_edit"]; found { + err = json.Unmarshal(raw, &a.AllowEdit) + if err != nil { + return fmt.Errorf("error reading 'allow_edit': %w", err) + } + delete(object, "allow_edit") + } + + if raw, found := object["ca_sha256"]; found { + err = json.Unmarshal(raw, &a.CaSha256) + if err != nil { + return fmt.Errorf("error reading 'ca_sha256': %w", err) + } + delete(object, "ca_sha256") + } + + if raw, found := object["ca_trusted_fingerprint"]; found { + err = json.Unmarshal(raw, &a.CaTrustedFingerprint) + if err != nil { + return fmt.Errorf("error reading 'ca_trusted_fingerprint': %w", err) + } + delete(object, "ca_trusted_fingerprint") + } + + if raw, found := object["config_yaml"]; found { + err = json.Unmarshal(raw, &a.ConfigYaml) + if err != nil { + return fmt.Errorf("error reading 'config_yaml': %w", err) + } + delete(object, "config_yaml") + } + + if raw, found := object["hosts"]; found { + err = json.Unmarshal(raw, &a.Hosts) + if err != nil { + return fmt.Errorf("error reading 'hosts': %w", err) + } + delete(object, "hosts") + } + + if raw, found := object["id"]; found { + err = json.Unmarshal(raw, &a.Id) + if err != nil { + return fmt.Errorf("error reading 'id': %w", err) + } + delete(object, "id") + } + + if raw, found := object["is_default"]; found { + err = json.Unmarshal(raw, &a.IsDefault) + if err != nil { + return fmt.Errorf("error reading 'is_default': %w", err) + } + delete(object, "is_default") + } + + if raw, found := object["is_default_monitoring"]; found { + err = json.Unmarshal(raw, &a.IsDefaultMonitoring) + if err != nil { + return fmt.Errorf("error reading 'is_default_monitoring': %w", err) + } + delete(object, "is_default_monitoring") + } + + if raw, found := object["is_internal"]; found { + err = json.Unmarshal(raw, &a.IsInternal) + if err != nil { + return fmt.Errorf("error reading 'is_internal': %w", err) + } + delete(object, "is_internal") + } + + if raw, found := object["is_preconfigured"]; found { + err = json.Unmarshal(raw, &a.IsPreconfigured) + if err != nil { + return fmt.Errorf("error reading 'is_preconfigured': %w", err) + } + delete(object, "is_preconfigured") + } + + if raw, found := object["name"]; found { + err = json.Unmarshal(raw, &a.Name) + if err != nil { + return fmt.Errorf("error reading 'name': %w", err) + } + delete(object, "name") + } + + if raw, found := object["preset"]; found { + err = json.Unmarshal(raw, &a.Preset) + if err != nil { + return fmt.Errorf("error reading 'preset': %w", err) + } + delete(object, "preset") + } + + if raw, found := object["proxy_id"]; found { + err = json.Unmarshal(raw, &a.ProxyId) + if err != nil { + return fmt.Errorf("error reading 'proxy_id': %w", err) + } + delete(object, "proxy_id") + } + + if raw, found := object["secrets"]; found { + err = json.Unmarshal(raw, &a.Secrets) + if err != nil { + return fmt.Errorf("error reading 'secrets': %w", err) + } + delete(object, "secrets") + } + + if raw, found := object["service_token"]; found { + err = json.Unmarshal(raw, &a.ServiceToken) + if err != nil { + return fmt.Errorf("error reading 'service_token': %w", err) + } + delete(object, "service_token") + } + + if raw, found := object["shipper"]; found { + err = json.Unmarshal(raw, &a.Shipper) + if err != nil { + return fmt.Errorf("error reading 'shipper': %w", err) + } + delete(object, "shipper") + } + + if raw, found := object["ssl"]; found { + err = json.Unmarshal(raw, &a.Ssl) + if err != nil { + return fmt.Errorf("error reading 'ssl': %w", err) + } + delete(object, "ssl") + } + + if raw, found := object["type"]; found { + err = json.Unmarshal(raw, &a.Type) + if err != nil { + return fmt.Errorf("error reading 'type': %w", err) + } + delete(object, "type") + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for OutputRemoteElasticsearch to handle AdditionalProperties +func (a OutputRemoteElasticsearch) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + if a.AllowEdit != nil { + object["allow_edit"], err = json.Marshal(a.AllowEdit) + if err != nil { + return nil, fmt.Errorf("error marshaling 'allow_edit': %w", err) + } + } + + if a.CaSha256 != nil { + object["ca_sha256"], err = json.Marshal(a.CaSha256) + if err != nil { + return nil, fmt.Errorf("error marshaling 'ca_sha256': %w", err) + } + } + + if a.CaTrustedFingerprint != nil { + object["ca_trusted_fingerprint"], err = json.Marshal(a.CaTrustedFingerprint) + if err != nil { + return nil, fmt.Errorf("error marshaling 'ca_trusted_fingerprint': %w", err) + } + } + + if a.ConfigYaml != nil { + object["config_yaml"], err = json.Marshal(a.ConfigYaml) + if err != nil { + return nil, fmt.Errorf("error marshaling 'config_yaml': %w", err) + } + } + + object["hosts"], err = json.Marshal(a.Hosts) + if err != nil { + return nil, fmt.Errorf("error marshaling 'hosts': %w", err) + } + + if a.Id != nil { + object["id"], err = json.Marshal(a.Id) + if err != nil { + return nil, fmt.Errorf("error marshaling 'id': %w", err) + } + } + + if a.IsDefault != nil { + object["is_default"], err = json.Marshal(a.IsDefault) + if err != nil { + return nil, fmt.Errorf("error marshaling 'is_default': %w", err) + } + } + + if a.IsDefaultMonitoring != nil { + object["is_default_monitoring"], err = json.Marshal(a.IsDefaultMonitoring) + if err != nil { + return nil, fmt.Errorf("error marshaling 'is_default_monitoring': %w", err) + } + } + + if a.IsInternal != nil { + object["is_internal"], err = json.Marshal(a.IsInternal) + if err != nil { + return nil, fmt.Errorf("error marshaling 'is_internal': %w", err) + } + } + + if a.IsPreconfigured != nil { + object["is_preconfigured"], err = json.Marshal(a.IsPreconfigured) + if err != nil { + return nil, fmt.Errorf("error marshaling 'is_preconfigured': %w", err) + } + } + + object["name"], err = json.Marshal(a.Name) + if err != nil { + return nil, fmt.Errorf("error marshaling 'name': %w", err) + } + + if a.Preset != nil { + object["preset"], err = json.Marshal(a.Preset) + if err != nil { + return nil, fmt.Errorf("error marshaling 'preset': %w", err) + } + } + + if a.ProxyId != nil { + object["proxy_id"], err = json.Marshal(a.ProxyId) + if err != nil { + return nil, fmt.Errorf("error marshaling 'proxy_id': %w", err) + } + } + + if a.Secrets != nil { + object["secrets"], err = json.Marshal(a.Secrets) + if err != nil { + return nil, fmt.Errorf("error marshaling 'secrets': %w", err) + } + } + + if a.ServiceToken != nil { + object["service_token"], err = json.Marshal(a.ServiceToken) + if err != nil { + return nil, fmt.Errorf("error marshaling 'service_token': %w", err) + } + } + + if a.Shipper != nil { + object["shipper"], err = json.Marshal(a.Shipper) + if err != nil { + return nil, fmt.Errorf("error marshaling 'shipper': %w", err) + } + } + + if a.Ssl != nil { + object["ssl"], err = json.Marshal(a.Ssl) + if err != nil { + return nil, fmt.Errorf("error marshaling 'ssl': %w", err) + } + } + + object["type"], err = json.Marshal(a.Type) + if err != nil { + return nil, fmt.Errorf("error marshaling 'type': %w", err) + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + +// Getter for additional properties for OutputRemoteElasticsearchSecretsServiceToken0. Returns the specified +// element and whether it was found +func (a OutputRemoteElasticsearchSecretsServiceToken0) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for OutputRemoteElasticsearchSecretsServiceToken0 +func (a *OutputRemoteElasticsearchSecretsServiceToken0) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for OutputRemoteElasticsearchSecretsServiceToken0 to handle AdditionalProperties +func (a *OutputRemoteElasticsearchSecretsServiceToken0) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["id"]; found { + err = json.Unmarshal(raw, &a.Id) + if err != nil { + return fmt.Errorf("error reading 'id': %w", err) + } + delete(object, "id") + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for OutputRemoteElasticsearchSecretsServiceToken0 to handle AdditionalProperties +func (a OutputRemoteElasticsearchSecretsServiceToken0) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + object["id"], err = json.Marshal(a.Id) + if err != nil { + return nil, fmt.Errorf("error marshaling 'id': %w", err) + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + +// Getter for additional properties for OutputRemoteElasticsearch_Secrets. Returns the specified +// element and whether it was found +func (a OutputRemoteElasticsearch_Secrets) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for OutputRemoteElasticsearch_Secrets +func (a *OutputRemoteElasticsearch_Secrets) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for OutputRemoteElasticsearch_Secrets to handle AdditionalProperties +func (a *OutputRemoteElasticsearch_Secrets) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["service_token"]; found { + err = json.Unmarshal(raw, &a.ServiceToken) + if err != nil { + return fmt.Errorf("error reading 'service_token': %w", err) + } + delete(object, "service_token") + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for OutputRemoteElasticsearch_Secrets to handle AdditionalProperties +func (a OutputRemoteElasticsearch_Secrets) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + if a.ServiceToken != nil { + object["service_token"], err = json.Marshal(a.ServiceToken) + if err != nil { + return nil, fmt.Errorf("error marshaling 'service_token': %w", err) + } + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + +// Getter for additional properties for OutputShipper. Returns the specified +// element and whether it was found +func (a OutputShipper) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for OutputShipper +func (a *OutputShipper) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for OutputShipper to handle AdditionalProperties +func (a *OutputShipper) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["compression_level"]; found { + err = json.Unmarshal(raw, &a.CompressionLevel) + if err != nil { + return fmt.Errorf("error reading 'compression_level': %w", err) + } + delete(object, "compression_level") + } + + if raw, found := object["disk_queue_compression_enabled"]; found { + err = json.Unmarshal(raw, &a.DiskQueueCompressionEnabled) + if err != nil { + return fmt.Errorf("error reading 'disk_queue_compression_enabled': %w", err) + } + delete(object, "disk_queue_compression_enabled") + } + + if raw, found := object["disk_queue_enabled"]; found { + err = json.Unmarshal(raw, &a.DiskQueueEnabled) + if err != nil { + return fmt.Errorf("error reading 'disk_queue_enabled': %w", err) + } + delete(object, "disk_queue_enabled") + } + + if raw, found := object["disk_queue_encryption_enabled"]; found { + err = json.Unmarshal(raw, &a.DiskQueueEncryptionEnabled) + if err != nil { + return fmt.Errorf("error reading 'disk_queue_encryption_enabled': %w", err) + } + delete(object, "disk_queue_encryption_enabled") + } + + if raw, found := object["disk_queue_max_size"]; found { + err = json.Unmarshal(raw, &a.DiskQueueMaxSize) + if err != nil { + return fmt.Errorf("error reading 'disk_queue_max_size': %w", err) + } + delete(object, "disk_queue_max_size") + } + + if raw, found := object["disk_queue_path"]; found { + err = json.Unmarshal(raw, &a.DiskQueuePath) + if err != nil { + return fmt.Errorf("error reading 'disk_queue_path': %w", err) + } + delete(object, "disk_queue_path") + } + + if raw, found := object["loadbalance"]; found { + err = json.Unmarshal(raw, &a.Loadbalance) + if err != nil { + return fmt.Errorf("error reading 'loadbalance': %w", err) + } + delete(object, "loadbalance") + } + + if raw, found := object["max_batch_bytes"]; found { + err = json.Unmarshal(raw, &a.MaxBatchBytes) + if err != nil { + return fmt.Errorf("error reading 'max_batch_bytes': %w", err) + } + delete(object, "max_batch_bytes") + } + + if raw, found := object["mem_queue_events"]; found { + err = json.Unmarshal(raw, &a.MemQueueEvents) + if err != nil { + return fmt.Errorf("error reading 'mem_queue_events': %w", err) + } + delete(object, "mem_queue_events") + } + + if raw, found := object["queue_flush_timeout"]; found { + err = json.Unmarshal(raw, &a.QueueFlushTimeout) + if err != nil { + return fmt.Errorf("error reading 'queue_flush_timeout': %w", err) + } + delete(object, "queue_flush_timeout") + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for OutputShipper to handle AdditionalProperties +func (a OutputShipper) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + object["compression_level"], err = json.Marshal(a.CompressionLevel) + if err != nil { + return nil, fmt.Errorf("error marshaling 'compression_level': %w", err) + } + + object["disk_queue_compression_enabled"], err = json.Marshal(a.DiskQueueCompressionEnabled) + if err != nil { + return nil, fmt.Errorf("error marshaling 'disk_queue_compression_enabled': %w", err) + } + + if a.DiskQueueEnabled != nil { + object["disk_queue_enabled"], err = json.Marshal(a.DiskQueueEnabled) + if err != nil { + return nil, fmt.Errorf("error marshaling 'disk_queue_enabled': %w", err) + } + } + + object["disk_queue_encryption_enabled"], err = json.Marshal(a.DiskQueueEncryptionEnabled) + if err != nil { + return nil, fmt.Errorf("error marshaling 'disk_queue_encryption_enabled': %w", err) + } + + object["disk_queue_max_size"], err = json.Marshal(a.DiskQueueMaxSize) + if err != nil { + return nil, fmt.Errorf("error marshaling 'disk_queue_max_size': %w", err) + } + + object["disk_queue_path"], err = json.Marshal(a.DiskQueuePath) + if err != nil { + return nil, fmt.Errorf("error marshaling 'disk_queue_path': %w", err) + } + + object["loadbalance"], err = json.Marshal(a.Loadbalance) + if err != nil { + return nil, fmt.Errorf("error marshaling 'loadbalance': %w", err) + } + + object["max_batch_bytes"], err = json.Marshal(a.MaxBatchBytes) + if err != nil { + return nil, fmt.Errorf("error marshaling 'max_batch_bytes': %w", err) + } + + object["mem_queue_events"], err = json.Marshal(a.MemQueueEvents) + if err != nil { + return nil, fmt.Errorf("error marshaling 'mem_queue_events': %w", err) + } + + object["queue_flush_timeout"], err = json.Marshal(a.QueueFlushTimeout) + if err != nil { + return nil, fmt.Errorf("error marshaling 'queue_flush_timeout': %w", err) + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + +// Getter for additional properties for OutputSsl. Returns the specified +// element and whether it was found +func (a OutputSsl) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for OutputSsl +func (a *OutputSsl) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for OutputSsl to handle AdditionalProperties +func (a *OutputSsl) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["certificate"]; found { + err = json.Unmarshal(raw, &a.Certificate) + if err != nil { + return fmt.Errorf("error reading 'certificate': %w", err) + } + delete(object, "certificate") + } + + if raw, found := object["certificate_authorities"]; found { + err = json.Unmarshal(raw, &a.CertificateAuthorities) + if err != nil { + return fmt.Errorf("error reading 'certificate_authorities': %w", err) + } + delete(object, "certificate_authorities") + } + + if raw, found := object["key"]; found { + err = json.Unmarshal(raw, &a.Key) + if err != nil { + return fmt.Errorf("error reading 'key': %w", err) + } + delete(object, "key") + } + + if raw, found := object["verification_mode"]; found { + err = json.Unmarshal(raw, &a.VerificationMode) + if err != nil { + return fmt.Errorf("error reading 'verification_mode': %w", err) + } + delete(object, "verification_mode") + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for OutputSsl to handle AdditionalProperties +func (a OutputSsl) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + if a.Certificate != nil { + object["certificate"], err = json.Marshal(a.Certificate) + if err != nil { + return nil, fmt.Errorf("error marshaling 'certificate': %w", err) + } + } + + if a.CertificateAuthorities != nil { + object["certificate_authorities"], err = json.Marshal(a.CertificateAuthorities) + if err != nil { + return nil, fmt.Errorf("error marshaling 'certificate_authorities': %w", err) + } + } + + if a.Key != nil { + object["key"], err = json.Marshal(a.Key) + if err != nil { + return nil, fmt.Errorf("error marshaling 'key': %w", err) + } + } + + if a.VerificationMode != nil { + object["verification_mode"], err = json.Marshal(a.VerificationMode) + if err != nil { + return nil, fmt.Errorf("error marshaling 'verification_mode': %w", err) + } + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + +// Getter for additional properties for PackageInfo. Returns the specified +// element and whether it was found +func (a PackageInfo) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for PackageInfo +func (a *PackageInfo) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for PackageInfo to handle AdditionalProperties +func (a *PackageInfo) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["agent"]; found { + err = json.Unmarshal(raw, &a.Agent) + if err != nil { + return fmt.Errorf("error reading 'agent': %w", err) + } + delete(object, "agent") + } + + if raw, found := object["asset_tags"]; found { + err = json.Unmarshal(raw, &a.AssetTags) + if err != nil { + return fmt.Errorf("error reading 'asset_tags': %w", err) + } + delete(object, "asset_tags") + } + + if raw, found := object["assets"]; found { + err = json.Unmarshal(raw, &a.Assets) + if err != nil { + return fmt.Errorf("error reading 'assets': %w", err) + } + delete(object, "assets") + } + + if raw, found := object["categories"]; found { + err = json.Unmarshal(raw, &a.Categories) + if err != nil { + return fmt.Errorf("error reading 'categories': %w", err) + } + delete(object, "categories") + } + + if raw, found := object["conditions"]; found { + err = json.Unmarshal(raw, &a.Conditions) + if err != nil { + return fmt.Errorf("error reading 'conditions': %w", err) + } + delete(object, "conditions") + } + + if raw, found := object["data_streams"]; found { + err = json.Unmarshal(raw, &a.DataStreams) + if err != nil { + return fmt.Errorf("error reading 'data_streams': %w", err) + } + delete(object, "data_streams") + } + + if raw, found := object["description"]; found { + err = json.Unmarshal(raw, &a.Description) + if err != nil { + return fmt.Errorf("error reading 'description': %w", err) + } + delete(object, "description") + } + + if raw, found := object["discovery"]; found { + err = json.Unmarshal(raw, &a.Discovery) + if err != nil { + return fmt.Errorf("error reading 'discovery': %w", err) + } + delete(object, "discovery") + } + + if raw, found := object["download"]; found { + err = json.Unmarshal(raw, &a.Download) + if err != nil { + return fmt.Errorf("error reading 'download': %w", err) + } + delete(object, "download") + } + + if raw, found := object["elasticsearch"]; found { + err = json.Unmarshal(raw, &a.Elasticsearch) + if err != nil { + return fmt.Errorf("error reading 'elasticsearch': %w", err) + } + delete(object, "elasticsearch") + } + + if raw, found := object["format_version"]; found { + err = json.Unmarshal(raw, &a.FormatVersion) + if err != nil { + return fmt.Errorf("error reading 'format_version': %w", err) + } + delete(object, "format_version") + } + + if raw, found := object["icons"]; found { + err = json.Unmarshal(raw, &a.Icons) + if err != nil { + return fmt.Errorf("error reading 'icons': %w", err) + } + delete(object, "icons") + } + + if raw, found := object["installationInfo"]; found { + err = json.Unmarshal(raw, &a.InstallationInfo) + if err != nil { + return fmt.Errorf("error reading 'installationInfo': %w", err) + } + delete(object, "installationInfo") + } + + if raw, found := object["internal"]; found { + err = json.Unmarshal(raw, &a.Internal) + if err != nil { + return fmt.Errorf("error reading 'internal': %w", err) + } + delete(object, "internal") + } + + if raw, found := object["keepPoliciesUpToDate"]; found { + err = json.Unmarshal(raw, &a.KeepPoliciesUpToDate) + if err != nil { + return fmt.Errorf("error reading 'keepPoliciesUpToDate': %w", err) + } + delete(object, "keepPoliciesUpToDate") + } + + if raw, found := object["latestVersion"]; found { + err = json.Unmarshal(raw, &a.LatestVersion) + if err != nil { + return fmt.Errorf("error reading 'latestVersion': %w", err) + } + delete(object, "latestVersion") + } + + if raw, found := object["license"]; found { + err = json.Unmarshal(raw, &a.License) + if err != nil { + return fmt.Errorf("error reading 'license': %w", err) + } + delete(object, "license") + } + + if raw, found := object["licensePath"]; found { + err = json.Unmarshal(raw, &a.LicensePath) + if err != nil { + return fmt.Errorf("error reading 'licensePath': %w", err) + } + delete(object, "licensePath") + } + + if raw, found := object["name"]; found { + err = json.Unmarshal(raw, &a.Name) + if err != nil { + return fmt.Errorf("error reading 'name': %w", err) + } + delete(object, "name") + } + + if raw, found := object["notice"]; found { + err = json.Unmarshal(raw, &a.Notice) + if err != nil { + return fmt.Errorf("error reading 'notice': %w", err) + } + delete(object, "notice") + } + + if raw, found := object["owner"]; found { + err = json.Unmarshal(raw, &a.Owner) + if err != nil { + return fmt.Errorf("error reading 'owner': %w", err) + } + delete(object, "owner") + } + + if raw, found := object["path"]; found { + err = json.Unmarshal(raw, &a.Path) + if err != nil { + return fmt.Errorf("error reading 'path': %w", err) + } + delete(object, "path") + } + + if raw, found := object["policy_templates"]; found { + err = json.Unmarshal(raw, &a.PolicyTemplates) + if err != nil { + return fmt.Errorf("error reading 'policy_templates': %w", err) + } + delete(object, "policy_templates") + } + + if raw, found := object["readme"]; found { + err = json.Unmarshal(raw, &a.Readme) + if err != nil { + return fmt.Errorf("error reading 'readme': %w", err) + } + delete(object, "readme") + } + + if raw, found := object["release"]; found { + err = json.Unmarshal(raw, &a.Release) + if err != nil { + return fmt.Errorf("error reading 'release': %w", err) + } + delete(object, "release") + } + + if raw, found := object["savedObject"]; found { + err = json.Unmarshal(raw, &a.SavedObject) + if err != nil { + return fmt.Errorf("error reading 'savedObject': %w", err) + } + delete(object, "savedObject") + } + + if raw, found := object["screenshots"]; found { + err = json.Unmarshal(raw, &a.Screenshots) + if err != nil { + return fmt.Errorf("error reading 'screenshots': %w", err) + } + delete(object, "screenshots") + } + + if raw, found := object["signature_path"]; found { + err = json.Unmarshal(raw, &a.SignaturePath) + if err != nil { + return fmt.Errorf("error reading 'signature_path': %w", err) + } + delete(object, "signature_path") + } + + if raw, found := object["source"]; found { + err = json.Unmarshal(raw, &a.Source) + if err != nil { + return fmt.Errorf("error reading 'source': %w", err) + } + delete(object, "source") + } + + if raw, found := object["status"]; found { + err = json.Unmarshal(raw, &a.Status) + if err != nil { + return fmt.Errorf("error reading 'status': %w", err) + } + delete(object, "status") + } + + if raw, found := object["title"]; found { + err = json.Unmarshal(raw, &a.Title) + if err != nil { + return fmt.Errorf("error reading 'title': %w", err) + } + delete(object, "title") + } + + if raw, found := object["type"]; found { + err = json.Unmarshal(raw, &a.Type) + if err != nil { + return fmt.Errorf("error reading 'type': %w", err) + } + delete(object, "type") + } + + if raw, found := object["vars"]; found { + err = json.Unmarshal(raw, &a.Vars) + if err != nil { + return fmt.Errorf("error reading 'vars': %w", err) + } + delete(object, "vars") + } + + if raw, found := object["version"]; found { + err = json.Unmarshal(raw, &a.Version) + if err != nil { + return fmt.Errorf("error reading 'version': %w", err) + } + delete(object, "version") + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for PackageInfo to handle AdditionalProperties +func (a PackageInfo) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + if a.Agent != nil { + object["agent"], err = json.Marshal(a.Agent) + if err != nil { + return nil, fmt.Errorf("error marshaling 'agent': %w", err) + } + } + + if a.AssetTags != nil { + object["asset_tags"], err = json.Marshal(a.AssetTags) + if err != nil { + return nil, fmt.Errorf("error marshaling 'asset_tags': %w", err) + } + } + + object["assets"], err = json.Marshal(a.Assets) + if err != nil { + return nil, fmt.Errorf("error marshaling 'assets': %w", err) + } + + if a.Categories != nil { + object["categories"], err = json.Marshal(a.Categories) + if err != nil { + return nil, fmt.Errorf("error marshaling 'categories': %w", err) + } + } + + if a.Conditions != nil { + object["conditions"], err = json.Marshal(a.Conditions) + if err != nil { + return nil, fmt.Errorf("error marshaling 'conditions': %w", err) + } + } + + if a.DataStreams != nil { + object["data_streams"], err = json.Marshal(a.DataStreams) + if err != nil { + return nil, fmt.Errorf("error marshaling 'data_streams': %w", err) + } + } + + if a.Description != nil { + object["description"], err = json.Marshal(a.Description) + if err != nil { + return nil, fmt.Errorf("error marshaling 'description': %w", err) + } + } + + if a.Discovery != nil { + object["discovery"], err = json.Marshal(a.Discovery) + if err != nil { + return nil, fmt.Errorf("error marshaling 'discovery': %w", err) + } + } + + if a.Download != nil { + object["download"], err = json.Marshal(a.Download) + if err != nil { + return nil, fmt.Errorf("error marshaling 'download': %w", err) + } + } + + if a.Elasticsearch != nil { + object["elasticsearch"], err = json.Marshal(a.Elasticsearch) + if err != nil { + return nil, fmt.Errorf("error marshaling 'elasticsearch': %w", err) + } + } + + if a.FormatVersion != nil { + object["format_version"], err = json.Marshal(a.FormatVersion) + if err != nil { + return nil, fmt.Errorf("error marshaling 'format_version': %w", err) + } + } + + if a.Icons != nil { + object["icons"], err = json.Marshal(a.Icons) + if err != nil { + return nil, fmt.Errorf("error marshaling 'icons': %w", err) + } + } + + if a.InstallationInfo != nil { + object["installationInfo"], err = json.Marshal(a.InstallationInfo) + if err != nil { + return nil, fmt.Errorf("error marshaling 'installationInfo': %w", err) + } + } + + if a.Internal != nil { + object["internal"], err = json.Marshal(a.Internal) + if err != nil { + return nil, fmt.Errorf("error marshaling 'internal': %w", err) + } + } + + if a.KeepPoliciesUpToDate != nil { + object["keepPoliciesUpToDate"], err = json.Marshal(a.KeepPoliciesUpToDate) + if err != nil { + return nil, fmt.Errorf("error marshaling 'keepPoliciesUpToDate': %w", err) + } + } + + if a.LatestVersion != nil { + object["latestVersion"], err = json.Marshal(a.LatestVersion) + if err != nil { + return nil, fmt.Errorf("error marshaling 'latestVersion': %w", err) + } + } + + if a.License != nil { + object["license"], err = json.Marshal(a.License) + if err != nil { + return nil, fmt.Errorf("error marshaling 'license': %w", err) + } + } + + if a.LicensePath != nil { + object["licensePath"], err = json.Marshal(a.LicensePath) + if err != nil { + return nil, fmt.Errorf("error marshaling 'licensePath': %w", err) + } + } + + object["name"], err = json.Marshal(a.Name) + if err != nil { + return nil, fmt.Errorf("error marshaling 'name': %w", err) + } + + if a.Notice != nil { + object["notice"], err = json.Marshal(a.Notice) + if err != nil { + return nil, fmt.Errorf("error marshaling 'notice': %w", err) + } + } + + if a.Owner != nil { + object["owner"], err = json.Marshal(a.Owner) + if err != nil { + return nil, fmt.Errorf("error marshaling 'owner': %w", err) + } + } + + if a.Path != nil { + object["path"], err = json.Marshal(a.Path) + if err != nil { + return nil, fmt.Errorf("error marshaling 'path': %w", err) + } + } + + if a.PolicyTemplates != nil { + object["policy_templates"], err = json.Marshal(a.PolicyTemplates) + if err != nil { + return nil, fmt.Errorf("error marshaling 'policy_templates': %w", err) + } + } + + if a.Readme != nil { + object["readme"], err = json.Marshal(a.Readme) + if err != nil { + return nil, fmt.Errorf("error marshaling 'readme': %w", err) + } + } + + if a.Release != nil { + object["release"], err = json.Marshal(a.Release) + if err != nil { + return nil, fmt.Errorf("error marshaling 'release': %w", err) + } + } + + object["savedObject"], err = json.Marshal(a.SavedObject) + if err != nil { + return nil, fmt.Errorf("error marshaling 'savedObject': %w", err) + } + + if a.Screenshots != nil { + object["screenshots"], err = json.Marshal(a.Screenshots) + if err != nil { + return nil, fmt.Errorf("error marshaling 'screenshots': %w", err) + } + } + + if a.SignaturePath != nil { + object["signature_path"], err = json.Marshal(a.SignaturePath) + if err != nil { + return nil, fmt.Errorf("error marshaling 'signature_path': %w", err) + } + } + + if a.Source != nil { + object["source"], err = json.Marshal(a.Source) + if err != nil { + return nil, fmt.Errorf("error marshaling 'source': %w", err) + } + } + + if a.Status != nil { + object["status"], err = json.Marshal(a.Status) + if err != nil { + return nil, fmt.Errorf("error marshaling 'status': %w", err) + } + } + + object["title"], err = json.Marshal(a.Title) + if err != nil { + return nil, fmt.Errorf("error marshaling 'title': %w", err) + } + + if a.Type != nil { + object["type"], err = json.Marshal(a.Type) + if err != nil { + return nil, fmt.Errorf("error marshaling 'type': %w", err) + } + } + + if a.Vars != nil { + object["vars"], err = json.Marshal(a.Vars) + if err != nil { + return nil, fmt.Errorf("error marshaling 'vars': %w", err) + } + } + + object["version"], err = json.Marshal(a.Version) + if err != nil { + return nil, fmt.Errorf("error marshaling 'version': %w", err) + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + +// Getter for additional properties for PackageInfo_Conditions_Elastic. Returns the specified +// element and whether it was found +func (a PackageInfo_Conditions_Elastic) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for PackageInfo_Conditions_Elastic +func (a *PackageInfo_Conditions_Elastic) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for PackageInfo_Conditions_Elastic to handle AdditionalProperties +func (a *PackageInfo_Conditions_Elastic) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["capabilities"]; found { + err = json.Unmarshal(raw, &a.Capabilities) + if err != nil { + return fmt.Errorf("error reading 'capabilities': %w", err) + } + delete(object, "capabilities") + } + + if raw, found := object["subscription"]; found { + err = json.Unmarshal(raw, &a.Subscription) + if err != nil { + return fmt.Errorf("error reading 'subscription': %w", err) + } + delete(object, "subscription") + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for PackageInfo_Conditions_Elastic to handle AdditionalProperties +func (a PackageInfo_Conditions_Elastic) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + if a.Capabilities != nil { + object["capabilities"], err = json.Marshal(a.Capabilities) + if err != nil { + return nil, fmt.Errorf("error marshaling 'capabilities': %w", err) + } + } + + if a.Subscription != nil { + object["subscription"], err = json.Marshal(a.Subscription) + if err != nil { + return nil, fmt.Errorf("error marshaling 'subscription': %w", err) + } + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + +// Getter for additional properties for PackageInfo_Conditions_Kibana. Returns the specified +// element and whether it was found +func (a PackageInfo_Conditions_Kibana) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for PackageInfo_Conditions_Kibana +func (a *PackageInfo_Conditions_Kibana) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for PackageInfo_Conditions_Kibana to handle AdditionalProperties +func (a *PackageInfo_Conditions_Kibana) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["version"]; found { + err = json.Unmarshal(raw, &a.Version) + if err != nil { + return fmt.Errorf("error reading 'version': %w", err) + } + delete(object, "version") + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for PackageInfo_Conditions_Kibana to handle AdditionalProperties +func (a PackageInfo_Conditions_Kibana) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + if a.Version != nil { + object["version"], err = json.Marshal(a.Version) + if err != nil { + return nil, fmt.Errorf("error marshaling 'version': %w", err) + } + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + +// Getter for additional properties for PackageInfo_Conditions. Returns the specified +// element and whether it was found +func (a PackageInfo_Conditions) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for PackageInfo_Conditions +func (a *PackageInfo_Conditions) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for PackageInfo_Conditions to handle AdditionalProperties +func (a *PackageInfo_Conditions) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["elastic"]; found { + err = json.Unmarshal(raw, &a.Elastic) + if err != nil { + return fmt.Errorf("error reading 'elastic': %w", err) + } + delete(object, "elastic") + } + + if raw, found := object["kibana"]; found { + err = json.Unmarshal(raw, &a.Kibana) + if err != nil { + return fmt.Errorf("error reading 'kibana': %w", err) + } + delete(object, "kibana") + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for PackageInfo_Conditions to handle AdditionalProperties +func (a PackageInfo_Conditions) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + if a.Elastic != nil { + object["elastic"], err = json.Marshal(a.Elastic) + if err != nil { + return nil, fmt.Errorf("error marshaling 'elastic': %w", err) + } + } + + if a.Kibana != nil { + object["kibana"], err = json.Marshal(a.Kibana) + if err != nil { + return nil, fmt.Errorf("error marshaling 'kibana': %w", err) + } + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + +// Getter for additional properties for PackageInfo_Discovery_Fields_Item. Returns the specified +// element and whether it was found +func (a PackageInfo_Discovery_Fields_Item) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for PackageInfo_Discovery_Fields_Item +func (a *PackageInfo_Discovery_Fields_Item) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for PackageInfo_Discovery_Fields_Item to handle AdditionalProperties +func (a *PackageInfo_Discovery_Fields_Item) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["name"]; found { + err = json.Unmarshal(raw, &a.Name) + if err != nil { + return fmt.Errorf("error reading 'name': %w", err) + } + delete(object, "name") + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for PackageInfo_Discovery_Fields_Item to handle AdditionalProperties +func (a PackageInfo_Discovery_Fields_Item) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + object["name"], err = json.Marshal(a.Name) + if err != nil { + return nil, fmt.Errorf("error marshaling 'name': %w", err) + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + +// Getter for additional properties for PackageInfo_Discovery. Returns the specified +// element and whether it was found +func (a PackageInfo_Discovery) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for PackageInfo_Discovery +func (a *PackageInfo_Discovery) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for PackageInfo_Discovery to handle AdditionalProperties +func (a *PackageInfo_Discovery) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["fields"]; found { + err = json.Unmarshal(raw, &a.Fields) + if err != nil { + return fmt.Errorf("error reading 'fields': %w", err) + } + delete(object, "fields") + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for PackageInfo_Discovery to handle AdditionalProperties +func (a PackageInfo_Discovery) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + if a.Fields != nil { + object["fields"], err = json.Marshal(a.Fields) + if err != nil { + return nil, fmt.Errorf("error marshaling 'fields': %w", err) + } + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + +// Getter for additional properties for PackageInfo_Icons_Item. Returns the specified +// element and whether it was found +func (a PackageInfo_Icons_Item) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for PackageInfo_Icons_Item +func (a *PackageInfo_Icons_Item) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for PackageInfo_Icons_Item to handle AdditionalProperties +func (a *PackageInfo_Icons_Item) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["dark_mode"]; found { + err = json.Unmarshal(raw, &a.DarkMode) + if err != nil { + return fmt.Errorf("error reading 'dark_mode': %w", err) + } + delete(object, "dark_mode") + } + + if raw, found := object["path"]; found { + err = json.Unmarshal(raw, &a.Path) + if err != nil { + return fmt.Errorf("error reading 'path': %w", err) + } + delete(object, "path") + } + + if raw, found := object["size"]; found { + err = json.Unmarshal(raw, &a.Size) + if err != nil { + return fmt.Errorf("error reading 'size': %w", err) + } + delete(object, "size") + } + + if raw, found := object["src"]; found { + err = json.Unmarshal(raw, &a.Src) + if err != nil { + return fmt.Errorf("error reading 'src': %w", err) + } + delete(object, "src") + } + + if raw, found := object["title"]; found { + err = json.Unmarshal(raw, &a.Title) + if err != nil { + return fmt.Errorf("error reading 'title': %w", err) + } + delete(object, "title") + } + + if raw, found := object["type"]; found { + err = json.Unmarshal(raw, &a.Type) + if err != nil { + return fmt.Errorf("error reading 'type': %w", err) + } + delete(object, "type") + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for PackageInfo_Icons_Item to handle AdditionalProperties +func (a PackageInfo_Icons_Item) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + if a.DarkMode != nil { + object["dark_mode"], err = json.Marshal(a.DarkMode) + if err != nil { + return nil, fmt.Errorf("error marshaling 'dark_mode': %w", err) + } + } + + if a.Path != nil { + object["path"], err = json.Marshal(a.Path) + if err != nil { + return nil, fmt.Errorf("error marshaling 'path': %w", err) + } + } + + if a.Size != nil { + object["size"], err = json.Marshal(a.Size) + if err != nil { + return nil, fmt.Errorf("error marshaling 'size': %w", err) + } + } + + object["src"], err = json.Marshal(a.Src) + if err != nil { + return nil, fmt.Errorf("error marshaling 'src': %w", err) + } + + if a.Title != nil { + object["title"], err = json.Marshal(a.Title) + if err != nil { + return nil, fmt.Errorf("error marshaling 'title': %w", err) + } + } + + if a.Type != nil { + object["type"], err = json.Marshal(a.Type) + if err != nil { + return nil, fmt.Errorf("error marshaling 'type': %w", err) + } + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + +// Getter for additional properties for PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Item. Returns the specified +// element and whether it was found +func (a PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Item) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Item +func (a *PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Item) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Item to handle AdditionalProperties +func (a *PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Item) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["id"]; found { + err = json.Unmarshal(raw, &a.Id) + if err != nil { + return fmt.Errorf("error reading 'id': %w", err) + } + delete(object, "id") + } + + if raw, found := object["originId"]; found { + err = json.Unmarshal(raw, &a.OriginId) + if err != nil { + return fmt.Errorf("error reading 'originId': %w", err) + } + delete(object, "originId") + } + + if raw, found := object["type"]; found { + err = json.Unmarshal(raw, &a.Type) + if err != nil { + return fmt.Errorf("error reading 'type': %w", err) + } + delete(object, "type") + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Item to handle AdditionalProperties +func (a PackageInfo_InstallationInfo_AdditionalSpacesInstalledKibana_Item) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + object["id"], err = json.Marshal(a.Id) + if err != nil { + return nil, fmt.Errorf("error marshaling 'id': %w", err) + } + + if a.OriginId != nil { + object["originId"], err = json.Marshal(a.OriginId) + if err != nil { + return nil, fmt.Errorf("error marshaling 'originId': %w", err) + } + } + + object["type"], err = json.Marshal(a.Type) + if err != nil { + return nil, fmt.Errorf("error marshaling 'type': %w", err) + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + +// Getter for additional properties for PackageInfo_InstallationInfo_ExperimentalDataStreamFeatures_Features. Returns the specified +// element and whether it was found +func (a PackageInfo_InstallationInfo_ExperimentalDataStreamFeatures_Features) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for PackageInfo_InstallationInfo_ExperimentalDataStreamFeatures_Features +func (a *PackageInfo_InstallationInfo_ExperimentalDataStreamFeatures_Features) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for PackageInfo_InstallationInfo_ExperimentalDataStreamFeatures_Features to handle AdditionalProperties +func (a *PackageInfo_InstallationInfo_ExperimentalDataStreamFeatures_Features) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["doc_value_only_numeric"]; found { + err = json.Unmarshal(raw, &a.DocValueOnlyNumeric) + if err != nil { + return fmt.Errorf("error reading 'doc_value_only_numeric': %w", err) + } + delete(object, "doc_value_only_numeric") + } + + if raw, found := object["doc_value_only_other"]; found { + err = json.Unmarshal(raw, &a.DocValueOnlyOther) + if err != nil { + return fmt.Errorf("error reading 'doc_value_only_other': %w", err) + } + delete(object, "doc_value_only_other") + } + + if raw, found := object["synthetic_source"]; found { + err = json.Unmarshal(raw, &a.SyntheticSource) + if err != nil { + return fmt.Errorf("error reading 'synthetic_source': %w", err) + } + delete(object, "synthetic_source") + } + + if raw, found := object["tsdb"]; found { + err = json.Unmarshal(raw, &a.Tsdb) + if err != nil { + return fmt.Errorf("error reading 'tsdb': %w", err) + } + delete(object, "tsdb") + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for PackageInfo_InstallationInfo_ExperimentalDataStreamFeatures_Features to handle AdditionalProperties +func (a PackageInfo_InstallationInfo_ExperimentalDataStreamFeatures_Features) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + if a.DocValueOnlyNumeric != nil { + object["doc_value_only_numeric"], err = json.Marshal(a.DocValueOnlyNumeric) + if err != nil { + return nil, fmt.Errorf("error marshaling 'doc_value_only_numeric': %w", err) + } + } + + if a.DocValueOnlyOther != nil { + object["doc_value_only_other"], err = json.Marshal(a.DocValueOnlyOther) + if err != nil { + return nil, fmt.Errorf("error marshaling 'doc_value_only_other': %w", err) + } + } + + if a.SyntheticSource != nil { + object["synthetic_source"], err = json.Marshal(a.SyntheticSource) + if err != nil { + return nil, fmt.Errorf("error marshaling 'synthetic_source': %w", err) + } + } + + if a.Tsdb != nil { + object["tsdb"], err = json.Marshal(a.Tsdb) + if err != nil { + return nil, fmt.Errorf("error marshaling 'tsdb': %w", err) + } + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + +// Getter for additional properties for PackageInfo_InstallationInfo_ExperimentalDataStreamFeatures_Item. Returns the specified +// element and whether it was found +func (a PackageInfo_InstallationInfo_ExperimentalDataStreamFeatures_Item) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for PackageInfo_InstallationInfo_ExperimentalDataStreamFeatures_Item +func (a *PackageInfo_InstallationInfo_ExperimentalDataStreamFeatures_Item) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for PackageInfo_InstallationInfo_ExperimentalDataStreamFeatures_Item to handle AdditionalProperties +func (a *PackageInfo_InstallationInfo_ExperimentalDataStreamFeatures_Item) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["data_stream"]; found { + err = json.Unmarshal(raw, &a.DataStream) + if err != nil { + return fmt.Errorf("error reading 'data_stream': %w", err) + } + delete(object, "data_stream") + } + + if raw, found := object["features"]; found { + err = json.Unmarshal(raw, &a.Features) + if err != nil { + return fmt.Errorf("error reading 'features': %w", err) + } + delete(object, "features") + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for PackageInfo_InstallationInfo_ExperimentalDataStreamFeatures_Item to handle AdditionalProperties +func (a PackageInfo_InstallationInfo_ExperimentalDataStreamFeatures_Item) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + object["data_stream"], err = json.Marshal(a.DataStream) + if err != nil { + return nil, fmt.Errorf("error marshaling 'data_stream': %w", err) + } + + object["features"], err = json.Marshal(a.Features) + if err != nil { + return nil, fmt.Errorf("error marshaling 'features': %w", err) + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + +// Getter for additional properties for PackageInfo_InstallationInfo_InstalledEs_Item. Returns the specified +// element and whether it was found +func (a PackageInfo_InstallationInfo_InstalledEs_Item) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for PackageInfo_InstallationInfo_InstalledEs_Item +func (a *PackageInfo_InstallationInfo_InstalledEs_Item) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for PackageInfo_InstallationInfo_InstalledEs_Item to handle AdditionalProperties +func (a *PackageInfo_InstallationInfo_InstalledEs_Item) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["deferred"]; found { + err = json.Unmarshal(raw, &a.Deferred) + if err != nil { + return fmt.Errorf("error reading 'deferred': %w", err) + } + delete(object, "deferred") + } + + if raw, found := object["id"]; found { + err = json.Unmarshal(raw, &a.Id) + if err != nil { + return fmt.Errorf("error reading 'id': %w", err) + } + delete(object, "id") + } + + if raw, found := object["type"]; found { + err = json.Unmarshal(raw, &a.Type) + if err != nil { + return fmt.Errorf("error reading 'type': %w", err) + } + delete(object, "type") + } + + if raw, found := object["version"]; found { + err = json.Unmarshal(raw, &a.Version) + if err != nil { + return fmt.Errorf("error reading 'version': %w", err) + } + delete(object, "version") + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for PackageInfo_InstallationInfo_InstalledEs_Item to handle AdditionalProperties +func (a PackageInfo_InstallationInfo_InstalledEs_Item) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + if a.Deferred != nil { + object["deferred"], err = json.Marshal(a.Deferred) + if err != nil { + return nil, fmt.Errorf("error marshaling 'deferred': %w", err) + } + } + + object["id"], err = json.Marshal(a.Id) + if err != nil { + return nil, fmt.Errorf("error marshaling 'id': %w", err) + } + + object["type"], err = json.Marshal(a.Type) + if err != nil { + return nil, fmt.Errorf("error marshaling 'type': %w", err) + } + + if a.Version != nil { + object["version"], err = json.Marshal(a.Version) + if err != nil { + return nil, fmt.Errorf("error marshaling 'version': %w", err) + } + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + +// Getter for additional properties for PackageInfo_InstallationInfo_InstalledKibana_Item. Returns the specified +// element and whether it was found +func (a PackageInfo_InstallationInfo_InstalledKibana_Item) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for PackageInfo_InstallationInfo_InstalledKibana_Item +func (a *PackageInfo_InstallationInfo_InstalledKibana_Item) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for PackageInfo_InstallationInfo_InstalledKibana_Item to handle AdditionalProperties +func (a *PackageInfo_InstallationInfo_InstalledKibana_Item) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["id"]; found { + err = json.Unmarshal(raw, &a.Id) + if err != nil { + return fmt.Errorf("error reading 'id': %w", err) + } + delete(object, "id") + } + + if raw, found := object["originId"]; found { + err = json.Unmarshal(raw, &a.OriginId) + if err != nil { + return fmt.Errorf("error reading 'originId': %w", err) + } + delete(object, "originId") + } + + if raw, found := object["type"]; found { + err = json.Unmarshal(raw, &a.Type) + if err != nil { + return fmt.Errorf("error reading 'type': %w", err) + } + delete(object, "type") + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for PackageInfo_InstallationInfo_InstalledKibana_Item to handle AdditionalProperties +func (a PackageInfo_InstallationInfo_InstalledKibana_Item) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + object["id"], err = json.Marshal(a.Id) + if err != nil { + return nil, fmt.Errorf("error marshaling 'id': %w", err) + } + + if a.OriginId != nil { + object["originId"], err = json.Marshal(a.OriginId) + if err != nil { + return nil, fmt.Errorf("error marshaling 'originId': %w", err) + } + } + + object["type"], err = json.Marshal(a.Type) + if err != nil { + return nil, fmt.Errorf("error marshaling 'type': %w", err) + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + +// Getter for additional properties for PackageInfo_InstallationInfo_LatestExecutedState. Returns the specified +// element and whether it was found +func (a PackageInfo_InstallationInfo_LatestExecutedState) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for PackageInfo_InstallationInfo_LatestExecutedState +func (a *PackageInfo_InstallationInfo_LatestExecutedState) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for PackageInfo_InstallationInfo_LatestExecutedState to handle AdditionalProperties +func (a *PackageInfo_InstallationInfo_LatestExecutedState) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["error"]; found { + err = json.Unmarshal(raw, &a.Error) + if err != nil { + return fmt.Errorf("error reading 'error': %w", err) + } + delete(object, "error") + } + + if raw, found := object["name"]; found { + err = json.Unmarshal(raw, &a.Name) + if err != nil { + return fmt.Errorf("error reading 'name': %w", err) + } + delete(object, "name") + } + + if raw, found := object["started_at"]; found { + err = json.Unmarshal(raw, &a.StartedAt) + if err != nil { + return fmt.Errorf("error reading 'started_at': %w", err) + } + delete(object, "started_at") + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for PackageInfo_InstallationInfo_LatestExecutedState to handle AdditionalProperties +func (a PackageInfo_InstallationInfo_LatestExecutedState) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + if a.Error != nil { + object["error"], err = json.Marshal(a.Error) + if err != nil { + return nil, fmt.Errorf("error marshaling 'error': %w", err) + } + } + + object["name"], err = json.Marshal(a.Name) + if err != nil { + return nil, fmt.Errorf("error marshaling 'name': %w", err) + } + + object["started_at"], err = json.Marshal(a.StartedAt) + if err != nil { + return nil, fmt.Errorf("error marshaling 'started_at': %w", err) + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + +// Getter for additional properties for PackageInfo_InstallationInfo_LatestInstallFailedAttempts_Error. Returns the specified +// element and whether it was found +func (a PackageInfo_InstallationInfo_LatestInstallFailedAttempts_Error) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for PackageInfo_InstallationInfo_LatestInstallFailedAttempts_Error +func (a *PackageInfo_InstallationInfo_LatestInstallFailedAttempts_Error) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for PackageInfo_InstallationInfo_LatestInstallFailedAttempts_Error to handle AdditionalProperties +func (a *PackageInfo_InstallationInfo_LatestInstallFailedAttempts_Error) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["message"]; found { + err = json.Unmarshal(raw, &a.Message) + if err != nil { + return fmt.Errorf("error reading 'message': %w", err) + } + delete(object, "message") + } + + if raw, found := object["name"]; found { + err = json.Unmarshal(raw, &a.Name) + if err != nil { + return fmt.Errorf("error reading 'name': %w", err) + } + delete(object, "name") + } + + if raw, found := object["stack"]; found { + err = json.Unmarshal(raw, &a.Stack) + if err != nil { + return fmt.Errorf("error reading 'stack': %w", err) + } + delete(object, "stack") + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for PackageInfo_InstallationInfo_LatestInstallFailedAttempts_Error to handle AdditionalProperties +func (a PackageInfo_InstallationInfo_LatestInstallFailedAttempts_Error) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + object["message"], err = json.Marshal(a.Message) + if err != nil { + return nil, fmt.Errorf("error marshaling 'message': %w", err) + } + + object["name"], err = json.Marshal(a.Name) + if err != nil { + return nil, fmt.Errorf("error marshaling 'name': %w", err) + } + + if a.Stack != nil { + object["stack"], err = json.Marshal(a.Stack) + if err != nil { + return nil, fmt.Errorf("error marshaling 'stack': %w", err) + } + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + +// Getter for additional properties for PackageInfo_InstallationInfo_LatestInstallFailedAttempts_Item. Returns the specified +// element and whether it was found +func (a PackageInfo_InstallationInfo_LatestInstallFailedAttempts_Item) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for PackageInfo_InstallationInfo_LatestInstallFailedAttempts_Item +func (a *PackageInfo_InstallationInfo_LatestInstallFailedAttempts_Item) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for PackageInfo_InstallationInfo_LatestInstallFailedAttempts_Item to handle AdditionalProperties +func (a *PackageInfo_InstallationInfo_LatestInstallFailedAttempts_Item) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["created_at"]; found { + err = json.Unmarshal(raw, &a.CreatedAt) + if err != nil { + return fmt.Errorf("error reading 'created_at': %w", err) + } + delete(object, "created_at") + } + + if raw, found := object["error"]; found { + err = json.Unmarshal(raw, &a.Error) + if err != nil { + return fmt.Errorf("error reading 'error': %w", err) + } + delete(object, "error") + } + + if raw, found := object["target_version"]; found { + err = json.Unmarshal(raw, &a.TargetVersion) + if err != nil { + return fmt.Errorf("error reading 'target_version': %w", err) + } + delete(object, "target_version") + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for PackageInfo_InstallationInfo_LatestInstallFailedAttempts_Item to handle AdditionalProperties +func (a PackageInfo_InstallationInfo_LatestInstallFailedAttempts_Item) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + object["created_at"], err = json.Marshal(a.CreatedAt) + if err != nil { + return nil, fmt.Errorf("error marshaling 'created_at': %w", err) + } + + object["error"], err = json.Marshal(a.Error) + if err != nil { + return nil, fmt.Errorf("error marshaling 'error': %w", err) + } + + object["target_version"], err = json.Marshal(a.TargetVersion) + if err != nil { + return nil, fmt.Errorf("error marshaling 'target_version': %w", err) + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + +// Getter for additional properties for PackageInfo_InstallationInfo. Returns the specified +// element and whether it was found +func (a PackageInfo_InstallationInfo) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for PackageInfo_InstallationInfo +func (a *PackageInfo_InstallationInfo) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for PackageInfo_InstallationInfo to handle AdditionalProperties +func (a *PackageInfo_InstallationInfo) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["additional_spaces_installed_kibana"]; found { + err = json.Unmarshal(raw, &a.AdditionalSpacesInstalledKibana) + if err != nil { + return fmt.Errorf("error reading 'additional_spaces_installed_kibana': %w", err) + } + delete(object, "additional_spaces_installed_kibana") + } + + if raw, found := object["created_at"]; found { + err = json.Unmarshal(raw, &a.CreatedAt) + if err != nil { + return fmt.Errorf("error reading 'created_at': %w", err) + } + delete(object, "created_at") + } + + if raw, found := object["experimental_data_stream_features"]; found { + err = json.Unmarshal(raw, &a.ExperimentalDataStreamFeatures) + if err != nil { + return fmt.Errorf("error reading 'experimental_data_stream_features': %w", err) + } + delete(object, "experimental_data_stream_features") + } + + if raw, found := object["install_format_schema_version"]; found { + err = json.Unmarshal(raw, &a.InstallFormatSchemaVersion) + if err != nil { + return fmt.Errorf("error reading 'install_format_schema_version': %w", err) + } + delete(object, "install_format_schema_version") + } + + if raw, found := object["install_source"]; found { + err = json.Unmarshal(raw, &a.InstallSource) + if err != nil { + return fmt.Errorf("error reading 'install_source': %w", err) + } + delete(object, "install_source") + } + + if raw, found := object["install_status"]; found { + err = json.Unmarshal(raw, &a.InstallStatus) + if err != nil { + return fmt.Errorf("error reading 'install_status': %w", err) + } + delete(object, "install_status") + } + + if raw, found := object["installed_es"]; found { + err = json.Unmarshal(raw, &a.InstalledEs) + if err != nil { + return fmt.Errorf("error reading 'installed_es': %w", err) + } + delete(object, "installed_es") + } + + if raw, found := object["installed_kibana"]; found { + err = json.Unmarshal(raw, &a.InstalledKibana) + if err != nil { + return fmt.Errorf("error reading 'installed_kibana': %w", err) + } + delete(object, "installed_kibana") + } + + if raw, found := object["installed_kibana_space_id"]; found { + err = json.Unmarshal(raw, &a.InstalledKibanaSpaceId) + if err != nil { + return fmt.Errorf("error reading 'installed_kibana_space_id': %w", err) + } + delete(object, "installed_kibana_space_id") + } + + if raw, found := object["latest_executed_state"]; found { + err = json.Unmarshal(raw, &a.LatestExecutedState) + if err != nil { + return fmt.Errorf("error reading 'latest_executed_state': %w", err) + } + delete(object, "latest_executed_state") + } + + if raw, found := object["latest_install_failed_attempts"]; found { + err = json.Unmarshal(raw, &a.LatestInstallFailedAttempts) + if err != nil { + return fmt.Errorf("error reading 'latest_install_failed_attempts': %w", err) + } + delete(object, "latest_install_failed_attempts") + } + + if raw, found := object["name"]; found { + err = json.Unmarshal(raw, &a.Name) + if err != nil { + return fmt.Errorf("error reading 'name': %w", err) + } + delete(object, "name") + } + + if raw, found := object["namespaces"]; found { + err = json.Unmarshal(raw, &a.Namespaces) + if err != nil { + return fmt.Errorf("error reading 'namespaces': %w", err) + } + delete(object, "namespaces") + } + + if raw, found := object["type"]; found { + err = json.Unmarshal(raw, &a.Type) + if err != nil { + return fmt.Errorf("error reading 'type': %w", err) + } + delete(object, "type") + } + + if raw, found := object["updated_at"]; found { + err = json.Unmarshal(raw, &a.UpdatedAt) + if err != nil { + return fmt.Errorf("error reading 'updated_at': %w", err) + } + delete(object, "updated_at") + } + + if raw, found := object["verification_key_id"]; found { + err = json.Unmarshal(raw, &a.VerificationKeyId) + if err != nil { + return fmt.Errorf("error reading 'verification_key_id': %w", err) + } + delete(object, "verification_key_id") + } + + if raw, found := object["verification_status"]; found { + err = json.Unmarshal(raw, &a.VerificationStatus) + if err != nil { + return fmt.Errorf("error reading 'verification_status': %w", err) + } + delete(object, "verification_status") + } + + if raw, found := object["version"]; found { + err = json.Unmarshal(raw, &a.Version) + if err != nil { + return fmt.Errorf("error reading 'version': %w", err) + } + delete(object, "version") + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for PackageInfo_InstallationInfo to handle AdditionalProperties +func (a PackageInfo_InstallationInfo) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + if a.AdditionalSpacesInstalledKibana != nil { + object["additional_spaces_installed_kibana"], err = json.Marshal(a.AdditionalSpacesInstalledKibana) + if err != nil { + return nil, fmt.Errorf("error marshaling 'additional_spaces_installed_kibana': %w", err) + } + } + + if a.CreatedAt != nil { + object["created_at"], err = json.Marshal(a.CreatedAt) + if err != nil { + return nil, fmt.Errorf("error marshaling 'created_at': %w", err) + } + } + + if a.ExperimentalDataStreamFeatures != nil { + object["experimental_data_stream_features"], err = json.Marshal(a.ExperimentalDataStreamFeatures) + if err != nil { + return nil, fmt.Errorf("error marshaling 'experimental_data_stream_features': %w", err) + } + } + + if a.InstallFormatSchemaVersion != nil { + object["install_format_schema_version"], err = json.Marshal(a.InstallFormatSchemaVersion) + if err != nil { + return nil, fmt.Errorf("error marshaling 'install_format_schema_version': %w", err) + } + } + + object["install_source"], err = json.Marshal(a.InstallSource) + if err != nil { + return nil, fmt.Errorf("error marshaling 'install_source': %w", err) + } + + object["install_status"], err = json.Marshal(a.InstallStatus) + if err != nil { + return nil, fmt.Errorf("error marshaling 'install_status': %w", err) + } + + object["installed_es"], err = json.Marshal(a.InstalledEs) + if err != nil { + return nil, fmt.Errorf("error marshaling 'installed_es': %w", err) + } + + object["installed_kibana"], err = json.Marshal(a.InstalledKibana) + if err != nil { + return nil, fmt.Errorf("error marshaling 'installed_kibana': %w", err) + } + + if a.InstalledKibanaSpaceId != nil { + object["installed_kibana_space_id"], err = json.Marshal(a.InstalledKibanaSpaceId) + if err != nil { + return nil, fmt.Errorf("error marshaling 'installed_kibana_space_id': %w", err) + } + } + + if a.LatestExecutedState != nil { + object["latest_executed_state"], err = json.Marshal(a.LatestExecutedState) + if err != nil { + return nil, fmt.Errorf("error marshaling 'latest_executed_state': %w", err) + } + } + + if a.LatestInstallFailedAttempts != nil { + object["latest_install_failed_attempts"], err = json.Marshal(a.LatestInstallFailedAttempts) + if err != nil { + return nil, fmt.Errorf("error marshaling 'latest_install_failed_attempts': %w", err) + } + } + + object["name"], err = json.Marshal(a.Name) + if err != nil { + return nil, fmt.Errorf("error marshaling 'name': %w", err) + } + + if a.Namespaces != nil { + object["namespaces"], err = json.Marshal(a.Namespaces) + if err != nil { + return nil, fmt.Errorf("error marshaling 'namespaces': %w", err) + } + } + + object["type"], err = json.Marshal(a.Type) + if err != nil { + return nil, fmt.Errorf("error marshaling 'type': %w", err) + } + + if a.UpdatedAt != nil { + object["updated_at"], err = json.Marshal(a.UpdatedAt) + if err != nil { + return nil, fmt.Errorf("error marshaling 'updated_at': %w", err) + } + } + + if a.VerificationKeyId != nil { + object["verification_key_id"], err = json.Marshal(a.VerificationKeyId) + if err != nil { + return nil, fmt.Errorf("error marshaling 'verification_key_id': %w", err) + } + } + + object["verification_status"], err = json.Marshal(a.VerificationStatus) + if err != nil { + return nil, fmt.Errorf("error marshaling 'verification_status': %w", err) + } + + object["version"], err = json.Marshal(a.Version) + if err != nil { + return nil, fmt.Errorf("error marshaling 'version': %w", err) + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + +// Getter for additional properties for PackageInfo_Owner. Returns the specified +// element and whether it was found +func (a PackageInfo_Owner) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for PackageInfo_Owner +func (a *PackageInfo_Owner) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for PackageInfo_Owner to handle AdditionalProperties +func (a *PackageInfo_Owner) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["github"]; found { + err = json.Unmarshal(raw, &a.Github) + if err != nil { + return fmt.Errorf("error reading 'github': %w", err) + } + delete(object, "github") + } + + if raw, found := object["type"]; found { + err = json.Unmarshal(raw, &a.Type) + if err != nil { + return fmt.Errorf("error reading 'type': %w", err) + } + delete(object, "type") + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for PackageInfo_Owner to handle AdditionalProperties +func (a PackageInfo_Owner) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + if a.Github != nil { + object["github"], err = json.Marshal(a.Github) + if err != nil { + return nil, fmt.Errorf("error marshaling 'github': %w", err) + } + } + + if a.Type != nil { + object["type"], err = json.Marshal(a.Type) + if err != nil { + return nil, fmt.Errorf("error marshaling 'type': %w", err) + } + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + +// Getter for additional properties for PackageInfo_Source. Returns the specified +// element and whether it was found +func (a PackageInfo_Source) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for PackageInfo_Source +func (a *PackageInfo_Source) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for PackageInfo_Source to handle AdditionalProperties +func (a *PackageInfo_Source) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["license"]; found { + err = json.Unmarshal(raw, &a.License) + if err != nil { + return fmt.Errorf("error reading 'license': %w", err) + } + delete(object, "license") + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for PackageInfo_Source to handle AdditionalProperties +func (a PackageInfo_Source) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + object["license"], err = json.Marshal(a.License) + if err != nil { + return nil, fmt.Errorf("error marshaling 'license': %w", err) + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + +// Getter for additional properties for PackageListItem. Returns the specified +// element and whether it was found +func (a PackageListItem) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for PackageListItem +func (a *PackageListItem) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for PackageListItem to handle AdditionalProperties +func (a *PackageListItem) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["categories"]; found { + err = json.Unmarshal(raw, &a.Categories) + if err != nil { + return fmt.Errorf("error reading 'categories': %w", err) + } + delete(object, "categories") + } + + if raw, found := object["conditions"]; found { + err = json.Unmarshal(raw, &a.Conditions) + if err != nil { + return fmt.Errorf("error reading 'conditions': %w", err) + } + delete(object, "conditions") + } + + if raw, found := object["data_streams"]; found { + err = json.Unmarshal(raw, &a.DataStreams) + if err != nil { + return fmt.Errorf("error reading 'data_streams': %w", err) + } + delete(object, "data_streams") + } + + if raw, found := object["description"]; found { + err = json.Unmarshal(raw, &a.Description) + if err != nil { + return fmt.Errorf("error reading 'description': %w", err) + } + delete(object, "description") + } + + if raw, found := object["discovery"]; found { + err = json.Unmarshal(raw, &a.Discovery) + if err != nil { + return fmt.Errorf("error reading 'discovery': %w", err) + } + delete(object, "discovery") + } + + if raw, found := object["download"]; found { + err = json.Unmarshal(raw, &a.Download) + if err != nil { + return fmt.Errorf("error reading 'download': %w", err) + } + delete(object, "download") + } + + if raw, found := object["format_version"]; found { + err = json.Unmarshal(raw, &a.FormatVersion) + if err != nil { + return fmt.Errorf("error reading 'format_version': %w", err) + } + delete(object, "format_version") + } + + if raw, found := object["icons"]; found { + err = json.Unmarshal(raw, &a.Icons) + if err != nil { + return fmt.Errorf("error reading 'icons': %w", err) + } + delete(object, "icons") + } + + if raw, found := object["id"]; found { + err = json.Unmarshal(raw, &a.Id) + if err != nil { + return fmt.Errorf("error reading 'id': %w", err) + } + delete(object, "id") + } + + if raw, found := object["installationInfo"]; found { + err = json.Unmarshal(raw, &a.InstallationInfo) + if err != nil { + return fmt.Errorf("error reading 'installationInfo': %w", err) + } + delete(object, "installationInfo") + } + + if raw, found := object["integration"]; found { + err = json.Unmarshal(raw, &a.Integration) + if err != nil { + return fmt.Errorf("error reading 'integration': %w", err) + } + delete(object, "integration") + } + + if raw, found := object["internal"]; found { + err = json.Unmarshal(raw, &a.Internal) + if err != nil { + return fmt.Errorf("error reading 'internal': %w", err) + } + delete(object, "internal") + } + + if raw, found := object["latestVersion"]; found { + err = json.Unmarshal(raw, &a.LatestVersion) + if err != nil { + return fmt.Errorf("error reading 'latestVersion': %w", err) + } + delete(object, "latestVersion") + } + + if raw, found := object["name"]; found { + err = json.Unmarshal(raw, &a.Name) + if err != nil { + return fmt.Errorf("error reading 'name': %w", err) + } + delete(object, "name") + } + + if raw, found := object["owner"]; found { + err = json.Unmarshal(raw, &a.Owner) + if err != nil { + return fmt.Errorf("error reading 'owner': %w", err) + } + delete(object, "owner") + } + + if raw, found := object["path"]; found { + err = json.Unmarshal(raw, &a.Path) + if err != nil { + return fmt.Errorf("error reading 'path': %w", err) + } + delete(object, "path") + } + + if raw, found := object["policy_templates"]; found { + err = json.Unmarshal(raw, &a.PolicyTemplates) + if err != nil { + return fmt.Errorf("error reading 'policy_templates': %w", err) + } + delete(object, "policy_templates") + } + + if raw, found := object["readme"]; found { + err = json.Unmarshal(raw, &a.Readme) + if err != nil { + return fmt.Errorf("error reading 'readme': %w", err) + } + delete(object, "readme") + } + + if raw, found := object["release"]; found { + err = json.Unmarshal(raw, &a.Release) + if err != nil { + return fmt.Errorf("error reading 'release': %w", err) + } + delete(object, "release") + } + + if raw, found := object["savedObject"]; found { + err = json.Unmarshal(raw, &a.SavedObject) + if err != nil { + return fmt.Errorf("error reading 'savedObject': %w", err) + } + delete(object, "savedObject") + } + + if raw, found := object["signature_path"]; found { + err = json.Unmarshal(raw, &a.SignaturePath) + if err != nil { + return fmt.Errorf("error reading 'signature_path': %w", err) + } + delete(object, "signature_path") + } + + if raw, found := object["source"]; found { + err = json.Unmarshal(raw, &a.Source) + if err != nil { + return fmt.Errorf("error reading 'source': %w", err) + } + delete(object, "source") + } + + if raw, found := object["status"]; found { + err = json.Unmarshal(raw, &a.Status) + if err != nil { + return fmt.Errorf("error reading 'status': %w", err) + } + delete(object, "status") + } + + if raw, found := object["title"]; found { + err = json.Unmarshal(raw, &a.Title) + if err != nil { + return fmt.Errorf("error reading 'title': %w", err) + } + delete(object, "title") + } + + if raw, found := object["type"]; found { + err = json.Unmarshal(raw, &a.Type) + if err != nil { + return fmt.Errorf("error reading 'type': %w", err) + } + delete(object, "type") + } + + if raw, found := object["vars"]; found { + err = json.Unmarshal(raw, &a.Vars) + if err != nil { + return fmt.Errorf("error reading 'vars': %w", err) + } + delete(object, "vars") + } + + if raw, found := object["version"]; found { + err = json.Unmarshal(raw, &a.Version) + if err != nil { + return fmt.Errorf("error reading 'version': %w", err) + } + delete(object, "version") + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for PackageListItem to handle AdditionalProperties +func (a PackageListItem) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + if a.Categories != nil { + object["categories"], err = json.Marshal(a.Categories) + if err != nil { + return nil, fmt.Errorf("error marshaling 'categories': %w", err) + } + } + + if a.Conditions != nil { + object["conditions"], err = json.Marshal(a.Conditions) + if err != nil { + return nil, fmt.Errorf("error marshaling 'conditions': %w", err) + } + } + + if a.DataStreams != nil { + object["data_streams"], err = json.Marshal(a.DataStreams) + if err != nil { + return nil, fmt.Errorf("error marshaling 'data_streams': %w", err) + } + } + + if a.Description != nil { + object["description"], err = json.Marshal(a.Description) + if err != nil { + return nil, fmt.Errorf("error marshaling 'description': %w", err) + } + } + + if a.Discovery != nil { + object["discovery"], err = json.Marshal(a.Discovery) + if err != nil { + return nil, fmt.Errorf("error marshaling 'discovery': %w", err) + } + } + + if a.Download != nil { + object["download"], err = json.Marshal(a.Download) + if err != nil { + return nil, fmt.Errorf("error marshaling 'download': %w", err) + } + } + + if a.FormatVersion != nil { + object["format_version"], err = json.Marshal(a.FormatVersion) + if err != nil { + return nil, fmt.Errorf("error marshaling 'format_version': %w", err) + } + } + + if a.Icons != nil { + object["icons"], err = json.Marshal(a.Icons) + if err != nil { + return nil, fmt.Errorf("error marshaling 'icons': %w", err) + } + } + + object["id"], err = json.Marshal(a.Id) + if err != nil { + return nil, fmt.Errorf("error marshaling 'id': %w", err) + } + + if a.InstallationInfo != nil { + object["installationInfo"], err = json.Marshal(a.InstallationInfo) + if err != nil { + return nil, fmt.Errorf("error marshaling 'installationInfo': %w", err) + } + } + + if a.Integration != nil { + object["integration"], err = json.Marshal(a.Integration) + if err != nil { + return nil, fmt.Errorf("error marshaling 'integration': %w", err) + } + } + + if a.Internal != nil { + object["internal"], err = json.Marshal(a.Internal) + if err != nil { + return nil, fmt.Errorf("error marshaling 'internal': %w", err) + } + } + + if a.LatestVersion != nil { + object["latestVersion"], err = json.Marshal(a.LatestVersion) + if err != nil { + return nil, fmt.Errorf("error marshaling 'latestVersion': %w", err) + } + } + + object["name"], err = json.Marshal(a.Name) + if err != nil { + return nil, fmt.Errorf("error marshaling 'name': %w", err) + } + + if a.Owner != nil { + object["owner"], err = json.Marshal(a.Owner) + if err != nil { + return nil, fmt.Errorf("error marshaling 'owner': %w", err) + } + } + + if a.Path != nil { + object["path"], err = json.Marshal(a.Path) + if err != nil { + return nil, fmt.Errorf("error marshaling 'path': %w", err) + } + } + + if a.PolicyTemplates != nil { + object["policy_templates"], err = json.Marshal(a.PolicyTemplates) + if err != nil { + return nil, fmt.Errorf("error marshaling 'policy_templates': %w", err) + } + } + + if a.Readme != nil { + object["readme"], err = json.Marshal(a.Readme) + if err != nil { + return nil, fmt.Errorf("error marshaling 'readme': %w", err) + } + } + + if a.Release != nil { + object["release"], err = json.Marshal(a.Release) + if err != nil { + return nil, fmt.Errorf("error marshaling 'release': %w", err) + } + } + + object["savedObject"], err = json.Marshal(a.SavedObject) + if err != nil { + return nil, fmt.Errorf("error marshaling 'savedObject': %w", err) + } + + if a.SignaturePath != nil { + object["signature_path"], err = json.Marshal(a.SignaturePath) + if err != nil { + return nil, fmt.Errorf("error marshaling 'signature_path': %w", err) + } + } + + if a.Source != nil { + object["source"], err = json.Marshal(a.Source) + if err != nil { + return nil, fmt.Errorf("error marshaling 'source': %w", err) + } + } + + if a.Status != nil { + object["status"], err = json.Marshal(a.Status) + if err != nil { + return nil, fmt.Errorf("error marshaling 'status': %w", err) + } + } + + object["title"], err = json.Marshal(a.Title) + if err != nil { + return nil, fmt.Errorf("error marshaling 'title': %w", err) + } + + if a.Type != nil { + object["type"], err = json.Marshal(a.Type) + if err != nil { + return nil, fmt.Errorf("error marshaling 'type': %w", err) + } + } + + if a.Vars != nil { + object["vars"], err = json.Marshal(a.Vars) + if err != nil { + return nil, fmt.Errorf("error marshaling 'vars': %w", err) + } + } + + object["version"], err = json.Marshal(a.Version) + if err != nil { + return nil, fmt.Errorf("error marshaling 'version': %w", err) + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + +// Getter for additional properties for PackageListItem_Conditions_Elastic. Returns the specified +// element and whether it was found +func (a PackageListItem_Conditions_Elastic) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for PackageListItem_Conditions_Elastic +func (a *PackageListItem_Conditions_Elastic) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for PackageListItem_Conditions_Elastic to handle AdditionalProperties +func (a *PackageListItem_Conditions_Elastic) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["capabilities"]; found { + err = json.Unmarshal(raw, &a.Capabilities) + if err != nil { + return fmt.Errorf("error reading 'capabilities': %w", err) + } + delete(object, "capabilities") + } + + if raw, found := object["subscription"]; found { + err = json.Unmarshal(raw, &a.Subscription) + if err != nil { + return fmt.Errorf("error reading 'subscription': %w", err) + } + delete(object, "subscription") + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for PackageListItem_Conditions_Elastic to handle AdditionalProperties +func (a PackageListItem_Conditions_Elastic) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + if a.Capabilities != nil { + object["capabilities"], err = json.Marshal(a.Capabilities) + if err != nil { + return nil, fmt.Errorf("error marshaling 'capabilities': %w", err) + } + } + + if a.Subscription != nil { + object["subscription"], err = json.Marshal(a.Subscription) + if err != nil { + return nil, fmt.Errorf("error marshaling 'subscription': %w", err) + } + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + +// Getter for additional properties for PackageListItem_Conditions_Kibana. Returns the specified +// element and whether it was found +func (a PackageListItem_Conditions_Kibana) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for PackageListItem_Conditions_Kibana +func (a *PackageListItem_Conditions_Kibana) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for PackageListItem_Conditions_Kibana to handle AdditionalProperties +func (a *PackageListItem_Conditions_Kibana) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["version"]; found { + err = json.Unmarshal(raw, &a.Version) + if err != nil { + return fmt.Errorf("error reading 'version': %w", err) + } + delete(object, "version") + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for PackageListItem_Conditions_Kibana to handle AdditionalProperties +func (a PackageListItem_Conditions_Kibana) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + if a.Version != nil { + object["version"], err = json.Marshal(a.Version) + if err != nil { + return nil, fmt.Errorf("error marshaling 'version': %w", err) + } + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + +// Getter for additional properties for PackageListItem_Conditions. Returns the specified +// element and whether it was found +func (a PackageListItem_Conditions) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for PackageListItem_Conditions +func (a *PackageListItem_Conditions) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for PackageListItem_Conditions to handle AdditionalProperties +func (a *PackageListItem_Conditions) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["elastic"]; found { + err = json.Unmarshal(raw, &a.Elastic) + if err != nil { + return fmt.Errorf("error reading 'elastic': %w", err) + } + delete(object, "elastic") + } + + if raw, found := object["kibana"]; found { + err = json.Unmarshal(raw, &a.Kibana) + if err != nil { + return fmt.Errorf("error reading 'kibana': %w", err) + } + delete(object, "kibana") + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for PackageListItem_Conditions to handle AdditionalProperties +func (a PackageListItem_Conditions) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + if a.Elastic != nil { + object["elastic"], err = json.Marshal(a.Elastic) + if err != nil { + return nil, fmt.Errorf("error marshaling 'elastic': %w", err) + } + } + + if a.Kibana != nil { + object["kibana"], err = json.Marshal(a.Kibana) + if err != nil { + return nil, fmt.Errorf("error marshaling 'kibana': %w", err) + } + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + +// Getter for additional properties for PackageListItem_Discovery_Fields_Item. Returns the specified +// element and whether it was found +func (a PackageListItem_Discovery_Fields_Item) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for PackageListItem_Discovery_Fields_Item +func (a *PackageListItem_Discovery_Fields_Item) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for PackageListItem_Discovery_Fields_Item to handle AdditionalProperties +func (a *PackageListItem_Discovery_Fields_Item) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["name"]; found { + err = json.Unmarshal(raw, &a.Name) + if err != nil { + return fmt.Errorf("error reading 'name': %w", err) + } + delete(object, "name") + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for PackageListItem_Discovery_Fields_Item to handle AdditionalProperties +func (a PackageListItem_Discovery_Fields_Item) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + object["name"], err = json.Marshal(a.Name) + if err != nil { + return nil, fmt.Errorf("error marshaling 'name': %w", err) + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + +// Getter for additional properties for PackageListItem_Discovery. Returns the specified +// element and whether it was found +func (a PackageListItem_Discovery) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for PackageListItem_Discovery +func (a *PackageListItem_Discovery) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for PackageListItem_Discovery to handle AdditionalProperties +func (a *PackageListItem_Discovery) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["fields"]; found { + err = json.Unmarshal(raw, &a.Fields) + if err != nil { + return fmt.Errorf("error reading 'fields': %w", err) + } + delete(object, "fields") + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for PackageListItem_Discovery to handle AdditionalProperties +func (a PackageListItem_Discovery) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + if a.Fields != nil { + object["fields"], err = json.Marshal(a.Fields) + if err != nil { + return nil, fmt.Errorf("error marshaling 'fields': %w", err) + } + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + +// Getter for additional properties for PackageListItem_Icons_Item. Returns the specified +// element and whether it was found +func (a PackageListItem_Icons_Item) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for PackageListItem_Icons_Item +func (a *PackageListItem_Icons_Item) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for PackageListItem_Icons_Item to handle AdditionalProperties +func (a *PackageListItem_Icons_Item) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["dark_mode"]; found { + err = json.Unmarshal(raw, &a.DarkMode) + if err != nil { + return fmt.Errorf("error reading 'dark_mode': %w", err) + } + delete(object, "dark_mode") + } + + if raw, found := object["path"]; found { + err = json.Unmarshal(raw, &a.Path) + if err != nil { + return fmt.Errorf("error reading 'path': %w", err) + } + delete(object, "path") + } + + if raw, found := object["size"]; found { + err = json.Unmarshal(raw, &a.Size) + if err != nil { + return fmt.Errorf("error reading 'size': %w", err) + } + delete(object, "size") + } + + if raw, found := object["src"]; found { + err = json.Unmarshal(raw, &a.Src) + if err != nil { + return fmt.Errorf("error reading 'src': %w", err) + } + delete(object, "src") + } + + if raw, found := object["title"]; found { + err = json.Unmarshal(raw, &a.Title) + if err != nil { + return fmt.Errorf("error reading 'title': %w", err) + } + delete(object, "title") + } + + if raw, found := object["type"]; found { + err = json.Unmarshal(raw, &a.Type) + if err != nil { + return fmt.Errorf("error reading 'type': %w", err) + } + delete(object, "type") + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for PackageListItem_Icons_Item to handle AdditionalProperties +func (a PackageListItem_Icons_Item) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + if a.DarkMode != nil { + object["dark_mode"], err = json.Marshal(a.DarkMode) + if err != nil { + return nil, fmt.Errorf("error marshaling 'dark_mode': %w", err) + } + } + + if a.Path != nil { + object["path"], err = json.Marshal(a.Path) + if err != nil { + return nil, fmt.Errorf("error marshaling 'path': %w", err) + } + } + + if a.Size != nil { + object["size"], err = json.Marshal(a.Size) + if err != nil { + return nil, fmt.Errorf("error marshaling 'size': %w", err) + } + } + + object["src"], err = json.Marshal(a.Src) + if err != nil { + return nil, fmt.Errorf("error marshaling 'src': %w", err) + } + + if a.Title != nil { + object["title"], err = json.Marshal(a.Title) + if err != nil { + return nil, fmt.Errorf("error marshaling 'title': %w", err) + } + } + + if a.Type != nil { + object["type"], err = json.Marshal(a.Type) + if err != nil { + return nil, fmt.Errorf("error marshaling 'type': %w", err) + } + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + +// Getter for additional properties for PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Item. Returns the specified +// element and whether it was found +func (a PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Item) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Item +func (a *PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Item) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Item to handle AdditionalProperties +func (a *PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Item) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["id"]; found { + err = json.Unmarshal(raw, &a.Id) + if err != nil { + return fmt.Errorf("error reading 'id': %w", err) + } + delete(object, "id") + } + + if raw, found := object["originId"]; found { + err = json.Unmarshal(raw, &a.OriginId) + if err != nil { + return fmt.Errorf("error reading 'originId': %w", err) + } + delete(object, "originId") + } + + if raw, found := object["type"]; found { + err = json.Unmarshal(raw, &a.Type) + if err != nil { + return fmt.Errorf("error reading 'type': %w", err) + } + delete(object, "type") + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Item to handle AdditionalProperties +func (a PackageListItem_InstallationInfo_AdditionalSpacesInstalledKibana_Item) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + object["id"], err = json.Marshal(a.Id) + if err != nil { + return nil, fmt.Errorf("error marshaling 'id': %w", err) + } + + if a.OriginId != nil { + object["originId"], err = json.Marshal(a.OriginId) + if err != nil { + return nil, fmt.Errorf("error marshaling 'originId': %w", err) + } + } + + object["type"], err = json.Marshal(a.Type) + if err != nil { + return nil, fmt.Errorf("error marshaling 'type': %w", err) + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + +// Getter for additional properties for PackageListItem_InstallationInfo_ExperimentalDataStreamFeatures_Features. Returns the specified +// element and whether it was found +func (a PackageListItem_InstallationInfo_ExperimentalDataStreamFeatures_Features) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for PackageListItem_InstallationInfo_ExperimentalDataStreamFeatures_Features +func (a *PackageListItem_InstallationInfo_ExperimentalDataStreamFeatures_Features) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for PackageListItem_InstallationInfo_ExperimentalDataStreamFeatures_Features to handle AdditionalProperties +func (a *PackageListItem_InstallationInfo_ExperimentalDataStreamFeatures_Features) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["doc_value_only_numeric"]; found { + err = json.Unmarshal(raw, &a.DocValueOnlyNumeric) + if err != nil { + return fmt.Errorf("error reading 'doc_value_only_numeric': %w", err) + } + delete(object, "doc_value_only_numeric") + } + + if raw, found := object["doc_value_only_other"]; found { + err = json.Unmarshal(raw, &a.DocValueOnlyOther) + if err != nil { + return fmt.Errorf("error reading 'doc_value_only_other': %w", err) + } + delete(object, "doc_value_only_other") + } + + if raw, found := object["synthetic_source"]; found { + err = json.Unmarshal(raw, &a.SyntheticSource) + if err != nil { + return fmt.Errorf("error reading 'synthetic_source': %w", err) + } + delete(object, "synthetic_source") + } + + if raw, found := object["tsdb"]; found { + err = json.Unmarshal(raw, &a.Tsdb) + if err != nil { + return fmt.Errorf("error reading 'tsdb': %w", err) + } + delete(object, "tsdb") + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for PackageListItem_InstallationInfo_ExperimentalDataStreamFeatures_Features to handle AdditionalProperties +func (a PackageListItem_InstallationInfo_ExperimentalDataStreamFeatures_Features) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + if a.DocValueOnlyNumeric != nil { + object["doc_value_only_numeric"], err = json.Marshal(a.DocValueOnlyNumeric) + if err != nil { + return nil, fmt.Errorf("error marshaling 'doc_value_only_numeric': %w", err) + } + } + + if a.DocValueOnlyOther != nil { + object["doc_value_only_other"], err = json.Marshal(a.DocValueOnlyOther) + if err != nil { + return nil, fmt.Errorf("error marshaling 'doc_value_only_other': %w", err) + } + } + + if a.SyntheticSource != nil { + object["synthetic_source"], err = json.Marshal(a.SyntheticSource) + if err != nil { + return nil, fmt.Errorf("error marshaling 'synthetic_source': %w", err) + } + } + + if a.Tsdb != nil { + object["tsdb"], err = json.Marshal(a.Tsdb) + if err != nil { + return nil, fmt.Errorf("error marshaling 'tsdb': %w", err) + } + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + +// Getter for additional properties for PackageListItem_InstallationInfo_ExperimentalDataStreamFeatures_Item. Returns the specified +// element and whether it was found +func (a PackageListItem_InstallationInfo_ExperimentalDataStreamFeatures_Item) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for PackageListItem_InstallationInfo_ExperimentalDataStreamFeatures_Item +func (a *PackageListItem_InstallationInfo_ExperimentalDataStreamFeatures_Item) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for PackageListItem_InstallationInfo_ExperimentalDataStreamFeatures_Item to handle AdditionalProperties +func (a *PackageListItem_InstallationInfo_ExperimentalDataStreamFeatures_Item) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["data_stream"]; found { + err = json.Unmarshal(raw, &a.DataStream) + if err != nil { + return fmt.Errorf("error reading 'data_stream': %w", err) + } + delete(object, "data_stream") + } + + if raw, found := object["features"]; found { + err = json.Unmarshal(raw, &a.Features) + if err != nil { + return fmt.Errorf("error reading 'features': %w", err) + } + delete(object, "features") + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for PackageListItem_InstallationInfo_ExperimentalDataStreamFeatures_Item to handle AdditionalProperties +func (a PackageListItem_InstallationInfo_ExperimentalDataStreamFeatures_Item) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + object["data_stream"], err = json.Marshal(a.DataStream) + if err != nil { + return nil, fmt.Errorf("error marshaling 'data_stream': %w", err) + } + + object["features"], err = json.Marshal(a.Features) + if err != nil { + return nil, fmt.Errorf("error marshaling 'features': %w", err) + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + +// Getter for additional properties for PackageListItem_InstallationInfo_InstalledEs_Item. Returns the specified +// element and whether it was found +func (a PackageListItem_InstallationInfo_InstalledEs_Item) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for PackageListItem_InstallationInfo_InstalledEs_Item +func (a *PackageListItem_InstallationInfo_InstalledEs_Item) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for PackageListItem_InstallationInfo_InstalledEs_Item to handle AdditionalProperties +func (a *PackageListItem_InstallationInfo_InstalledEs_Item) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["deferred"]; found { + err = json.Unmarshal(raw, &a.Deferred) + if err != nil { + return fmt.Errorf("error reading 'deferred': %w", err) + } + delete(object, "deferred") + } + + if raw, found := object["id"]; found { + err = json.Unmarshal(raw, &a.Id) + if err != nil { + return fmt.Errorf("error reading 'id': %w", err) + } + delete(object, "id") + } + + if raw, found := object["type"]; found { + err = json.Unmarshal(raw, &a.Type) + if err != nil { + return fmt.Errorf("error reading 'type': %w", err) + } + delete(object, "type") + } + + if raw, found := object["version"]; found { + err = json.Unmarshal(raw, &a.Version) + if err != nil { + return fmt.Errorf("error reading 'version': %w", err) + } + delete(object, "version") + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for PackageListItem_InstallationInfo_InstalledEs_Item to handle AdditionalProperties +func (a PackageListItem_InstallationInfo_InstalledEs_Item) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + if a.Deferred != nil { + object["deferred"], err = json.Marshal(a.Deferred) + if err != nil { + return nil, fmt.Errorf("error marshaling 'deferred': %w", err) + } + } + + object["id"], err = json.Marshal(a.Id) + if err != nil { + return nil, fmt.Errorf("error marshaling 'id': %w", err) + } + + object["type"], err = json.Marshal(a.Type) + if err != nil { + return nil, fmt.Errorf("error marshaling 'type': %w", err) + } + + if a.Version != nil { + object["version"], err = json.Marshal(a.Version) + if err != nil { + return nil, fmt.Errorf("error marshaling 'version': %w", err) + } + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + +// Getter for additional properties for PackageListItem_InstallationInfo_InstalledKibana_Item. Returns the specified +// element and whether it was found +func (a PackageListItem_InstallationInfo_InstalledKibana_Item) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for PackageListItem_InstallationInfo_InstalledKibana_Item +func (a *PackageListItem_InstallationInfo_InstalledKibana_Item) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for PackageListItem_InstallationInfo_InstalledKibana_Item to handle AdditionalProperties +func (a *PackageListItem_InstallationInfo_InstalledKibana_Item) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["id"]; found { + err = json.Unmarshal(raw, &a.Id) + if err != nil { + return fmt.Errorf("error reading 'id': %w", err) + } + delete(object, "id") + } + + if raw, found := object["originId"]; found { + err = json.Unmarshal(raw, &a.OriginId) + if err != nil { + return fmt.Errorf("error reading 'originId': %w", err) + } + delete(object, "originId") + } + + if raw, found := object["type"]; found { + err = json.Unmarshal(raw, &a.Type) + if err != nil { + return fmt.Errorf("error reading 'type': %w", err) + } + delete(object, "type") + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for PackageListItem_InstallationInfo_InstalledKibana_Item to handle AdditionalProperties +func (a PackageListItem_InstallationInfo_InstalledKibana_Item) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + object["id"], err = json.Marshal(a.Id) + if err != nil { + return nil, fmt.Errorf("error marshaling 'id': %w", err) + } + + if a.OriginId != nil { + object["originId"], err = json.Marshal(a.OriginId) + if err != nil { + return nil, fmt.Errorf("error marshaling 'originId': %w", err) + } + } + + object["type"], err = json.Marshal(a.Type) + if err != nil { + return nil, fmt.Errorf("error marshaling 'type': %w", err) + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + +// Getter for additional properties for PackageListItem_InstallationInfo_LatestExecutedState. Returns the specified +// element and whether it was found +func (a PackageListItem_InstallationInfo_LatestExecutedState) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for PackageListItem_InstallationInfo_LatestExecutedState +func (a *PackageListItem_InstallationInfo_LatestExecutedState) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for PackageListItem_InstallationInfo_LatestExecutedState to handle AdditionalProperties +func (a *PackageListItem_InstallationInfo_LatestExecutedState) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["error"]; found { + err = json.Unmarshal(raw, &a.Error) + if err != nil { + return fmt.Errorf("error reading 'error': %w", err) + } + delete(object, "error") + } + + if raw, found := object["name"]; found { + err = json.Unmarshal(raw, &a.Name) + if err != nil { + return fmt.Errorf("error reading 'name': %w", err) + } + delete(object, "name") + } + + if raw, found := object["started_at"]; found { + err = json.Unmarshal(raw, &a.StartedAt) + if err != nil { + return fmt.Errorf("error reading 'started_at': %w", err) + } + delete(object, "started_at") + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for PackageListItem_InstallationInfo_LatestExecutedState to handle AdditionalProperties +func (a PackageListItem_InstallationInfo_LatestExecutedState) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + if a.Error != nil { + object["error"], err = json.Marshal(a.Error) + if err != nil { + return nil, fmt.Errorf("error marshaling 'error': %w", err) + } + } + + object["name"], err = json.Marshal(a.Name) + if err != nil { + return nil, fmt.Errorf("error marshaling 'name': %w", err) + } + + object["started_at"], err = json.Marshal(a.StartedAt) + if err != nil { + return nil, fmt.Errorf("error marshaling 'started_at': %w", err) + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + +// Getter for additional properties for PackageListItem_InstallationInfo_LatestInstallFailedAttempts_Error. Returns the specified +// element and whether it was found +func (a PackageListItem_InstallationInfo_LatestInstallFailedAttempts_Error) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for PackageListItem_InstallationInfo_LatestInstallFailedAttempts_Error +func (a *PackageListItem_InstallationInfo_LatestInstallFailedAttempts_Error) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for PackageListItem_InstallationInfo_LatestInstallFailedAttempts_Error to handle AdditionalProperties +func (a *PackageListItem_InstallationInfo_LatestInstallFailedAttempts_Error) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["message"]; found { + err = json.Unmarshal(raw, &a.Message) + if err != nil { + return fmt.Errorf("error reading 'message': %w", err) + } + delete(object, "message") + } + + if raw, found := object["name"]; found { + err = json.Unmarshal(raw, &a.Name) + if err != nil { + return fmt.Errorf("error reading 'name': %w", err) + } + delete(object, "name") + } + + if raw, found := object["stack"]; found { + err = json.Unmarshal(raw, &a.Stack) + if err != nil { + return fmt.Errorf("error reading 'stack': %w", err) + } + delete(object, "stack") + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for PackageListItem_InstallationInfo_LatestInstallFailedAttempts_Error to handle AdditionalProperties +func (a PackageListItem_InstallationInfo_LatestInstallFailedAttempts_Error) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + object["message"], err = json.Marshal(a.Message) + if err != nil { + return nil, fmt.Errorf("error marshaling 'message': %w", err) + } + + object["name"], err = json.Marshal(a.Name) + if err != nil { + return nil, fmt.Errorf("error marshaling 'name': %w", err) + } + + if a.Stack != nil { + object["stack"], err = json.Marshal(a.Stack) + if err != nil { + return nil, fmt.Errorf("error marshaling 'stack': %w", err) + } + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + +// Getter for additional properties for PackageListItem_InstallationInfo_LatestInstallFailedAttempts_Item. Returns the specified +// element and whether it was found +func (a PackageListItem_InstallationInfo_LatestInstallFailedAttempts_Item) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for PackageListItem_InstallationInfo_LatestInstallFailedAttempts_Item +func (a *PackageListItem_InstallationInfo_LatestInstallFailedAttempts_Item) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for PackageListItem_InstallationInfo_LatestInstallFailedAttempts_Item to handle AdditionalProperties +func (a *PackageListItem_InstallationInfo_LatestInstallFailedAttempts_Item) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["created_at"]; found { + err = json.Unmarshal(raw, &a.CreatedAt) + if err != nil { + return fmt.Errorf("error reading 'created_at': %w", err) + } + delete(object, "created_at") + } + + if raw, found := object["error"]; found { + err = json.Unmarshal(raw, &a.Error) + if err != nil { + return fmt.Errorf("error reading 'error': %w", err) + } + delete(object, "error") + } + + if raw, found := object["target_version"]; found { + err = json.Unmarshal(raw, &a.TargetVersion) + if err != nil { + return fmt.Errorf("error reading 'target_version': %w", err) + } + delete(object, "target_version") + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for PackageListItem_InstallationInfo_LatestInstallFailedAttempts_Item to handle AdditionalProperties +func (a PackageListItem_InstallationInfo_LatestInstallFailedAttempts_Item) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + object["created_at"], err = json.Marshal(a.CreatedAt) + if err != nil { + return nil, fmt.Errorf("error marshaling 'created_at': %w", err) + } + + object["error"], err = json.Marshal(a.Error) + if err != nil { + return nil, fmt.Errorf("error marshaling 'error': %w", err) + } + + object["target_version"], err = json.Marshal(a.TargetVersion) + if err != nil { + return nil, fmt.Errorf("error marshaling 'target_version': %w", err) + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + +// Getter for additional properties for PackageListItem_InstallationInfo. Returns the specified +// element and whether it was found +func (a PackageListItem_InstallationInfo) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for PackageListItem_InstallationInfo +func (a *PackageListItem_InstallationInfo) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for PackageListItem_InstallationInfo to handle AdditionalProperties +func (a *PackageListItem_InstallationInfo) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["additional_spaces_installed_kibana"]; found { + err = json.Unmarshal(raw, &a.AdditionalSpacesInstalledKibana) + if err != nil { + return fmt.Errorf("error reading 'additional_spaces_installed_kibana': %w", err) + } + delete(object, "additional_spaces_installed_kibana") + } + + if raw, found := object["created_at"]; found { + err = json.Unmarshal(raw, &a.CreatedAt) + if err != nil { + return fmt.Errorf("error reading 'created_at': %w", err) + } + delete(object, "created_at") + } + + if raw, found := object["experimental_data_stream_features"]; found { + err = json.Unmarshal(raw, &a.ExperimentalDataStreamFeatures) + if err != nil { + return fmt.Errorf("error reading 'experimental_data_stream_features': %w", err) + } + delete(object, "experimental_data_stream_features") + } + + if raw, found := object["install_format_schema_version"]; found { + err = json.Unmarshal(raw, &a.InstallFormatSchemaVersion) + if err != nil { + return fmt.Errorf("error reading 'install_format_schema_version': %w", err) + } + delete(object, "install_format_schema_version") + } + + if raw, found := object["install_source"]; found { + err = json.Unmarshal(raw, &a.InstallSource) + if err != nil { + return fmt.Errorf("error reading 'install_source': %w", err) + } + delete(object, "install_source") + } + + if raw, found := object["install_status"]; found { + err = json.Unmarshal(raw, &a.InstallStatus) + if err != nil { + return fmt.Errorf("error reading 'install_status': %w", err) + } + delete(object, "install_status") + } + + if raw, found := object["installed_es"]; found { + err = json.Unmarshal(raw, &a.InstalledEs) + if err != nil { + return fmt.Errorf("error reading 'installed_es': %w", err) + } + delete(object, "installed_es") + } + + if raw, found := object["installed_kibana"]; found { + err = json.Unmarshal(raw, &a.InstalledKibana) + if err != nil { + return fmt.Errorf("error reading 'installed_kibana': %w", err) + } + delete(object, "installed_kibana") + } + + if raw, found := object["installed_kibana_space_id"]; found { + err = json.Unmarshal(raw, &a.InstalledKibanaSpaceId) + if err != nil { + return fmt.Errorf("error reading 'installed_kibana_space_id': %w", err) + } + delete(object, "installed_kibana_space_id") + } + + if raw, found := object["latest_executed_state"]; found { + err = json.Unmarshal(raw, &a.LatestExecutedState) + if err != nil { + return fmt.Errorf("error reading 'latest_executed_state': %w", err) + } + delete(object, "latest_executed_state") + } + + if raw, found := object["latest_install_failed_attempts"]; found { + err = json.Unmarshal(raw, &a.LatestInstallFailedAttempts) + if err != nil { + return fmt.Errorf("error reading 'latest_install_failed_attempts': %w", err) + } + delete(object, "latest_install_failed_attempts") + } + + if raw, found := object["name"]; found { + err = json.Unmarshal(raw, &a.Name) + if err != nil { + return fmt.Errorf("error reading 'name': %w", err) + } + delete(object, "name") + } + + if raw, found := object["namespaces"]; found { + err = json.Unmarshal(raw, &a.Namespaces) + if err != nil { + return fmt.Errorf("error reading 'namespaces': %w", err) + } + delete(object, "namespaces") + } + + if raw, found := object["type"]; found { + err = json.Unmarshal(raw, &a.Type) + if err != nil { + return fmt.Errorf("error reading 'type': %w", err) + } + delete(object, "type") + } + + if raw, found := object["updated_at"]; found { + err = json.Unmarshal(raw, &a.UpdatedAt) + if err != nil { + return fmt.Errorf("error reading 'updated_at': %w", err) + } + delete(object, "updated_at") + } + + if raw, found := object["verification_key_id"]; found { + err = json.Unmarshal(raw, &a.VerificationKeyId) + if err != nil { + return fmt.Errorf("error reading 'verification_key_id': %w", err) + } + delete(object, "verification_key_id") + } + + if raw, found := object["verification_status"]; found { + err = json.Unmarshal(raw, &a.VerificationStatus) + if err != nil { + return fmt.Errorf("error reading 'verification_status': %w", err) + } + delete(object, "verification_status") + } + + if raw, found := object["version"]; found { + err = json.Unmarshal(raw, &a.Version) + if err != nil { + return fmt.Errorf("error reading 'version': %w", err) + } + delete(object, "version") + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for PackageListItem_InstallationInfo to handle AdditionalProperties +func (a PackageListItem_InstallationInfo) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + if a.AdditionalSpacesInstalledKibana != nil { + object["additional_spaces_installed_kibana"], err = json.Marshal(a.AdditionalSpacesInstalledKibana) + if err != nil { + return nil, fmt.Errorf("error marshaling 'additional_spaces_installed_kibana': %w", err) + } + } + + if a.CreatedAt != nil { + object["created_at"], err = json.Marshal(a.CreatedAt) + if err != nil { + return nil, fmt.Errorf("error marshaling 'created_at': %w", err) + } + } + + if a.ExperimentalDataStreamFeatures != nil { + object["experimental_data_stream_features"], err = json.Marshal(a.ExperimentalDataStreamFeatures) + if err != nil { + return nil, fmt.Errorf("error marshaling 'experimental_data_stream_features': %w", err) + } + } + + if a.InstallFormatSchemaVersion != nil { + object["install_format_schema_version"], err = json.Marshal(a.InstallFormatSchemaVersion) + if err != nil { + return nil, fmt.Errorf("error marshaling 'install_format_schema_version': %w", err) + } + } + + object["install_source"], err = json.Marshal(a.InstallSource) + if err != nil { + return nil, fmt.Errorf("error marshaling 'install_source': %w", err) + } + + object["install_status"], err = json.Marshal(a.InstallStatus) + if err != nil { + return nil, fmt.Errorf("error marshaling 'install_status': %w", err) + } + + object["installed_es"], err = json.Marshal(a.InstalledEs) + if err != nil { + return nil, fmt.Errorf("error marshaling 'installed_es': %w", err) + } + + object["installed_kibana"], err = json.Marshal(a.InstalledKibana) + if err != nil { + return nil, fmt.Errorf("error marshaling 'installed_kibana': %w", err) + } + + if a.InstalledKibanaSpaceId != nil { + object["installed_kibana_space_id"], err = json.Marshal(a.InstalledKibanaSpaceId) + if err != nil { + return nil, fmt.Errorf("error marshaling 'installed_kibana_space_id': %w", err) + } + } + + if a.LatestExecutedState != nil { + object["latest_executed_state"], err = json.Marshal(a.LatestExecutedState) + if err != nil { + return nil, fmt.Errorf("error marshaling 'latest_executed_state': %w", err) + } + } + + if a.LatestInstallFailedAttempts != nil { + object["latest_install_failed_attempts"], err = json.Marshal(a.LatestInstallFailedAttempts) + if err != nil { + return nil, fmt.Errorf("error marshaling 'latest_install_failed_attempts': %w", err) + } + } + + object["name"], err = json.Marshal(a.Name) + if err != nil { + return nil, fmt.Errorf("error marshaling 'name': %w", err) + } + + if a.Namespaces != nil { + object["namespaces"], err = json.Marshal(a.Namespaces) + if err != nil { + return nil, fmt.Errorf("error marshaling 'namespaces': %w", err) + } + } + + object["type"], err = json.Marshal(a.Type) + if err != nil { + return nil, fmt.Errorf("error marshaling 'type': %w", err) + } + + if a.UpdatedAt != nil { + object["updated_at"], err = json.Marshal(a.UpdatedAt) + if err != nil { + return nil, fmt.Errorf("error marshaling 'updated_at': %w", err) + } + } + + if a.VerificationKeyId != nil { + object["verification_key_id"], err = json.Marshal(a.VerificationKeyId) + if err != nil { + return nil, fmt.Errorf("error marshaling 'verification_key_id': %w", err) + } + } + + object["verification_status"], err = json.Marshal(a.VerificationStatus) + if err != nil { + return nil, fmt.Errorf("error marshaling 'verification_status': %w", err) + } + + object["version"], err = json.Marshal(a.Version) + if err != nil { + return nil, fmt.Errorf("error marshaling 'version': %w", err) + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + +// Getter for additional properties for PackageListItem_Owner. Returns the specified +// element and whether it was found +func (a PackageListItem_Owner) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for PackageListItem_Owner +func (a *PackageListItem_Owner) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for PackageListItem_Owner to handle AdditionalProperties +func (a *PackageListItem_Owner) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["github"]; found { + err = json.Unmarshal(raw, &a.Github) + if err != nil { + return fmt.Errorf("error reading 'github': %w", err) + } + delete(object, "github") + } + + if raw, found := object["type"]; found { + err = json.Unmarshal(raw, &a.Type) + if err != nil { + return fmt.Errorf("error reading 'type': %w", err) + } + delete(object, "type") + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for PackageListItem_Owner to handle AdditionalProperties +func (a PackageListItem_Owner) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + if a.Github != nil { + object["github"], err = json.Marshal(a.Github) + if err != nil { + return nil, fmt.Errorf("error marshaling 'github': %w", err) + } + } + + if a.Type != nil { + object["type"], err = json.Marshal(a.Type) + if err != nil { + return nil, fmt.Errorf("error marshaling 'type': %w", err) + } + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + +// Getter for additional properties for PackageListItem_Source. Returns the specified +// element and whether it was found +func (a PackageListItem_Source) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for PackageListItem_Source +func (a *PackageListItem_Source) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for PackageListItem_Source to handle AdditionalProperties +func (a *PackageListItem_Source) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["license"]; found { + err = json.Unmarshal(raw, &a.License) + if err != nil { + return fmt.Errorf("error reading 'license': %w", err) + } + delete(object, "license") + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for PackageListItem_Source to handle AdditionalProperties +func (a PackageListItem_Source) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + object["license"], err = json.Marshal(a.License) + if err != nil { + return nil, fmt.Errorf("error marshaling 'license': %w", err) + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + +// Getter for additional properties for PackagePolicy_Elasticsearch_Privileges. Returns the specified +// element and whether it was found +func (a PackagePolicy_Elasticsearch_Privileges) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for PackagePolicy_Elasticsearch_Privileges +func (a *PackagePolicy_Elasticsearch_Privileges) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for PackagePolicy_Elasticsearch_Privileges to handle AdditionalProperties +func (a *PackagePolicy_Elasticsearch_Privileges) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["cluster"]; found { + err = json.Unmarshal(raw, &a.Cluster) + if err != nil { + return fmt.Errorf("error reading 'cluster': %w", err) + } + delete(object, "cluster") + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for PackagePolicy_Elasticsearch_Privileges to handle AdditionalProperties +func (a PackagePolicy_Elasticsearch_Privileges) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + if a.Cluster != nil { + object["cluster"], err = json.Marshal(a.Cluster) + if err != nil { + return nil, fmt.Errorf("error marshaling 'cluster': %w", err) + } + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + +// Getter for additional properties for PackagePolicy_Elasticsearch. Returns the specified +// element and whether it was found +func (a PackagePolicy_Elasticsearch) Get(fieldName string) (value interface{}, found bool) { + if a.AdditionalProperties != nil { + value, found = a.AdditionalProperties[fieldName] + } + return +} + +// Setter for additional properties for PackagePolicy_Elasticsearch +func (a *PackagePolicy_Elasticsearch) Set(fieldName string, value interface{}) { + if a.AdditionalProperties == nil { + a.AdditionalProperties = make(map[string]interface{}) + } + a.AdditionalProperties[fieldName] = value +} + +// Override default JSON handling for PackagePolicy_Elasticsearch to handle AdditionalProperties +func (a *PackagePolicy_Elasticsearch) UnmarshalJSON(b []byte) error { + object := make(map[string]json.RawMessage) + err := json.Unmarshal(b, &object) + if err != nil { + return err + } + + if raw, found := object["privileges"]; found { + err = json.Unmarshal(raw, &a.Privileges) + if err != nil { + return fmt.Errorf("error reading 'privileges': %w", err) + } + delete(object, "privileges") + } + + if len(object) != 0 { + a.AdditionalProperties = make(map[string]interface{}) + for fieldName, fieldBuf := range object { + var fieldVal interface{} + err := json.Unmarshal(fieldBuf, &fieldVal) + if err != nil { + return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) + } + a.AdditionalProperties[fieldName] = fieldVal + } + } + return nil +} + +// Override default JSON handling for PackagePolicy_Elasticsearch to handle AdditionalProperties +func (a PackagePolicy_Elasticsearch) MarshalJSON() ([]byte, error) { + var err error + object := make(map[string]json.RawMessage) + + if a.Privileges != nil { + object["privileges"], err = json.Marshal(a.Privileges) + if err != nil { + return nil, fmt.Errorf("error marshaling 'privileges': %w", err) + } + } + + for fieldName, field := range a.AdditionalProperties { + object[fieldName], err = json.Marshal(field) + if err != nil { + return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) + } + } + return json.Marshal(object) +} + +// AsAgentPolicyGlobalDataTagsValue0 returns the union data inside the AgentPolicy_GlobalDataTags_Value as a AgentPolicyGlobalDataTagsValue0 +func (t AgentPolicy_GlobalDataTags_Value) AsAgentPolicyGlobalDataTagsValue0() (AgentPolicyGlobalDataTagsValue0, error) { + var body AgentPolicyGlobalDataTagsValue0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromAgentPolicyGlobalDataTagsValue0 overwrites any union data inside the AgentPolicy_GlobalDataTags_Value as the provided AgentPolicyGlobalDataTagsValue0 +func (t *AgentPolicy_GlobalDataTags_Value) FromAgentPolicyGlobalDataTagsValue0(v AgentPolicyGlobalDataTagsValue0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeAgentPolicyGlobalDataTagsValue0 performs a merge with any union data inside the AgentPolicy_GlobalDataTags_Value, using the provided AgentPolicyGlobalDataTagsValue0 +func (t *AgentPolicy_GlobalDataTags_Value) MergeAgentPolicyGlobalDataTagsValue0(v AgentPolicyGlobalDataTagsValue0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsAgentPolicyGlobalDataTagsValue1 returns the union data inside the AgentPolicy_GlobalDataTags_Value as a AgentPolicyGlobalDataTagsValue1 +func (t AgentPolicy_GlobalDataTags_Value) AsAgentPolicyGlobalDataTagsValue1() (AgentPolicyGlobalDataTagsValue1, error) { + var body AgentPolicyGlobalDataTagsValue1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromAgentPolicyGlobalDataTagsValue1 overwrites any union data inside the AgentPolicy_GlobalDataTags_Value as the provided AgentPolicyGlobalDataTagsValue1 +func (t *AgentPolicy_GlobalDataTags_Value) FromAgentPolicyGlobalDataTagsValue1(v AgentPolicyGlobalDataTagsValue1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeAgentPolicyGlobalDataTagsValue1 performs a merge with any union data inside the AgentPolicy_GlobalDataTags_Value, using the provided AgentPolicyGlobalDataTagsValue1 +func (t *AgentPolicy_GlobalDataTags_Value) MergeAgentPolicyGlobalDataTagsValue1(v AgentPolicyGlobalDataTagsValue1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t AgentPolicy_GlobalDataTags_Value) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *AgentPolicy_GlobalDataTags_Value) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsAgentPolicyPackagePolicies0 returns the union data inside the AgentPolicy_PackagePolicies as a AgentPolicyPackagePolicies0 +func (t AgentPolicy_PackagePolicies) AsAgentPolicyPackagePolicies0() (AgentPolicyPackagePolicies0, error) { + var body AgentPolicyPackagePolicies0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromAgentPolicyPackagePolicies0 overwrites any union data inside the AgentPolicy_PackagePolicies as the provided AgentPolicyPackagePolicies0 +func (t *AgentPolicy_PackagePolicies) FromAgentPolicyPackagePolicies0(v AgentPolicyPackagePolicies0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeAgentPolicyPackagePolicies0 performs a merge with any union data inside the AgentPolicy_PackagePolicies, using the provided AgentPolicyPackagePolicies0 +func (t *AgentPolicy_PackagePolicies) MergeAgentPolicyPackagePolicies0(v AgentPolicyPackagePolicies0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsAgentPolicyPackagePolicies1 returns the union data inside the AgentPolicy_PackagePolicies as a AgentPolicyPackagePolicies1 +func (t AgentPolicy_PackagePolicies) AsAgentPolicyPackagePolicies1() (AgentPolicyPackagePolicies1, error) { + var body AgentPolicyPackagePolicies1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromAgentPolicyPackagePolicies1 overwrites any union data inside the AgentPolicy_PackagePolicies as the provided AgentPolicyPackagePolicies1 +func (t *AgentPolicy_PackagePolicies) FromAgentPolicyPackagePolicies1(v AgentPolicyPackagePolicies1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeAgentPolicyPackagePolicies1 performs a merge with any union data inside the AgentPolicy_PackagePolicies, using the provided AgentPolicyPackagePolicies1 +func (t *AgentPolicy_PackagePolicies) MergeAgentPolicyPackagePolicies1(v AgentPolicyPackagePolicies1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t AgentPolicy_PackagePolicies) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *AgentPolicy_PackagePolicies) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsNewOutputKafkaSecretsPassword0 returns the union data inside the NewOutputKafka_Secrets_Password as a NewOutputKafkaSecretsPassword0 +func (t NewOutputKafka_Secrets_Password) AsNewOutputKafkaSecretsPassword0() (NewOutputKafkaSecretsPassword0, error) { + var body NewOutputKafkaSecretsPassword0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromNewOutputKafkaSecretsPassword0 overwrites any union data inside the NewOutputKafka_Secrets_Password as the provided NewOutputKafkaSecretsPassword0 +func (t *NewOutputKafka_Secrets_Password) FromNewOutputKafkaSecretsPassword0(v NewOutputKafkaSecretsPassword0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeNewOutputKafkaSecretsPassword0 performs a merge with any union data inside the NewOutputKafka_Secrets_Password, using the provided NewOutputKafkaSecretsPassword0 +func (t *NewOutputKafka_Secrets_Password) MergeNewOutputKafkaSecretsPassword0(v NewOutputKafkaSecretsPassword0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsNewOutputKafkaSecretsPassword1 returns the union data inside the NewOutputKafka_Secrets_Password as a NewOutputKafkaSecretsPassword1 +func (t NewOutputKafka_Secrets_Password) AsNewOutputKafkaSecretsPassword1() (NewOutputKafkaSecretsPassword1, error) { + var body NewOutputKafkaSecretsPassword1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromNewOutputKafkaSecretsPassword1 overwrites any union data inside the NewOutputKafka_Secrets_Password as the provided NewOutputKafkaSecretsPassword1 +func (t *NewOutputKafka_Secrets_Password) FromNewOutputKafkaSecretsPassword1(v NewOutputKafkaSecretsPassword1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeNewOutputKafkaSecretsPassword1 performs a merge with any union data inside the NewOutputKafka_Secrets_Password, using the provided NewOutputKafkaSecretsPassword1 +func (t *NewOutputKafka_Secrets_Password) MergeNewOutputKafkaSecretsPassword1(v NewOutputKafkaSecretsPassword1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t NewOutputKafka_Secrets_Password) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *NewOutputKafka_Secrets_Password) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsNewOutputKafkaSecretsSslKey0 returns the union data inside the NewOutputKafka_Secrets_Ssl_Key as a NewOutputKafkaSecretsSslKey0 +func (t NewOutputKafka_Secrets_Ssl_Key) AsNewOutputKafkaSecretsSslKey0() (NewOutputKafkaSecretsSslKey0, error) { + var body NewOutputKafkaSecretsSslKey0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromNewOutputKafkaSecretsSslKey0 overwrites any union data inside the NewOutputKafka_Secrets_Ssl_Key as the provided NewOutputKafkaSecretsSslKey0 +func (t *NewOutputKafka_Secrets_Ssl_Key) FromNewOutputKafkaSecretsSslKey0(v NewOutputKafkaSecretsSslKey0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeNewOutputKafkaSecretsSslKey0 performs a merge with any union data inside the NewOutputKafka_Secrets_Ssl_Key, using the provided NewOutputKafkaSecretsSslKey0 +func (t *NewOutputKafka_Secrets_Ssl_Key) MergeNewOutputKafkaSecretsSslKey0(v NewOutputKafkaSecretsSslKey0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsNewOutputKafkaSecretsSslKey1 returns the union data inside the NewOutputKafka_Secrets_Ssl_Key as a NewOutputKafkaSecretsSslKey1 +func (t NewOutputKafka_Secrets_Ssl_Key) AsNewOutputKafkaSecretsSslKey1() (NewOutputKafkaSecretsSslKey1, error) { + var body NewOutputKafkaSecretsSslKey1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromNewOutputKafkaSecretsSslKey1 overwrites any union data inside the NewOutputKafka_Secrets_Ssl_Key as the provided NewOutputKafkaSecretsSslKey1 +func (t *NewOutputKafka_Secrets_Ssl_Key) FromNewOutputKafkaSecretsSslKey1(v NewOutputKafkaSecretsSslKey1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeNewOutputKafkaSecretsSslKey1 performs a merge with any union data inside the NewOutputKafka_Secrets_Ssl_Key, using the provided NewOutputKafkaSecretsSslKey1 +func (t *NewOutputKafka_Secrets_Ssl_Key) MergeNewOutputKafkaSecretsSslKey1(v NewOutputKafkaSecretsSslKey1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t NewOutputKafka_Secrets_Ssl_Key) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *NewOutputKafka_Secrets_Ssl_Key) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsNewOutputLogstashSecretsSslKey0 returns the union data inside the NewOutputLogstash_Secrets_Ssl_Key as a NewOutputLogstashSecretsSslKey0 +func (t NewOutputLogstash_Secrets_Ssl_Key) AsNewOutputLogstashSecretsSslKey0() (NewOutputLogstashSecretsSslKey0, error) { + var body NewOutputLogstashSecretsSslKey0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromNewOutputLogstashSecretsSslKey0 overwrites any union data inside the NewOutputLogstash_Secrets_Ssl_Key as the provided NewOutputLogstashSecretsSslKey0 +func (t *NewOutputLogstash_Secrets_Ssl_Key) FromNewOutputLogstashSecretsSslKey0(v NewOutputLogstashSecretsSslKey0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeNewOutputLogstashSecretsSslKey0 performs a merge with any union data inside the NewOutputLogstash_Secrets_Ssl_Key, using the provided NewOutputLogstashSecretsSslKey0 +func (t *NewOutputLogstash_Secrets_Ssl_Key) MergeNewOutputLogstashSecretsSslKey0(v NewOutputLogstashSecretsSslKey0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsNewOutputLogstashSecretsSslKey1 returns the union data inside the NewOutputLogstash_Secrets_Ssl_Key as a NewOutputLogstashSecretsSslKey1 +func (t NewOutputLogstash_Secrets_Ssl_Key) AsNewOutputLogstashSecretsSslKey1() (NewOutputLogstashSecretsSslKey1, error) { + var body NewOutputLogstashSecretsSslKey1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromNewOutputLogstashSecretsSslKey1 overwrites any union data inside the NewOutputLogstash_Secrets_Ssl_Key as the provided NewOutputLogstashSecretsSslKey1 +func (t *NewOutputLogstash_Secrets_Ssl_Key) FromNewOutputLogstashSecretsSslKey1(v NewOutputLogstashSecretsSslKey1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeNewOutputLogstashSecretsSslKey1 performs a merge with any union data inside the NewOutputLogstash_Secrets_Ssl_Key, using the provided NewOutputLogstashSecretsSslKey1 +func (t *NewOutputLogstash_Secrets_Ssl_Key) MergeNewOutputLogstashSecretsSslKey1(v NewOutputLogstashSecretsSslKey1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t NewOutputLogstash_Secrets_Ssl_Key) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *NewOutputLogstash_Secrets_Ssl_Key) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsNewOutputRemoteElasticsearchSecretsServiceToken0 returns the union data inside the NewOutputRemoteElasticsearch_Secrets_ServiceToken as a NewOutputRemoteElasticsearchSecretsServiceToken0 +func (t NewOutputRemoteElasticsearch_Secrets_ServiceToken) AsNewOutputRemoteElasticsearchSecretsServiceToken0() (NewOutputRemoteElasticsearchSecretsServiceToken0, error) { + var body NewOutputRemoteElasticsearchSecretsServiceToken0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromNewOutputRemoteElasticsearchSecretsServiceToken0 overwrites any union data inside the NewOutputRemoteElasticsearch_Secrets_ServiceToken as the provided NewOutputRemoteElasticsearchSecretsServiceToken0 +func (t *NewOutputRemoteElasticsearch_Secrets_ServiceToken) FromNewOutputRemoteElasticsearchSecretsServiceToken0(v NewOutputRemoteElasticsearchSecretsServiceToken0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeNewOutputRemoteElasticsearchSecretsServiceToken0 performs a merge with any union data inside the NewOutputRemoteElasticsearch_Secrets_ServiceToken, using the provided NewOutputRemoteElasticsearchSecretsServiceToken0 +func (t *NewOutputRemoteElasticsearch_Secrets_ServiceToken) MergeNewOutputRemoteElasticsearchSecretsServiceToken0(v NewOutputRemoteElasticsearchSecretsServiceToken0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsNewOutputRemoteElasticsearchSecretsServiceToken1 returns the union data inside the NewOutputRemoteElasticsearch_Secrets_ServiceToken as a NewOutputRemoteElasticsearchSecretsServiceToken1 +func (t NewOutputRemoteElasticsearch_Secrets_ServiceToken) AsNewOutputRemoteElasticsearchSecretsServiceToken1() (NewOutputRemoteElasticsearchSecretsServiceToken1, error) { + var body NewOutputRemoteElasticsearchSecretsServiceToken1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromNewOutputRemoteElasticsearchSecretsServiceToken1 overwrites any union data inside the NewOutputRemoteElasticsearch_Secrets_ServiceToken as the provided NewOutputRemoteElasticsearchSecretsServiceToken1 +func (t *NewOutputRemoteElasticsearch_Secrets_ServiceToken) FromNewOutputRemoteElasticsearchSecretsServiceToken1(v NewOutputRemoteElasticsearchSecretsServiceToken1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeNewOutputRemoteElasticsearchSecretsServiceToken1 performs a merge with any union data inside the NewOutputRemoteElasticsearch_Secrets_ServiceToken, using the provided NewOutputRemoteElasticsearchSecretsServiceToken1 +func (t *NewOutputRemoteElasticsearch_Secrets_ServiceToken) MergeNewOutputRemoteElasticsearchSecretsServiceToken1(v NewOutputRemoteElasticsearchSecretsServiceToken1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t NewOutputRemoteElasticsearch_Secrets_ServiceToken) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *NewOutputRemoteElasticsearch_Secrets_ServiceToken) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsNewOutputElasticsearch returns the union data inside the NewOutputUnion as a NewOutputElasticsearch +func (t NewOutputUnion) AsNewOutputElasticsearch() (NewOutputElasticsearch, error) { + var body NewOutputElasticsearch + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromNewOutputElasticsearch overwrites any union data inside the NewOutputUnion as the provided NewOutputElasticsearch +func (t *NewOutputUnion) FromNewOutputElasticsearch(v NewOutputElasticsearch) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeNewOutputElasticsearch performs a merge with any union data inside the NewOutputUnion, using the provided NewOutputElasticsearch +func (t *NewOutputUnion) MergeNewOutputElasticsearch(v NewOutputElasticsearch) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsNewOutputRemoteElasticsearch returns the union data inside the NewOutputUnion as a NewOutputRemoteElasticsearch +func (t NewOutputUnion) AsNewOutputRemoteElasticsearch() (NewOutputRemoteElasticsearch, error) { + var body NewOutputRemoteElasticsearch + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromNewOutputRemoteElasticsearch overwrites any union data inside the NewOutputUnion as the provided NewOutputRemoteElasticsearch +func (t *NewOutputUnion) FromNewOutputRemoteElasticsearch(v NewOutputRemoteElasticsearch) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeNewOutputRemoteElasticsearch performs a merge with any union data inside the NewOutputUnion, using the provided NewOutputRemoteElasticsearch +func (t *NewOutputUnion) MergeNewOutputRemoteElasticsearch(v NewOutputRemoteElasticsearch) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsNewOutputLogstash returns the union data inside the NewOutputUnion as a NewOutputLogstash +func (t NewOutputUnion) AsNewOutputLogstash() (NewOutputLogstash, error) { + var body NewOutputLogstash + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromNewOutputLogstash overwrites any union data inside the NewOutputUnion as the provided NewOutputLogstash +func (t *NewOutputUnion) FromNewOutputLogstash(v NewOutputLogstash) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeNewOutputLogstash performs a merge with any union data inside the NewOutputUnion, using the provided NewOutputLogstash +func (t *NewOutputUnion) MergeNewOutputLogstash(v NewOutputLogstash) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsNewOutputKafka returns the union data inside the NewOutputUnion as a NewOutputKafka +func (t NewOutputUnion) AsNewOutputKafka() (NewOutputKafka, error) { + var body NewOutputKafka + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromNewOutputKafka overwrites any union data inside the NewOutputUnion as the provided NewOutputKafka +func (t *NewOutputUnion) FromNewOutputKafka(v NewOutputKafka) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeNewOutputKafka performs a merge with any union data inside the NewOutputUnion, using the provided NewOutputKafka +func (t *NewOutputUnion) MergeNewOutputKafka(v NewOutputKafka) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t NewOutputUnion) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *NewOutputUnion) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsOutputKafkaSecretsPassword0 returns the union data inside the OutputKafka_Secrets_Password as a OutputKafkaSecretsPassword0 +func (t OutputKafka_Secrets_Password) AsOutputKafkaSecretsPassword0() (OutputKafkaSecretsPassword0, error) { + var body OutputKafkaSecretsPassword0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromOutputKafkaSecretsPassword0 overwrites any union data inside the OutputKafka_Secrets_Password as the provided OutputKafkaSecretsPassword0 +func (t *OutputKafka_Secrets_Password) FromOutputKafkaSecretsPassword0(v OutputKafkaSecretsPassword0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeOutputKafkaSecretsPassword0 performs a merge with any union data inside the OutputKafka_Secrets_Password, using the provided OutputKafkaSecretsPassword0 +func (t *OutputKafka_Secrets_Password) MergeOutputKafkaSecretsPassword0(v OutputKafkaSecretsPassword0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsOutputKafkaSecretsPassword1 returns the union data inside the OutputKafka_Secrets_Password as a OutputKafkaSecretsPassword1 +func (t OutputKafka_Secrets_Password) AsOutputKafkaSecretsPassword1() (OutputKafkaSecretsPassword1, error) { + var body OutputKafkaSecretsPassword1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromOutputKafkaSecretsPassword1 overwrites any union data inside the OutputKafka_Secrets_Password as the provided OutputKafkaSecretsPassword1 +func (t *OutputKafka_Secrets_Password) FromOutputKafkaSecretsPassword1(v OutputKafkaSecretsPassword1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeOutputKafkaSecretsPassword1 performs a merge with any union data inside the OutputKafka_Secrets_Password, using the provided OutputKafkaSecretsPassword1 +func (t *OutputKafka_Secrets_Password) MergeOutputKafkaSecretsPassword1(v OutputKafkaSecretsPassword1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t OutputKafka_Secrets_Password) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *OutputKafka_Secrets_Password) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsOutputKafkaSecretsSslKey0 returns the union data inside the OutputKafka_Secrets_Ssl_Key as a OutputKafkaSecretsSslKey0 +func (t OutputKafka_Secrets_Ssl_Key) AsOutputKafkaSecretsSslKey0() (OutputKafkaSecretsSslKey0, error) { + var body OutputKafkaSecretsSslKey0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromOutputKafkaSecretsSslKey0 overwrites any union data inside the OutputKafka_Secrets_Ssl_Key as the provided OutputKafkaSecretsSslKey0 +func (t *OutputKafka_Secrets_Ssl_Key) FromOutputKafkaSecretsSslKey0(v OutputKafkaSecretsSslKey0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeOutputKafkaSecretsSslKey0 performs a merge with any union data inside the OutputKafka_Secrets_Ssl_Key, using the provided OutputKafkaSecretsSslKey0 +func (t *OutputKafka_Secrets_Ssl_Key) MergeOutputKafkaSecretsSslKey0(v OutputKafkaSecretsSslKey0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsOutputKafkaSecretsSslKey1 returns the union data inside the OutputKafka_Secrets_Ssl_Key as a OutputKafkaSecretsSslKey1 +func (t OutputKafka_Secrets_Ssl_Key) AsOutputKafkaSecretsSslKey1() (OutputKafkaSecretsSslKey1, error) { + var body OutputKafkaSecretsSslKey1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromOutputKafkaSecretsSslKey1 overwrites any union data inside the OutputKafka_Secrets_Ssl_Key as the provided OutputKafkaSecretsSslKey1 +func (t *OutputKafka_Secrets_Ssl_Key) FromOutputKafkaSecretsSslKey1(v OutputKafkaSecretsSslKey1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeOutputKafkaSecretsSslKey1 performs a merge with any union data inside the OutputKafka_Secrets_Ssl_Key, using the provided OutputKafkaSecretsSslKey1 +func (t *OutputKafka_Secrets_Ssl_Key) MergeOutputKafkaSecretsSslKey1(v OutputKafkaSecretsSslKey1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t OutputKafka_Secrets_Ssl_Key) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *OutputKafka_Secrets_Ssl_Key) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsOutputLogstashSecretsSslKey0 returns the union data inside the OutputLogstash_Secrets_Ssl_Key as a OutputLogstashSecretsSslKey0 +func (t OutputLogstash_Secrets_Ssl_Key) AsOutputLogstashSecretsSslKey0() (OutputLogstashSecretsSslKey0, error) { + var body OutputLogstashSecretsSslKey0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromOutputLogstashSecretsSslKey0 overwrites any union data inside the OutputLogstash_Secrets_Ssl_Key as the provided OutputLogstashSecretsSslKey0 +func (t *OutputLogstash_Secrets_Ssl_Key) FromOutputLogstashSecretsSslKey0(v OutputLogstashSecretsSslKey0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeOutputLogstashSecretsSslKey0 performs a merge with any union data inside the OutputLogstash_Secrets_Ssl_Key, using the provided OutputLogstashSecretsSslKey0 +func (t *OutputLogstash_Secrets_Ssl_Key) MergeOutputLogstashSecretsSslKey0(v OutputLogstashSecretsSslKey0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsOutputLogstashSecretsSslKey1 returns the union data inside the OutputLogstash_Secrets_Ssl_Key as a OutputLogstashSecretsSslKey1 +func (t OutputLogstash_Secrets_Ssl_Key) AsOutputLogstashSecretsSslKey1() (OutputLogstashSecretsSslKey1, error) { + var body OutputLogstashSecretsSslKey1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromOutputLogstashSecretsSslKey1 overwrites any union data inside the OutputLogstash_Secrets_Ssl_Key as the provided OutputLogstashSecretsSslKey1 +func (t *OutputLogstash_Secrets_Ssl_Key) FromOutputLogstashSecretsSslKey1(v OutputLogstashSecretsSslKey1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeOutputLogstashSecretsSslKey1 performs a merge with any union data inside the OutputLogstash_Secrets_Ssl_Key, using the provided OutputLogstashSecretsSslKey1 +func (t *OutputLogstash_Secrets_Ssl_Key) MergeOutputLogstashSecretsSslKey1(v OutputLogstashSecretsSslKey1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t OutputLogstash_Secrets_Ssl_Key) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *OutputLogstash_Secrets_Ssl_Key) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsOutputRemoteElasticsearchSecretsServiceToken0 returns the union data inside the OutputRemoteElasticsearch_Secrets_ServiceToken as a OutputRemoteElasticsearchSecretsServiceToken0 +func (t OutputRemoteElasticsearch_Secrets_ServiceToken) AsOutputRemoteElasticsearchSecretsServiceToken0() (OutputRemoteElasticsearchSecretsServiceToken0, error) { + var body OutputRemoteElasticsearchSecretsServiceToken0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromOutputRemoteElasticsearchSecretsServiceToken0 overwrites any union data inside the OutputRemoteElasticsearch_Secrets_ServiceToken as the provided OutputRemoteElasticsearchSecretsServiceToken0 +func (t *OutputRemoteElasticsearch_Secrets_ServiceToken) FromOutputRemoteElasticsearchSecretsServiceToken0(v OutputRemoteElasticsearchSecretsServiceToken0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeOutputRemoteElasticsearchSecretsServiceToken0 performs a merge with any union data inside the OutputRemoteElasticsearch_Secrets_ServiceToken, using the provided OutputRemoteElasticsearchSecretsServiceToken0 +func (t *OutputRemoteElasticsearch_Secrets_ServiceToken) MergeOutputRemoteElasticsearchSecretsServiceToken0(v OutputRemoteElasticsearchSecretsServiceToken0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsOutputRemoteElasticsearchSecretsServiceToken1 returns the union data inside the OutputRemoteElasticsearch_Secrets_ServiceToken as a OutputRemoteElasticsearchSecretsServiceToken1 +func (t OutputRemoteElasticsearch_Secrets_ServiceToken) AsOutputRemoteElasticsearchSecretsServiceToken1() (OutputRemoteElasticsearchSecretsServiceToken1, error) { + var body OutputRemoteElasticsearchSecretsServiceToken1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromOutputRemoteElasticsearchSecretsServiceToken1 overwrites any union data inside the OutputRemoteElasticsearch_Secrets_ServiceToken as the provided OutputRemoteElasticsearchSecretsServiceToken1 +func (t *OutputRemoteElasticsearch_Secrets_ServiceToken) FromOutputRemoteElasticsearchSecretsServiceToken1(v OutputRemoteElasticsearchSecretsServiceToken1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeOutputRemoteElasticsearchSecretsServiceToken1 performs a merge with any union data inside the OutputRemoteElasticsearch_Secrets_ServiceToken, using the provided OutputRemoteElasticsearchSecretsServiceToken1 +func (t *OutputRemoteElasticsearch_Secrets_ServiceToken) MergeOutputRemoteElasticsearchSecretsServiceToken1(v OutputRemoteElasticsearchSecretsServiceToken1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t OutputRemoteElasticsearch_Secrets_ServiceToken) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *OutputRemoteElasticsearch_Secrets_ServiceToken) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsOutputElasticsearch returns the union data inside the OutputUnion as a OutputElasticsearch +func (t OutputUnion) AsOutputElasticsearch() (OutputElasticsearch, error) { + var body OutputElasticsearch + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromOutputElasticsearch overwrites any union data inside the OutputUnion as the provided OutputElasticsearch +func (t *OutputUnion) FromOutputElasticsearch(v OutputElasticsearch) error { + v.Type = "elasticsearch" + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeOutputElasticsearch performs a merge with any union data inside the OutputUnion, using the provided OutputElasticsearch +func (t *OutputUnion) MergeOutputElasticsearch(v OutputElasticsearch) error { + v.Type = "elasticsearch" + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsOutputRemoteElasticsearch returns the union data inside the OutputUnion as a OutputRemoteElasticsearch +func (t OutputUnion) AsOutputRemoteElasticsearch() (OutputRemoteElasticsearch, error) { + var body OutputRemoteElasticsearch + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromOutputRemoteElasticsearch overwrites any union data inside the OutputUnion as the provided OutputRemoteElasticsearch +func (t *OutputUnion) FromOutputRemoteElasticsearch(v OutputRemoteElasticsearch) error { + v.Type = "remote_elasticsearch" + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeOutputRemoteElasticsearch performs a merge with any union data inside the OutputUnion, using the provided OutputRemoteElasticsearch +func (t *OutputUnion) MergeOutputRemoteElasticsearch(v OutputRemoteElasticsearch) error { + v.Type = "remote_elasticsearch" + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsOutputLogstash returns the union data inside the OutputUnion as a OutputLogstash +func (t OutputUnion) AsOutputLogstash() (OutputLogstash, error) { + var body OutputLogstash + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromOutputLogstash overwrites any union data inside the OutputUnion as the provided OutputLogstash +func (t *OutputUnion) FromOutputLogstash(v OutputLogstash) error { + v.Type = "logstash" + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeOutputLogstash performs a merge with any union data inside the OutputUnion, using the provided OutputLogstash +func (t *OutputUnion) MergeOutputLogstash(v OutputLogstash) error { + v.Type = "logstash" + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsOutputKafka returns the union data inside the OutputUnion as a OutputKafka +func (t OutputUnion) AsOutputKafka() (OutputKafka, error) { + var body OutputKafka + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromOutputKafka overwrites any union data inside the OutputUnion as the provided OutputKafka +func (t *OutputUnion) FromOutputKafka(v OutputKafka) error { + v.Type = "kafka" + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeOutputKafka performs a merge with any union data inside the OutputUnion, using the provided OutputKafka +func (t *OutputUnion) MergeOutputKafka(v OutputKafka) error { + v.Type = "kafka" + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t OutputUnion) Discriminator() (string, error) { + var discriminator struct { + Discriminator string `json:"type"` + } + err := json.Unmarshal(t.union, &discriminator) + return discriminator.Discriminator, err +} + +func (t OutputUnion) ValueByDiscriminator() (interface{}, error) { + discriminator, err := t.Discriminator() + if err != nil { + return nil, err + } + switch discriminator { + case "elasticsearch": + return t.AsOutputElasticsearch() + case "kafka": + return t.AsOutputKafka() + case "logstash": + return t.AsOutputLogstash() + case "remote_elasticsearch": + return t.AsOutputRemoteElasticsearch() + default: + return nil, errors.New("unknown discriminator value: " + discriminator) + } +} + +func (t OutputUnion) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *OutputUnion) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsUpdateOutputKafkaSecretsPassword0 returns the union data inside the UpdateOutputKafka_Secrets_Password as a UpdateOutputKafkaSecretsPassword0 +func (t UpdateOutputKafka_Secrets_Password) AsUpdateOutputKafkaSecretsPassword0() (UpdateOutputKafkaSecretsPassword0, error) { + var body UpdateOutputKafkaSecretsPassword0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromUpdateOutputKafkaSecretsPassword0 overwrites any union data inside the UpdateOutputKafka_Secrets_Password as the provided UpdateOutputKafkaSecretsPassword0 +func (t *UpdateOutputKafka_Secrets_Password) FromUpdateOutputKafkaSecretsPassword0(v UpdateOutputKafkaSecretsPassword0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeUpdateOutputKafkaSecretsPassword0 performs a merge with any union data inside the UpdateOutputKafka_Secrets_Password, using the provided UpdateOutputKafkaSecretsPassword0 +func (t *UpdateOutputKafka_Secrets_Password) MergeUpdateOutputKafkaSecretsPassword0(v UpdateOutputKafkaSecretsPassword0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsUpdateOutputKafkaSecretsPassword1 returns the union data inside the UpdateOutputKafka_Secrets_Password as a UpdateOutputKafkaSecretsPassword1 +func (t UpdateOutputKafka_Secrets_Password) AsUpdateOutputKafkaSecretsPassword1() (UpdateOutputKafkaSecretsPassword1, error) { + var body UpdateOutputKafkaSecretsPassword1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromUpdateOutputKafkaSecretsPassword1 overwrites any union data inside the UpdateOutputKafka_Secrets_Password as the provided UpdateOutputKafkaSecretsPassword1 +func (t *UpdateOutputKafka_Secrets_Password) FromUpdateOutputKafkaSecretsPassword1(v UpdateOutputKafkaSecretsPassword1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeUpdateOutputKafkaSecretsPassword1 performs a merge with any union data inside the UpdateOutputKafka_Secrets_Password, using the provided UpdateOutputKafkaSecretsPassword1 +func (t *UpdateOutputKafka_Secrets_Password) MergeUpdateOutputKafkaSecretsPassword1(v UpdateOutputKafkaSecretsPassword1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t UpdateOutputKafka_Secrets_Password) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *UpdateOutputKafka_Secrets_Password) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsUpdateOutputKafkaSecretsSslKey0 returns the union data inside the UpdateOutputKafka_Secrets_Ssl_Key as a UpdateOutputKafkaSecretsSslKey0 +func (t UpdateOutputKafka_Secrets_Ssl_Key) AsUpdateOutputKafkaSecretsSslKey0() (UpdateOutputKafkaSecretsSslKey0, error) { + var body UpdateOutputKafkaSecretsSslKey0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromUpdateOutputKafkaSecretsSslKey0 overwrites any union data inside the UpdateOutputKafka_Secrets_Ssl_Key as the provided UpdateOutputKafkaSecretsSslKey0 +func (t *UpdateOutputKafka_Secrets_Ssl_Key) FromUpdateOutputKafkaSecretsSslKey0(v UpdateOutputKafkaSecretsSslKey0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeUpdateOutputKafkaSecretsSslKey0 performs a merge with any union data inside the UpdateOutputKafka_Secrets_Ssl_Key, using the provided UpdateOutputKafkaSecretsSslKey0 +func (t *UpdateOutputKafka_Secrets_Ssl_Key) MergeUpdateOutputKafkaSecretsSslKey0(v UpdateOutputKafkaSecretsSslKey0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsUpdateOutputKafkaSecretsSslKey1 returns the union data inside the UpdateOutputKafka_Secrets_Ssl_Key as a UpdateOutputKafkaSecretsSslKey1 +func (t UpdateOutputKafka_Secrets_Ssl_Key) AsUpdateOutputKafkaSecretsSslKey1() (UpdateOutputKafkaSecretsSslKey1, error) { + var body UpdateOutputKafkaSecretsSslKey1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromUpdateOutputKafkaSecretsSslKey1 overwrites any union data inside the UpdateOutputKafka_Secrets_Ssl_Key as the provided UpdateOutputKafkaSecretsSslKey1 +func (t *UpdateOutputKafka_Secrets_Ssl_Key) FromUpdateOutputKafkaSecretsSslKey1(v UpdateOutputKafkaSecretsSslKey1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeUpdateOutputKafkaSecretsSslKey1 performs a merge with any union data inside the UpdateOutputKafka_Secrets_Ssl_Key, using the provided UpdateOutputKafkaSecretsSslKey1 +func (t *UpdateOutputKafka_Secrets_Ssl_Key) MergeUpdateOutputKafkaSecretsSslKey1(v UpdateOutputKafkaSecretsSslKey1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t UpdateOutputKafka_Secrets_Ssl_Key) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *UpdateOutputKafka_Secrets_Ssl_Key) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsUpdateOutputLogstashSecretsSslKey0 returns the union data inside the UpdateOutputLogstash_Secrets_Ssl_Key as a UpdateOutputLogstashSecretsSslKey0 +func (t UpdateOutputLogstash_Secrets_Ssl_Key) AsUpdateOutputLogstashSecretsSslKey0() (UpdateOutputLogstashSecretsSslKey0, error) { + var body UpdateOutputLogstashSecretsSslKey0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromUpdateOutputLogstashSecretsSslKey0 overwrites any union data inside the UpdateOutputLogstash_Secrets_Ssl_Key as the provided UpdateOutputLogstashSecretsSslKey0 +func (t *UpdateOutputLogstash_Secrets_Ssl_Key) FromUpdateOutputLogstashSecretsSslKey0(v UpdateOutputLogstashSecretsSslKey0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeUpdateOutputLogstashSecretsSslKey0 performs a merge with any union data inside the UpdateOutputLogstash_Secrets_Ssl_Key, using the provided UpdateOutputLogstashSecretsSslKey0 +func (t *UpdateOutputLogstash_Secrets_Ssl_Key) MergeUpdateOutputLogstashSecretsSslKey0(v UpdateOutputLogstashSecretsSslKey0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsUpdateOutputLogstashSecretsSslKey1 returns the union data inside the UpdateOutputLogstash_Secrets_Ssl_Key as a UpdateOutputLogstashSecretsSslKey1 +func (t UpdateOutputLogstash_Secrets_Ssl_Key) AsUpdateOutputLogstashSecretsSslKey1() (UpdateOutputLogstashSecretsSslKey1, error) { + var body UpdateOutputLogstashSecretsSslKey1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromUpdateOutputLogstashSecretsSslKey1 overwrites any union data inside the UpdateOutputLogstash_Secrets_Ssl_Key as the provided UpdateOutputLogstashSecretsSslKey1 +func (t *UpdateOutputLogstash_Secrets_Ssl_Key) FromUpdateOutputLogstashSecretsSslKey1(v UpdateOutputLogstashSecretsSslKey1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeUpdateOutputLogstashSecretsSslKey1 performs a merge with any union data inside the UpdateOutputLogstash_Secrets_Ssl_Key, using the provided UpdateOutputLogstashSecretsSslKey1 +func (t *UpdateOutputLogstash_Secrets_Ssl_Key) MergeUpdateOutputLogstashSecretsSslKey1(v UpdateOutputLogstashSecretsSslKey1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t UpdateOutputLogstash_Secrets_Ssl_Key) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *UpdateOutputLogstash_Secrets_Ssl_Key) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsUpdateOutputRemoteElasticsearchSecretsServiceToken0 returns the union data inside the UpdateOutputRemoteElasticsearch_Secrets_ServiceToken as a UpdateOutputRemoteElasticsearchSecretsServiceToken0 +func (t UpdateOutputRemoteElasticsearch_Secrets_ServiceToken) AsUpdateOutputRemoteElasticsearchSecretsServiceToken0() (UpdateOutputRemoteElasticsearchSecretsServiceToken0, error) { + var body UpdateOutputRemoteElasticsearchSecretsServiceToken0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromUpdateOutputRemoteElasticsearchSecretsServiceToken0 overwrites any union data inside the UpdateOutputRemoteElasticsearch_Secrets_ServiceToken as the provided UpdateOutputRemoteElasticsearchSecretsServiceToken0 +func (t *UpdateOutputRemoteElasticsearch_Secrets_ServiceToken) FromUpdateOutputRemoteElasticsearchSecretsServiceToken0(v UpdateOutputRemoteElasticsearchSecretsServiceToken0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeUpdateOutputRemoteElasticsearchSecretsServiceToken0 performs a merge with any union data inside the UpdateOutputRemoteElasticsearch_Secrets_ServiceToken, using the provided UpdateOutputRemoteElasticsearchSecretsServiceToken0 +func (t *UpdateOutputRemoteElasticsearch_Secrets_ServiceToken) MergeUpdateOutputRemoteElasticsearchSecretsServiceToken0(v UpdateOutputRemoteElasticsearchSecretsServiceToken0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsUpdateOutputRemoteElasticsearchSecretsServiceToken1 returns the union data inside the UpdateOutputRemoteElasticsearch_Secrets_ServiceToken as a UpdateOutputRemoteElasticsearchSecretsServiceToken1 +func (t UpdateOutputRemoteElasticsearch_Secrets_ServiceToken) AsUpdateOutputRemoteElasticsearchSecretsServiceToken1() (UpdateOutputRemoteElasticsearchSecretsServiceToken1, error) { + var body UpdateOutputRemoteElasticsearchSecretsServiceToken1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromUpdateOutputRemoteElasticsearchSecretsServiceToken1 overwrites any union data inside the UpdateOutputRemoteElasticsearch_Secrets_ServiceToken as the provided UpdateOutputRemoteElasticsearchSecretsServiceToken1 +func (t *UpdateOutputRemoteElasticsearch_Secrets_ServiceToken) FromUpdateOutputRemoteElasticsearchSecretsServiceToken1(v UpdateOutputRemoteElasticsearchSecretsServiceToken1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeUpdateOutputRemoteElasticsearchSecretsServiceToken1 performs a merge with any union data inside the UpdateOutputRemoteElasticsearch_Secrets_ServiceToken, using the provided UpdateOutputRemoteElasticsearchSecretsServiceToken1 +func (t *UpdateOutputRemoteElasticsearch_Secrets_ServiceToken) MergeUpdateOutputRemoteElasticsearchSecretsServiceToken1(v UpdateOutputRemoteElasticsearchSecretsServiceToken1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t UpdateOutputRemoteElasticsearch_Secrets_ServiceToken) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *UpdateOutputRemoteElasticsearch_Secrets_ServiceToken) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsUpdateOutputElasticsearch returns the union data inside the UpdateOutputUnion as a UpdateOutputElasticsearch +func (t UpdateOutputUnion) AsUpdateOutputElasticsearch() (UpdateOutputElasticsearch, error) { + var body UpdateOutputElasticsearch + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromUpdateOutputElasticsearch overwrites any union data inside the UpdateOutputUnion as the provided UpdateOutputElasticsearch +func (t *UpdateOutputUnion) FromUpdateOutputElasticsearch(v UpdateOutputElasticsearch) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeUpdateOutputElasticsearch performs a merge with any union data inside the UpdateOutputUnion, using the provided UpdateOutputElasticsearch +func (t *UpdateOutputUnion) MergeUpdateOutputElasticsearch(v UpdateOutputElasticsearch) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsUpdateOutputRemoteElasticsearch returns the union data inside the UpdateOutputUnion as a UpdateOutputRemoteElasticsearch +func (t UpdateOutputUnion) AsUpdateOutputRemoteElasticsearch() (UpdateOutputRemoteElasticsearch, error) { + var body UpdateOutputRemoteElasticsearch + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromUpdateOutputRemoteElasticsearch overwrites any union data inside the UpdateOutputUnion as the provided UpdateOutputRemoteElasticsearch +func (t *UpdateOutputUnion) FromUpdateOutputRemoteElasticsearch(v UpdateOutputRemoteElasticsearch) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeUpdateOutputRemoteElasticsearch performs a merge with any union data inside the UpdateOutputUnion, using the provided UpdateOutputRemoteElasticsearch +func (t *UpdateOutputUnion) MergeUpdateOutputRemoteElasticsearch(v UpdateOutputRemoteElasticsearch) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsUpdateOutputLogstash returns the union data inside the UpdateOutputUnion as a UpdateOutputLogstash +func (t UpdateOutputUnion) AsUpdateOutputLogstash() (UpdateOutputLogstash, error) { + var body UpdateOutputLogstash + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromUpdateOutputLogstash overwrites any union data inside the UpdateOutputUnion as the provided UpdateOutputLogstash +func (t *UpdateOutputUnion) FromUpdateOutputLogstash(v UpdateOutputLogstash) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeUpdateOutputLogstash performs a merge with any union data inside the UpdateOutputUnion, using the provided UpdateOutputLogstash +func (t *UpdateOutputUnion) MergeUpdateOutputLogstash(v UpdateOutputLogstash) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsUpdateOutputKafka returns the union data inside the UpdateOutputUnion as a UpdateOutputKafka +func (t UpdateOutputUnion) AsUpdateOutputKafka() (UpdateOutputKafka, error) { + var body UpdateOutputKafka + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromUpdateOutputKafka overwrites any union data inside the UpdateOutputUnion as the provided UpdateOutputKafka +func (t *UpdateOutputUnion) FromUpdateOutputKafka(v UpdateOutputKafka) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeUpdateOutputKafka performs a merge with any union data inside the UpdateOutputUnion, using the provided UpdateOutputKafka +func (t *UpdateOutputUnion) MergeUpdateOutputKafka(v UpdateOutputKafka) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t UpdateOutputUnion) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *UpdateOutputUnion) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// RequestEditorFn is the function signature for the RequestEditor callback function +type RequestEditorFn func(ctx context.Context, req *http.Request) error + +// Doer performs HTTP requests. +// +// The standard http.Client implements this interface. +type HttpRequestDoer interface { + Do(req *http.Request) (*http.Response, error) +} + +// Client which conforms to the OpenAPI3 specification for this service. +type Client struct { + // The endpoint of the server conforming to this interface, with scheme, + // https://api.deepmap.com for example. This can contain a path relative + // to the server, such as https://api.deepmap.com/dev-test, and all the + // paths in the swagger spec will be appended to the server. + Server string + + // Doer for performing requests, typically a *http.Client with any + // customized settings, such as certificate chains. + Client HttpRequestDoer + + // A list of callbacks for modifying requests which are generated before sending over + // the network. + RequestEditors []RequestEditorFn +} + +// ClientOption allows setting custom parameters during construction +type ClientOption func(*Client) error + +// Creates a new Client, with reasonable defaults +func NewClient(server string, opts ...ClientOption) (*Client, error) { + // create a client with sane default values + client := Client{ + Server: server, + } + // mutate client and add all optional params + for _, o := range opts { + if err := o(&client); err != nil { + return nil, err + } + } + // ensure the server URL always has a trailing slash + if !strings.HasSuffix(client.Server, "/") { + client.Server += "/" + } + // create httpClient, if not already present + if client.Client == nil { + client.Client = &http.Client{} + } + return &client, nil +} + +// WithHTTPClient allows overriding the default Doer, which is +// automatically created using http.Client. This is useful for tests. +func WithHTTPClient(doer HttpRequestDoer) ClientOption { + return func(c *Client) error { + c.Client = doer + return nil + } +} + +// WithRequestEditorFn allows setting up a callback function, which will be +// called right before sending the request. This can be used to mutate the request. +func WithRequestEditorFn(fn RequestEditorFn) ClientOption { + return func(c *Client) error { + c.RequestEditors = append(c.RequestEditors, fn) + return nil + } +} + +// The interface specification for the client above. +type ClientInterface interface { + // GetDataViews request + GetDataViews(ctx context.Context, spaceId SpaceId, reqEditors ...RequestEditorFn) (*http.Response, error) + + // CreateDataViewWithBody request with any body + CreateDataViewWithBody(ctx context.Context, spaceId SpaceId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + CreateDataView(ctx context.Context, spaceId SpaceId, body CreateDataViewJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeleteDataView request + DeleteDataView(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetDataView request + GetDataView(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, reqEditors ...RequestEditorFn) (*http.Response, error) + + // UpdateDataViewWithBody request with any body + UpdateDataViewWithBody(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + UpdateDataView(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, body UpdateDataViewJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetAgentPolicies request + GetAgentPolicies(ctx context.Context, params *GetAgentPoliciesParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // CreateAgentPolicyWithBody request with any body + CreateAgentPolicyWithBody(ctx context.Context, params *CreateAgentPolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + CreateAgentPolicy(ctx context.Context, params *CreateAgentPolicyParams, body CreateAgentPolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeleteAgentPolicyWithBody request with any body + DeleteAgentPolicyWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + DeleteAgentPolicy(ctx context.Context, body DeleteAgentPolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetAgentPolicy request + GetAgentPolicy(ctx context.Context, agentPolicyId string, params *GetAgentPolicyParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // UpdateAgentPolicyWithBody request with any body + UpdateAgentPolicyWithBody(ctx context.Context, agentPolicyId string, params *UpdateAgentPolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + UpdateAgentPolicy(ctx context.Context, agentPolicyId string, params *UpdateAgentPolicyParams, body UpdateAgentPolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetEnrollmentApiKeys request + GetEnrollmentApiKeys(ctx context.Context, params *GetEnrollmentApiKeysParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ListPackages request + ListPackages(ctx context.Context, params *ListPackagesParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // InstallPackageByUploadWithBody request with any body + InstallPackageByUploadWithBody(ctx context.Context, params *InstallPackageByUploadParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeletePackageWithBody request with any body + DeletePackageWithBody(ctx context.Context, pkgName string, pkgVersion string, params *DeletePackageParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + DeletePackage(ctx context.Context, pkgName string, pkgVersion string, params *DeletePackageParams, body DeletePackageJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetPackage request + GetPackage(ctx context.Context, pkgName string, pkgVersion string, params *GetPackageParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // InstallPackageWithBody request with any body + InstallPackageWithBody(ctx context.Context, pkgName string, pkgVersion string, params *InstallPackageParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + InstallPackage(ctx context.Context, pkgName string, pkgVersion string, params *InstallPackageParams, body InstallPackageJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetFleetServerHosts request + GetFleetServerHosts(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + + // CreateFleetServerHostWithBody request with any body + CreateFleetServerHostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + CreateFleetServerHost(ctx context.Context, body CreateFleetServerHostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeleteFleetServerHost request + DeleteFleetServerHost(ctx context.Context, itemId string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetFleetServerHost request + GetFleetServerHost(ctx context.Context, itemId string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // UpdateFleetServerHostWithBody request with any body + UpdateFleetServerHostWithBody(ctx context.Context, itemId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + UpdateFleetServerHost(ctx context.Context, itemId string, body UpdateFleetServerHostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetOutputs request + GetOutputs(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + + // CreateOutputWithBody request with any body + CreateOutputWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + CreateOutput(ctx context.Context, body CreateOutputJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeleteOutput request + DeleteOutput(ctx context.Context, outputId string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetOutput request + GetOutput(ctx context.Context, outputId string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // UpdateOutputWithBody request with any body + UpdateOutputWithBody(ctx context.Context, outputId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + UpdateOutput(ctx context.Context, outputId string, body UpdateOutputJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetPackagePolicies request + GetPackagePolicies(ctx context.Context, params *GetPackagePoliciesParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // CreatePackagePolicyWithBody request with any body + CreatePackagePolicyWithBody(ctx context.Context, params *CreatePackagePolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + CreatePackagePolicy(ctx context.Context, params *CreatePackagePolicyParams, body CreatePackagePolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeletePackagePolicy request + DeletePackagePolicy(ctx context.Context, packagePolicyId string, params *DeletePackagePolicyParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetPackagePolicy request + GetPackagePolicy(ctx context.Context, packagePolicyId string, params *GetPackagePolicyParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // UpdatePackagePolicyWithBody request with any body + UpdatePackagePolicyWithBody(ctx context.Context, packagePolicyId string, params *UpdatePackagePolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + UpdatePackagePolicy(ctx context.Context, packagePolicyId string, params *UpdatePackagePolicyParams, body UpdatePackagePolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) +} + +func (c *Client) GetAgentPolicies(ctx context.Context, params *GetAgentPoliciesParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetAgentPoliciesRequest(c.Server, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) CreateAgentPolicyWithBody(ctx context.Context, params *CreateAgentPolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateAgentPolicyRequestWithBody(c.Server, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) CreateAgentPolicy(ctx context.Context, params *CreateAgentPolicyParams, body CreateAgentPolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateAgentPolicyRequest(c.Server, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) DeleteAgentPolicyWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteAgentPolicyRequestWithBody(c.Server, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) DeleteAgentPolicy(ctx context.Context, body DeleteAgentPolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteAgentPolicyRequest(c.Server, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) GetAgentPolicy(ctx context.Context, agentPolicyId string, params *GetAgentPolicyParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetAgentPolicyRequest(c.Server, agentPolicyId, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) UpdateAgentPolicyWithBody(ctx context.Context, agentPolicyId string, params *UpdateAgentPolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateAgentPolicyRequestWithBody(c.Server, agentPolicyId, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) UpdateAgentPolicy(ctx context.Context, agentPolicyId string, params *UpdateAgentPolicyParams, body UpdateAgentPolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateAgentPolicyRequest(c.Server, agentPolicyId, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) GetEnrollmentApiKeys(ctx context.Context, params *GetEnrollmentApiKeysParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetEnrollmentApiKeysRequest(c.Server, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) ListPackages(ctx context.Context, params *ListPackagesParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewListPackagesRequest(c.Server, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) InstallPackageByUploadWithBody(ctx context.Context, params *InstallPackageByUploadParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewInstallPackageByUploadRequestWithBody(c.Server, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) DeletePackageWithBody(ctx context.Context, pkgName string, pkgVersion string, params *DeletePackageParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeletePackageRequestWithBody(c.Server, pkgName, pkgVersion, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) DeletePackage(ctx context.Context, pkgName string, pkgVersion string, params *DeletePackageParams, body DeletePackageJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeletePackageRequest(c.Server, pkgName, pkgVersion, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) GetPackage(ctx context.Context, pkgName string, pkgVersion string, params *GetPackageParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetPackageRequest(c.Server, pkgName, pkgVersion, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) InstallPackageWithBody(ctx context.Context, pkgName string, pkgVersion string, params *InstallPackageParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewInstallPackageRequestWithBody(c.Server, pkgName, pkgVersion, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) InstallPackage(ctx context.Context, pkgName string, pkgVersion string, params *InstallPackageParams, body InstallPackageJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewInstallPackageRequest(c.Server, pkgName, pkgVersion, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) GetFleetServerHosts(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetFleetServerHostsRequest(c.Server) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) CreateFleetServerHostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateFleetServerHostRequestWithBody(c.Server, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) CreateFleetServerHost(ctx context.Context, body CreateFleetServerHostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateFleetServerHostRequest(c.Server, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) DeleteFleetServerHost(ctx context.Context, itemId string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteFleetServerHostRequest(c.Server, itemId) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) GetFleetServerHost(ctx context.Context, itemId string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetFleetServerHostRequest(c.Server, itemId) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) UpdateFleetServerHostWithBody(ctx context.Context, itemId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateFleetServerHostRequestWithBody(c.Server, itemId, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) UpdateFleetServerHost(ctx context.Context, itemId string, body UpdateFleetServerHostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateFleetServerHostRequest(c.Server, itemId, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) GetOutputs(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetOutputsRequest(c.Server) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) CreateOutputWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateOutputRequestWithBody(c.Server, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) CreateOutput(ctx context.Context, body CreateOutputJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateOutputRequest(c.Server, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) DeleteOutput(ctx context.Context, outputId string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteOutputRequest(c.Server, outputId) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) GetOutput(ctx context.Context, outputId string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetOutputRequest(c.Server, outputId) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) UpdateOutputWithBody(ctx context.Context, outputId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateOutputRequestWithBody(c.Server, outputId, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) UpdateOutput(ctx context.Context, outputId string, body UpdateOutputJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateOutputRequest(c.Server, outputId, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) GetPackagePolicies(ctx context.Context, params *GetPackagePoliciesParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetPackagePoliciesRequest(c.Server, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) CreatePackagePolicyWithBody(ctx context.Context, params *CreatePackagePolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreatePackagePolicyRequestWithBody(c.Server, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) CreatePackagePolicy(ctx context.Context, params *CreatePackagePolicyParams, body CreatePackagePolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreatePackagePolicyRequest(c.Server, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) DeletePackagePolicy(ctx context.Context, packagePolicyId string, params *DeletePackagePolicyParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeletePackagePolicyRequest(c.Server, packagePolicyId, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) GetPackagePolicy(ctx context.Context, packagePolicyId string, params *GetPackagePolicyParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetPackagePolicyRequest(c.Server, packagePolicyId, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) UpdatePackagePolicyWithBody(ctx context.Context, packagePolicyId string, params *UpdatePackagePolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdatePackagePolicyRequestWithBody(c.Server, packagePolicyId, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) UpdatePackagePolicy(ctx context.Context, packagePolicyId string, params *UpdatePackagePolicyParams, body UpdatePackagePolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdatePackagePolicyRequest(c.Server, packagePolicyId, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// NewGetAgentPoliciesRequest generates requests for GetAgentPolicies +func NewGetAgentPoliciesRequest(server string, params *GetAgentPoliciesParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/fleet/agent_policies") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.Page != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "page", runtime.ParamLocationQuery, *params.Page); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.PerPage != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "perPage", runtime.ParamLocationQuery, *params.PerPage); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.SortField != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "sortField", runtime.ParamLocationQuery, *params.SortField); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.SortOrder != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "sortOrder", runtime.ParamLocationQuery, *params.SortOrder); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.ShowUpgradeable != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "showUpgradeable", runtime.ParamLocationQuery, *params.ShowUpgradeable); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Kuery != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "kuery", runtime.ParamLocationQuery, *params.Kuery); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.NoAgentCount != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "noAgentCount", runtime.ParamLocationQuery, *params.NoAgentCount); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.WithAgentCount != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "withAgentCount", runtime.ParamLocationQuery, *params.WithAgentCount); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Full != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "full", runtime.ParamLocationQuery, *params.Full); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Format != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "format", runtime.ParamLocationQuery, *params.Format); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewCreateAgentPolicyRequest calls the generic CreateAgentPolicy builder with application/json body +func NewCreateAgentPolicyRequest(server string, params *CreateAgentPolicyParams, body CreateAgentPolicyJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewCreateAgentPolicyRequestWithBody(server, params, "application/json", bodyReader) +} + +// NewCreateAgentPolicyRequestWithBody generates requests for CreateAgentPolicy with any type of body +func NewCreateAgentPolicyRequestWithBody(server string, params *CreateAgentPolicyParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/fleet/agent_policies") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.SysMonitoring != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "sys_monitoring", runtime.ParamLocationQuery, *params.SysMonitoring); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewDeleteAgentPolicyRequest calls the generic DeleteAgentPolicy builder with application/json body +func NewDeleteAgentPolicyRequest(server string, body DeleteAgentPolicyJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewDeleteAgentPolicyRequestWithBody(server, "application/json", bodyReader) +} + +// NewDeleteAgentPolicyRequestWithBody generates requests for DeleteAgentPolicy with any type of body +func NewDeleteAgentPolicyRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/fleet/agent_policies/delete") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewGetAgentPolicyRequest generates requests for GetAgentPolicy +func NewGetAgentPolicyRequest(server string, agentPolicyId string, params *GetAgentPolicyParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "agentPolicyId", runtime.ParamLocationPath, agentPolicyId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/fleet/agent_policies/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.Format != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "format", runtime.ParamLocationQuery, *params.Format); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewUpdateAgentPolicyRequest calls the generic UpdateAgentPolicy builder with application/json body +func NewUpdateAgentPolicyRequest(server string, agentPolicyId string, params *UpdateAgentPolicyParams, body UpdateAgentPolicyJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewUpdateAgentPolicyRequestWithBody(server, agentPolicyId, params, "application/json", bodyReader) +} + +// NewUpdateAgentPolicyRequestWithBody generates requests for UpdateAgentPolicy with any type of body +func NewUpdateAgentPolicyRequestWithBody(server string, agentPolicyId string, params *UpdateAgentPolicyParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "agentPolicyId", runtime.ParamLocationPath, agentPolicyId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/fleet/agent_policies/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.Format != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "format", runtime.ParamLocationQuery, *params.Format); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("PUT", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewGetEnrollmentApiKeysRequest generates requests for GetEnrollmentApiKeys +func NewGetEnrollmentApiKeysRequest(server string, params *GetEnrollmentApiKeysParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/fleet/enrollment_api_keys") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.Page != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "page", runtime.ParamLocationQuery, *params.Page); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.PerPage != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "perPage", runtime.ParamLocationQuery, *params.PerPage); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Kuery != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "kuery", runtime.ParamLocationQuery, *params.Kuery); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewListPackagesRequest generates requests for ListPackages +func NewListPackagesRequest(server string, params *ListPackagesParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/fleet/epm/packages") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.Category != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "category", runtime.ParamLocationQuery, *params.Category); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Prerelease != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "prerelease", runtime.ParamLocationQuery, *params.Prerelease); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Experimental != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "experimental", runtime.ParamLocationQuery, *params.Experimental); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.ExcludeInstallStatus != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "excludeInstallStatus", runtime.ParamLocationQuery, *params.ExcludeInstallStatus); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewInstallPackageByUploadRequestWithBody generates requests for InstallPackageByUpload with any type of body +func NewInstallPackageByUploadRequestWithBody(server string, params *InstallPackageByUploadParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/fleet/epm/packages") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.IgnoreMappingUpdateErrors != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "ignoreMappingUpdateErrors", runtime.ParamLocationQuery, *params.IgnoreMappingUpdateErrors); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.SkipDataStreamRollover != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "skipDataStreamRollover", runtime.ParamLocationQuery, *params.SkipDataStreamRollover); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewDeletePackageRequest calls the generic DeletePackage builder with application/json body +func NewDeletePackageRequest(server string, pkgName string, pkgVersion string, params *DeletePackageParams, body DeletePackageJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewDeletePackageRequestWithBody(server, pkgName, pkgVersion, params, "application/json", bodyReader) +} + +// NewDeletePackageRequestWithBody generates requests for DeletePackage with any type of body +func NewDeletePackageRequestWithBody(server string, pkgName string, pkgVersion string, params *DeletePackageParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "pkgName", runtime.ParamLocationPath, pkgName) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "pkgVersion", runtime.ParamLocationPath, pkgVersion) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/fleet/epm/packages/%s/%s", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.Force != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "force", runtime.ParamLocationQuery, *params.Force); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("DELETE", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewGetPackageRequest generates requests for GetPackage +func NewGetPackageRequest(server string, pkgName string, pkgVersion string, params *GetPackageParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "pkgName", runtime.ParamLocationPath, pkgName) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "pkgVersion", runtime.ParamLocationPath, pkgVersion) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/fleet/epm/packages/%s/%s", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.IgnoreUnverified != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "ignoreUnverified", runtime.ParamLocationQuery, *params.IgnoreUnverified); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Prerelease != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "prerelease", runtime.ParamLocationQuery, *params.Prerelease); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Full != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "full", runtime.ParamLocationQuery, *params.Full); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.WithMetadata != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "withMetadata", runtime.ParamLocationQuery, *params.WithMetadata); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewInstallPackageRequest calls the generic InstallPackage builder with application/json body +func NewInstallPackageRequest(server string, pkgName string, pkgVersion string, params *InstallPackageParams, body InstallPackageJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewInstallPackageRequestWithBody(server, pkgName, pkgVersion, params, "application/json", bodyReader) +} + +// NewInstallPackageRequestWithBody generates requests for InstallPackage with any type of body +func NewInstallPackageRequestWithBody(server string, pkgName string, pkgVersion string, params *InstallPackageParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "pkgName", runtime.ParamLocationPath, pkgName) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "pkgVersion", runtime.ParamLocationPath, pkgVersion) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/fleet/epm/packages/%s/%s", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.Prerelease != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "prerelease", runtime.ParamLocationQuery, *params.Prerelease); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.IgnoreMappingUpdateErrors != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "ignoreMappingUpdateErrors", runtime.ParamLocationQuery, *params.IgnoreMappingUpdateErrors); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.SkipDataStreamRollover != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "skipDataStreamRollover", runtime.ParamLocationQuery, *params.SkipDataStreamRollover); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewGetFleetServerHostsRequest generates requests for GetFleetServerHosts +func NewGetFleetServerHostsRequest(server string) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/fleet/fleet_server_hosts") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewCreateFleetServerHostRequest calls the generic CreateFleetServerHost builder with application/json body +func NewCreateFleetServerHostRequest(server string, body CreateFleetServerHostJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewCreateFleetServerHostRequestWithBody(server, "application/json", bodyReader) +} + +// NewCreateFleetServerHostRequestWithBody generates requests for CreateFleetServerHost with any type of body +func NewCreateFleetServerHostRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/fleet/fleet_server_hosts") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewDeleteFleetServerHostRequest generates requests for DeleteFleetServerHost +func NewDeleteFleetServerHostRequest(server string, itemId string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "itemId", runtime.ParamLocationPath, itemId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/fleet/fleet_server_hosts/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetFleetServerHostRequest generates requests for GetFleetServerHost +func NewGetFleetServerHostRequest(server string, itemId string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "itemId", runtime.ParamLocationPath, itemId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/fleet/fleet_server_hosts/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewUpdateFleetServerHostRequest calls the generic UpdateFleetServerHost builder with application/json body +func NewUpdateFleetServerHostRequest(server string, itemId string, body UpdateFleetServerHostJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewUpdateFleetServerHostRequestWithBody(server, itemId, "application/json", bodyReader) +} + +// NewUpdateFleetServerHostRequestWithBody generates requests for UpdateFleetServerHost with any type of body +func NewUpdateFleetServerHostRequestWithBody(server string, itemId string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "itemId", runtime.ParamLocationPath, itemId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/fleet/fleet_server_hosts/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("PUT", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewGetOutputsRequest generates requests for GetOutputs +func NewGetOutputsRequest(server string) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/fleet/outputs") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewCreateOutputRequest calls the generic CreateOutput builder with application/json body +func NewCreateOutputRequest(server string, body CreateOutputJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewCreateOutputRequestWithBody(server, "application/json", bodyReader) +} + +// NewCreateOutputRequestWithBody generates requests for CreateOutput with any type of body +func NewCreateOutputRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/fleet/outputs") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewDeleteOutputRequest generates requests for DeleteOutput +func NewDeleteOutputRequest(server string, outputId string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "outputId", runtime.ParamLocationPath, outputId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/fleet/outputs/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetOutputRequest generates requests for GetOutput +func NewGetOutputRequest(server string, outputId string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "outputId", runtime.ParamLocationPath, outputId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/fleet/outputs/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewUpdateOutputRequest calls the generic UpdateOutput builder with application/json body +func NewUpdateOutputRequest(server string, outputId string, body UpdateOutputJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewUpdateOutputRequestWithBody(server, outputId, "application/json", bodyReader) +} + +// NewUpdateOutputRequestWithBody generates requests for UpdateOutput with any type of body +func NewUpdateOutputRequestWithBody(server string, outputId string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "outputId", runtime.ParamLocationPath, outputId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/fleet/outputs/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("PUT", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewGetPackagePoliciesRequest generates requests for GetPackagePolicies +func NewGetPackagePoliciesRequest(server string, params *GetPackagePoliciesParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/fleet/package_policies") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.Page != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "page", runtime.ParamLocationQuery, *params.Page); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.PerPage != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "perPage", runtime.ParamLocationQuery, *params.PerPage); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.SortField != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "sortField", runtime.ParamLocationQuery, *params.SortField); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.SortOrder != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "sortOrder", runtime.ParamLocationQuery, *params.SortOrder); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.ShowUpgradeable != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "showUpgradeable", runtime.ParamLocationQuery, *params.ShowUpgradeable); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Kuery != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "kuery", runtime.ParamLocationQuery, *params.Kuery); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Format != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "format", runtime.ParamLocationQuery, *params.Format); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.WithAgentCount != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "withAgentCount", runtime.ParamLocationQuery, *params.WithAgentCount); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewCreatePackagePolicyRequest calls the generic CreatePackagePolicy builder with application/json body +func NewCreatePackagePolicyRequest(server string, params *CreatePackagePolicyParams, body CreatePackagePolicyJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewCreatePackagePolicyRequestWithBody(server, params, "application/json", bodyReader) +} + +// NewCreatePackagePolicyRequestWithBody generates requests for CreatePackagePolicy with any type of body +func NewCreatePackagePolicyRequestWithBody(server string, params *CreatePackagePolicyParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/fleet/package_policies") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.Format != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "format", runtime.ParamLocationQuery, *params.Format); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewDeletePackagePolicyRequest generates requests for DeletePackagePolicy +func NewDeletePackagePolicyRequest(server string, packagePolicyId string, params *DeletePackagePolicyParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "packagePolicyId", runtime.ParamLocationPath, packagePolicyId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/fleet/package_policies/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.Force != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "force", runtime.ParamLocationQuery, *params.Force); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("DELETE", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetPackagePolicyRequest generates requests for GetPackagePolicy +func NewGetPackagePolicyRequest(server string, packagePolicyId string, params *GetPackagePolicyParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "packagePolicyId", runtime.ParamLocationPath, packagePolicyId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/fleet/package_policies/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.Format != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "format", runtime.ParamLocationQuery, *params.Format); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewUpdatePackagePolicyRequest calls the generic UpdatePackagePolicy builder with application/json body +func NewUpdatePackagePolicyRequest(server string, packagePolicyId string, params *UpdatePackagePolicyParams, body UpdatePackagePolicyJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewUpdatePackagePolicyRequestWithBody(server, packagePolicyId, params, "application/json", bodyReader) +} + +// NewUpdatePackagePolicyRequestWithBody generates requests for UpdatePackagePolicy with any type of body +func NewUpdatePackagePolicyRequestWithBody(server string, packagePolicyId string, params *UpdatePackagePolicyParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "packagePolicyId", runtime.ParamLocationPath, packagePolicyId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/fleet/package_policies/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.Format != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "format", runtime.ParamLocationQuery, *params.Format); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("PUT", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// ClientWithResponsesInterface is the interface specification for the client with responses above. +type ClientWithResponsesInterface interface { + // GetDataViewsWithResponse request + GetDataViewsWithResponse(ctx context.Context, spaceId SpaceId, reqEditors ...RequestEditorFn) (*GetDataViewsResponse, error) + + // CreateDataViewWithBodyWithResponse request with any body + CreateDataViewWithBodyWithResponse(ctx context.Context, spaceId SpaceId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateDataViewResponse, error) + + CreateDataViewWithResponse(ctx context.Context, spaceId SpaceId, body CreateDataViewJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateDataViewResponse, error) + + // DeleteDataViewWithResponse request + DeleteDataViewWithResponse(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, reqEditors ...RequestEditorFn) (*DeleteDataViewResponse, error) + + // GetDataViewWithResponse request + GetDataViewWithResponse(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, reqEditors ...RequestEditorFn) (*GetDataViewResponse, error) + + // UpdateDataViewWithBodyWithResponse request with any body + UpdateDataViewWithBodyWithResponse(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateDataViewResponse, error) + + UpdateDataViewWithResponse(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, body UpdateDataViewJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateDataViewResponse, error) + + // GetAgentPoliciesWithResponse request + GetAgentPoliciesWithResponse(ctx context.Context, params *GetAgentPoliciesParams, reqEditors ...RequestEditorFn) (*GetAgentPoliciesResponse, error) + + // CreateAgentPolicyWithBodyWithResponse request with any body + CreateAgentPolicyWithBodyWithResponse(ctx context.Context, params *CreateAgentPolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateAgentPolicyResponse, error) + + CreateAgentPolicyWithResponse(ctx context.Context, params *CreateAgentPolicyParams, body CreateAgentPolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateAgentPolicyResponse, error) + + // DeleteAgentPolicyWithBodyWithResponse request with any body + DeleteAgentPolicyWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DeleteAgentPolicyResponse, error) + + DeleteAgentPolicyWithResponse(ctx context.Context, body DeleteAgentPolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*DeleteAgentPolicyResponse, error) + + // GetAgentPolicyWithResponse request + GetAgentPolicyWithResponse(ctx context.Context, agentPolicyId string, params *GetAgentPolicyParams, reqEditors ...RequestEditorFn) (*GetAgentPolicyResponse, error) + + // UpdateAgentPolicyWithBodyWithResponse request with any body + UpdateAgentPolicyWithBodyWithResponse(ctx context.Context, agentPolicyId string, params *UpdateAgentPolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateAgentPolicyResponse, error) + + UpdateAgentPolicyWithResponse(ctx context.Context, agentPolicyId string, params *UpdateAgentPolicyParams, body UpdateAgentPolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateAgentPolicyResponse, error) + + // GetEnrollmentApiKeysWithResponse request + GetEnrollmentApiKeysWithResponse(ctx context.Context, params *GetEnrollmentApiKeysParams, reqEditors ...RequestEditorFn) (*GetEnrollmentApiKeysResponse, error) + + // ListPackagesWithResponse request + ListPackagesWithResponse(ctx context.Context, params *ListPackagesParams, reqEditors ...RequestEditorFn) (*ListPackagesResponse, error) + + // InstallPackageByUploadWithBodyWithResponse request with any body + InstallPackageByUploadWithBodyWithResponse(ctx context.Context, params *InstallPackageByUploadParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*InstallPackageByUploadResponse, error) + + // DeletePackageWithBodyWithResponse request with any body + DeletePackageWithBodyWithResponse(ctx context.Context, pkgName string, pkgVersion string, params *DeletePackageParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DeletePackageResponse, error) + + DeletePackageWithResponse(ctx context.Context, pkgName string, pkgVersion string, params *DeletePackageParams, body DeletePackageJSONRequestBody, reqEditors ...RequestEditorFn) (*DeletePackageResponse, error) + + // GetPackageWithResponse request + GetPackageWithResponse(ctx context.Context, pkgName string, pkgVersion string, params *GetPackageParams, reqEditors ...RequestEditorFn) (*GetPackageResponse, error) + + // InstallPackageWithBodyWithResponse request with any body + InstallPackageWithBodyWithResponse(ctx context.Context, pkgName string, pkgVersion string, params *InstallPackageParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*InstallPackageResponse, error) + + InstallPackageWithResponse(ctx context.Context, pkgName string, pkgVersion string, params *InstallPackageParams, body InstallPackageJSONRequestBody, reqEditors ...RequestEditorFn) (*InstallPackageResponse, error) + + // GetFleetServerHostsWithResponse request + GetFleetServerHostsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetFleetServerHostsResponse, error) + + // CreateFleetServerHostWithBodyWithResponse request with any body + CreateFleetServerHostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateFleetServerHostResponse, error) + + CreateFleetServerHostWithResponse(ctx context.Context, body CreateFleetServerHostJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateFleetServerHostResponse, error) + + // DeleteFleetServerHostWithResponse request + DeleteFleetServerHostWithResponse(ctx context.Context, itemId string, reqEditors ...RequestEditorFn) (*DeleteFleetServerHostResponse, error) + + // GetFleetServerHostWithResponse request + GetFleetServerHostWithResponse(ctx context.Context, itemId string, reqEditors ...RequestEditorFn) (*GetFleetServerHostResponse, error) + + // UpdateFleetServerHostWithBodyWithResponse request with any body + UpdateFleetServerHostWithBodyWithResponse(ctx context.Context, itemId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateFleetServerHostResponse, error) + + UpdateFleetServerHostWithResponse(ctx context.Context, itemId string, body UpdateFleetServerHostJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateFleetServerHostResponse, error) + + // GetOutputsWithResponse request + GetOutputsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetOutputsResponse, error) + + // CreateOutputWithBodyWithResponse request with any body + CreateOutputWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateOutputResponse, error) + + CreateOutputWithResponse(ctx context.Context, body CreateOutputJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateOutputResponse, error) + + // DeleteOutputWithResponse request + DeleteOutputWithResponse(ctx context.Context, outputId string, reqEditors ...RequestEditorFn) (*DeleteOutputResponse, error) + + // GetOutputWithResponse request + GetOutputWithResponse(ctx context.Context, outputId string, reqEditors ...RequestEditorFn) (*GetOutputResponse, error) + + // UpdateOutputWithBodyWithResponse request with any body + UpdateOutputWithBodyWithResponse(ctx context.Context, outputId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateOutputResponse, error) + + UpdateOutputWithResponse(ctx context.Context, outputId string, body UpdateOutputJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateOutputResponse, error) + + // GetPackagePoliciesWithResponse request + GetPackagePoliciesWithResponse(ctx context.Context, params *GetPackagePoliciesParams, reqEditors ...RequestEditorFn) (*GetPackagePoliciesResponse, error) + + // CreatePackagePolicyWithBodyWithResponse request with any body + CreatePackagePolicyWithBodyWithResponse(ctx context.Context, params *CreatePackagePolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreatePackagePolicyResponse, error) + + CreatePackagePolicyWithResponse(ctx context.Context, params *CreatePackagePolicyParams, body CreatePackagePolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*CreatePackagePolicyResponse, error) + + // DeletePackagePolicyWithResponse request + DeletePackagePolicyWithResponse(ctx context.Context, packagePolicyId string, params *DeletePackagePolicyParams, reqEditors ...RequestEditorFn) (*DeletePackagePolicyResponse, error) + + // GetPackagePolicyWithResponse request + GetPackagePolicyWithResponse(ctx context.Context, packagePolicyId string, params *GetPackagePolicyParams, reqEditors ...RequestEditorFn) (*GetPackagePolicyResponse, error) + + // UpdatePackagePolicyWithBodyWithResponse request with any body + UpdatePackagePolicyWithBodyWithResponse(ctx context.Context, packagePolicyId string, params *UpdatePackagePolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdatePackagePolicyResponse, error) + + UpdatePackagePolicyWithResponse(ctx context.Context, packagePolicyId string, params *UpdatePackagePolicyParams, body UpdatePackagePolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdatePackagePolicyResponse, error) +} + +type GetAgentPoliciesResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + Items []AgentPolicy `json:"items"` + Page float32 `json:"page"` + PerPage float32 `json:"perPage"` + Total float32 `json:"total"` + } + JSON400 *struct { + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` + } +} + +// Status returns HTTPResponse.Status +func (r GetAgentPoliciesResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetAgentPoliciesResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type CreateAgentPolicyResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + Item AgentPolicy `json:"item"` + } + JSON400 *struct { + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` + } +} + +// Status returns HTTPResponse.Status +func (r CreateAgentPolicyResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r CreateAgentPolicyResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type DeleteAgentPolicyResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + Id string `json:"id"` + Name string `json:"name"` + } + JSON400 *struct { + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` + } +} + +// Status returns HTTPResponse.Status +func (r DeleteAgentPolicyResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteAgentPolicyResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetAgentPolicyResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + Item AgentPolicy `json:"item"` + } + JSON400 *struct { + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` + } +} + +// Status returns HTTPResponse.Status +func (r GetAgentPolicyResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetAgentPolicyResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type UpdateAgentPolicyResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + Item AgentPolicy `json:"item"` + } + JSON400 *struct { + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` + } +} + +// Status returns HTTPResponse.Status +func (r UpdateAgentPolicyResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r UpdateAgentPolicyResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetEnrollmentApiKeysResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + Items []EnrollmentApiKey `json:"items"` + // Deprecated: + List []struct { + // Active When false, the enrollment API key is revoked and cannot be used for enrolling Elastic Agents. + Active bool `json:"active"` + + // ApiKey The enrollment API key (token) used for enrolling Elastic Agents. + ApiKey string `json:"api_key"` + + // ApiKeyId The ID of the API key in the Security API. + ApiKeyId string `json:"api_key_id"` + CreatedAt string `json:"created_at"` + Id string `json:"id"` + + // Name The name of the enrollment API key. + Name *string `json:"name,omitempty"` + + // PolicyId The ID of the agent policy the Elastic Agent will be enrolled in. + PolicyId *string `json:"policy_id,omitempty"` + } `json:"list"` + Page float32 `json:"page"` + PerPage float32 `json:"perPage"` + Total float32 `json:"total"` + } + JSON400 *struct { + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` + } +} + +// Status returns HTTPResponse.Status +func (r GetEnrollmentApiKeysResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetEnrollmentApiKeysResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type ListPackagesResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + Items []PackageListItem `json:"items"` + Response *[]ListPackages_200_Response_Item `json:"response,omitempty"` + } + JSON400 *struct { + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` + } +} +type ListPackages_200_Response_Conditions_Elastic struct { + Capabilities *[]string `json:"capabilities,omitempty"` + Subscription *string `json:"subscription,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` +} +type ListPackages_200_Response_Conditions_Kibana struct { + Version *string `json:"version,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` +} +type ListPackages_200_Response_Conditions struct { + Elastic *ListPackages_200_Response_Conditions_Elastic `json:"elastic,omitempty"` + Kibana *ListPackages_200_Response_Conditions_Kibana `json:"kibana,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` +} +type ListPackages_200_Response_Discovery_Fields_Item struct { + Name string `json:"name"` + AdditionalProperties map[string]interface{} `json:"-"` +} +type ListPackages_200_Response_Discovery struct { + Fields *[]ListPackages_200_Response_Discovery_Fields_Item `json:"fields,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` +} +type ListPackages_200_Response_Icons_Item struct { + DarkMode *bool `json:"dark_mode,omitempty"` + Path *string `json:"path,omitempty"` + Size *string `json:"size,omitempty"` + Src string `json:"src"` + Title *string `json:"title,omitempty"` + Type *string `json:"type,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` +} +type ListPackages200ResponseInstallationInfoAdditionalSpacesInstalledKibanaType string +type ListPackages_200_Response_InstallationInfo_AdditionalSpacesInstalledKibana_Item struct { + Id string `json:"id"` + OriginId *string `json:"originId,omitempty"` + Type ListPackages200ResponseInstallationInfoAdditionalSpacesInstalledKibanaType `json:"type"` + AdditionalProperties map[string]interface{} `json:"-"` +} +type ListPackages_200_Response_InstallationInfo_ExperimentalDataStreamFeatures_Features struct { + DocValueOnlyNumeric *bool `json:"doc_value_only_numeric,omitempty"` + DocValueOnlyOther *bool `json:"doc_value_only_other,omitempty"` + SyntheticSource *bool `json:"synthetic_source,omitempty"` + Tsdb *bool `json:"tsdb,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` +} +type ListPackages_200_Response_InstallationInfo_ExperimentalDataStreamFeatures_Item struct { + DataStream string `json:"data_stream"` + Features ListPackages_200_Response_InstallationInfo_ExperimentalDataStreamFeatures_Features `json:"features"` + AdditionalProperties map[string]interface{} `json:"-"` +} +type ListPackages200ResponseInstallationInfoInstallSource string +type ListPackages200ResponseInstallationInfoInstallStatus string +type ListPackages200ResponseInstallationInfoInstalledEsType string +type ListPackages_200_Response_InstallationInfo_InstalledEs_Item struct { + Deferred *bool `json:"deferred,omitempty"` + Id string `json:"id"` + Type ListPackages200ResponseInstallationInfoInstalledEsType `json:"type"` + Version *string `json:"version,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` +} +type ListPackages200ResponseInstallationInfoInstalledKibanaType string +type ListPackages_200_Response_InstallationInfo_InstalledKibana_Item struct { + Id string `json:"id"` + OriginId *string `json:"originId,omitempty"` + Type ListPackages200ResponseInstallationInfoInstalledKibanaType `json:"type"` + AdditionalProperties map[string]interface{} `json:"-"` +} +type ListPackages_200_Response_InstallationInfo_LatestExecutedState struct { + Error *string `json:"error,omitempty"` + Name string `json:"name"` + StartedAt string `json:"started_at"` + AdditionalProperties map[string]interface{} `json:"-"` +} +type ListPackages_200_Response_InstallationInfo_LatestInstallFailedAttempts_Error struct { + Message string `json:"message"` + Name string `json:"name"` + Stack *string `json:"stack,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` +} +type ListPackages_200_Response_InstallationInfo_LatestInstallFailedAttempts_Item struct { + CreatedAt string `json:"created_at"` + Error ListPackages_200_Response_InstallationInfo_LatestInstallFailedAttempts_Error `json:"error"` + TargetVersion string `json:"target_version"` + AdditionalProperties map[string]interface{} `json:"-"` +} +type ListPackages200ResponseInstallationInfoVerificationStatus string +type ListPackages_200_Response_InstallationInfo struct { + AdditionalSpacesInstalledKibana *map[string][]ListPackages_200_Response_InstallationInfo_AdditionalSpacesInstalledKibana_Item `json:"additional_spaces_installed_kibana,omitempty"` + CreatedAt *string `json:"created_at,omitempty"` + ExperimentalDataStreamFeatures *[]ListPackages_200_Response_InstallationInfo_ExperimentalDataStreamFeatures_Item `json:"experimental_data_stream_features,omitempty"` + InstallFormatSchemaVersion *string `json:"install_format_schema_version,omitempty"` + InstallSource ListPackages200ResponseInstallationInfoInstallSource `json:"install_source"` + InstallStatus ListPackages200ResponseInstallationInfoInstallStatus `json:"install_status"` + InstalledEs []ListPackages_200_Response_InstallationInfo_InstalledEs_Item `json:"installed_es"` + InstalledKibana []ListPackages_200_Response_InstallationInfo_InstalledKibana_Item `json:"installed_kibana"` + InstalledKibanaSpaceId *string `json:"installed_kibana_space_id,omitempty"` + LatestExecutedState *ListPackages_200_Response_InstallationInfo_LatestExecutedState `json:"latest_executed_state,omitempty"` + LatestInstallFailedAttempts *[]ListPackages_200_Response_InstallationInfo_LatestInstallFailedAttempts_Item `json:"latest_install_failed_attempts,omitempty"` + Name string `json:"name"` + Namespaces *[]string `json:"namespaces,omitempty"` + Type string `json:"type"` + UpdatedAt *string `json:"updated_at,omitempty"` + VerificationKeyId *string `json:"verification_key_id"` + VerificationStatus ListPackages200ResponseInstallationInfoVerificationStatus `json:"verification_status"` + Version string `json:"version"` + AdditionalProperties map[string]interface{} `json:"-"` +} +type ListPackages200ResponseOwnerType string +type ListPackages_200_Response_Owner struct { + Github *string `json:"github,omitempty"` + Type *ListPackages200ResponseOwnerType `json:"type,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` +} +type ListPackages200ResponseRelease string +type ListPackages_200_Response_Source struct { + License string `json:"license"` + AdditionalProperties map[string]interface{} `json:"-"` +} +type ListPackages200ResponseType string +type ListPackages_200_Response_Item struct { + Categories *[]string `json:"categories,omitempty"` + Conditions *ListPackages_200_Response_Conditions `json:"conditions,omitempty"` + DataStreams *[]map[string]interface{} `json:"data_streams,omitempty"` + Description *string `json:"description,omitempty"` + Discovery *ListPackages_200_Response_Discovery `json:"discovery,omitempty"` + Download *string `json:"download,omitempty"` + FormatVersion *string `json:"format_version,omitempty"` + Icons *[]ListPackages_200_Response_Icons_Item `json:"icons,omitempty"` + Id string `json:"id"` + InstallationInfo *ListPackages_200_Response_InstallationInfo `json:"installationInfo,omitempty"` + Integration *string `json:"integration,omitempty"` + Internal *bool `json:"internal,omitempty"` + LatestVersion *string `json:"latestVersion,omitempty"` + Name string `json:"name"` + Owner *ListPackages_200_Response_Owner `json:"owner,omitempty"` + Path *string `json:"path,omitempty"` + PolicyTemplates *[]map[string]interface{} `json:"policy_templates,omitempty"` + Readme *string `json:"readme,omitempty"` + Release *ListPackages200ResponseRelease `json:"release,omitempty"` + SavedObject interface{} `json:"savedObject"` + SignaturePath *string `json:"signature_path,omitempty"` + Source *ListPackages_200_Response_Source `json:"source,omitempty"` + Status *string `json:"status,omitempty"` + Title string `json:"title"` + Type *ListPackages200ResponseType `json:"type,omitempty"` + Vars *[]map[string]interface{} `json:"vars,omitempty"` + Version string `json:"version"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// Status returns HTTPResponse.Status +func (r ListPackagesResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ListPackagesResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type InstallPackageByUploadResponse struct { + Body []byte + HTTPResponse *http.Response +} + +// Status returns HTTPResponse.Status +func (r InstallPackageByUploadResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r InstallPackageByUploadResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type DeletePackageResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + Items []DeletePackage_200_Items_Item `json:"items"` + // Deprecated: + Response *[]DeletePackage_200_Response_Item `json:"response,omitempty"` + } + JSON400 *struct { + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` + } +} +type DeletePackage200Items0 struct { + Id string `json:"id"` + OriginId *string `json:"originId,omitempty"` + Type DeletePackage200Items0Type `json:"type"` +} +type DeletePackage200Items0Type string +type DeletePackage200Items1 struct { + Deferred *bool `json:"deferred,omitempty"` + Id string `json:"id"` + Type DeletePackage200Items1Type `json:"type"` + Version *string `json:"version,omitempty"` +} +type DeletePackage200Items1Type string +type DeletePackage_200_Items_Item struct { + union json.RawMessage +} +type DeletePackage200Response0 struct { + Id string `json:"id"` + OriginId *string `json:"originId,omitempty"` + Type DeletePackage200Response0Type `json:"type"` +} +type DeletePackage200Response0Type string +type DeletePackage200Response1 struct { + Deferred *bool `json:"deferred,omitempty"` + Id string `json:"id"` + Type DeletePackage200Response1Type `json:"type"` + Version *string `json:"version,omitempty"` +} +type DeletePackage200Response1Type string +type DeletePackage_200_Response_Item struct { + union json.RawMessage +} + +// Status returns HTTPResponse.Status +func (r DeletePackageResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeletePackageResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetPackageResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + Item PackageInfo `json:"item"` + Metadata *struct { + HasPolicies bool `json:"has_policies"` + } `json:"metadata,omitempty"` + // Deprecated: + Response *GetPackage_200_Response `json:"response,omitempty"` + } + JSON400 *struct { + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` + } +} +type GetPackage_200_Response_Conditions_Elastic struct { + Capabilities *[]string `json:"capabilities,omitempty"` + Subscription *string `json:"subscription,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` +} +type GetPackage_200_Response_Conditions_Kibana struct { + Version *string `json:"version,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` +} +type GetPackage_200_Response_Conditions struct { + Elastic *GetPackage_200_Response_Conditions_Elastic `json:"elastic,omitempty"` + Kibana *GetPackage_200_Response_Conditions_Kibana `json:"kibana,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` +} +type GetPackage_200_Response_Discovery_Fields_Item struct { + Name string `json:"name"` + AdditionalProperties map[string]interface{} `json:"-"` +} +type GetPackage_200_Response_Discovery struct { + Fields *[]GetPackage_200_Response_Discovery_Fields_Item `json:"fields,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` +} +type GetPackage_200_Response_Icons_Item struct { + DarkMode *bool `json:"dark_mode,omitempty"` + Path *string `json:"path,omitempty"` + Size *string `json:"size,omitempty"` + Src string `json:"src"` + Title *string `json:"title,omitempty"` + Type *string `json:"type,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` +} +type GetPackage200ResponseInstallationInfoAdditionalSpacesInstalledKibanaType string +type GetPackage_200_Response_InstallationInfo_AdditionalSpacesInstalledKibana_Item struct { + Id string `json:"id"` + OriginId *string `json:"originId,omitempty"` + Type GetPackage200ResponseInstallationInfoAdditionalSpacesInstalledKibanaType `json:"type"` + AdditionalProperties map[string]interface{} `json:"-"` +} +type GetPackage_200_Response_InstallationInfo_ExperimentalDataStreamFeatures_Features struct { + DocValueOnlyNumeric *bool `json:"doc_value_only_numeric,omitempty"` + DocValueOnlyOther *bool `json:"doc_value_only_other,omitempty"` + SyntheticSource *bool `json:"synthetic_source,omitempty"` + Tsdb *bool `json:"tsdb,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` +} +type GetPackage_200_Response_InstallationInfo_ExperimentalDataStreamFeatures_Item struct { + DataStream string `json:"data_stream"` + Features GetPackage_200_Response_InstallationInfo_ExperimentalDataStreamFeatures_Features `json:"features"` + AdditionalProperties map[string]interface{} `json:"-"` +} +type GetPackage200ResponseInstallationInfoInstallSource string +type GetPackage200ResponseInstallationInfoInstallStatus string +type GetPackage200ResponseInstallationInfoInstalledEsType string +type GetPackage_200_Response_InstallationInfo_InstalledEs_Item struct { + Deferred *bool `json:"deferred,omitempty"` + Id string `json:"id"` + Type GetPackage200ResponseInstallationInfoInstalledEsType `json:"type"` + Version *string `json:"version,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` +} +type GetPackage200ResponseInstallationInfoInstalledKibanaType string +type GetPackage_200_Response_InstallationInfo_InstalledKibana_Item struct { + Id string `json:"id"` + OriginId *string `json:"originId,omitempty"` + Type GetPackage200ResponseInstallationInfoInstalledKibanaType `json:"type"` + AdditionalProperties map[string]interface{} `json:"-"` +} +type GetPackage_200_Response_InstallationInfo_LatestExecutedState struct { + Error *string `json:"error,omitempty"` + Name string `json:"name"` + StartedAt string `json:"started_at"` + AdditionalProperties map[string]interface{} `json:"-"` +} +type GetPackage_200_Response_InstallationInfo_LatestInstallFailedAttempts_Error struct { + Message string `json:"message"` + Name string `json:"name"` + Stack *string `json:"stack,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` +} +type GetPackage_200_Response_InstallationInfo_LatestInstallFailedAttempts_Item struct { + CreatedAt string `json:"created_at"` + Error GetPackage_200_Response_InstallationInfo_LatestInstallFailedAttempts_Error `json:"error"` + TargetVersion string `json:"target_version"` + AdditionalProperties map[string]interface{} `json:"-"` +} +type GetPackage200ResponseInstallationInfoVerificationStatus string +type GetPackage_200_Response_InstallationInfo struct { + AdditionalSpacesInstalledKibana *map[string][]GetPackage_200_Response_InstallationInfo_AdditionalSpacesInstalledKibana_Item `json:"additional_spaces_installed_kibana,omitempty"` + CreatedAt *string `json:"created_at,omitempty"` + ExperimentalDataStreamFeatures *[]GetPackage_200_Response_InstallationInfo_ExperimentalDataStreamFeatures_Item `json:"experimental_data_stream_features,omitempty"` + InstallFormatSchemaVersion *string `json:"install_format_schema_version,omitempty"` + InstallSource GetPackage200ResponseInstallationInfoInstallSource `json:"install_source"` + InstallStatus GetPackage200ResponseInstallationInfoInstallStatus `json:"install_status"` + InstalledEs []GetPackage_200_Response_InstallationInfo_InstalledEs_Item `json:"installed_es"` + InstalledKibana []GetPackage_200_Response_InstallationInfo_InstalledKibana_Item `json:"installed_kibana"` + InstalledKibanaSpaceId *string `json:"installed_kibana_space_id,omitempty"` + LatestExecutedState *GetPackage_200_Response_InstallationInfo_LatestExecutedState `json:"latest_executed_state,omitempty"` + LatestInstallFailedAttempts *[]GetPackage_200_Response_InstallationInfo_LatestInstallFailedAttempts_Item `json:"latest_install_failed_attempts,omitempty"` + Name string `json:"name"` + Namespaces *[]string `json:"namespaces,omitempty"` + Type string `json:"type"` + UpdatedAt *string `json:"updated_at,omitempty"` + VerificationKeyId *string `json:"verification_key_id"` + VerificationStatus GetPackage200ResponseInstallationInfoVerificationStatus `json:"verification_status"` + Version string `json:"version"` + AdditionalProperties map[string]interface{} `json:"-"` +} +type GetPackage200ResponseOwnerType string +type GetPackage_200_Response_Owner struct { + Github *string `json:"github,omitempty"` + Type *GetPackage200ResponseOwnerType `json:"type,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` +} +type GetPackage200ResponseRelease string +type GetPackage_200_Response_Source struct { + License string `json:"license"` + AdditionalProperties map[string]interface{} `json:"-"` +} +type GetPackage200ResponseType string +type GetPackage_200_Response struct { + Agent *struct { + Privileges *struct { + Root *bool `json:"root,omitempty"` + } `json:"privileges,omitempty"` + } `json:"agent,omitempty"` + AssetTags *[]struct { + AssetIds *[]string `json:"asset_ids,omitempty"` + AssetTypes *[]string `json:"asset_types,omitempty"` + Text string `json:"text"` + } `json:"asset_tags,omitempty"` + Assets map[string]interface{} `json:"assets"` + Categories *[]string `json:"categories,omitempty"` + Conditions *GetPackage_200_Response_Conditions `json:"conditions,omitempty"` + DataStreams *[]map[string]interface{} `json:"data_streams,omitempty"` + Description *string `json:"description,omitempty"` + Discovery *GetPackage_200_Response_Discovery `json:"discovery,omitempty"` + Download *string `json:"download,omitempty"` + Elasticsearch *map[string]interface{} `json:"elasticsearch,omitempty"` + FormatVersion *string `json:"format_version,omitempty"` + Icons *[]GetPackage_200_Response_Icons_Item `json:"icons,omitempty"` + InstallationInfo *GetPackage_200_Response_InstallationInfo `json:"installationInfo,omitempty"` + Internal *bool `json:"internal,omitempty"` + KeepPoliciesUpToDate *bool `json:"keepPoliciesUpToDate,omitempty"` + LatestVersion *string `json:"latestVersion,omitempty"` + License *string `json:"license,omitempty"` + LicensePath *string `json:"licensePath,omitempty"` + Name string `json:"name"` + Notice *string `json:"notice,omitempty"` + Owner *GetPackage_200_Response_Owner `json:"owner,omitempty"` + Path *string `json:"path,omitempty"` + PolicyTemplates *[]map[string]interface{} `json:"policy_templates,omitempty"` + Readme *string `json:"readme,omitempty"` + Release *GetPackage200ResponseRelease `json:"release,omitempty"` + SavedObject interface{} `json:"savedObject"` + Screenshots *[]struct { + DarkMode *bool `json:"dark_mode,omitempty"` + Path *string `json:"path,omitempty"` + Size *string `json:"size,omitempty"` + Src string `json:"src"` + Title *string `json:"title,omitempty"` + Type *string `json:"type,omitempty"` + } `json:"screenshots,omitempty"` + SignaturePath *string `json:"signature_path,omitempty"` + Source *GetPackage_200_Response_Source `json:"source,omitempty"` + Status *string `json:"status,omitempty"` + Title string `json:"title"` + Type *GetPackage200ResponseType `json:"type,omitempty"` + Vars *[]map[string]interface{} `json:"vars,omitempty"` + Version string `json:"version"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// Status returns HTTPResponse.Status +func (r GetPackageResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetPackageResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type InstallPackageResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + Meta struct { + InstallSource string `json:"install_source"` + } `json:"_meta"` + Items []InstallPackage_200_Items_Item `json:"items"` + // Deprecated: + Response *[]InstallPackage_200_Response_Item `json:"response,omitempty"` + } + JSON400 *struct { + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` + } +} +type InstallPackage200Items0 struct { + Id string `json:"id"` + OriginId *string `json:"originId,omitempty"` + Type InstallPackage200Items0Type `json:"type"` +} +type InstallPackage200Items0Type string +type InstallPackage200Items1 struct { + Deferred *bool `json:"deferred,omitempty"` + Id string `json:"id"` + Type InstallPackage200Items1Type `json:"type"` + Version *string `json:"version,omitempty"` +} +type InstallPackage200Items1Type string +type InstallPackage_200_Items_Item struct { + union json.RawMessage +} +type InstallPackage200Response0 struct { + Id string `json:"id"` + OriginId *string `json:"originId,omitempty"` + Type InstallPackage200Response0Type `json:"type"` +} +type InstallPackage200Response0Type string +type InstallPackage200Response1 struct { + Deferred *bool `json:"deferred,omitempty"` + Id string `json:"id"` + Type InstallPackage200Response1Type `json:"type"` + Version *string `json:"version,omitempty"` +} +type InstallPackage200Response1Type string +type InstallPackage_200_Response_Item struct { + union json.RawMessage +} + +// Status returns HTTPResponse.Status +func (r InstallPackageResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r InstallPackageResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetFleetServerHostsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + Items []ServerHost `json:"items"` + Page float32 `json:"page"` + PerPage float32 `json:"perPage"` + Total float32 `json:"total"` + } + JSON400 *struct { + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` + } +} + +// Status returns HTTPResponse.Status +func (r GetFleetServerHostsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetFleetServerHostsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type CreateFleetServerHostResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + Item ServerHost `json:"item"` + } + JSON400 *struct { + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` + } +} + +// Status returns HTTPResponse.Status +func (r CreateFleetServerHostResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r CreateFleetServerHostResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type DeleteFleetServerHostResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + Id string `json:"id"` + } + JSON400 *struct { + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` + } +} + +// Status returns HTTPResponse.Status +func (r DeleteFleetServerHostResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteFleetServerHostResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetFleetServerHostResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + Item ServerHost `json:"item"` + } + JSON400 *struct { + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` + } +} + +// Status returns HTTPResponse.Status +func (r GetFleetServerHostResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetFleetServerHostResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type UpdateFleetServerHostResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + Item ServerHost `json:"item"` + } + JSON400 *struct { + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` + } +} + +// Status returns HTTPResponse.Status +func (r UpdateFleetServerHostResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r UpdateFleetServerHostResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetOutputsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + Items []OutputUnion `json:"items"` + Page float32 `json:"page"` + PerPage float32 `json:"perPage"` + Total float32 `json:"total"` + } + JSON400 *struct { + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` + } +} + +// Status returns HTTPResponse.Status +func (r GetOutputsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetOutputsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type CreateOutputResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + Item OutputUnion `json:"item"` + } + JSON400 *struct { + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` + } +} + +// Status returns HTTPResponse.Status +func (r CreateOutputResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r CreateOutputResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type DeleteOutputResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + Id string `json:"id"` + } + JSON400 *struct { + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` + } + JSON404 *struct { + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` + } +} + +// Status returns HTTPResponse.Status +func (r DeleteOutputResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteOutputResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetOutputResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + Item OutputUnion `json:"item"` + } + JSON400 *struct { + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` + } +} + +// Status returns HTTPResponse.Status +func (r GetOutputResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetOutputResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type UpdateOutputResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + Item OutputUnion `json:"item"` + } + JSON400 *struct { + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` + } +} + +// Status returns HTTPResponse.Status +func (r UpdateOutputResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r UpdateOutputResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetPackagePoliciesResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + Items []PackagePolicy `json:"items"` + Page float32 `json:"page"` + PerPage float32 `json:"perPage"` + Total float32 `json:"total"` + } + JSON400 *struct { + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` + } +} + +// Status returns HTTPResponse.Status +func (r GetPackagePoliciesResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetPackagePoliciesResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type CreatePackagePolicyResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + Item PackagePolicy `json:"item"` + } + JSON400 *struct { + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` + } + JSON409 *struct { + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` + } +} + +// Status returns HTTPResponse.Status +func (r CreatePackagePolicyResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r CreatePackagePolicyResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type DeletePackagePolicyResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + Id string `json:"id"` + } + JSON400 *struct { + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` + } +} + +// Status returns HTTPResponse.Status +func (r DeletePackagePolicyResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeletePackagePolicyResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetPackagePolicyResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + Item PackagePolicy `json:"item"` + } + JSON400 *struct { + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` + } + JSON404 *struct { + Message string `json:"message"` + } +} + +// Status returns HTTPResponse.Status +func (r GetPackagePolicyResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetPackagePolicyResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type UpdatePackagePolicyResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + Item PackagePolicy `json:"item"` + } + JSON400 *struct { + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` + } + JSON403 *struct { + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` + } +} + +// Status returns HTTPResponse.Status +func (r UpdatePackagePolicyResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r UpdatePackagePolicyResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// GetAgentPoliciesWithResponse request returning *GetAgentPoliciesResponse +func (c *ClientWithResponses) GetAgentPoliciesWithResponse(ctx context.Context, params *GetAgentPoliciesParams, reqEditors ...RequestEditorFn) (*GetAgentPoliciesResponse, error) { + rsp, err := c.GetAgentPolicies(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetAgentPoliciesResponse(rsp) +} + +// CreateAgentPolicyWithBodyWithResponse request with arbitrary body returning *CreateAgentPolicyResponse +func (c *ClientWithResponses) CreateAgentPolicyWithBodyWithResponse(ctx context.Context, params *CreateAgentPolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateAgentPolicyResponse, error) { + rsp, err := c.CreateAgentPolicyWithBody(ctx, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateAgentPolicyResponse(rsp) +} + +func (c *ClientWithResponses) CreateAgentPolicyWithResponse(ctx context.Context, params *CreateAgentPolicyParams, body CreateAgentPolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateAgentPolicyResponse, error) { + rsp, err := c.CreateAgentPolicy(ctx, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateAgentPolicyResponse(rsp) +} + +// DeleteAgentPolicyWithBodyWithResponse request with arbitrary body returning *DeleteAgentPolicyResponse +func (c *ClientWithResponses) DeleteAgentPolicyWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DeleteAgentPolicyResponse, error) { + rsp, err := c.DeleteAgentPolicyWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteAgentPolicyResponse(rsp) +} + +func (c *ClientWithResponses) DeleteAgentPolicyWithResponse(ctx context.Context, body DeleteAgentPolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*DeleteAgentPolicyResponse, error) { + rsp, err := c.DeleteAgentPolicy(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteAgentPolicyResponse(rsp) +} + +// GetAgentPolicyWithResponse request returning *GetAgentPolicyResponse +func (c *ClientWithResponses) GetAgentPolicyWithResponse(ctx context.Context, agentPolicyId string, params *GetAgentPolicyParams, reqEditors ...RequestEditorFn) (*GetAgentPolicyResponse, error) { + rsp, err := c.GetAgentPolicy(ctx, agentPolicyId, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetAgentPolicyResponse(rsp) +} + +// UpdateAgentPolicyWithBodyWithResponse request with arbitrary body returning *UpdateAgentPolicyResponse +func (c *ClientWithResponses) UpdateAgentPolicyWithBodyWithResponse(ctx context.Context, agentPolicyId string, params *UpdateAgentPolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateAgentPolicyResponse, error) { + rsp, err := c.UpdateAgentPolicyWithBody(ctx, agentPolicyId, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdateAgentPolicyResponse(rsp) +} + +func (c *ClientWithResponses) UpdateAgentPolicyWithResponse(ctx context.Context, agentPolicyId string, params *UpdateAgentPolicyParams, body UpdateAgentPolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateAgentPolicyResponse, error) { + rsp, err := c.UpdateAgentPolicy(ctx, agentPolicyId, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdateAgentPolicyResponse(rsp) +} + +// GetEnrollmentApiKeysWithResponse request returning *GetEnrollmentApiKeysResponse +func (c *ClientWithResponses) GetEnrollmentApiKeysWithResponse(ctx context.Context, params *GetEnrollmentApiKeysParams, reqEditors ...RequestEditorFn) (*GetEnrollmentApiKeysResponse, error) { + rsp, err := c.GetEnrollmentApiKeys(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetEnrollmentApiKeysResponse(rsp) +} + +// ListPackagesWithResponse request returning *ListPackagesResponse +func (c *ClientWithResponses) ListPackagesWithResponse(ctx context.Context, params *ListPackagesParams, reqEditors ...RequestEditorFn) (*ListPackagesResponse, error) { + rsp, err := c.ListPackages(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseListPackagesResponse(rsp) +} + +// InstallPackageByUploadWithBodyWithResponse request with arbitrary body returning *InstallPackageByUploadResponse +func (c *ClientWithResponses) InstallPackageByUploadWithBodyWithResponse(ctx context.Context, params *InstallPackageByUploadParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*InstallPackageByUploadResponse, error) { + rsp, err := c.InstallPackageByUploadWithBody(ctx, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseInstallPackageByUploadResponse(rsp) +} + +// DeletePackageWithBodyWithResponse request with arbitrary body returning *DeletePackageResponse +func (c *ClientWithResponses) DeletePackageWithBodyWithResponse(ctx context.Context, pkgName string, pkgVersion string, params *DeletePackageParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DeletePackageResponse, error) { + rsp, err := c.DeletePackageWithBody(ctx, pkgName, pkgVersion, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeletePackageResponse(rsp) +} + +func (c *ClientWithResponses) DeletePackageWithResponse(ctx context.Context, pkgName string, pkgVersion string, params *DeletePackageParams, body DeletePackageJSONRequestBody, reqEditors ...RequestEditorFn) (*DeletePackageResponse, error) { + rsp, err := c.DeletePackage(ctx, pkgName, pkgVersion, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeletePackageResponse(rsp) +} + +// GetPackageWithResponse request returning *GetPackageResponse +func (c *ClientWithResponses) GetPackageWithResponse(ctx context.Context, pkgName string, pkgVersion string, params *GetPackageParams, reqEditors ...RequestEditorFn) (*GetPackageResponse, error) { + rsp, err := c.GetPackage(ctx, pkgName, pkgVersion, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetPackageResponse(rsp) +} + +// InstallPackageWithBodyWithResponse request with arbitrary body returning *InstallPackageResponse +func (c *ClientWithResponses) InstallPackageWithBodyWithResponse(ctx context.Context, pkgName string, pkgVersion string, params *InstallPackageParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*InstallPackageResponse, error) { + rsp, err := c.InstallPackageWithBody(ctx, pkgName, pkgVersion, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseInstallPackageResponse(rsp) +} + +func (c *ClientWithResponses) InstallPackageWithResponse(ctx context.Context, pkgName string, pkgVersion string, params *InstallPackageParams, body InstallPackageJSONRequestBody, reqEditors ...RequestEditorFn) (*InstallPackageResponse, error) { + rsp, err := c.InstallPackage(ctx, pkgName, pkgVersion, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseInstallPackageResponse(rsp) +} + +// GetFleetServerHostsWithResponse request returning *GetFleetServerHostsResponse +func (c *ClientWithResponses) GetFleetServerHostsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetFleetServerHostsResponse, error) { + rsp, err := c.GetFleetServerHosts(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetFleetServerHostsResponse(rsp) +} + +// CreateFleetServerHostWithBodyWithResponse request with arbitrary body returning *CreateFleetServerHostResponse +func (c *ClientWithResponses) CreateFleetServerHostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateFleetServerHostResponse, error) { + rsp, err := c.CreateFleetServerHostWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateFleetServerHostResponse(rsp) +} + +func (c *ClientWithResponses) CreateFleetServerHostWithResponse(ctx context.Context, body CreateFleetServerHostJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateFleetServerHostResponse, error) { + rsp, err := c.CreateFleetServerHost(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateFleetServerHostResponse(rsp) +} + +// DeleteFleetServerHostWithResponse request returning *DeleteFleetServerHostResponse +func (c *ClientWithResponses) DeleteFleetServerHostWithResponse(ctx context.Context, itemId string, reqEditors ...RequestEditorFn) (*DeleteFleetServerHostResponse, error) { + rsp, err := c.DeleteFleetServerHost(ctx, itemId, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteFleetServerHostResponse(rsp) +} + +// GetFleetServerHostWithResponse request returning *GetFleetServerHostResponse +func (c *ClientWithResponses) GetFleetServerHostWithResponse(ctx context.Context, itemId string, reqEditors ...RequestEditorFn) (*GetFleetServerHostResponse, error) { + rsp, err := c.GetFleetServerHost(ctx, itemId, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetFleetServerHostResponse(rsp) +} + +// UpdateFleetServerHostWithBodyWithResponse request with arbitrary body returning *UpdateFleetServerHostResponse +func (c *ClientWithResponses) UpdateFleetServerHostWithBodyWithResponse(ctx context.Context, itemId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateFleetServerHostResponse, error) { + rsp, err := c.UpdateFleetServerHostWithBody(ctx, itemId, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdateFleetServerHostResponse(rsp) +} + +func (c *ClientWithResponses) UpdateFleetServerHostWithResponse(ctx context.Context, itemId string, body UpdateFleetServerHostJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateFleetServerHostResponse, error) { + rsp, err := c.UpdateFleetServerHost(ctx, itemId, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdateFleetServerHostResponse(rsp) +} + +// GetOutputsWithResponse request returning *GetOutputsResponse +func (c *ClientWithResponses) GetOutputsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetOutputsResponse, error) { + rsp, err := c.GetOutputs(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetOutputsResponse(rsp) +} + +// CreateOutputWithBodyWithResponse request with arbitrary body returning *CreateOutputResponse +func (c *ClientWithResponses) CreateOutputWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateOutputResponse, error) { + rsp, err := c.CreateOutputWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateOutputResponse(rsp) +} + +func (c *ClientWithResponses) CreateOutputWithResponse(ctx context.Context, body CreateOutputJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateOutputResponse, error) { + rsp, err := c.CreateOutput(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateOutputResponse(rsp) +} + +// DeleteOutputWithResponse request returning *DeleteOutputResponse +func (c *ClientWithResponses) DeleteOutputWithResponse(ctx context.Context, outputId string, reqEditors ...RequestEditorFn) (*DeleteOutputResponse, error) { + rsp, err := c.DeleteOutput(ctx, outputId, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteOutputResponse(rsp) +} + +// GetOutputWithResponse request returning *GetOutputResponse +func (c *ClientWithResponses) GetOutputWithResponse(ctx context.Context, outputId string, reqEditors ...RequestEditorFn) (*GetOutputResponse, error) { + rsp, err := c.GetOutput(ctx, outputId, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetOutputResponse(rsp) +} + +// UpdateOutputWithBodyWithResponse request with arbitrary body returning *UpdateOutputResponse +func (c *ClientWithResponses) UpdateOutputWithBodyWithResponse(ctx context.Context, outputId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateOutputResponse, error) { + rsp, err := c.UpdateOutputWithBody(ctx, outputId, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdateOutputResponse(rsp) +} + +func (c *ClientWithResponses) UpdateOutputWithResponse(ctx context.Context, outputId string, body UpdateOutputJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateOutputResponse, error) { + rsp, err := c.UpdateOutput(ctx, outputId, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdateOutputResponse(rsp) +} + +// GetPackagePoliciesWithResponse request returning *GetPackagePoliciesResponse +func (c *ClientWithResponses) GetPackagePoliciesWithResponse(ctx context.Context, params *GetPackagePoliciesParams, reqEditors ...RequestEditorFn) (*GetPackagePoliciesResponse, error) { + rsp, err := c.GetPackagePolicies(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetPackagePoliciesResponse(rsp) +} + +// CreatePackagePolicyWithBodyWithResponse request with arbitrary body returning *CreatePackagePolicyResponse +func (c *ClientWithResponses) CreatePackagePolicyWithBodyWithResponse(ctx context.Context, params *CreatePackagePolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreatePackagePolicyResponse, error) { + rsp, err := c.CreatePackagePolicyWithBody(ctx, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreatePackagePolicyResponse(rsp) +} + +func (c *ClientWithResponses) CreatePackagePolicyWithResponse(ctx context.Context, params *CreatePackagePolicyParams, body CreatePackagePolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*CreatePackagePolicyResponse, error) { + rsp, err := c.CreatePackagePolicy(ctx, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreatePackagePolicyResponse(rsp) +} + +// DeletePackagePolicyWithResponse request returning *DeletePackagePolicyResponse +func (c *ClientWithResponses) DeletePackagePolicyWithResponse(ctx context.Context, packagePolicyId string, params *DeletePackagePolicyParams, reqEditors ...RequestEditorFn) (*DeletePackagePolicyResponse, error) { + rsp, err := c.DeletePackagePolicy(ctx, packagePolicyId, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeletePackagePolicyResponse(rsp) +} + +// GetPackagePolicyWithResponse request returning *GetPackagePolicyResponse +func (c *ClientWithResponses) GetPackagePolicyWithResponse(ctx context.Context, packagePolicyId string, params *GetPackagePolicyParams, reqEditors ...RequestEditorFn) (*GetPackagePolicyResponse, error) { + rsp, err := c.GetPackagePolicy(ctx, packagePolicyId, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetPackagePolicyResponse(rsp) +} + +// UpdatePackagePolicyWithBodyWithResponse request with arbitrary body returning *UpdatePackagePolicyResponse +func (c *ClientWithResponses) UpdatePackagePolicyWithBodyWithResponse(ctx context.Context, packagePolicyId string, params *UpdatePackagePolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdatePackagePolicyResponse, error) { + rsp, err := c.UpdatePackagePolicyWithBody(ctx, packagePolicyId, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdatePackagePolicyResponse(rsp) +} + +func (c *ClientWithResponses) UpdatePackagePolicyWithResponse(ctx context.Context, packagePolicyId string, params *UpdatePackagePolicyParams, body UpdatePackagePolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdatePackagePolicyResponse, error) { + rsp, err := c.UpdatePackagePolicy(ctx, packagePolicyId, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdatePackagePolicyResponse(rsp) +} + +// ParseGetAgentPoliciesResponse parses an HTTP response from a GetAgentPoliciesWithResponse call +func ParseGetAgentPoliciesResponse(rsp *http.Response) (*GetAgentPoliciesResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetAgentPoliciesResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + Items []AgentPolicy `json:"items"` + Page float32 `json:"page"` + PerPage float32 `json:"perPage"` + Total float32 `json:"total"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest struct { + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + } + + return response, nil +} + +// ParseCreateAgentPolicyResponse parses an HTTP response from a CreateAgentPolicyWithResponse call +func ParseCreateAgentPolicyResponse(rsp *http.Response) (*CreateAgentPolicyResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &CreateAgentPolicyResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + Item AgentPolicy `json:"item"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest struct { + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + } + + return response, nil +} + +// ParseDeleteAgentPolicyResponse parses an HTTP response from a DeleteAgentPolicyWithResponse call +func ParseDeleteAgentPolicyResponse(rsp *http.Response) (*DeleteAgentPolicyResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &DeleteAgentPolicyResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + Id string `json:"id"` + Name string `json:"name"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest struct { + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + } + + return response, nil +} + +// ParseGetAgentPolicyResponse parses an HTTP response from a GetAgentPolicyWithResponse call +func ParseGetAgentPolicyResponse(rsp *http.Response) (*GetAgentPolicyResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetAgentPolicyResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + Item AgentPolicy `json:"item"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest struct { + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + } + + return response, nil +} + +// ParseUpdateAgentPolicyResponse parses an HTTP response from a UpdateAgentPolicyWithResponse call +func ParseUpdateAgentPolicyResponse(rsp *http.Response) (*UpdateAgentPolicyResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &UpdateAgentPolicyResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + Item AgentPolicy `json:"item"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest struct { + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + } + + return response, nil +} + +// ParseGetEnrollmentApiKeysResponse parses an HTTP response from a GetEnrollmentApiKeysWithResponse call +func ParseGetEnrollmentApiKeysResponse(rsp *http.Response) (*GetEnrollmentApiKeysResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetEnrollmentApiKeysResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + Items []EnrollmentApiKey `json:"items"` + // Deprecated: + List []struct { + // Active When false, the enrollment API key is revoked and cannot be used for enrolling Elastic Agents. + Active bool `json:"active"` + + // ApiKey The enrollment API key (token) used for enrolling Elastic Agents. + ApiKey string `json:"api_key"` + + // ApiKeyId The ID of the API key in the Security API. + ApiKeyId string `json:"api_key_id"` + CreatedAt string `json:"created_at"` + Id string `json:"id"` + + // Name The name of the enrollment API key. + Name *string `json:"name,omitempty"` + + // PolicyId The ID of the agent policy the Elastic Agent will be enrolled in. + PolicyId *string `json:"policy_id,omitempty"` + } `json:"list"` + Page float32 `json:"page"` + PerPage float32 `json:"perPage"` + Total float32 `json:"total"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest struct { + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + } + + return response, nil +} + +// ParseListPackagesResponse parses an HTTP response from a ListPackagesWithResponse call +func ParseListPackagesResponse(rsp *http.Response) (*ListPackagesResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &ListPackagesResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + Items []PackageListItem `json:"items"` + Response *[]ListPackages_200_Response_Item `json:"response,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest struct { + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + } + + return response, nil +} + +// ParseInstallPackageByUploadResponse parses an HTTP response from a InstallPackageByUploadWithResponse call +func ParseInstallPackageByUploadResponse(rsp *http.Response) (*InstallPackageByUploadResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &InstallPackageByUploadResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + return response, nil +} + +// ParseDeletePackageResponse parses an HTTP response from a DeletePackageWithResponse call +func ParseDeletePackageResponse(rsp *http.Response) (*DeletePackageResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &DeletePackageResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + Items []DeletePackage_200_Items_Item `json:"items"` + // Deprecated: + Response *[]DeletePackage_200_Response_Item `json:"response,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest struct { + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + } + + return response, nil +} + +// ParseGetPackageResponse parses an HTTP response from a GetPackageWithResponse call +func ParseGetPackageResponse(rsp *http.Response) (*GetPackageResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetPackageResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + Item PackageInfo `json:"item"` + Metadata *struct { + HasPolicies bool `json:"has_policies"` + } `json:"metadata,omitempty"` + // Deprecated: + Response *GetPackage_200_Response `json:"response,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest struct { + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + } + + return response, nil +} + +// ParseInstallPackageResponse parses an HTTP response from a InstallPackageWithResponse call +func ParseInstallPackageResponse(rsp *http.Response) (*InstallPackageResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &InstallPackageResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + Meta struct { + InstallSource string `json:"install_source"` + } `json:"_meta"` + Items []InstallPackage_200_Items_Item `json:"items"` + // Deprecated: + Response *[]InstallPackage_200_Response_Item `json:"response,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest struct { + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + } + + return response, nil +} + +// ParseGetFleetServerHostsResponse parses an HTTP response from a GetFleetServerHostsWithResponse call +func ParseGetFleetServerHostsResponse(rsp *http.Response) (*GetFleetServerHostsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetFleetServerHostsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + Items []ServerHost `json:"items"` + Page float32 `json:"page"` + PerPage float32 `json:"perPage"` + Total float32 `json:"total"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest struct { + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + } + + return response, nil +} + +// ParseCreateFleetServerHostResponse parses an HTTP response from a CreateFleetServerHostWithResponse call +func ParseCreateFleetServerHostResponse(rsp *http.Response) (*CreateFleetServerHostResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &CreateFleetServerHostResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + Item ServerHost `json:"item"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest struct { + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + } + + return response, nil +} + +// ParseDeleteFleetServerHostResponse parses an HTTP response from a DeleteFleetServerHostWithResponse call +func ParseDeleteFleetServerHostResponse(rsp *http.Response) (*DeleteFleetServerHostResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &DeleteFleetServerHostResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + Id string `json:"id"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest struct { + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + } + + return response, nil +} + +// ParseGetFleetServerHostResponse parses an HTTP response from a GetFleetServerHostWithResponse call +func ParseGetFleetServerHostResponse(rsp *http.Response) (*GetFleetServerHostResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetFleetServerHostResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + Item ServerHost `json:"item"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest struct { + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + } + + return response, nil +} + +// ParseUpdateFleetServerHostResponse parses an HTTP response from a UpdateFleetServerHostWithResponse call +func ParseUpdateFleetServerHostResponse(rsp *http.Response) (*UpdateFleetServerHostResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &UpdateFleetServerHostResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + Item ServerHost `json:"item"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest struct { + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + } + + return response, nil +} + +// ParseGetOutputsResponse parses an HTTP response from a GetOutputsWithResponse call +func ParseGetOutputsResponse(rsp *http.Response) (*GetOutputsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetOutputsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + Items []OutputUnion `json:"items"` + Page float32 `json:"page"` + PerPage float32 `json:"perPage"` + Total float32 `json:"total"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest struct { + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + } + + return response, nil +} + +// ParseCreateOutputResponse parses an HTTP response from a CreateOutputWithResponse call +func ParseCreateOutputResponse(rsp *http.Response) (*CreateOutputResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &CreateOutputResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + Item OutputUnion `json:"item"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest struct { + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + } + + return response, nil +} + +// ParseDeleteOutputResponse parses an HTTP response from a DeleteOutputWithResponse call +func ParseDeleteOutputResponse(rsp *http.Response) (*DeleteOutputResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &DeleteOutputResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + Id string `json:"id"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest struct { + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest struct { + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + } + + return response, nil +} + +// ParseGetOutputResponse parses an HTTP response from a GetOutputWithResponse call +func ParseGetOutputResponse(rsp *http.Response) (*GetOutputResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetOutputResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + Item OutputUnion `json:"item"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest struct { + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + } + + return response, nil +} + +// ParseUpdateOutputResponse parses an HTTP response from a UpdateOutputWithResponse call +func ParseUpdateOutputResponse(rsp *http.Response) (*UpdateOutputResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &UpdateOutputResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + Item OutputUnion `json:"item"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest struct { + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + } + + return response, nil +} + +// ParseGetPackagePoliciesResponse parses an HTTP response from a GetPackagePoliciesWithResponse call +func ParseGetPackagePoliciesResponse(rsp *http.Response) (*GetPackagePoliciesResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetPackagePoliciesResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + Items []PackagePolicy `json:"items"` + Page float32 `json:"page"` + PerPage float32 `json:"perPage"` + Total float32 `json:"total"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest struct { + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + } + + return response, nil +} + +// ParseCreatePackagePolicyResponse parses an HTTP response from a CreatePackagePolicyWithResponse call +func ParseCreatePackagePolicyResponse(rsp *http.Response) (*CreatePackagePolicyResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &CreatePackagePolicyResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + Item PackagePolicy `json:"item"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest struct { + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: + var dest struct { + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON409 = &dest + + } + + return response, nil +} + +// ParseDeletePackagePolicyResponse parses an HTTP response from a DeletePackagePolicyWithResponse call +func ParseDeletePackagePolicyResponse(rsp *http.Response) (*DeletePackagePolicyResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &DeletePackagePolicyResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + Id string `json:"id"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest struct { + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + } + + return response, nil +} + +// ParseGetPackagePolicyResponse parses an HTTP response from a GetPackagePolicyWithResponse call +func ParseGetPackagePolicyResponse(rsp *http.Response) (*GetPackagePolicyResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetPackagePolicyResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + Item PackagePolicy `json:"item"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest struct { + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest struct { + Message string `json:"message"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + } + + return response, nil +} + +// ParseUpdatePackagePolicyResponse parses an HTTP response from a UpdatePackagePolicyWithResponse call +func ParseUpdatePackagePolicyResponse(rsp *http.Response) (*UpdatePackagePolicyResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &UpdatePackagePolicyResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + Item PackagePolicy `json:"item"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest struct { + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest struct { + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + + } + + return response, nil +} diff --git a/generated/kibana/transform_schema.go b/generated/kibana/transform_schema.go index 46fb59604..5daad8653 100644 --- a/generated/kibana/transform_schema.go +++ b/generated/kibana/transform_schema.go @@ -542,7 +542,10 @@ var transformers = []TransformFunc{ transformRemoveKbnXsrf, transformRemoveApiVersionParam, transformSimplifyContentType, + transformOperationIDs, + transformAddMisingDescriptions, transformKibanaPaths, + transformFleetPaths, // transformRemoveEnums, // transformAddGoPointersFlag, transformRemoveExamples, @@ -553,9 +556,21 @@ var transformers = []TransformFunc{ // of endpoints and methods. func transformFilterPaths(schema *Schema) { var includePaths = map[string][]string{ - "/api/data_views": {"get"}, - "/api/data_views/data_view": {"post"}, - "/api/data_views/data_view/{viewId}": {"get", "post", "delete"}, + "/api/data_views": {"get"}, + "/api/data_views/data_view": {"post"}, + "/api/data_views/data_view/{viewId}": {"get", "post", "delete"}, + "/api/fleet/agent_policies": {"get", "post"}, + "/api/fleet/agent_policies/delete": {"post"}, + "/api/fleet/agent_policies/{agentPolicyId}": {"get", "put"}, + "/api/fleet/enrollment_api_keys": {"get"}, + "/api/fleet/epm/packages": {"get", "post"}, + "/api/fleet/epm/packages/{pkgName}/{pkgVersion}": {"get", "post", "delete"}, + "/api/fleet/fleet_server_hosts": {"get", "post"}, + "/api/fleet/fleet_server_hosts/{itemId}": {"get", "put", "delete"}, + "/api/fleet/outputs": {"get", "post"}, + "/api/fleet/outputs/{outputId}": {"get", "put", "delete"}, + "/api/fleet/package_policies": {"get", "post"}, + "/api/fleet/package_policies/{packagePolicyId}": {"get", "put", "delete"}, } for path, pathInfo := range schema.Paths { @@ -676,8 +691,8 @@ func transformSimplifyContentType(schema *Schema) { } } -// transformKibanaPaths fixes the Kibana paths. -func transformKibanaPaths(schema *Schema) { +// transformOperationIDs fixes each path's operationId. +func transformOperationIDs(schema *Schema) { operationIds := map[string]map[string]string{ "/api/data_views": { "get": "get_data_views", @@ -690,6 +705,56 @@ func transformKibanaPaths(schema *Schema) { "post": "update_data_view", "delete": "delete_data_view", }, + "/api/fleet/agent_policies": { + "get": "get_agent_policies", + "post": "create_agent_policy", + }, + "/api/fleet/agent_policies/delete": { + "post": "delete_agent_policy", + }, + "/api/fleet/agent_policies/{agentPolicyId}": { + "get": "get_agent_policy", + "put": "update_agent_policy", + }, + "/api/fleet/enrollment_api_keys": { + "get": "get_enrollment_api_keys", + }, + "/api/fleet/epm/packages": { + "get": "list_packages", + "post": "install_package_by_upload", + }, + "/api/fleet/epm/packages/{pkgName}/{pkgVersion}": { + "get": "get_package", + "post": "install_package", + "delete": "delete_package", + }, + "/api/fleet/fleet_server_hosts": { + "get": "get_fleet_server_hosts", + "post": "create_fleet_server_host", + }, + "/api/fleet/fleet_server_hosts/{itemId}": { + "get": "get_fleet_server_host", + "put": "update_fleet_server_host", + "delete": "delete_fleet_server_host", + }, + "/api/fleet/outputs": { + "get": "get_outputs", + "post": "create_output", + }, + "/api/fleet/outputs/{outputId}": { + "get": "get_output", + "put": "update_output", + "delete": "delete_output", + }, + "/api/fleet/package_policies": { + "get": "get_package_policies", + "post": "create_package_policy", + }, + "/api/fleet/package_policies/{packagePolicyId}": { + "get": "get_package_policy", + "put": "update_package_policy", + "delete": "delete_package_policy", + }, } // Set each missing operationId @@ -700,8 +765,10 @@ func transformKibanaPaths(schema *Schema) { endpoint.Set("operationId", operationId) } } +} - // Fix OpenAPI error: set each missing description +// transformAddMisingDescriptions adds descriptions to each path missing one. +func transformAddMisingDescriptions(schema *Schema) { for _, pathInfo := range schema.Paths { for _, endpoint := range pathInfo.Endpoints { responses := endpoint.MustGetMap("responses") @@ -713,7 +780,10 @@ func transformKibanaPaths(schema *Schema) { } } } +} +// transformKibanaPaths fixes the Kibana paths. +func transformKibanaPaths(schema *Schema) { // Convert any paths needing it to /s/{spaceId} variants spaceIdPaths := []string{ "/api/data_views", @@ -784,6 +854,199 @@ func transformKibanaPaths(schema *Schema) { schema.Components.CreateRef(schema, "Data_views_update_data_view_request_object_inner", "schemas.Data_views_update_data_view_request_object.properties.data_view") } +// transformFleetPaths fixes the fleet paths. +func transformFleetPaths(schema *Schema) { + // Agent policies + // https://github.com/elastic/kibana/blob/main/x-pack/plugins/fleet/common/types/models/agent_policy.ts + // https://github.com/elastic/kibana/blob/main/x-pack/plugins/fleet/common/types/rest_spec/agent_policy.ts + + agentPoliciesPath := schema.MustGetPath("/api/fleet/agent_policies") + agentPolicyPath := schema.MustGetPath("/api/fleet/agent_policies/{agentPolicyId}") + + agentPoliciesPath.Get.CreateRef(schema, "agent_policy", "responses.200.content.application/json.schema.properties.items.items") + agentPoliciesPath.Post.CreateRef(schema, "agent_policy", "responses.200.content.application/json.schema.properties.item") + agentPolicyPath.Get.CreateRef(schema, "agent_policy", "responses.200.content.application/json.schema.properties.item") + agentPolicyPath.Put.CreateRef(schema, "agent_policy", "responses.200.content.application/json.schema.properties.item") + + // See: https://github.com/elastic/kibana/issues/197155 + // [request body.keep_monitoring_alive]: expected value of type [boolean] but got [null] + // [request body.supports_agentless]: expected value of type [boolean] but got [null] + // [request body.overrides]: expected value of type [boolean] but got [null] + for _, key := range []string{"keep_monitoring_alive", "supports_agentless", "overrides"} { + agentPoliciesPath.Post.Set(fmt.Sprintf("requestBody.content.application/json.schema.properties.%s.x-omitempty", key), true) + agentPolicyPath.Put.Set(fmt.Sprintf("requestBody.content.application/json.schema.properties.%s.x-omitempty", key), true) + } + + // Enrollment api keys + // https://github.com/elastic/kibana/blob/main/x-pack/plugins/fleet/common/types/models/enrollment_api_key.ts + // https://github.com/elastic/kibana/blob/main/x-pack/plugins/fleet/common/types/rest_spec/enrollment_api_key.ts + + apiKeysPath := schema.MustGetPath("/api/fleet/enrollment_api_keys") + apiKeysPath.Get.CreateRef(schema, "enrollment_api_key", "responses.200.content.application/json.schema.properties.items.items") + + // EPM + // https://github.com/elastic/kibana/blob/main/x-pack/plugins/fleet/common/types/models/epm.ts + // https://github.com/elastic/kibana/blob/main/x-pack/plugins/fleet/common/types/rest_spec/epm.ts + + packagesPath := schema.MustGetPath("/api/fleet/epm/packages") + packagePath := schema.MustGetPath("/api/fleet/epm/packages/{pkgName}/{pkgVersion}") + packagesPath.Get.CreateRef(schema, "package_list_item", "responses.200.content.application/json.schema.properties.items.items") + packagePath.Get.CreateRef(schema, "package_info", "responses.200.content.application/json.schema.properties.item") + + // Server hosts + // https://github.com/elastic/kibana/blob/main/x-pack/plugins/fleet/common/types/models/fleet_server_policy_config.ts + // https://github.com/elastic/kibana/blob/main/x-pack/plugins/fleet/common/types/rest_spec/fleet_server_hosts.ts + + hostsPath := schema.MustGetPath("/api/fleet/fleet_server_hosts") + hostPath := schema.MustGetPath("/api/fleet/fleet_server_hosts/{itemId}") + + hostsPath.Get.CreateRef(schema, "server_host", "responses.200.content.application/json.schema.properties.items.items") + hostsPath.Post.CreateRef(schema, "server_host", "responses.200.content.application/json.schema.properties.item") + hostPath.Get.CreateRef(schema, "server_host", "responses.200.content.application/json.schema.properties.item") + hostPath.Put.CreateRef(schema, "server_host", "responses.200.content.application/json.schema.properties.item") + + // 8.6.2 regression + // [request body.proxy_id]: definition for this key is missing + // See: https://github.com/elastic/kibana/issues/197155 + hostsPath.Post.Set("requestBody.content.application/json.schema.properties.proxy_id.x-omitempty", true) + hostPath.Put.Set("requestBody.content.application/json.schema.properties.proxy_id.x-omitempty", true) + + // Outputs + // https://github.com/elastic/kibana/blob/main/x-pack/plugins/fleet/common/types/models/output.ts + // https://github.com/elastic/kibana/blob/main/x-pack/plugins/fleet/common/types/rest_spec/output.ts + + outputByIdPath := schema.MustGetPath("/api/fleet/outputs/{outputId}") + outputsPath := schema.MustGetPath("/api/fleet/outputs") + + outputsPath.Post.CreateRef(schema, "new_output_union", "requestBody.content.application/json.schema") + outputByIdPath.Put.CreateRef(schema, "update_output_union", "requestBody.content.application/json.schema") + outputsPath.Get.CreateRef(schema, "output_union", "responses.200.content.application/json.schema.properties.items.items") + outputByIdPath.Get.CreateRef(schema, "output_union", "responses.200.content.application/json.schema.properties.item") + outputsPath.Post.CreateRef(schema, "output_union", "responses.200.content.application/json.schema.properties.item") + outputByIdPath.Put.CreateRef(schema, "output_union", "responses.200.content.application/json.schema.properties.item") + + for _, name := range []string{"output", "new_output", "update_output"} { + // Ref each index in the anyOf union + schema.Components.CreateRef(schema, fmt.Sprintf("%s_elasticsearch", name), fmt.Sprintf("schemas.%s_union.anyOf.0", name)) + schema.Components.CreateRef(schema, fmt.Sprintf("%s_remote_elasticsearch", name), fmt.Sprintf("schemas.%s_union.anyOf.1", name)) + schema.Components.CreateRef(schema, fmt.Sprintf("%s_logstash", name), fmt.Sprintf("schemas.%s_union.anyOf.2", name)) + schema.Components.CreateRef(schema, fmt.Sprintf("%s_kafka", name), fmt.Sprintf("schemas.%s_union.anyOf.3", name)) + + // Extract child structs + for _, typ := range []string{"elasticsearch", "remote_elasticsearch", "logstash", "kafka"} { + schema.Components.CreateRef(schema, fmt.Sprintf("%s_shipper", name), fmt.Sprintf("schemas.%s_%s.properties.shipper", name, typ)) + schema.Components.CreateRef(schema, fmt.Sprintf("%s_ssl", name), fmt.Sprintf("schemas.%s_%s.properties.ssl", name, typ)) + } + + // Ideally just remove the "anyOf", however then we would need to make + // refs for each of the "oneOf" options. So turn them into an "any" instead. + // See: https://github.com/elastic/kibana/issues/197153 + /* + anyOf: + - items: {} + type: array + - type: boolean + - type: number + - type: object + - type: string + nullable: true + oneOf: + - type: number + - not: {} + */ + + props := schema.Components.MustGetMap(fmt.Sprintf("schemas.%s_kafka.properties", name)) + for _, key := range []string{"compression_level", "connection_type", "password", "username"} { + props.Set(key, Map{}) + } + } + + // Add the missing discriminator to the response union + // See: https://github.com/elastic/kibana/issues/181994 + schema.Components.Set("schemas.output_union.discriminator", Map{ + "propertyName": "type", + "mapping": Map{ + "elasticsearch": "#/components/schemas/output_elasticsearch", + "remote_elasticsearch": "#/components/schemas/output_remote_elasticsearch", + "logstash": "#/components/schemas/output_logstash", + "kafka": "#/components/schemas/output_kafka", + }, + }) + + for _, name := range []string{"new_output", "update_output"} { + for _, typ := range []string{"elasticsearch", "remote_elasticsearch", "logstash", "kafka"} { + // [request body.1.ca_sha256]: expected value of type [string] but got [null]" + // See: https://github.com/elastic/kibana/issues/197155 + schema.Components.Set(fmt.Sprintf("schemas.%s_%s.properties.ca_sha256.x-omitempty", name, typ), true) + + // [request body.1.ca_trusted_fingerprint]: expected value of type [string] but got [null] + // See: https://github.com/elastic/kibana/issues/197155 + schema.Components.Set(fmt.Sprintf("schemas.%s_%s.properties.ca_trusted_fingerprint.x-omitempty", name, typ), true) + + // 8.6.2 regression + // [request body.proxy_id]: definition for this key is missing" + // See: https://github.com/elastic/kibana/issues/197155 + schema.Components.Set(fmt.Sprintf("schemas.%s_%s.properties.proxy_id.x-omitempty", name, typ), true) + } + + // [request body.1.shipper]: expected a plain object value, but found [null] instead + // See: https://github.com/elastic/kibana/issues/197155 + schema.Components.Set(fmt.Sprintf("schemas.%s_shipper.x-omitempty", name), true) + + // [request body.1.ssl]: expected a plain object value, but found [null] instead + // See: https://github.com/elastic/kibana/issues/197155 + schema.Components.Set(fmt.Sprintf("schemas.%s_ssl.x-omitempty", name), true) + + } + + for _, typ := range []string{"elasticsearch", "remote_elasticsearch", "logstash", "kafka"} { + // strict_dynamic_mapping_exception: [1:345] mapping set to strict, dynamic introduction of [id] within [ingest-outputs] is not allowed" + // See: https://github.com/elastic/kibana/issues/197155 + schema.Components.MustDelete(fmt.Sprintf("schemas.update_output_%s.properties.id", typ)) + } + + // Package policies + // https://github.com/elastic/kibana/blob/main/x-pack/plugins/fleet/common/types/models/package_policy.ts + // https://github.com/elastic/kibana/blob/main/x-pack/plugins/fleet/common/types/rest_spec/package_policy.ts + + epmPoliciesPath := schema.MustGetPath("/api/fleet/package_policies") + epmPolicyPath := schema.MustGetPath("/api/fleet/package_policies/{packagePolicyId}") + + epmPoliciesPath.Get.CreateRef(schema, "package_policy", "responses.200.content.application/json.schema.properties.items.items") + epmPoliciesPath.Post.CreateRef(schema, "package_policy", "responses.200.content.application/json.schema.properties.item") + + epmPoliciesPath.Post.Move("requestBody.content.application/json.schema.anyOf.1", "requestBody.content.application/json.schema") // anyOf.0 is the deprecated array format + epmPolicyPath.Put.Move("requestBody.content.application/json.schema.anyOf.1", "requestBody.content.application/json.schema") // anyOf.0 is the deprecated array format + epmPoliciesPath.Post.CreateRef(schema, "package_policy_request", "requestBody.content.application/json.schema") + epmPolicyPath.Put.CreateRef(schema, "package_policy_request", "requestBody.content.application/json.schema") + + epmPolicyPath.Get.CreateRef(schema, "package_policy", "responses.200.content.application/json.schema.properties.item") + epmPolicyPath.Put.CreateRef(schema, "package_policy", "responses.200.content.application/json.schema.properties.item") + + schema.Components.CreateRef(schema, "package_policy_secret_ref", "schemas.package_policy.properties.secret_references.items") + schema.Components.Move("schemas.package_policy.properties.inputs.anyOf.1", "schemas.package_policy.properties.inputs") // anyOf.0 is the deprecated array format + + schema.Components.CreateRef(schema, "package_policy_input", "schemas.package_policy.properties.inputs.additionalProperties") + schema.Components.CreateRef(schema, "package_policy_input_stream", "schemas.package_policy_input.properties.streams.additionalProperties") + + schema.Components.CreateRef(schema, "package_policy_request_package", "schemas.package_policy_request.properties.package") + schema.Components.CreateRef(schema, "package_policy_request_input", "schemas.package_policy_request.properties.inputs.additionalProperties") + schema.Components.CreateRef(schema, "package_policy_request_input_stream", "schemas.package_policy_request_input.properties.streams.additionalProperties") + + // Simplify all of the vars + schema.Components.Set("schemas.package_policy.properties.vars", Map{"type": "object"}) + schema.Components.Set("schemas.package_policy_input.properties.vars", Map{"type": "object"}) + schema.Components.Set("schemas.package_policy_input_stream.properties.vars", Map{"type": "object"}) + schema.Components.Set("schemas.package_policy_request.properties.vars", Map{"type": "object"}) + schema.Components.Set("schemas.package_policy_request_input.properties.vars", Map{"type": "object"}) + schema.Components.Set("schemas.package_policy_request_input_stream.properties.vars", Map{"type": "object"}) + + // [request body.0.output_id]: expected value of type [string] but got [null] + // [request body.1.output_id]: definition for this key is missing" + // See: https://github.com/elastic/kibana/issues/197155 + schema.Components.Set("schemas.package_policy_request.properties.output_id.x-omitempty", true) +} + // transformRemoveEnums remove all enums. func transformRemoveEnums(schema *Schema) { deleteEnumFn := func(key string, node Map) { diff --git a/internal/clients/fleet/client.go b/internal/clients/fleet/client.go index d2d211e2e..623b1204d 100644 --- a/internal/clients/fleet/client.go +++ b/internal/clients/fleet/client.go @@ -8,7 +8,7 @@ import ( "os" "strings" - fleetapi "github.com/elastic/terraform-provider-elasticstack/generated/fleet" + "github.com/elastic/terraform-provider-elasticstack/generated/kibana" "github.com/elastic/terraform-provider-elasticstack/internal/utils" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/logging" ) @@ -27,7 +27,7 @@ type Config struct { type Client struct { URL string HTTP *http.Client - API *fleetapi.ClientWithResponses + API *kbapi.ClientWithResponses } // NewClient creates a new Elastic Fleet API client. @@ -68,7 +68,7 @@ func NewClient(cfg Config) (*Client, error) { endpoint += "/" } - fleetAPIClient, err := fleetapi.NewClientWithResponses(endpoint, fleetapi.WithHTTPClient(httpClient)) + fleetAPIClient, err := kbapi.NewClientWithResponses(endpoint, kbapi.WithHTTPClient(httpClient)) if err != nil { return nil, fmt.Errorf("unable to create Fleet API client: %w", err) } diff --git a/internal/clients/fleet/fleet.go b/internal/clients/fleet/fleet.go index a8bb5197d..fc2bb2ba2 100644 --- a/internal/clients/fleet/fleet.go +++ b/internal/clients/fleet/fleet.go @@ -6,7 +6,7 @@ import ( "fmt" "net/http" - fleetapi "github.com/elastic/terraform-provider-elasticstack/generated/fleet" + "github.com/elastic/terraform-provider-elasticstack/generated/kibana" "github.com/elastic/terraform-provider-elasticstack/internal/utils" "github.com/hashicorp/terraform-plugin-framework/diag" ) @@ -16,7 +16,7 @@ var ( ) // GetEnrollmentTokens reads all enrollment tokens from the API. -func GetEnrollmentTokens(ctx context.Context, client *Client) ([]fleetapi.EnrollmentApiKey, diag.Diagnostics) { +func GetEnrollmentTokens(ctx context.Context, client *Client) ([]kbapi.EnrollmentApiKey, diag.Diagnostics) { resp, err := client.API.GetEnrollmentApiKeysWithResponse(ctx, nil) if err != nil { return nil, utils.FrameworkDiagFromError(err) @@ -31,8 +31,8 @@ func GetEnrollmentTokens(ctx context.Context, client *Client) ([]fleetapi.Enroll } // GetEnrollmentTokensByPolicy Get enrollment tokens by given policy ID. -func GetEnrollmentTokensByPolicy(ctx context.Context, client *Client, policyID string) ([]fleetapi.EnrollmentApiKey, diag.Diagnostics) { - params := fleetapi.GetEnrollmentApiKeysParams{ +func GetEnrollmentTokensByPolicy(ctx context.Context, client *Client, policyID string) ([]kbapi.EnrollmentApiKey, diag.Diagnostics) { + params := kbapi.GetEnrollmentApiKeysParams{ Kuery: utils.Pointer("policy_id:" + policyID), } @@ -50,7 +50,7 @@ func GetEnrollmentTokensByPolicy(ctx context.Context, client *Client, policyID s } // GetAgentPolicy reads a specific agent policy from the API. -func GetAgentPolicy(ctx context.Context, client *Client, id string) (*fleetapi.AgentPolicy, diag.Diagnostics) { +func GetAgentPolicy(ctx context.Context, client *Client, id string) (*kbapi.AgentPolicy, diag.Diagnostics) { resp, err := client.API.GetAgentPolicyWithResponse(ctx, id, nil) if err != nil { return nil, utils.FrameworkDiagFromError(err) @@ -67,8 +67,8 @@ func GetAgentPolicy(ctx context.Context, client *Client, id string) (*fleetapi.A } // CreateAgentPolicy creates a new agent policy. -func CreateAgentPolicy(ctx context.Context, client *Client, req fleetapi.CreateAgentPolicyJSONRequestBody, sysMonitoring bool) (*fleetapi.AgentPolicy, diag.Diagnostics) { - params := fleetapi.CreateAgentPolicyParams{ +func CreateAgentPolicy(ctx context.Context, client *Client, req kbapi.CreateAgentPolicyJSONRequestBody, sysMonitoring bool) (*kbapi.AgentPolicy, diag.Diagnostics) { + params := kbapi.CreateAgentPolicyParams{ SysMonitoring: utils.Pointer(sysMonitoring), } @@ -86,7 +86,7 @@ func CreateAgentPolicy(ctx context.Context, client *Client, req fleetapi.CreateA } // UpdateAgentPolicy updates an existing agent policy. -func UpdateAgentPolicy(ctx context.Context, client *Client, id string, req fleetapi.UpdateAgentPolicyJSONRequestBody) (*fleetapi.AgentPolicy, diag.Diagnostics) { +func UpdateAgentPolicy(ctx context.Context, client *Client, id string, req kbapi.UpdateAgentPolicyJSONRequestBody) (*kbapi.AgentPolicy, diag.Diagnostics) { resp, err := client.API.UpdateAgentPolicyWithResponse(ctx, id, nil, req) if err != nil { return nil, utils.FrameworkDiagFromError(err) @@ -102,7 +102,7 @@ func UpdateAgentPolicy(ctx context.Context, client *Client, id string, req fleet // DeleteAgentPolicy deletes an existing agent policy. func DeleteAgentPolicy(ctx context.Context, client *Client, id string) diag.Diagnostics { - body := fleetapi.DeleteAgentPolicyJSONRequestBody{ + body := kbapi.DeleteAgentPolicyJSONRequestBody{ AgentPolicyId: id, } @@ -122,7 +122,7 @@ func DeleteAgentPolicy(ctx context.Context, client *Client, id string) diag.Diag } // GetOutput reads a specific output from the API. -func GetOutput(ctx context.Context, client *Client, id string) (*fleetapi.OutputUnion, diag.Diagnostics) { +func GetOutput(ctx context.Context, client *Client, id string) (*kbapi.OutputUnion, diag.Diagnostics) { resp, err := client.API.GetOutputWithResponse(ctx, id) if err != nil { return nil, utils.FrameworkDiagFromError(err) @@ -139,7 +139,7 @@ func GetOutput(ctx context.Context, client *Client, id string) (*fleetapi.Output } // CreateOutput creates a new output. -func CreateOutput(ctx context.Context, client *Client, req fleetapi.NewOutputUnion) (*fleetapi.OutputUnion, diag.Diagnostics) { +func CreateOutput(ctx context.Context, client *Client, req kbapi.NewOutputUnion) (*kbapi.OutputUnion, diag.Diagnostics) { resp, err := client.API.CreateOutputWithResponse(ctx, req) if err != nil { return nil, utils.FrameworkDiagFromError(err) @@ -154,7 +154,7 @@ func CreateOutput(ctx context.Context, client *Client, req fleetapi.NewOutputUni } // UpdateOutput updates an existing output. -func UpdateOutput(ctx context.Context, client *Client, id string, req fleetapi.UpdateOutputUnion) (*fleetapi.OutputUnion, diag.Diagnostics) { +func UpdateOutput(ctx context.Context, client *Client, id string, req kbapi.UpdateOutputUnion) (*kbapi.OutputUnion, diag.Diagnostics) { resp, err := client.API.UpdateOutputWithResponse(ctx, id, req) if err != nil { return nil, utils.FrameworkDiagFromError(err) @@ -186,7 +186,7 @@ func DeleteOutput(ctx context.Context, client *Client, id string) diag.Diagnosti } // GetFleetServerHost reads a specific fleet server host from the API. -func GetFleetServerHost(ctx context.Context, client *Client, id string) (*fleetapi.ServerHost, diag.Diagnostics) { +func GetFleetServerHost(ctx context.Context, client *Client, id string) (*kbapi.ServerHost, diag.Diagnostics) { resp, err := client.API.GetFleetServerHostWithResponse(ctx, id) if err != nil { return nil, utils.FrameworkDiagFromError(err) @@ -203,7 +203,7 @@ func GetFleetServerHost(ctx context.Context, client *Client, id string) (*fleeta } // CreateFleetServerHost creates a new fleet server host. -func CreateFleetServerHost(ctx context.Context, client *Client, req fleetapi.CreateFleetServerHostJSONRequestBody) (*fleetapi.ServerHost, diag.Diagnostics) { +func CreateFleetServerHost(ctx context.Context, client *Client, req kbapi.CreateFleetServerHostJSONRequestBody) (*kbapi.ServerHost, diag.Diagnostics) { resp, err := client.API.CreateFleetServerHostWithResponse(ctx, req) if err != nil { return nil, utils.FrameworkDiagFromError(err) @@ -218,7 +218,7 @@ func CreateFleetServerHost(ctx context.Context, client *Client, req fleetapi.Cre } // UpdateFleetServerHost updates an existing fleet server host. -func UpdateFleetServerHost(ctx context.Context, client *Client, id string, req fleetapi.UpdateFleetServerHostJSONRequestBody) (*fleetapi.ServerHost, diag.Diagnostics) { +func UpdateFleetServerHost(ctx context.Context, client *Client, id string, req kbapi.UpdateFleetServerHostJSONRequestBody) (*kbapi.ServerHost, diag.Diagnostics) { resp, err := client.API.UpdateFleetServerHostWithResponse(ctx, id, req) if err != nil { return nil, utils.FrameworkDiagFromError(err) @@ -250,9 +250,9 @@ func DeleteFleetServerHost(ctx context.Context, client *Client, id string) diag. } // GetPackagePolicy reads a specific package policy from the API. -func GetPackagePolicy(ctx context.Context, client *Client, id string) (*fleetapi.PackagePolicy, diag.Diagnostics) { - params := fleetapi.GetPackagePolicyParams{ - Format: utils.Pointer(fleetapi.GetPackagePolicyParamsFormatSimplified), +func GetPackagePolicy(ctx context.Context, client *Client, id string) (*kbapi.PackagePolicy, diag.Diagnostics) { + params := kbapi.GetPackagePolicyParams{ + Format: utils.Pointer(kbapi.GetPackagePolicyParamsFormatSimplified), } resp, err := client.API.GetPackagePolicyWithResponse(ctx, id, ¶ms) @@ -271,9 +271,9 @@ func GetPackagePolicy(ctx context.Context, client *Client, id string) (*fleetapi } // CreatePackagePolicy creates a new package policy. -func CreatePackagePolicy(ctx context.Context, client *Client, req fleetapi.CreatePackagePolicyJSONRequestBody) (*fleetapi.PackagePolicy, diag.Diagnostics) { - params := fleetapi.CreatePackagePolicyParams{ - Format: utils.Pointer(fleetapi.CreatePackagePolicyParamsFormatSimplified), +func CreatePackagePolicy(ctx context.Context, client *Client, req kbapi.CreatePackagePolicyJSONRequestBody) (*kbapi.PackagePolicy, diag.Diagnostics) { + params := kbapi.CreatePackagePolicyParams{ + Format: utils.Pointer(kbapi.CreatePackagePolicyParamsFormatSimplified), } resp, err := client.API.CreatePackagePolicyWithResponse(ctx, ¶ms, req) @@ -290,9 +290,9 @@ func CreatePackagePolicy(ctx context.Context, client *Client, req fleetapi.Creat } // UpdatePackagePolicy updates an existing package policy. -func UpdatePackagePolicy(ctx context.Context, client *Client, id string, req fleetapi.UpdatePackagePolicyJSONRequestBody) (*fleetapi.PackagePolicy, diag.Diagnostics) { - params := fleetapi.UpdatePackagePolicyParams{ - Format: utils.Pointer(fleetapi.Simplified), +func UpdatePackagePolicy(ctx context.Context, client *Client, id string, req kbapi.UpdatePackagePolicyJSONRequestBody) (*kbapi.PackagePolicy, diag.Diagnostics) { + params := kbapi.UpdatePackagePolicyParams{ + Format: utils.Pointer(kbapi.Simplified), } resp, err := client.API.UpdatePackagePolicyWithResponse(ctx, id, ¶ms, req) @@ -310,7 +310,7 @@ func UpdatePackagePolicy(ctx context.Context, client *Client, id string, req fle // DeletePackagePolicy deletes an existing package policy. func DeletePackagePolicy(ctx context.Context, client *Client, id string, force bool) diag.Diagnostics { - params := fleetapi.DeletePackagePolicyParams{ + params := kbapi.DeletePackagePolicyParams{ Force: &force, } @@ -330,8 +330,8 @@ func DeletePackagePolicy(ctx context.Context, client *Client, id string, force b } // GetPackage reads a specific package from the API. -func GetPackage(ctx context.Context, client *Client, name, version string) (*fleetapi.PackageInfo, diag.Diagnostics) { - params := fleetapi.GetPackageParams{} +func GetPackage(ctx context.Context, client *Client, name, version string) (*kbapi.PackageInfo, diag.Diagnostics) { + params := kbapi.GetPackageParams{} resp, err := client.API.GetPackageWithResponse(ctx, name, version, ¶ms) if err != nil { @@ -350,8 +350,8 @@ func GetPackage(ctx context.Context, client *Client, name, version string) (*fle // InstallPackage installs a package. func InstallPackage(ctx context.Context, client *Client, name, version string, force bool) diag.Diagnostics { - params := fleetapi.InstallPackageParams{} - body := fleetapi.InstallPackageJSONRequestBody{ + params := kbapi.InstallPackageParams{} + body := kbapi.InstallPackageJSONRequestBody{ Force: &force, } @@ -370,7 +370,7 @@ func InstallPackage(ctx context.Context, client *Client, name, version string, f // Uninstall uninstalls a package. func Uninstall(ctx context.Context, client *Client, name, version string, force bool) diag.Diagnostics { - body := fleetapi.DeletePackageJSONRequestBody{ + body := kbapi.DeletePackageJSONRequestBody{ Force: force, } @@ -397,8 +397,8 @@ func Uninstall(ctx context.Context, client *Client, name, version string, force } // GetPackages returns information about the latest packages known to Fleet. -func GetPackages(ctx context.Context, client *Client, prerelease bool) ([]fleetapi.PackageListItem, diag.Diagnostics) { - params := fleetapi.ListPackagesParams{ +func GetPackages(ctx context.Context, client *Client, prerelease bool) ([]kbapi.PackageListItem, diag.Diagnostics) { + params := kbapi.ListPackagesParams{ Prerelease: &prerelease, } diff --git a/internal/fleet/agent_policy/models.go b/internal/fleet/agent_policy/models.go index 8cfe8d1e2..3e1018d5e 100644 --- a/internal/fleet/agent_policy/models.go +++ b/internal/fleet/agent_policy/models.go @@ -3,7 +3,7 @@ package agent_policy import ( "slices" - fleetapi "github.com/elastic/terraform-provider-elasticstack/generated/fleet" + "github.com/elastic/terraform-provider-elasticstack/generated/kibana" "github.com/elastic/terraform-provider-elasticstack/internal/utils" "github.com/hashicorp/terraform-plugin-framework/types" ) @@ -24,7 +24,7 @@ type agentPolicyModel struct { SkipDestroy types.Bool `tfsdk:"skip_destroy"` } -func (model *agentPolicyModel) populateFromAPI(data *fleetapi.AgentPolicy) { +func (model *agentPolicyModel) populateFromAPI(data *kbapi.AgentPolicy) { if data == nil { return } @@ -37,10 +37,10 @@ func (model *agentPolicyModel) populateFromAPI(data *fleetapi.AgentPolicy) { model.FleetServerHostId = types.StringPointerValue(data.FleetServerHostId) if data.MonitoringEnabled != nil { - if slices.Contains(*data.MonitoringEnabled, fleetapi.AgentPolicyMonitoringEnabledLogs) { + if slices.Contains(*data.MonitoringEnabled, kbapi.AgentPolicyMonitoringEnabledLogs) { model.MonitorLogs = types.BoolValue(true) } - if slices.Contains(*data.MonitoringEnabled, fleetapi.AgentPolicyMonitoringEnabledMetrics) { + if slices.Contains(*data.MonitoringEnabled, kbapi.AgentPolicyMonitoringEnabledMetrics) { model.MonitorMetrics = types.BoolValue(true) } } @@ -56,16 +56,16 @@ func (model *agentPolicyModel) populateFromAPI(data *fleetapi.AgentPolicy) { model.Namespace = types.StringValue(data.Namespace) } -func (model agentPolicyModel) toAPICreateModel() fleetapi.CreateAgentPolicyJSONRequestBody { - monitoring := make([]fleetapi.CreateAgentPolicyJSONBodyMonitoringEnabled, 0, 2) +func (model agentPolicyModel) toAPICreateModel() kbapi.CreateAgentPolicyJSONRequestBody { + monitoring := make([]kbapi.CreateAgentPolicyJSONBodyMonitoringEnabled, 0, 2) if model.MonitorLogs.ValueBool() { - monitoring = append(monitoring, fleetapi.CreateAgentPolicyJSONBodyMonitoringEnabledLogs) + monitoring = append(monitoring, kbapi.CreateAgentPolicyJSONBodyMonitoringEnabledLogs) } if model.MonitorMetrics.ValueBool() { - monitoring = append(monitoring, fleetapi.CreateAgentPolicyJSONBodyMonitoringEnabledMetrics) + monitoring = append(monitoring, kbapi.CreateAgentPolicyJSONBodyMonitoringEnabledMetrics) } - body := fleetapi.CreateAgentPolicyJSONRequestBody{ + body := kbapi.CreateAgentPolicyJSONRequestBody{ DataOutputId: model.DataOutputId.ValueStringPointer(), Description: model.Description.ValueStringPointer(), DownloadSourceId: model.DownloadSourceId.ValueStringPointer(), @@ -80,16 +80,16 @@ func (model agentPolicyModel) toAPICreateModel() fleetapi.CreateAgentPolicyJSONR return body } -func (model agentPolicyModel) toAPIUpdateModel() fleetapi.UpdateAgentPolicyJSONRequestBody { - monitoring := make([]fleetapi.UpdateAgentPolicyJSONBodyMonitoringEnabled, 0, 2) +func (model agentPolicyModel) toAPIUpdateModel() kbapi.UpdateAgentPolicyJSONRequestBody { + monitoring := make([]kbapi.UpdateAgentPolicyJSONBodyMonitoringEnabled, 0, 2) if model.MonitorLogs.ValueBool() { - monitoring = append(monitoring, fleetapi.Logs) + monitoring = append(monitoring, kbapi.Logs) } if model.MonitorMetrics.ValueBool() { - monitoring = append(monitoring, fleetapi.Metrics) + monitoring = append(monitoring, kbapi.Metrics) } - body := fleetapi.UpdateAgentPolicyJSONRequestBody{ + body := kbapi.UpdateAgentPolicyJSONRequestBody{ DataOutputId: model.DataOutputId.ValueStringPointer(), Description: model.Description.ValueStringPointer(), DownloadSourceId: model.DownloadSourceId.ValueStringPointer(), diff --git a/internal/fleet/enrollment_tokens/models.go b/internal/fleet/enrollment_tokens/models.go index 1b3bfeb35..30da4e2c7 100644 --- a/internal/fleet/enrollment_tokens/models.go +++ b/internal/fleet/enrollment_tokens/models.go @@ -3,7 +3,7 @@ package enrollment_tokens import ( "context" - fleetapi "github.com/elastic/terraform-provider-elasticstack/generated/fleet" + "github.com/elastic/terraform-provider-elasticstack/generated/kibana" "github.com/elastic/terraform-provider-elasticstack/internal/utils" "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/path" @@ -26,12 +26,12 @@ type enrollmentTokenModel struct { PolicyID types.String `tfsdk:"policy_id"` } -func (model *enrollmentTokensModel) populateFromAPI(ctx context.Context, data []fleetapi.EnrollmentApiKey) (diags diag.Diagnostics) { +func (model *enrollmentTokensModel) populateFromAPI(ctx context.Context, data []kbapi.EnrollmentApiKey) (diags diag.Diagnostics) { model.Tokens = utils.SliceToListType(ctx, data, getTokenType(), path.Root("tokens"), &diags, newEnrollmentTokenModel) return } -func newEnrollmentTokenModel(data fleetapi.EnrollmentApiKey, meta utils.ListMeta) enrollmentTokenModel { +func newEnrollmentTokenModel(data kbapi.EnrollmentApiKey, meta utils.ListMeta) enrollmentTokenModel { return enrollmentTokenModel{ KeyID: types.StringValue(data.Id), Active: types.BoolValue(data.Active), diff --git a/internal/fleet/enrollment_tokens/read.go b/internal/fleet/enrollment_tokens/read.go index 325285897..559670e61 100644 --- a/internal/fleet/enrollment_tokens/read.go +++ b/internal/fleet/enrollment_tokens/read.go @@ -3,7 +3,7 @@ package enrollment_tokens import ( "context" - fleetapi "github.com/elastic/terraform-provider-elasticstack/generated/fleet" + "github.com/elastic/terraform-provider-elasticstack/generated/kibana" "github.com/elastic/terraform-provider-elasticstack/internal/clients/fleet" "github.com/elastic/terraform-provider-elasticstack/internal/utils" "github.com/hashicorp/terraform-plugin-framework/datasource" @@ -25,7 +25,7 @@ func (d *enrollmentTokensDataSource) Read(ctx context.Context, req datasource.Re return } - var tokens []fleetapi.EnrollmentApiKey + var tokens []kbapi.EnrollmentApiKey policyID := model.PolicyID.ValueString() if policyID == "" { tokens, diags = fleet.GetEnrollmentTokens(ctx, client) diff --git a/internal/fleet/integration_ds/models.go b/internal/fleet/integration_ds/models.go index 75125cbd6..896f55c99 100644 --- a/internal/fleet/integration_ds/models.go +++ b/internal/fleet/integration_ds/models.go @@ -1,7 +1,7 @@ package integration_ds import ( - fleetapi "github.com/elastic/terraform-provider-elasticstack/generated/fleet" + "github.com/elastic/terraform-provider-elasticstack/generated/kibana" "github.com/hashicorp/terraform-plugin-framework/types" ) @@ -12,7 +12,7 @@ type integrationDataSourceModel struct { Version types.String `tfsdk:"version"` } -func (m *integrationDataSourceModel) populateFromAPI(pkgName string, packages []fleetapi.PackageListItem) { +func (m *integrationDataSourceModel) populateFromAPI(pkgName string, packages []kbapi.PackageListItem) { m.Version = types.StringNull() for _, pkg := range packages { if pkg.Name == pkgName { diff --git a/internal/fleet/integration_policy/models.go b/internal/fleet/integration_policy/models.go index 8f15bb160..f61234222 100644 --- a/internal/fleet/integration_policy/models.go +++ b/internal/fleet/integration_policy/models.go @@ -4,7 +4,7 @@ import ( "context" "sort" - fleetapi "github.com/elastic/terraform-provider-elasticstack/generated/fleet" + "github.com/elastic/terraform-provider-elasticstack/generated/kibana" "github.com/elastic/terraform-provider-elasticstack/internal/utils" "github.com/hashicorp/terraform-plugin-framework-jsontypes/jsontypes" "github.com/hashicorp/terraform-plugin-framework/diag" @@ -34,7 +34,7 @@ type integrationPolicyInputModel struct { VarsJson jsontypes.Normalized `tfsdk:"vars_json"` } -func (model *integrationPolicyModel) populateFromAPI(ctx context.Context, data *fleetapi.PackagePolicy) diag.Diagnostics { +func (model *integrationPolicyModel) populateFromAPI(ctx context.Context, data *kbapi.PackagePolicy) diag.Diagnostics { if data == nil { return nil } @@ -57,9 +57,9 @@ func (model *integrationPolicyModel) populateFromAPI(ctx context.Context, data * return diags } -func (model *integrationPolicyModel) populateInputFromAPI(ctx context.Context, inputs map[string]fleetapi.PackagePolicyInput, diags *diag.Diagnostics) { +func (model *integrationPolicyModel) populateInputFromAPI(ctx context.Context, inputs map[string]kbapi.PackagePolicyInput, diags *diag.Diagnostics) { newInputs := utils.TransformMapToSlice(ctx, inputs, path.Root("input"), diags, - func(inputData fleetapi.PackagePolicyInput, meta utils.MapMeta) integrationPolicyInputModel { + func(inputData kbapi.PackagePolicyInput, meta utils.MapMeta) integrationPolicyInputModel { return integrationPolicyInputModel{ InputID: types.StringValue(meta.Key), Enabled: types.BoolPointerValue(inputData.Enabled), @@ -81,15 +81,15 @@ func (model *integrationPolicyModel) populateInputFromAPI(ctx context.Context, i } } -func (model integrationPolicyModel) toAPIModel(ctx context.Context, isUpdate bool) (fleetapi.PackagePolicyRequest, diag.Diagnostics) { +func (model integrationPolicyModel) toAPIModel(ctx context.Context, isUpdate bool) (kbapi.PackagePolicyRequest, diag.Diagnostics) { var diags diag.Diagnostics - body := fleetapi.PackagePolicyRequest{ + body := kbapi.PackagePolicyRequest{ Description: model.Description.ValueStringPointer(), Force: model.Force.ValueBoolPointer(), Name: model.Name.ValueString(), Namespace: model.Namespace.ValueStringPointer(), - Package: fleetapi.PackagePolicyRequestPackage{ + Package: kbapi.PackagePolicyRequestPackage{ Name: model.IntegrationName.ValueString(), Version: model.IntegrationVersion.ValueString(), }, @@ -102,10 +102,10 @@ func (model integrationPolicyModel) toAPIModel(ctx context.Context, isUpdate boo } body.Inputs = utils.MapRef(utils.ListTypeToMap(ctx, model.Input, path.Root("input"), &diags, - func(inputModel integrationPolicyInputModel, meta utils.ListMeta) (string, fleetapi.PackagePolicyRequestInput) { - return inputModel.InputID.ValueString(), fleetapi.PackagePolicyRequestInput{ + func(inputModel integrationPolicyInputModel, meta utils.ListMeta) (string, kbapi.PackagePolicyRequestInput) { + return inputModel.InputID.ValueString(), kbapi.PackagePolicyRequestInput{ Enabled: inputModel.Enabled.ValueBoolPointer(), - Streams: utils.MapRef(utils.NormalizedTypeToMap[fleetapi.PackagePolicyRequestInputStream](inputModel.StreamsJson, meta.Path.AtName("streams_json"), &diags)), + Streams: utils.MapRef(utils.NormalizedTypeToMap[kbapi.PackagePolicyRequestInputStream](inputModel.StreamsJson, meta.Path.AtName("streams_json"), &diags)), Vars: utils.MapRef(utils.NormalizedTypeToMap[any](inputModel.VarsJson, meta.Path.AtName("vars_json"), &diags)), } })) diff --git a/internal/fleet/integration_policy/secrets.go b/internal/fleet/integration_policy/secrets.go index 832b2f9da..8d1340e63 100644 --- a/internal/fleet/integration_policy/secrets.go +++ b/internal/fleet/integration_policy/secrets.go @@ -4,7 +4,7 @@ import ( "context" "encoding/json" - fleetapi "github.com/elastic/terraform-provider-elasticstack/generated/fleet" + "github.com/elastic/terraform-provider-elasticstack/generated/kibana" "github.com/elastic/terraform-provider-elasticstack/internal/utils" "github.com/hashicorp/terraform-plugin-framework/diag" ) @@ -17,7 +17,7 @@ type secretStore map[string]any // newSecretStore creates a new secretStore from the resource privateData. // If the store already exists, it is filtered by any references in the resp policy. -func newSecretStore(ctx context.Context, resp *fleetapi.PackagePolicy, private privateData) (store secretStore, diags diag.Diagnostics) { +func newSecretStore(ctx context.Context, resp *kbapi.PackagePolicy, private privateData) (store secretStore, diags diag.Diagnostics) { bytes, nd := private.GetKey(ctx, "secrets") diags.Append(nd...) if diags.HasError() { @@ -63,7 +63,7 @@ func (s secretStore) Save(ctx context.Context, private privateData) (diags diag. // HandleRespSecrets extracts the wrapped value from each response var, then // replaces any secret refs with the original value from secrets if available. -func HandleRespSecrets(ctx context.Context, resp *fleetapi.PackagePolicy, private privateData) (diags diag.Diagnostics) { +func HandleRespSecrets(ctx context.Context, resp *kbapi.PackagePolicy, private privateData) (diags diag.Diagnostics) { secrets, nd := newSecretStore(ctx, resp, private) diags.Append(nd...) if diags.HasError() { @@ -116,7 +116,7 @@ func HandleRespSecrets(ctx context.Context, resp *fleetapi.PackagePolicy, privat // HandleReqRespSecrets extracts the wrapped value from each response var, then // maps any secret refs to the original request value. -func HandleReqRespSecrets(ctx context.Context, req fleetapi.PackagePolicyRequest, resp *fleetapi.PackagePolicy, private privateData) (diags diag.Diagnostics) { +func HandleReqRespSecrets(ctx context.Context, req kbapi.PackagePolicyRequest, resp *kbapi.PackagePolicy, private privateData) (diags diag.Diagnostics) { secrets, nd := newSecretStore(ctx, resp, private) diags.Append(nd...) if diags.HasError() { diff --git a/internal/fleet/integration_policy/secrets_test.go b/internal/fleet/integration_policy/secrets_test.go index a5e8599b4..689820a6a 100644 --- a/internal/fleet/integration_policy/secrets_test.go +++ b/internal/fleet/integration_policy/secrets_test.go @@ -5,7 +5,7 @@ import ( "maps" "testing" - fleetapi "github.com/elastic/terraform-provider-elasticstack/generated/fleet" + "github.com/elastic/terraform-provider-elasticstack/generated/kibana" "github.com/elastic/terraform-provider-elasticstack/internal/fleet/integration_policy" "github.com/elastic/terraform-provider-elasticstack/internal/utils" "github.com/hashicorp/terraform-plugin-framework/diag" @@ -35,7 +35,7 @@ func TestHandleRespSecrets(t *testing.T) { ctx := context.Background() private := privateData{"secrets": `{"known-secret":"secret"}`} - secretRefs := &[]fleetapi.PackagePolicySecretRef{ + secretRefs := &[]kbapi.PackagePolicySecretRef{ {Id: "known-secret"}, } @@ -83,20 +83,20 @@ func TestHandleRespSecrets(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - resp := fleetapi.PackagePolicy{ + resp := kbapi.PackagePolicy{ SecretReferences: secretRefs, - Inputs: map[string]fleetapi.PackagePolicyInput{ + Inputs: map[string]kbapi.PackagePolicyInput{ "input1": { - Streams: &map[string]fleetapi.PackagePolicyInputStream{"stream1": fleetapi.PackagePolicyInputStream{Vars: utils.Pointer(maps.Clone(tt.input))}}, + Streams: &map[string]kbapi.PackagePolicyInputStream{"stream1": kbapi.PackagePolicyInputStream{Vars: utils.Pointer(maps.Clone(tt.input))}}, Vars: utils.Pointer(maps.Clone(tt.input)), }, }, Vars: utils.Pointer(maps.Clone(tt.input)), } - wants := fleetapi.PackagePolicy{ - Inputs: map[string]fleetapi.PackagePolicyInput{ + wants := kbapi.PackagePolicy{ + Inputs: map[string]kbapi.PackagePolicyInput{ "input1": { - Streams: &map[string]fleetapi.PackagePolicyInputStream{"stream1": fleetapi.PackagePolicyInputStream{Vars: utils.Pointer(tt.want)}}, + Streams: &map[string]kbapi.PackagePolicyInputStream{"stream1": kbapi.PackagePolicyInputStream{Vars: utils.Pointer(tt.want)}}, Vars: &tt.want, }, }, @@ -132,7 +132,7 @@ func TestHandleReqRespSecrets(t *testing.T) { ctx := context.Background() - secretRefs := &[]fleetapi.PackagePolicySecretRef{ + secretRefs := &[]kbapi.PackagePolicySecretRef{ {Id: "known-secret"}, } @@ -188,29 +188,29 @@ func TestHandleReqRespSecrets(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - req := fleetapi.PackagePolicyRequest{ - Inputs: &map[string]fleetapi.PackagePolicyRequestInput{ + req := kbapi.PackagePolicyRequest{ + Inputs: &map[string]kbapi.PackagePolicyRequestInput{ "input1": { - Streams: &map[string]fleetapi.PackagePolicyRequestInputStream{"stream1": {Vars: utils.Pointer(maps.Clone(tt.reqInput))}}, + Streams: &map[string]kbapi.PackagePolicyRequestInputStream{"stream1": {Vars: utils.Pointer(maps.Clone(tt.reqInput))}}, Vars: utils.Pointer(maps.Clone(tt.reqInput)), }, }, Vars: utils.Pointer(maps.Clone(tt.reqInput)), } - resp := fleetapi.PackagePolicy{ + resp := kbapi.PackagePolicy{ SecretReferences: secretRefs, - Inputs: map[string]fleetapi.PackagePolicyInput{ + Inputs: map[string]kbapi.PackagePolicyInput{ "input1": { - Streams: &map[string]fleetapi.PackagePolicyInputStream{"stream1": fleetapi.PackagePolicyInputStream{Vars: utils.Pointer(maps.Clone(tt.respInput))}}, + Streams: &map[string]kbapi.PackagePolicyInputStream{"stream1": kbapi.PackagePolicyInputStream{Vars: utils.Pointer(maps.Clone(tt.respInput))}}, Vars: utils.Pointer(maps.Clone(tt.respInput)), }, }, Vars: utils.Pointer(maps.Clone(tt.respInput)), } - wants := fleetapi.PackagePolicy{ - Inputs: map[string]fleetapi.PackagePolicyInput{ + wants := kbapi.PackagePolicy{ + Inputs: map[string]kbapi.PackagePolicyInput{ "input1": { - Streams: &map[string]fleetapi.PackagePolicyInputStream{"stream1": fleetapi.PackagePolicyInputStream{Vars: utils.Pointer(tt.want)}}, + Streams: &map[string]kbapi.PackagePolicyInputStream{"stream1": kbapi.PackagePolicyInputStream{Vars: utils.Pointer(tt.want)}}, Vars: &tt.want, }, }, diff --git a/internal/fleet/output/models.go b/internal/fleet/output/models.go index d6371d916..b7879b6c8 100644 --- a/internal/fleet/output/models.go +++ b/internal/fleet/output/models.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - fleetapi "github.com/elastic/terraform-provider-elasticstack/generated/fleet" + "github.com/elastic/terraform-provider-elasticstack/generated/kibana" "github.com/elastic/terraform-provider-elasticstack/internal/utils" "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/path" @@ -31,12 +31,12 @@ type outputSslModel struct { Key types.String `tfsdk:"key"` } -func (model *outputModel) populateFromAPI(ctx context.Context, union *fleetapi.OutputUnion) (diags diag.Diagnostics) { +func (model *outputModel) populateFromAPI(ctx context.Context, union *kbapi.OutputUnion) (diags diag.Diagnostics) { if union == nil { return } - doSsl := func(ssl *fleetapi.OutputSsl) types.List { + doSsl := func(ssl *kbapi.OutputSsl) types.List { if ssl != nil { p := path.Root("ssl") sslModels := []outputSslModel{{ @@ -104,12 +104,12 @@ func (model *outputModel) populateFromAPI(ctx context.Context, union *fleetapi.O return } -func (model outputModel) toAPICreateModel(ctx context.Context) (union fleetapi.NewOutputUnion, diags diag.Diagnostics) { - doSsl := func() *fleetapi.NewOutputSsl { +func (model outputModel) toAPICreateModel(ctx context.Context) (union kbapi.NewOutputUnion, diags diag.Diagnostics) { + doSsl := func() *kbapi.NewOutputSsl { if utils.IsKnown(model.Ssl) { sslModels := utils.ListTypeAs[outputSslModel](ctx, model.Ssl, path.Root("ssl"), &diags) if len(sslModels) > 0 { - return &fleetapi.NewOutputSsl{ + return &kbapi.NewOutputSsl{ Certificate: sslModels[0].Certificate.ValueStringPointer(), CertificateAuthorities: utils.SliceRef(utils.ListTypeToSlice_String(ctx, sslModels[0].CertificateAuthorities, path.Root("certificate_authorities"), &diags)), Key: sslModels[0].Key.ValueStringPointer(), @@ -122,8 +122,8 @@ func (model outputModel) toAPICreateModel(ctx context.Context) (union fleetapi.N outputType := model.Type.ValueString() switch outputType { case "elasticsearch": - body := fleetapi.NewOutputElasticsearch{ - Type: fleetapi.NewOutputElasticsearchTypeElasticsearch, + body := kbapi.NewOutputElasticsearch{ + Type: kbapi.NewOutputElasticsearchTypeElasticsearch, CaSha256: model.CaSha256.ValueStringPointer(), CaTrustedFingerprint: model.CaTrustedFingerprint.ValueStringPointer(), ConfigYaml: model.ConfigYaml.ValueStringPointer(), @@ -142,8 +142,8 @@ func (model outputModel) toAPICreateModel(ctx context.Context) (union fleetapi.N } case "logstash": - body := fleetapi.NewOutputLogstash{ - Type: fleetapi.NewOutputLogstashTypeLogstash, + body := kbapi.NewOutputLogstash{ + Type: kbapi.NewOutputLogstashTypeLogstash, CaSha256: model.CaSha256.ValueStringPointer(), CaTrustedFingerprint: model.CaTrustedFingerprint.ValueStringPointer(), ConfigYaml: model.ConfigYaml.ValueStringPointer(), @@ -168,12 +168,12 @@ func (model outputModel) toAPICreateModel(ctx context.Context) (union fleetapi.N return } -func (model outputModel) toAPIUpdateModel(ctx context.Context) (union fleetapi.UpdateOutputUnion, diags diag.Diagnostics) { - doSsl := func() *fleetapi.UpdateOutputSsl { +func (model outputModel) toAPIUpdateModel(ctx context.Context) (union kbapi.UpdateOutputUnion, diags diag.Diagnostics) { + doSsl := func() *kbapi.UpdateOutputSsl { if utils.IsKnown(model.Ssl) { sslModels := utils.ListTypeAs[outputSslModel](ctx, model.Ssl, path.Root("ssl"), &diags) if len(sslModels) > 0 { - return &fleetapi.UpdateOutputSsl{ + return &kbapi.UpdateOutputSsl{ Certificate: sslModels[0].Certificate.ValueStringPointer(), CertificateAuthorities: utils.SliceRef(utils.ListTypeToSlice_String(ctx, sslModels[0].CertificateAuthorities, path.Root("certificate_authorities"), &diags)), Key: sslModels[0].Key.ValueStringPointer(), @@ -186,8 +186,8 @@ func (model outputModel) toAPIUpdateModel(ctx context.Context) (union fleetapi.U outputType := model.Type.ValueString() switch outputType { case "elasticsearch": - body := fleetapi.UpdateOutputElasticsearch{ - Type: utils.Pointer(fleetapi.Elasticsearch), + body := kbapi.UpdateOutputElasticsearch{ + Type: utils.Pointer(kbapi.Elasticsearch), CaSha256: model.CaSha256.ValueStringPointer(), CaTrustedFingerprint: model.CaTrustedFingerprint.ValueStringPointer(), ConfigYaml: model.ConfigYaml.ValueStringPointer(), @@ -205,8 +205,8 @@ func (model outputModel) toAPIUpdateModel(ctx context.Context) (union fleetapi.U } case "logstash": - body := fleetapi.UpdateOutputLogstash{ - Type: utils.Pointer(fleetapi.Logstash), + body := kbapi.UpdateOutputLogstash{ + Type: utils.Pointer(kbapi.Logstash), CaSha256: model.CaSha256.ValueStringPointer(), CaTrustedFingerprint: model.CaTrustedFingerprint.ValueStringPointer(), ConfigYaml: model.ConfigYaml.ValueStringPointer(), diff --git a/internal/fleet/server_host/models.go b/internal/fleet/server_host/models.go index aaa43d48e..171af5da2 100644 --- a/internal/fleet/server_host/models.go +++ b/internal/fleet/server_host/models.go @@ -3,7 +3,7 @@ package server_host import ( "context" - fleetapi "github.com/elastic/terraform-provider-elasticstack/generated/fleet" + "github.com/elastic/terraform-provider-elasticstack/generated/kibana" "github.com/elastic/terraform-provider-elasticstack/internal/utils" "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/path" @@ -18,7 +18,7 @@ type serverHostModel struct { Default types.Bool `tfsdk:"default"` } -func (model *serverHostModel) populateFromAPI(ctx context.Context, data *fleetapi.ServerHost) (diags diag.Diagnostics) { +func (model *serverHostModel) populateFromAPI(ctx context.Context, data *kbapi.ServerHost) (diags diag.Diagnostics) { if data == nil { return nil } @@ -32,8 +32,8 @@ func (model *serverHostModel) populateFromAPI(ctx context.Context, data *fleetap return } -func (model serverHostModel) toAPICreateModel(ctx context.Context) (body fleetapi.CreateFleetServerHostJSONRequestBody, diags diag.Diagnostics) { - body = fleetapi.CreateFleetServerHostJSONRequestBody{ +func (model serverHostModel) toAPICreateModel(ctx context.Context) (body kbapi.CreateFleetServerHostJSONRequestBody, diags diag.Diagnostics) { + body = kbapi.CreateFleetServerHostJSONRequestBody{ HostUrls: utils.ListTypeToSlice_String(ctx, model.Hosts, path.Root("hosts"), &diags), Id: model.HostID.ValueStringPointer(), IsDefault: model.Default.ValueBoolPointer(), @@ -42,8 +42,8 @@ func (model serverHostModel) toAPICreateModel(ctx context.Context) (body fleetap return } -func (model serverHostModel) toAPIUpdateModel(ctx context.Context) (body fleetapi.UpdateFleetServerHostJSONRequestBody, diags diag.Diagnostics) { - body = fleetapi.UpdateFleetServerHostJSONRequestBody{ +func (model serverHostModel) toAPIUpdateModel(ctx context.Context) (body kbapi.UpdateFleetServerHostJSONRequestBody, diags diag.Diagnostics) { + body = kbapi.UpdateFleetServerHostJSONRequestBody{ HostUrls: utils.SliceRef(utils.ListTypeToSlice_String(ctx, model.Hosts, path.Root("hosts"), &diags)), IsDefault: model.Default.ValueBoolPointer(), Name: model.Name.ValueStringPointer(), diff --git a/tools/fleet_gen.go b/tools/fleet_gen.go deleted file mode 100644 index ee36a2df1..000000000 --- a/tools/fleet_gen.go +++ /dev/null @@ -1,3 +0,0 @@ -package tools - -//go:generate make -C ../generated/fleet clean all From d11c213347d32de7e1c10a2910be2dd31db68aa9 Mon Sep 17 00:00:00 2001 From: Raymond Lynch Date: Tue, 29 Oct 2024 12:19:00 -0400 Subject: [PATCH 08/15] update changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f0d2c602..d612526b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ ## [Unreleased] - Use the auto-generated OAS schema from elastic/kibana for the Fleet API. ([#834](https://github.com/elastic/terraform-provider-elasticstack/issues/834)) -- Use the auto-generated OAS schema from elastic/kibana for parts of the Kibana API as applicable. Keep libs/go-kibana-rest until migration can be completed. Clean and simplify the `elasticstack_kibana_data_view` resource to match the styling of Fleet resources. ([#881](https://github.com/elastic/terraform-provider-elasticstack/issues/881)) +- Rename generated/fleet to generated/kibana, add data_view APIs. Keep libs/go-kibana-rest until migration can be completed. Clean and simplify the `elasticstack_kibana_data_view` resource to match the styling of Fleet resources. ([#881](https://github.com/elastic/terraform-provider-elasticstack/issues/881)) ## [0.11.11] - 2024-10-25 From 71b9ddee37cb3d695d3f576498efc36ed6cc738b Mon Sep 17 00:00:00 2001 From: Raymond Lynch Date: Tue, 29 Oct 2024 15:26:38 -0400 Subject: [PATCH 09/15] gen kibana api --- generated/kibana/kibana.gen.go | 2186 ++++++++++++++++---------------- 1 file changed, 1093 insertions(+), 1093 deletions(-) diff --git a/generated/kibana/kibana.gen.go b/generated/kibana/kibana.gen.go index 9dab8fdff..a71ed7703 100644 --- a/generated/kibana/kibana.gen.go +++ b/generated/kibana/kibana.gen.go @@ -32,926 +32,6 @@ const ( N404 DataViews404ResponseStatusCode = 404 ) -// DataViews400Response defines model for Data_views_400_response. -type DataViews400Response struct { - Error string `json:"error"` - Message string `json:"message"` - StatusCode float32 `json:"statusCode"` -} - -// DataViews404Response defines model for Data_views_404_response. -type DataViews404Response struct { - Error *DataViews404ResponseError `json:"error,omitempty"` - Message *string `json:"message,omitempty"` - StatusCode *DataViews404ResponseStatusCode `json:"statusCode,omitempty"` -} - -// DataViews404ResponseError defines model for DataViews404Response.Error. -type DataViews404ResponseError string - -// DataViews404ResponseStatusCode defines model for DataViews404Response.StatusCode. -type DataViews404ResponseStatusCode int - -// DataViewsAllownoindex Allows the data view saved object to exist before the data is available. -type DataViewsAllownoindex = bool - -// DataViewsCreateDataViewRequestObject defines model for Data_views_create_data_view_request_object. -type DataViewsCreateDataViewRequestObject struct { - // DataView The data view object. - DataView DataViewsCreateDataViewRequestObjectInner `json:"data_view"` - - // Override Override an existing data view if a data view with the provided title already exists. - Override *bool `json:"override,omitempty"` -} - -// DataViewsCreateDataViewRequestObjectInner The data view object. -type DataViewsCreateDataViewRequestObjectInner struct { - // AllowNoIndex Allows the data view saved object to exist before the data is available. - AllowNoIndex *DataViewsAllownoindex `json:"allowNoIndex,omitempty"` - FieldAttrs *map[string]DataViewsFieldattrs `json:"fieldAttrs,omitempty"` - - // FieldFormats A map of field formats by field name. - FieldFormats *DataViewsFieldformats `json:"fieldFormats,omitempty"` - Fields *map[string]interface{} `json:"fields,omitempty"` - Id *string `json:"id,omitempty"` - - // Name The data view name. - Name *string `json:"name,omitempty"` - - // Namespaces An array of space identifiers for sharing the data view between multiple spaces. - Namespaces *DataViewsNamespaces `json:"namespaces,omitempty"` - RuntimeFieldMap *map[string]DataViewsRuntimefieldmap `json:"runtimeFieldMap,omitempty"` - - // SourceFilters The array of field names you want to filter out in Discover. - SourceFilters *DataViewsSourcefilters `json:"sourceFilters,omitempty"` - - // TimeFieldName The timestamp field name, which you use for time-based data views. - TimeFieldName *DataViewsTimefieldname `json:"timeFieldName,omitempty"` - - // Title Comma-separated list of data streams, indices, and aliases that you want to search. Supports wildcards (`*`). - Title DataViewsTitle `json:"title"` - - // Type When set to `rollup`, identifies the rollup data views. - Type *DataViewsType `json:"type,omitempty"` - - // TypeMeta When you use rollup indices, contains the field list for the rollup data view API endpoints. - TypeMeta *DataViewsTypemeta `json:"typeMeta,omitempty"` - Version *string `json:"version,omitempty"` -} - -// DataViewsDataViewResponseObject defines model for Data_views_data_view_response_object. -type DataViewsDataViewResponseObject struct { - DataView *DataViewsDataViewResponseObjectInner `json:"data_view,omitempty"` -} - -// DataViewsDataViewResponseObjectInner defines model for Data_views_data_view_response_object_inner. -type DataViewsDataViewResponseObjectInner struct { - // AllowNoIndex Allows the data view saved object to exist before the data is available. - AllowNoIndex *DataViewsAllownoindex `json:"allowNoIndex,omitempty"` - FieldAttrs *map[string]DataViewsFieldattrs `json:"fieldAttrs,omitempty"` - - // FieldFormats A map of field formats by field name. - FieldFormats *DataViewsFieldformats `json:"fieldFormats,omitempty"` - Fields *map[string]interface{} `json:"fields,omitempty"` - Id *string `json:"id,omitempty"` - - // Name The data view name. - Name *string `json:"name,omitempty"` - - // Namespaces An array of space identifiers for sharing the data view between multiple spaces. - Namespaces *DataViewsNamespaces `json:"namespaces,omitempty"` - RuntimeFieldMap *map[string]DataViewsRuntimefieldmap `json:"runtimeFieldMap,omitempty"` - - // SourceFilters The array of field names you want to filter out in Discover. - SourceFilters *DataViewsSourcefilters `json:"sourceFilters,omitempty"` - - // TimeFieldName The timestamp field name, which you use for time-based data views. - TimeFieldName *DataViewsTimefieldname `json:"timeFieldName,omitempty"` - - // Title Comma-separated list of data streams, indices, and aliases that you want to search. Supports wildcards (`*`). - Title *DataViewsTitle `json:"title,omitempty"` - - // TypeMeta When you use rollup indices, contains the field list for the rollup data view API endpoints. - TypeMeta *DataViewsTypemetaResponse `json:"typeMeta"` - Version *string `json:"version,omitempty"` -} - -// DataViewsFieldattrs A map of field attributes by field name. -type DataViewsFieldattrs struct { - // Count Popularity count for the field. - Count *int `json:"count,omitempty"` - - // CustomDescription Custom description for the field. - CustomDescription *string `json:"customDescription,omitempty"` - - // CustomLabel Custom label for the field. - CustomLabel *string `json:"customLabel,omitempty"` -} - -// DataViewsFieldformat defines model for Data_views_fieldformat. -type DataViewsFieldformat struct { - Id *string `json:"id,omitempty"` - Params *DataViewsFieldformatParams `json:"params,omitempty"` -} - -// DataViewsFieldformatParams defines model for Data_views_fieldformat_params. -type DataViewsFieldformatParams struct { - LabelTemplate *string `json:"labelTemplate,omitempty"` - Pattern *string `json:"pattern,omitempty"` - UrlTemplate *string `json:"urlTemplate,omitempty"` -} - -// DataViewsFieldformats A map of field formats by field name. -type DataViewsFieldformats map[string]DataViewsFieldformat - -// DataViewsNamespaces An array of space identifiers for sharing the data view between multiple spaces. -type DataViewsNamespaces = []string - -// DataViewsRuntimefieldmap A map of runtime field definitions by field name. -type DataViewsRuntimefieldmap struct { - Script DataViewsRuntimefieldmapScript `json:"script"` - - // Type Mapping type of the runtime field. - Type string `json:"type"` -} - -// DataViewsRuntimefieldmapScript defines model for Data_views_runtimefieldmap_script. -type DataViewsRuntimefieldmapScript struct { - // Source Script for the runtime field. - Source *string `json:"source,omitempty"` -} - -// DataViewsSourcefilterItem defines model for Data_views_sourcefilter_item. -type DataViewsSourcefilterItem struct { - Value string `json:"value"` -} - -// DataViewsSourcefilters The array of field names you want to filter out in Discover. -type DataViewsSourcefilters = []DataViewsSourcefilterItem - -// DataViewsTimefieldname The timestamp field name, which you use for time-based data views. -type DataViewsTimefieldname = string - -// DataViewsTitle Comma-separated list of data streams, indices, and aliases that you want to search. Supports wildcards (`*`). -type DataViewsTitle = string - -// DataViewsType When set to `rollup`, identifies the rollup data views. -type DataViewsType = string - -// DataViewsTypemeta When you use rollup indices, contains the field list for the rollup data view API endpoints. -type DataViewsTypemeta struct { - // Aggs A map of rollup restrictions by aggregation type and field name. - Aggs map[string]interface{} `json:"aggs"` - - // Params Properties for retrieving rollup fields. - Params map[string]interface{} `json:"params"` -} - -// DataViewsTypemetaResponse When you use rollup indices, contains the field list for the rollup data view API endpoints. -type DataViewsTypemetaResponse struct { - // Aggs A map of rollup restrictions by aggregation type and field name. - Aggs *map[string]interface{} `json:"aggs,omitempty"` - - // Params Properties for retrieving rollup fields. - Params *map[string]interface{} `json:"params,omitempty"` -} - -// DataViewsUpdateDataViewRequestObject defines model for Data_views_update_data_view_request_object. -type DataViewsUpdateDataViewRequestObject struct { - // DataView The data view properties you want to update. Only the specified properties are updated in the data view. Unspecified fields stay as they are persisted. - DataView DataViewsUpdateDataViewRequestObjectInner `json:"data_view"` - - // RefreshFields Reloads the data view fields after the data view is updated. - RefreshFields *bool `json:"refresh_fields,omitempty"` -} - -// DataViewsUpdateDataViewRequestObjectInner The data view properties you want to update. Only the specified properties are updated in the data view. Unspecified fields stay as they are persisted. -type DataViewsUpdateDataViewRequestObjectInner struct { - // AllowNoIndex Allows the data view saved object to exist before the data is available. - AllowNoIndex *DataViewsAllownoindex `json:"allowNoIndex,omitempty"` - - // FieldFormats A map of field formats by field name. - FieldFormats *DataViewsFieldformats `json:"fieldFormats,omitempty"` - Fields *map[string]interface{} `json:"fields,omitempty"` - Name *string `json:"name,omitempty"` - RuntimeFieldMap *map[string]DataViewsRuntimefieldmap `json:"runtimeFieldMap,omitempty"` - - // SourceFilters The array of field names you want to filter out in Discover. - SourceFilters *DataViewsSourcefilters `json:"sourceFilters,omitempty"` - - // TimeFieldName The timestamp field name, which you use for time-based data views. - TimeFieldName *DataViewsTimefieldname `json:"timeFieldName,omitempty"` - - // Title Comma-separated list of data streams, indices, and aliases that you want to search. Supports wildcards (`*`). - Title *DataViewsTitle `json:"title,omitempty"` - - // Type When set to `rollup`, identifies the rollup data views. - Type *DataViewsType `json:"type,omitempty"` - - // TypeMeta When you use rollup indices, contains the field list for the rollup data view API endpoints. - TypeMeta *DataViewsTypemeta `json:"typeMeta,omitempty"` -} - -// GetDataViewsResponseItem defines model for get_data_views_response_item. -type GetDataViewsResponseItem struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Namespaces *[]string `json:"namespaces,omitempty"` - Title *string `json:"title,omitempty"` - TypeMeta *map[string]interface{} `json:"typeMeta,omitempty"` -} - -// DataViewsViewId defines model for Data_views_view_id. -type DataViewsViewId = string - -// SpaceId defines model for spaceId. -type SpaceId = string - -// CreateDataViewJSONRequestBody defines body for CreateDataView for application/json ContentType. -type CreateDataViewJSONRequestBody = DataViewsCreateDataViewRequestObject - -// UpdateDataViewJSONRequestBody defines body for UpdateDataView for application/json ContentType. -type UpdateDataViewJSONRequestBody = DataViewsUpdateDataViewRequestObject - -func (c *Client) GetDataViews(ctx context.Context, spaceId SpaceId, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetDataViewsRequest(c.Server, spaceId) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) CreateDataViewWithBody(ctx context.Context, spaceId SpaceId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateDataViewRequestWithBody(c.Server, spaceId, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) CreateDataView(ctx context.Context, spaceId SpaceId, body CreateDataViewJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateDataViewRequest(c.Server, spaceId, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) DeleteDataView(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewDeleteDataViewRequest(c.Server, spaceId, viewId) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) GetDataView(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetDataViewRequest(c.Server, spaceId, viewId) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) UpdateDataViewWithBody(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewUpdateDataViewRequestWithBody(c.Server, spaceId, viewId, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) UpdateDataView(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, body UpdateDataViewJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewUpdateDataViewRequest(c.Server, spaceId, viewId, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -// NewGetDataViewsRequest generates requests for GetDataViews -func NewGetDataViewsRequest(server string, spaceId SpaceId) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "spaceId", runtime.ParamLocationPath, spaceId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/s/%s/api/data_views", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewCreateDataViewRequest calls the generic CreateDataView builder with application/json body -func NewCreateDataViewRequest(server string, spaceId SpaceId, body CreateDataViewJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewCreateDataViewRequestWithBody(server, spaceId, "application/json", bodyReader) -} - -// NewCreateDataViewRequestWithBody generates requests for CreateDataView with any type of body -func NewCreateDataViewRequestWithBody(server string, spaceId SpaceId, contentType string, body io.Reader) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "spaceId", runtime.ParamLocationPath, spaceId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/s/%s/api/data_views/data_view", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -// NewDeleteDataViewRequest generates requests for DeleteDataView -func NewDeleteDataViewRequest(server string, spaceId SpaceId, viewId DataViewsViewId) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "spaceId", runtime.ParamLocationPath, spaceId) - if err != nil { - return nil, err - } - - var pathParam1 string - - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "viewId", runtime.ParamLocationPath, viewId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/s/%s/api/data_views/data_view/%s", pathParam0, pathParam1) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("DELETE", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewGetDataViewRequest generates requests for GetDataView -func NewGetDataViewRequest(server string, spaceId SpaceId, viewId DataViewsViewId) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "spaceId", runtime.ParamLocationPath, spaceId) - if err != nil { - return nil, err - } - - var pathParam1 string - - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "viewId", runtime.ParamLocationPath, viewId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/s/%s/api/data_views/data_view/%s", pathParam0, pathParam1) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - -// NewUpdateDataViewRequest calls the generic UpdateDataView builder with application/json body -func NewUpdateDataViewRequest(server string, spaceId SpaceId, viewId DataViewsViewId, body UpdateDataViewJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewUpdateDataViewRequestWithBody(server, spaceId, viewId, "application/json", bodyReader) -} - -// NewUpdateDataViewRequestWithBody generates requests for UpdateDataView with any type of body -func NewUpdateDataViewRequestWithBody(server string, spaceId SpaceId, viewId DataViewsViewId, contentType string, body io.Reader) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "spaceId", runtime.ParamLocationPath, spaceId) - if err != nil { - return nil, err - } - - var pathParam1 string - - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "viewId", runtime.ParamLocationPath, viewId) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/s/%s/api/data_views/data_view/%s", pathParam0, pathParam1) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { - return nil, err - } - - req.Header.Add("Content-Type", contentType) - - return req, nil -} - -func (c *Client) applyEditors(ctx context.Context, req *http.Request, additionalEditors []RequestEditorFn) error { - for _, r := range c.RequestEditors { - if err := r(ctx, req); err != nil { - return err - } - } - for _, r := range additionalEditors { - if err := r(ctx, req); err != nil { - return err - } - } - return nil -} - -// ClientWithResponses builds on ClientInterface to offer response payloads -type ClientWithResponses struct { - ClientInterface -} - -// NewClientWithResponses creates a new ClientWithResponses, which wraps -// Client with return type handling -func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error) { - client, err := NewClient(server, opts...) - if err != nil { - return nil, err - } - return &ClientWithResponses{client}, nil -} - -// WithBaseURL overrides the baseURL. -func WithBaseURL(baseURL string) ClientOption { - return func(c *Client) error { - newBaseURL, err := url.Parse(baseURL) - if err != nil { - return err - } - c.Server = newBaseURL.String() - return nil - } -} - -type GetDataViewsResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *struct { - DataView *[]GetDataViewsResponseItem `json:"data_view,omitempty"` - } - JSON400 *DataViews400Response -} - -// Status returns HTTPResponse.Status -func (r GetDataViewsResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r GetDataViewsResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type CreateDataViewResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *DataViewsDataViewResponseObject - JSON400 *DataViews400Response -} - -// Status returns HTTPResponse.Status -func (r CreateDataViewResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r CreateDataViewResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type DeleteDataViewResponse struct { - Body []byte - HTTPResponse *http.Response - JSON404 *DataViews404Response -} - -// Status returns HTTPResponse.Status -func (r DeleteDataViewResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r DeleteDataViewResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type GetDataViewResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *DataViewsDataViewResponseObject - JSON404 *DataViews404Response -} - -// Status returns HTTPResponse.Status -func (r GetDataViewResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r GetDataViewResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -type UpdateDataViewResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *DataViewsDataViewResponseObject - JSON400 *DataViews400Response -} - -// Status returns HTTPResponse.Status -func (r UpdateDataViewResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status - } - return http.StatusText(0) -} - -// StatusCode returns HTTPResponse.StatusCode -func (r UpdateDataViewResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode - } - return 0 -} - -// GetDataViewsWithResponse request returning *GetDataViewsResponse -func (c *ClientWithResponses) GetDataViewsWithResponse(ctx context.Context, spaceId SpaceId, reqEditors ...RequestEditorFn) (*GetDataViewsResponse, error) { - rsp, err := c.GetDataViews(ctx, spaceId, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetDataViewsResponse(rsp) -} - -// CreateDataViewWithBodyWithResponse request with arbitrary body returning *CreateDataViewResponse -func (c *ClientWithResponses) CreateDataViewWithBodyWithResponse(ctx context.Context, spaceId SpaceId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateDataViewResponse, error) { - rsp, err := c.CreateDataViewWithBody(ctx, spaceId, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseCreateDataViewResponse(rsp) -} - -func (c *ClientWithResponses) CreateDataViewWithResponse(ctx context.Context, spaceId SpaceId, body CreateDataViewJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateDataViewResponse, error) { - rsp, err := c.CreateDataView(ctx, spaceId, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseCreateDataViewResponse(rsp) -} - -// DeleteDataViewWithResponse request returning *DeleteDataViewResponse -func (c *ClientWithResponses) DeleteDataViewWithResponse(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, reqEditors ...RequestEditorFn) (*DeleteDataViewResponse, error) { - rsp, err := c.DeleteDataView(ctx, spaceId, viewId, reqEditors...) - if err != nil { - return nil, err - } - return ParseDeleteDataViewResponse(rsp) -} - -// GetDataViewWithResponse request returning *GetDataViewResponse -func (c *ClientWithResponses) GetDataViewWithResponse(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, reqEditors ...RequestEditorFn) (*GetDataViewResponse, error) { - rsp, err := c.GetDataView(ctx, spaceId, viewId, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetDataViewResponse(rsp) -} - -// UpdateDataViewWithBodyWithResponse request with arbitrary body returning *UpdateDataViewResponse -func (c *ClientWithResponses) UpdateDataViewWithBodyWithResponse(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateDataViewResponse, error) { - rsp, err := c.UpdateDataViewWithBody(ctx, spaceId, viewId, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseUpdateDataViewResponse(rsp) -} - -func (c *ClientWithResponses) UpdateDataViewWithResponse(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, body UpdateDataViewJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateDataViewResponse, error) { - rsp, err := c.UpdateDataView(ctx, spaceId, viewId, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseUpdateDataViewResponse(rsp) -} - -// ParseGetDataViewsResponse parses an HTTP response from a GetDataViewsWithResponse call -func ParseGetDataViewsResponse(rsp *http.Response) (*GetDataViewsResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &GetDataViewsResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest struct { - DataView *[]GetDataViewsResponseItem `json:"data_view,omitempty"` - } - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest DataViews400Response - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON400 = &dest - - } - - return response, nil -} - -// ParseCreateDataViewResponse parses an HTTP response from a CreateDataViewWithResponse call -func ParseCreateDataViewResponse(rsp *http.Response) (*CreateDataViewResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &CreateDataViewResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest DataViewsDataViewResponseObject - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest DataViews400Response - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON400 = &dest - - } - - return response, nil -} - -// ParseDeleteDataViewResponse parses an HTTP response from a DeleteDataViewWithResponse call -func ParseDeleteDataViewResponse(rsp *http.Response) (*DeleteDataViewResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &DeleteDataViewResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: - var dest DataViews404Response - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON404 = &dest - - } - - return response, nil -} - -// ParseGetDataViewResponse parses an HTTP response from a GetDataViewWithResponse call -func ParseGetDataViewResponse(rsp *http.Response) (*GetDataViewResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &GetDataViewResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest DataViewsDataViewResponseObject - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: - var dest DataViews404Response - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON404 = &dest - - } - - return response, nil -} - -// ParseUpdateDataViewResponse parses an HTTP response from a UpdateDataViewWithResponse call -func ParseUpdateDataViewResponse(rsp *http.Response) (*UpdateDataViewResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &UpdateDataViewResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest DataViewsDataViewResponseObject - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest DataViews400Response - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON400 = &dest - - } - - return response, nil -} - // Defines values for AgentPolicyMonitoringEnabled. const ( AgentPolicyMonitoringEnabledLogs AgentPolicyMonitoringEnabled = "logs" @@ -1403,86 +483,306 @@ const ( UpdateOutputRemoteElasticsearchPresetThroughput UpdateOutputRemoteElasticsearchPreset = "throughput" ) -// Defines values for UpdateOutputRemoteElasticsearchType. -const ( - RemoteElasticsearch UpdateOutputRemoteElasticsearchType = "remote_elasticsearch" -) +// Defines values for UpdateOutputRemoteElasticsearchType. +const ( + RemoteElasticsearch UpdateOutputRemoteElasticsearchType = "remote_elasticsearch" +) + +// Defines values for UpdateOutputSslVerificationMode. +const ( + Certificate UpdateOutputSslVerificationMode = "certificate" + Full UpdateOutputSslVerificationMode = "full" + None UpdateOutputSslVerificationMode = "none" + Strict UpdateOutputSslVerificationMode = "strict" +) + +// Defines values for GetAgentPoliciesParamsSortOrder. +const ( + GetAgentPoliciesParamsSortOrderAsc GetAgentPoliciesParamsSortOrder = "asc" + GetAgentPoliciesParamsSortOrderDesc GetAgentPoliciesParamsSortOrder = "desc" +) + +// Defines values for GetAgentPoliciesParamsFormat. +const ( + GetAgentPoliciesParamsFormatLegacy GetAgentPoliciesParamsFormat = "legacy" + GetAgentPoliciesParamsFormatSimplified GetAgentPoliciesParamsFormat = "simplified" +) + +// Defines values for CreateAgentPolicyJSONBodyMonitoringEnabled. +const ( + CreateAgentPolicyJSONBodyMonitoringEnabledLogs CreateAgentPolicyJSONBodyMonitoringEnabled = "logs" + CreateAgentPolicyJSONBodyMonitoringEnabledMetrics CreateAgentPolicyJSONBodyMonitoringEnabled = "metrics" + CreateAgentPolicyJSONBodyMonitoringEnabledTraces CreateAgentPolicyJSONBodyMonitoringEnabled = "traces" +) + +// Defines values for GetAgentPolicyParamsFormat. +const ( + GetAgentPolicyParamsFormatLegacy GetAgentPolicyParamsFormat = "legacy" + GetAgentPolicyParamsFormatSimplified GetAgentPolicyParamsFormat = "simplified" +) + +// Defines values for UpdateAgentPolicyParamsFormat. +const ( + UpdateAgentPolicyParamsFormatLegacy UpdateAgentPolicyParamsFormat = "legacy" + UpdateAgentPolicyParamsFormatSimplified UpdateAgentPolicyParamsFormat = "simplified" +) + +// Defines values for UpdateAgentPolicyJSONBodyMonitoringEnabled. +const ( + Logs UpdateAgentPolicyJSONBodyMonitoringEnabled = "logs" + Metrics UpdateAgentPolicyJSONBodyMonitoringEnabled = "metrics" + Traces UpdateAgentPolicyJSONBodyMonitoringEnabled = "traces" +) + +// Defines values for GetPackagePoliciesParamsSortOrder. +const ( + GetPackagePoliciesParamsSortOrderAsc GetPackagePoliciesParamsSortOrder = "asc" + GetPackagePoliciesParamsSortOrderDesc GetPackagePoliciesParamsSortOrder = "desc" +) + +// Defines values for GetPackagePoliciesParamsFormat. +const ( + GetPackagePoliciesParamsFormatLegacy GetPackagePoliciesParamsFormat = "legacy" + GetPackagePoliciesParamsFormatSimplified GetPackagePoliciesParamsFormat = "simplified" +) + +// Defines values for CreatePackagePolicyParamsFormat. +const ( + CreatePackagePolicyParamsFormatLegacy CreatePackagePolicyParamsFormat = "legacy" + CreatePackagePolicyParamsFormatSimplified CreatePackagePolicyParamsFormat = "simplified" +) + +// Defines values for GetPackagePolicyParamsFormat. +const ( + GetPackagePolicyParamsFormatLegacy GetPackagePolicyParamsFormat = "legacy" + GetPackagePolicyParamsFormatSimplified GetPackagePolicyParamsFormat = "simplified" +) + +// Defines values for UpdatePackagePolicyParamsFormat. +const ( + Legacy UpdatePackagePolicyParamsFormat = "legacy" + Simplified UpdatePackagePolicyParamsFormat = "simplified" +) + +// DataViews400Response defines model for Data_views_400_response. +type DataViews400Response struct { + Error string `json:"error"` + Message string `json:"message"` + StatusCode float32 `json:"statusCode"` +} + +// DataViews404Response defines model for Data_views_404_response. +type DataViews404Response struct { + Error *DataViews404ResponseError `json:"error,omitempty"` + Message *string `json:"message,omitempty"` + StatusCode *DataViews404ResponseStatusCode `json:"statusCode,omitempty"` +} + +// DataViews404ResponseError defines model for DataViews404Response.Error. +type DataViews404ResponseError string + +// DataViews404ResponseStatusCode defines model for DataViews404Response.StatusCode. +type DataViews404ResponseStatusCode int + +// DataViewsAllownoindex Allows the data view saved object to exist before the data is available. +type DataViewsAllownoindex = bool + +// DataViewsCreateDataViewRequestObject defines model for Data_views_create_data_view_request_object. +type DataViewsCreateDataViewRequestObject struct { + // DataView The data view object. + DataView DataViewsCreateDataViewRequestObjectInner `json:"data_view"` + + // Override Override an existing data view if a data view with the provided title already exists. + Override *bool `json:"override,omitempty"` +} + +// DataViewsCreateDataViewRequestObjectInner The data view object. +type DataViewsCreateDataViewRequestObjectInner struct { + // AllowNoIndex Allows the data view saved object to exist before the data is available. + AllowNoIndex *DataViewsAllownoindex `json:"allowNoIndex,omitempty"` + FieldAttrs *map[string]DataViewsFieldattrs `json:"fieldAttrs,omitempty"` + + // FieldFormats A map of field formats by field name. + FieldFormats *DataViewsFieldformats `json:"fieldFormats,omitempty"` + Fields *map[string]interface{} `json:"fields,omitempty"` + Id *string `json:"id,omitempty"` + + // Name The data view name. + Name *string `json:"name,omitempty"` + + // Namespaces An array of space identifiers for sharing the data view between multiple spaces. + Namespaces *DataViewsNamespaces `json:"namespaces,omitempty"` + RuntimeFieldMap *map[string]DataViewsRuntimefieldmap `json:"runtimeFieldMap,omitempty"` + + // SourceFilters The array of field names you want to filter out in Discover. + SourceFilters *DataViewsSourcefilters `json:"sourceFilters,omitempty"` + + // TimeFieldName The timestamp field name, which you use for time-based data views. + TimeFieldName *DataViewsTimefieldname `json:"timeFieldName,omitempty"` + + // Title Comma-separated list of data streams, indices, and aliases that you want to search. Supports wildcards (`*`). + Title DataViewsTitle `json:"title"` + + // Type When set to `rollup`, identifies the rollup data views. + Type *DataViewsType `json:"type,omitempty"` + + // TypeMeta When you use rollup indices, contains the field list for the rollup data view API endpoints. + TypeMeta *DataViewsTypemeta `json:"typeMeta,omitempty"` + Version *string `json:"version,omitempty"` +} + +// DataViewsDataViewResponseObject defines model for Data_views_data_view_response_object. +type DataViewsDataViewResponseObject struct { + DataView *DataViewsDataViewResponseObjectInner `json:"data_view,omitempty"` +} + +// DataViewsDataViewResponseObjectInner defines model for Data_views_data_view_response_object_inner. +type DataViewsDataViewResponseObjectInner struct { + // AllowNoIndex Allows the data view saved object to exist before the data is available. + AllowNoIndex *DataViewsAllownoindex `json:"allowNoIndex,omitempty"` + FieldAttrs *map[string]DataViewsFieldattrs `json:"fieldAttrs,omitempty"` + + // FieldFormats A map of field formats by field name. + FieldFormats *DataViewsFieldformats `json:"fieldFormats,omitempty"` + Fields *map[string]interface{} `json:"fields,omitempty"` + Id *string `json:"id,omitempty"` + + // Name The data view name. + Name *string `json:"name,omitempty"` + + // Namespaces An array of space identifiers for sharing the data view between multiple spaces. + Namespaces *DataViewsNamespaces `json:"namespaces,omitempty"` + RuntimeFieldMap *map[string]DataViewsRuntimefieldmap `json:"runtimeFieldMap,omitempty"` + + // SourceFilters The array of field names you want to filter out in Discover. + SourceFilters *DataViewsSourcefilters `json:"sourceFilters,omitempty"` + + // TimeFieldName The timestamp field name, which you use for time-based data views. + TimeFieldName *DataViewsTimefieldname `json:"timeFieldName,omitempty"` + + // Title Comma-separated list of data streams, indices, and aliases that you want to search. Supports wildcards (`*`). + Title *DataViewsTitle `json:"title,omitempty"` + + // TypeMeta When you use rollup indices, contains the field list for the rollup data view API endpoints. + TypeMeta *DataViewsTypemetaResponse `json:"typeMeta"` + Version *string `json:"version,omitempty"` +} + +// DataViewsFieldattrs A map of field attributes by field name. +type DataViewsFieldattrs struct { + // Count Popularity count for the field. + Count *int `json:"count,omitempty"` + + // CustomDescription Custom description for the field. + CustomDescription *string `json:"customDescription,omitempty"` + + // CustomLabel Custom label for the field. + CustomLabel *string `json:"customLabel,omitempty"` +} + +// DataViewsFieldformat defines model for Data_views_fieldformat. +type DataViewsFieldformat struct { + Id *string `json:"id,omitempty"` + Params *DataViewsFieldformatParams `json:"params,omitempty"` +} + +// DataViewsFieldformatParams defines model for Data_views_fieldformat_params. +type DataViewsFieldformatParams struct { + LabelTemplate *string `json:"labelTemplate,omitempty"` + Pattern *string `json:"pattern,omitempty"` + UrlTemplate *string `json:"urlTemplate,omitempty"` +} + +// DataViewsFieldformats A map of field formats by field name. +type DataViewsFieldformats map[string]DataViewsFieldformat + +// DataViewsNamespaces An array of space identifiers for sharing the data view between multiple spaces. +type DataViewsNamespaces = []string + +// DataViewsRuntimefieldmap A map of runtime field definitions by field name. +type DataViewsRuntimefieldmap struct { + Script DataViewsRuntimefieldmapScript `json:"script"` + + // Type Mapping type of the runtime field. + Type string `json:"type"` +} + +// DataViewsRuntimefieldmapScript defines model for Data_views_runtimefieldmap_script. +type DataViewsRuntimefieldmapScript struct { + // Source Script for the runtime field. + Source *string `json:"source,omitempty"` +} + +// DataViewsSourcefilterItem defines model for Data_views_sourcefilter_item. +type DataViewsSourcefilterItem struct { + Value string `json:"value"` +} + +// DataViewsSourcefilters The array of field names you want to filter out in Discover. +type DataViewsSourcefilters = []DataViewsSourcefilterItem + +// DataViewsTimefieldname The timestamp field name, which you use for time-based data views. +type DataViewsTimefieldname = string + +// DataViewsTitle Comma-separated list of data streams, indices, and aliases that you want to search. Supports wildcards (`*`). +type DataViewsTitle = string + +// DataViewsType When set to `rollup`, identifies the rollup data views. +type DataViewsType = string -// Defines values for UpdateOutputSslVerificationMode. -const ( - Certificate UpdateOutputSslVerificationMode = "certificate" - Full UpdateOutputSslVerificationMode = "full" - None UpdateOutputSslVerificationMode = "none" - Strict UpdateOutputSslVerificationMode = "strict" -) +// DataViewsTypemeta When you use rollup indices, contains the field list for the rollup data view API endpoints. +type DataViewsTypemeta struct { + // Aggs A map of rollup restrictions by aggregation type and field name. + Aggs map[string]interface{} `json:"aggs"` -// Defines values for GetAgentPoliciesParamsSortOrder. -const ( - GetAgentPoliciesParamsSortOrderAsc GetAgentPoliciesParamsSortOrder = "asc" - GetAgentPoliciesParamsSortOrderDesc GetAgentPoliciesParamsSortOrder = "desc" -) + // Params Properties for retrieving rollup fields. + Params map[string]interface{} `json:"params"` +} -// Defines values for GetAgentPoliciesParamsFormat. -const ( - GetAgentPoliciesParamsFormatLegacy GetAgentPoliciesParamsFormat = "legacy" - GetAgentPoliciesParamsFormatSimplified GetAgentPoliciesParamsFormat = "simplified" -) +// DataViewsTypemetaResponse When you use rollup indices, contains the field list for the rollup data view API endpoints. +type DataViewsTypemetaResponse struct { + // Aggs A map of rollup restrictions by aggregation type and field name. + Aggs *map[string]interface{} `json:"aggs,omitempty"` -// Defines values for CreateAgentPolicyJSONBodyMonitoringEnabled. -const ( - CreateAgentPolicyJSONBodyMonitoringEnabledLogs CreateAgentPolicyJSONBodyMonitoringEnabled = "logs" - CreateAgentPolicyJSONBodyMonitoringEnabledMetrics CreateAgentPolicyJSONBodyMonitoringEnabled = "metrics" - CreateAgentPolicyJSONBodyMonitoringEnabledTraces CreateAgentPolicyJSONBodyMonitoringEnabled = "traces" -) + // Params Properties for retrieving rollup fields. + Params *map[string]interface{} `json:"params,omitempty"` +} -// Defines values for GetAgentPolicyParamsFormat. -const ( - GetAgentPolicyParamsFormatLegacy GetAgentPolicyParamsFormat = "legacy" - GetAgentPolicyParamsFormatSimplified GetAgentPolicyParamsFormat = "simplified" -) +// DataViewsUpdateDataViewRequestObject defines model for Data_views_update_data_view_request_object. +type DataViewsUpdateDataViewRequestObject struct { + // DataView The data view properties you want to update. Only the specified properties are updated in the data view. Unspecified fields stay as they are persisted. + DataView DataViewsUpdateDataViewRequestObjectInner `json:"data_view"` -// Defines values for UpdateAgentPolicyParamsFormat. -const ( - UpdateAgentPolicyParamsFormatLegacy UpdateAgentPolicyParamsFormat = "legacy" - UpdateAgentPolicyParamsFormatSimplified UpdateAgentPolicyParamsFormat = "simplified" -) + // RefreshFields Reloads the data view fields after the data view is updated. + RefreshFields *bool `json:"refresh_fields,omitempty"` +} -// Defines values for UpdateAgentPolicyJSONBodyMonitoringEnabled. -const ( - Logs UpdateAgentPolicyJSONBodyMonitoringEnabled = "logs" - Metrics UpdateAgentPolicyJSONBodyMonitoringEnabled = "metrics" - Traces UpdateAgentPolicyJSONBodyMonitoringEnabled = "traces" -) +// DataViewsUpdateDataViewRequestObjectInner The data view properties you want to update. Only the specified properties are updated in the data view. Unspecified fields stay as they are persisted. +type DataViewsUpdateDataViewRequestObjectInner struct { + // AllowNoIndex Allows the data view saved object to exist before the data is available. + AllowNoIndex *DataViewsAllownoindex `json:"allowNoIndex,omitempty"` -// Defines values for GetPackagePoliciesParamsSortOrder. -const ( - GetPackagePoliciesParamsSortOrderAsc GetPackagePoliciesParamsSortOrder = "asc" - GetPackagePoliciesParamsSortOrderDesc GetPackagePoliciesParamsSortOrder = "desc" -) + // FieldFormats A map of field formats by field name. + FieldFormats *DataViewsFieldformats `json:"fieldFormats,omitempty"` + Fields *map[string]interface{} `json:"fields,omitempty"` + Name *string `json:"name,omitempty"` + RuntimeFieldMap *map[string]DataViewsRuntimefieldmap `json:"runtimeFieldMap,omitempty"` -// Defines values for GetPackagePoliciesParamsFormat. -const ( - GetPackagePoliciesParamsFormatLegacy GetPackagePoliciesParamsFormat = "legacy" - GetPackagePoliciesParamsFormatSimplified GetPackagePoliciesParamsFormat = "simplified" -) + // SourceFilters The array of field names you want to filter out in Discover. + SourceFilters *DataViewsSourcefilters `json:"sourceFilters,omitempty"` -// Defines values for CreatePackagePolicyParamsFormat. -const ( - CreatePackagePolicyParamsFormatLegacy CreatePackagePolicyParamsFormat = "legacy" - CreatePackagePolicyParamsFormatSimplified CreatePackagePolicyParamsFormat = "simplified" -) + // TimeFieldName The timestamp field name, which you use for time-based data views. + TimeFieldName *DataViewsTimefieldname `json:"timeFieldName,omitempty"` -// Defines values for GetPackagePolicyParamsFormat. -const ( - GetPackagePolicyParamsFormatLegacy GetPackagePolicyParamsFormat = "legacy" - GetPackagePolicyParamsFormatSimplified GetPackagePolicyParamsFormat = "simplified" -) + // Title Comma-separated list of data streams, indices, and aliases that you want to search. Supports wildcards (`*`). + Title *DataViewsTitle `json:"title,omitempty"` -// Defines values for UpdatePackagePolicyParamsFormat. -const ( - Legacy UpdatePackagePolicyParamsFormat = "legacy" - Simplified UpdatePackagePolicyParamsFormat = "simplified" -) + // Type When set to `rollup`, identifies the rollup data views. + Type *DataViewsType `json:"type,omitempty"` + + // TypeMeta When you use rollup indices, contains the field list for the rollup data view API endpoints. + TypeMeta *DataViewsTypemeta `json:"typeMeta,omitempty"` +} // AgentPolicy defines model for agent_policy. type AgentPolicy struct { @@ -1740,6 +1040,15 @@ type EnrollmentApiKey struct { PolicyId *string `json:"policy_id,omitempty"` } +// GetDataViewsResponseItem defines model for get_data_views_response_item. +type GetDataViewsResponseItem struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Namespaces *[]string `json:"namespaces,omitempty"` + Title *string `json:"title,omitempty"` + TypeMeta *map[string]interface{} `json:"typeMeta,omitempty"` +} + // NewOutputElasticsearch defines model for new_output_elasticsearch. type NewOutputElasticsearch struct { AllowEdit *[]string `json:"allow_edit,omitempty"` @@ -3129,6 +2438,12 @@ type UpdateOutputUnion struct { union json.RawMessage } +// DataViewsViewId defines model for Data_views_view_id. +type DataViewsViewId = string + +// SpaceId defines model for spaceId. +type SpaceId = string + // GetAgentPoliciesParams defines parameters for GetAgentPolicies. type GetAgentPoliciesParams struct { Page *float32 `form:"page,omitempty" json:"page,omitempty"` @@ -3500,6 +2815,12 @@ type CreatePackagePolicyJSONRequestBody = PackagePolicyRequest // UpdatePackagePolicyJSONRequestBody defines body for UpdatePackagePolicy for application/json ContentType. type UpdatePackagePolicyJSONRequestBody = PackagePolicyRequest +// CreateDataViewJSONRequestBody defines body for CreateDataView for application/json ContentType. +type CreateDataViewJSONRequestBody = DataViewsCreateDataViewRequestObject + +// UpdateDataViewJSONRequestBody defines body for UpdateDataView for application/json ContentType. +type UpdateDataViewJSONRequestBody = DataViewsUpdateDataViewRequestObject + // Getter for additional properties for AgentPolicy_PackagePolicies_1_Elasticsearch_Privileges. Returns the specified // element and whether it was found func (a AgentPolicy_PackagePolicies_1_Elasticsearch_Privileges) Get(fieldName string) (value interface{}, found bool) { @@ -12472,25 +11793,6 @@ func WithRequestEditorFn(fn RequestEditorFn) ClientOption { // The interface specification for the client above. type ClientInterface interface { - // GetDataViews request - GetDataViews(ctx context.Context, spaceId SpaceId, reqEditors ...RequestEditorFn) (*http.Response, error) - - // CreateDataViewWithBody request with any body - CreateDataViewWithBody(ctx context.Context, spaceId SpaceId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - CreateDataView(ctx context.Context, spaceId SpaceId, body CreateDataViewJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // DeleteDataView request - DeleteDataView(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, reqEditors ...RequestEditorFn) (*http.Response, error) - - // GetDataView request - GetDataView(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, reqEditors ...RequestEditorFn) (*http.Response, error) - - // UpdateDataViewWithBody request with any body - UpdateDataViewWithBody(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - UpdateDataView(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, body UpdateDataViewJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetAgentPolicies request GetAgentPolicies(ctx context.Context, params *GetAgentPoliciesParams, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -12590,6 +11892,25 @@ type ClientInterface interface { UpdatePackagePolicyWithBody(ctx context.Context, packagePolicyId string, params *UpdatePackagePolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) UpdatePackagePolicy(ctx context.Context, packagePolicyId string, params *UpdatePackagePolicyParams, body UpdatePackagePolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetDataViews request + GetDataViews(ctx context.Context, spaceId SpaceId, reqEditors ...RequestEditorFn) (*http.Response, error) + + // CreateDataViewWithBody request with any body + CreateDataViewWithBody(ctx context.Context, spaceId SpaceId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + CreateDataView(ctx context.Context, spaceId SpaceId, body CreateDataViewJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeleteDataView request + DeleteDataView(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetDataView request + GetDataView(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, reqEditors ...RequestEditorFn) (*http.Response, error) + + // UpdateDataViewWithBody request with any body + UpdateDataViewWithBody(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + UpdateDataView(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, body UpdateDataViewJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) } func (c *Client) GetAgentPolicies(ctx context.Context, params *GetAgentPoliciesParams, reqEditors ...RequestEditorFn) (*http.Response, error) { @@ -12916,8 +12237,92 @@ func (c *Client) DeleteOutput(ctx context.Context, outputId string, reqEditors . return c.Client.Do(req) } -func (c *Client) GetOutput(ctx context.Context, outputId string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetOutputRequest(c.Server, outputId) +func (c *Client) GetOutput(ctx context.Context, outputId string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetOutputRequest(c.Server, outputId) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) UpdateOutputWithBody(ctx context.Context, outputId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateOutputRequestWithBody(c.Server, outputId, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) UpdateOutput(ctx context.Context, outputId string, body UpdateOutputJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateOutputRequest(c.Server, outputId, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) GetPackagePolicies(ctx context.Context, params *GetPackagePoliciesParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetPackagePoliciesRequest(c.Server, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) CreatePackagePolicyWithBody(ctx context.Context, params *CreatePackagePolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreatePackagePolicyRequestWithBody(c.Server, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) CreatePackagePolicy(ctx context.Context, params *CreatePackagePolicyParams, body CreatePackagePolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreatePackagePolicyRequest(c.Server, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) DeletePackagePolicy(ctx context.Context, packagePolicyId string, params *DeletePackagePolicyParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeletePackagePolicyRequest(c.Server, packagePolicyId, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) GetPackagePolicy(ctx context.Context, packagePolicyId string, params *GetPackagePolicyParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetPackagePolicyRequest(c.Server, packagePolicyId, params) if err != nil { return nil, err } @@ -12928,8 +12333,8 @@ func (c *Client) GetOutput(ctx context.Context, outputId string, reqEditors ...R return c.Client.Do(req) } -func (c *Client) UpdateOutputWithBody(ctx context.Context, outputId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewUpdateOutputRequestWithBody(c.Server, outputId, contentType, body) +func (c *Client) UpdatePackagePolicyWithBody(ctx context.Context, packagePolicyId string, params *UpdatePackagePolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdatePackagePolicyRequestWithBody(c.Server, packagePolicyId, params, contentType, body) if err != nil { return nil, err } @@ -12940,8 +12345,8 @@ func (c *Client) UpdateOutputWithBody(ctx context.Context, outputId string, cont return c.Client.Do(req) } -func (c *Client) UpdateOutput(ctx context.Context, outputId string, body UpdateOutputJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewUpdateOutputRequest(c.Server, outputId, body) +func (c *Client) UpdatePackagePolicy(ctx context.Context, packagePolicyId string, params *UpdatePackagePolicyParams, body UpdatePackagePolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdatePackagePolicyRequest(c.Server, packagePolicyId, params, body) if err != nil { return nil, err } @@ -12952,8 +12357,8 @@ func (c *Client) UpdateOutput(ctx context.Context, outputId string, body UpdateO return c.Client.Do(req) } -func (c *Client) GetPackagePolicies(ctx context.Context, params *GetPackagePoliciesParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetPackagePoliciesRequest(c.Server, params) +func (c *Client) GetDataViews(ctx context.Context, spaceId SpaceId, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetDataViewsRequest(c.Server, spaceId) if err != nil { return nil, err } @@ -12964,8 +12369,8 @@ func (c *Client) GetPackagePolicies(ctx context.Context, params *GetPackagePolic return c.Client.Do(req) } -func (c *Client) CreatePackagePolicyWithBody(ctx context.Context, params *CreatePackagePolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreatePackagePolicyRequestWithBody(c.Server, params, contentType, body) +func (c *Client) CreateDataViewWithBody(ctx context.Context, spaceId SpaceId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateDataViewRequestWithBody(c.Server, spaceId, contentType, body) if err != nil { return nil, err } @@ -12976,8 +12381,8 @@ func (c *Client) CreatePackagePolicyWithBody(ctx context.Context, params *Create return c.Client.Do(req) } -func (c *Client) CreatePackagePolicy(ctx context.Context, params *CreatePackagePolicyParams, body CreatePackagePolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreatePackagePolicyRequest(c.Server, params, body) +func (c *Client) CreateDataView(ctx context.Context, spaceId SpaceId, body CreateDataViewJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateDataViewRequest(c.Server, spaceId, body) if err != nil { return nil, err } @@ -12988,8 +12393,8 @@ func (c *Client) CreatePackagePolicy(ctx context.Context, params *CreatePackageP return c.Client.Do(req) } -func (c *Client) DeletePackagePolicy(ctx context.Context, packagePolicyId string, params *DeletePackagePolicyParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewDeletePackagePolicyRequest(c.Server, packagePolicyId, params) +func (c *Client) DeleteDataView(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteDataViewRequest(c.Server, spaceId, viewId) if err != nil { return nil, err } @@ -13000,8 +12405,8 @@ func (c *Client) DeletePackagePolicy(ctx context.Context, packagePolicyId string return c.Client.Do(req) } -func (c *Client) GetPackagePolicy(ctx context.Context, packagePolicyId string, params *GetPackagePolicyParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetPackagePolicyRequest(c.Server, packagePolicyId, params) +func (c *Client) GetDataView(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetDataViewRequest(c.Server, spaceId, viewId) if err != nil { return nil, err } @@ -13012,8 +12417,8 @@ func (c *Client) GetPackagePolicy(ctx context.Context, packagePolicyId string, p return c.Client.Do(req) } -func (c *Client) UpdatePackagePolicyWithBody(ctx context.Context, packagePolicyId string, params *UpdatePackagePolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewUpdatePackagePolicyRequestWithBody(c.Server, packagePolicyId, params, contentType, body) +func (c *Client) UpdateDataViewWithBody(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateDataViewRequestWithBody(c.Server, spaceId, viewId, contentType, body) if err != nil { return nil, err } @@ -13024,8 +12429,8 @@ func (c *Client) UpdatePackagePolicyWithBody(ctx context.Context, packagePolicyI return c.Client.Do(req) } -func (c *Client) UpdatePackagePolicy(ctx context.Context, packagePolicyId string, params *UpdatePackagePolicyParams, body UpdatePackagePolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewUpdatePackagePolicyRequest(c.Server, packagePolicyId, params, body) +func (c *Client) UpdateDataView(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, body UpdateDataViewJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateDataViewRequest(c.Server, spaceId, viewId, body) if err != nil { return nil, err } @@ -14682,9 +14087,241 @@ func NewGetPackagePolicyRequest(server string, packagePolicyId string, params *G } } - } + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewUpdatePackagePolicyRequest calls the generic UpdatePackagePolicy builder with application/json body +func NewUpdatePackagePolicyRequest(server string, packagePolicyId string, params *UpdatePackagePolicyParams, body UpdatePackagePolicyJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewUpdatePackagePolicyRequestWithBody(server, packagePolicyId, params, "application/json", bodyReader) +} + +// NewUpdatePackagePolicyRequestWithBody generates requests for UpdatePackagePolicy with any type of body +func NewUpdatePackagePolicyRequestWithBody(server string, packagePolicyId string, params *UpdatePackagePolicyParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "packagePolicyId", runtime.ParamLocationPath, packagePolicyId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/api/fleet/package_policies/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.Format != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "format", runtime.ParamLocationQuery, *params.Format); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("PUT", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewGetDataViewsRequest generates requests for GetDataViews +func NewGetDataViewsRequest(server string, spaceId SpaceId) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "spaceId", runtime.ParamLocationPath, spaceId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/s/%s/api/data_views", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewCreateDataViewRequest calls the generic CreateDataView builder with application/json body +func NewCreateDataViewRequest(server string, spaceId SpaceId, body CreateDataViewJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewCreateDataViewRequestWithBody(server, spaceId, "application/json", bodyReader) +} + +// NewCreateDataViewRequestWithBody generates requests for CreateDataView with any type of body +func NewCreateDataViewRequestWithBody(server string, spaceId SpaceId, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "spaceId", runtime.ParamLocationPath, spaceId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/s/%s/api/data_views/data_view", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewDeleteDataViewRequest generates requests for DeleteDataView +func NewDeleteDataViewRequest(server string, spaceId SpaceId, viewId DataViewsViewId) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "spaceId", runtime.ParamLocationPath, spaceId) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "viewId", runtime.ParamLocationPath, viewId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/s/%s/api/data_views/data_view/%s", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetDataViewRequest generates requests for GetDataView +func NewGetDataViewRequest(server string, spaceId SpaceId, viewId DataViewsViewId) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "spaceId", runtime.ParamLocationPath, spaceId) + if err != nil { + return nil, err + } + + var pathParam1 string - queryURL.RawQuery = queryValues.Encode() + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "viewId", runtime.ParamLocationPath, viewId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/s/%s/api/data_views/data_view/%s", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err } req, err := http.NewRequest("GET", queryURL.String(), nil) @@ -14695,24 +14332,31 @@ func NewGetPackagePolicyRequest(server string, packagePolicyId string, params *G return req, nil } -// NewUpdatePackagePolicyRequest calls the generic UpdatePackagePolicy builder with application/json body -func NewUpdatePackagePolicyRequest(server string, packagePolicyId string, params *UpdatePackagePolicyParams, body UpdatePackagePolicyJSONRequestBody) (*http.Request, error) { +// NewUpdateDataViewRequest calls the generic UpdateDataView builder with application/json body +func NewUpdateDataViewRequest(server string, spaceId SpaceId, viewId DataViewsViewId, body UpdateDataViewJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewUpdatePackagePolicyRequestWithBody(server, packagePolicyId, params, "application/json", bodyReader) + return NewUpdateDataViewRequestWithBody(server, spaceId, viewId, "application/json", bodyReader) } -// NewUpdatePackagePolicyRequestWithBody generates requests for UpdatePackagePolicy with any type of body -func NewUpdatePackagePolicyRequestWithBody(server string, packagePolicyId string, params *UpdatePackagePolicyParams, contentType string, body io.Reader) (*http.Request, error) { +// NewUpdateDataViewRequestWithBody generates requests for UpdateDataView with any type of body +func NewUpdateDataViewRequestWithBody(server string, spaceId SpaceId, viewId DataViewsViewId, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "packagePolicyId", runtime.ParamLocationPath, packagePolicyId) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "spaceId", runtime.ParamLocationPath, spaceId) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "viewId", runtime.ParamLocationPath, viewId) if err != nil { return nil, err } @@ -14722,7 +14366,7 @@ func NewUpdatePackagePolicyRequestWithBody(server string, packagePolicyId string return nil, err } - operationPath := fmt.Sprintf("/api/fleet/package_policies/%s", pathParam0) + operationPath := fmt.Sprintf("/s/%s/api/data_views/data_view/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -14732,59 +14376,59 @@ func NewUpdatePackagePolicyRequestWithBody(server string, packagePolicyId string return nil, err } - if params != nil { - queryValues := queryURL.Query() + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } - if params.Format != nil { + req.Header.Add("Content-Type", contentType) - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "format", runtime.ParamLocationQuery, *params.Format); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } + return req, nil +} +func (c *Client) applyEditors(ctx context.Context, req *http.Request, additionalEditors []RequestEditorFn) error { + for _, r := range c.RequestEditors { + if err := r(ctx, req); err != nil { + return err + } + } + for _, r := range additionalEditors { + if err := r(ctx, req); err != nil { + return err } - - queryURL.RawQuery = queryValues.Encode() } + return nil +} - req, err := http.NewRequest("PUT", queryURL.String(), body) +// ClientWithResponses builds on ClientInterface to offer response payloads +type ClientWithResponses struct { + ClientInterface +} + +// NewClientWithResponses creates a new ClientWithResponses, which wraps +// Client with return type handling +func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error) { + client, err := NewClient(server, opts...) if err != nil { return nil, err } + return &ClientWithResponses{client}, nil +} - req.Header.Add("Content-Type", contentType) - - return req, nil +// WithBaseURL overrides the baseURL. +func WithBaseURL(baseURL string) ClientOption { + return func(c *Client) error { + newBaseURL, err := url.Parse(baseURL) + if err != nil { + return err + } + c.Server = newBaseURL.String() + return nil + } } // ClientWithResponsesInterface is the interface specification for the client with responses above. type ClientWithResponsesInterface interface { - // GetDataViewsWithResponse request - GetDataViewsWithResponse(ctx context.Context, spaceId SpaceId, reqEditors ...RequestEditorFn) (*GetDataViewsResponse, error) - - // CreateDataViewWithBodyWithResponse request with any body - CreateDataViewWithBodyWithResponse(ctx context.Context, spaceId SpaceId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateDataViewResponse, error) - - CreateDataViewWithResponse(ctx context.Context, spaceId SpaceId, body CreateDataViewJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateDataViewResponse, error) - - // DeleteDataViewWithResponse request - DeleteDataViewWithResponse(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, reqEditors ...RequestEditorFn) (*DeleteDataViewResponse, error) - - // GetDataViewWithResponse request - GetDataViewWithResponse(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, reqEditors ...RequestEditorFn) (*GetDataViewResponse, error) - - // UpdateDataViewWithBodyWithResponse request with any body - UpdateDataViewWithBodyWithResponse(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateDataViewResponse, error) - - UpdateDataViewWithResponse(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, body UpdateDataViewJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateDataViewResponse, error) - // GetAgentPoliciesWithResponse request GetAgentPoliciesWithResponse(ctx context.Context, params *GetAgentPoliciesParams, reqEditors ...RequestEditorFn) (*GetAgentPoliciesResponse, error) @@ -14884,6 +14528,25 @@ type ClientWithResponsesInterface interface { UpdatePackagePolicyWithBodyWithResponse(ctx context.Context, packagePolicyId string, params *UpdatePackagePolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdatePackagePolicyResponse, error) UpdatePackagePolicyWithResponse(ctx context.Context, packagePolicyId string, params *UpdatePackagePolicyParams, body UpdatePackagePolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdatePackagePolicyResponse, error) + + // GetDataViewsWithResponse request + GetDataViewsWithResponse(ctx context.Context, spaceId SpaceId, reqEditors ...RequestEditorFn) (*GetDataViewsResponse, error) + + // CreateDataViewWithBodyWithResponse request with any body + CreateDataViewWithBodyWithResponse(ctx context.Context, spaceId SpaceId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateDataViewResponse, error) + + CreateDataViewWithResponse(ctx context.Context, spaceId SpaceId, body CreateDataViewJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateDataViewResponse, error) + + // DeleteDataViewWithResponse request + DeleteDataViewWithResponse(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, reqEditors ...RequestEditorFn) (*DeleteDataViewResponse, error) + + // GetDataViewWithResponse request + GetDataViewWithResponse(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, reqEditors ...RequestEditorFn) (*GetDataViewResponse, error) + + // UpdateDataViewWithBodyWithResponse request with any body + UpdateDataViewWithBodyWithResponse(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateDataViewResponse, error) + + UpdateDataViewWithResponse(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, body UpdateDataViewJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateDataViewResponse, error) } type GetAgentPoliciesResponse struct { @@ -16033,7 +15696,134 @@ type GetPackagePolicyResponse struct { } // Status returns HTTPResponse.Status -func (r GetPackagePolicyResponse) Status() string { +func (r GetPackagePolicyResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetPackagePolicyResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type UpdatePackagePolicyResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + Item PackagePolicy `json:"item"` + } + JSON400 *struct { + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` + } + JSON403 *struct { + Error *string `json:"error,omitempty"` + Message string `json:"message"` + StatusCode *float32 `json:"statusCode,omitempty"` + } +} + +// Status returns HTTPResponse.Status +func (r UpdatePackagePolicyResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r UpdatePackagePolicyResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetDataViewsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + DataView *[]GetDataViewsResponseItem `json:"data_view,omitempty"` + } + JSON400 *DataViews400Response +} + +// Status returns HTTPResponse.Status +func (r GetDataViewsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetDataViewsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type CreateDataViewResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *DataViewsDataViewResponseObject + JSON400 *DataViews400Response +} + +// Status returns HTTPResponse.Status +func (r CreateDataViewResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r CreateDataViewResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type DeleteDataViewResponse struct { + Body []byte + HTTPResponse *http.Response + JSON404 *DataViews404Response +} + +// Status returns HTTPResponse.Status +func (r DeleteDataViewResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteDataViewResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetDataViewResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *DataViewsDataViewResponseObject + JSON404 *DataViews404Response +} + +// Status returns HTTPResponse.Status +func (r GetDataViewResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -16041,33 +15831,22 @@ func (r GetPackagePolicyResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetPackagePolicyResponse) StatusCode() int { +func (r GetDataViewResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type UpdatePackagePolicyResponse struct { +type UpdateDataViewResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *struct { - Item PackagePolicy `json:"item"` - } - JSON400 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` - } - JSON403 *struct { - Error *string `json:"error,omitempty"` - Message string `json:"message"` - StatusCode *float32 `json:"statusCode,omitempty"` - } + JSON200 *DataViewsDataViewResponseObject + JSON400 *DataViews400Response } // Status returns HTTPResponse.Status -func (r UpdatePackagePolicyResponse) Status() string { +func (r UpdateDataViewResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -16075,7 +15854,7 @@ func (r UpdatePackagePolicyResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r UpdatePackagePolicyResponse) StatusCode() int { +func (r UpdateDataViewResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -16404,6 +16183,67 @@ func (c *ClientWithResponses) UpdatePackagePolicyWithResponse(ctx context.Contex return ParseUpdatePackagePolicyResponse(rsp) } +// GetDataViewsWithResponse request returning *GetDataViewsResponse +func (c *ClientWithResponses) GetDataViewsWithResponse(ctx context.Context, spaceId SpaceId, reqEditors ...RequestEditorFn) (*GetDataViewsResponse, error) { + rsp, err := c.GetDataViews(ctx, spaceId, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetDataViewsResponse(rsp) +} + +// CreateDataViewWithBodyWithResponse request with arbitrary body returning *CreateDataViewResponse +func (c *ClientWithResponses) CreateDataViewWithBodyWithResponse(ctx context.Context, spaceId SpaceId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateDataViewResponse, error) { + rsp, err := c.CreateDataViewWithBody(ctx, spaceId, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateDataViewResponse(rsp) +} + +func (c *ClientWithResponses) CreateDataViewWithResponse(ctx context.Context, spaceId SpaceId, body CreateDataViewJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateDataViewResponse, error) { + rsp, err := c.CreateDataView(ctx, spaceId, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateDataViewResponse(rsp) +} + +// DeleteDataViewWithResponse request returning *DeleteDataViewResponse +func (c *ClientWithResponses) DeleteDataViewWithResponse(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, reqEditors ...RequestEditorFn) (*DeleteDataViewResponse, error) { + rsp, err := c.DeleteDataView(ctx, spaceId, viewId, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteDataViewResponse(rsp) +} + +// GetDataViewWithResponse request returning *GetDataViewResponse +func (c *ClientWithResponses) GetDataViewWithResponse(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, reqEditors ...RequestEditorFn) (*GetDataViewResponse, error) { + rsp, err := c.GetDataView(ctx, spaceId, viewId, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetDataViewResponse(rsp) +} + +// UpdateDataViewWithBodyWithResponse request with arbitrary body returning *UpdateDataViewResponse +func (c *ClientWithResponses) UpdateDataViewWithBodyWithResponse(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateDataViewResponse, error) { + rsp, err := c.UpdateDataViewWithBody(ctx, spaceId, viewId, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdateDataViewResponse(rsp) +} + +func (c *ClientWithResponses) UpdateDataViewWithResponse(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, body UpdateDataViewJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateDataViewResponse, error) { + rsp, err := c.UpdateDataView(ctx, spaceId, viewId, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdateDataViewResponse(rsp) +} + // ParseGetAgentPoliciesResponse parses an HTTP response from a GetAgentPoliciesWithResponse call func ParseGetAgentPoliciesResponse(rsp *http.Response) (*GetAgentPoliciesResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) @@ -17484,3 +17324,163 @@ func ParseUpdatePackagePolicyResponse(rsp *http.Response) (*UpdatePackagePolicyR return response, nil } + +// ParseGetDataViewsResponse parses an HTTP response from a GetDataViewsWithResponse call +func ParseGetDataViewsResponse(rsp *http.Response) (*GetDataViewsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetDataViewsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + DataView *[]GetDataViewsResponseItem `json:"data_view,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest DataViews400Response + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + } + + return response, nil +} + +// ParseCreateDataViewResponse parses an HTTP response from a CreateDataViewWithResponse call +func ParseCreateDataViewResponse(rsp *http.Response) (*CreateDataViewResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &CreateDataViewResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest DataViewsDataViewResponseObject + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest DataViews400Response + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + } + + return response, nil +} + +// ParseDeleteDataViewResponse parses an HTTP response from a DeleteDataViewWithResponse call +func ParseDeleteDataViewResponse(rsp *http.Response) (*DeleteDataViewResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &DeleteDataViewResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest DataViews404Response + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + } + + return response, nil +} + +// ParseGetDataViewResponse parses an HTTP response from a GetDataViewWithResponse call +func ParseGetDataViewResponse(rsp *http.Response) (*GetDataViewResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &GetDataViewResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest DataViewsDataViewResponseObject + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest DataViews404Response + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + } + + return response, nil +} + +// ParseUpdateDataViewResponse parses an HTTP response from a UpdateDataViewWithResponse call +func ParseUpdateDataViewResponse(rsp *http.Response) (*UpdateDataViewResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &UpdateDataViewResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest DataViewsDataViewResponseObject + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest DataViews400Response + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + } + + return response, nil +} From 8012598a2793d859026b09c4d637f7df204f0b96 Mon Sep 17 00:00:00 2001 From: Raymond Lynch Date: Sun, 3 Nov 2024 08:38:28 -0500 Subject: [PATCH 10/15] missing diags check --- internal/kibana/data_view/resource.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/kibana/data_view/resource.go b/internal/kibana/data_view/resource.go index cd8d1f8df..184f38689 100644 --- a/internal/kibana/data_view/resource.go +++ b/internal/kibana/data_view/resource.go @@ -48,5 +48,6 @@ func (r *DataViewResource) ImportState(ctx context.Context, req resource.ImportS DataView: types.ObjectUnknown(getDataViewAttrTypes()), } - resp.State.Set(ctx, stateModel) + diags = resp.State.Set(ctx, stateModel) + resp.Diagnostics.Append(diags...) } From 709e64a206636c040ba9655ba60d403ef96ca896 Mon Sep 17 00:00:00 2001 From: Raymond Lynch Date: Sat, 2 Nov 2024 20:29:50 -0400 Subject: [PATCH 11/15] Fresh OAS pull to support upstream operationIds See elastic/kibana: [OAS] Beautify generated operation ids (#198132) --- generated/kibana/kibana.gen.go | 2268 ++++++++++++------------ generated/kibana/transform_schema.go | 77 - internal/clients/fleet/fleet.go | 84 +- internal/clients/kibana2/data_views.go | 14 +- internal/fleet/agent_policy/models.go | 16 +- internal/fleet/server_host/models.go | 8 +- 6 files changed, 1195 insertions(+), 1272 deletions(-) diff --git a/generated/kibana/kibana.gen.go b/generated/kibana/kibana.gen.go index a71ed7703..0af2931c7 100644 --- a/generated/kibana/kibana.gen.go +++ b/generated/kibana/kibana.gen.go @@ -496,72 +496,72 @@ const ( Strict UpdateOutputSslVerificationMode = "strict" ) -// Defines values for GetAgentPoliciesParamsSortOrder. +// Defines values for GetFleetAgentPoliciesParamsSortOrder. const ( - GetAgentPoliciesParamsSortOrderAsc GetAgentPoliciesParamsSortOrder = "asc" - GetAgentPoliciesParamsSortOrderDesc GetAgentPoliciesParamsSortOrder = "desc" + GetFleetAgentPoliciesParamsSortOrderAsc GetFleetAgentPoliciesParamsSortOrder = "asc" + GetFleetAgentPoliciesParamsSortOrderDesc GetFleetAgentPoliciesParamsSortOrder = "desc" ) -// Defines values for GetAgentPoliciesParamsFormat. +// Defines values for GetFleetAgentPoliciesParamsFormat. const ( - GetAgentPoliciesParamsFormatLegacy GetAgentPoliciesParamsFormat = "legacy" - GetAgentPoliciesParamsFormatSimplified GetAgentPoliciesParamsFormat = "simplified" + GetFleetAgentPoliciesParamsFormatLegacy GetFleetAgentPoliciesParamsFormat = "legacy" + GetFleetAgentPoliciesParamsFormatSimplified GetFleetAgentPoliciesParamsFormat = "simplified" ) -// Defines values for CreateAgentPolicyJSONBodyMonitoringEnabled. +// Defines values for PostFleetAgentPoliciesJSONBodyMonitoringEnabled. const ( - CreateAgentPolicyJSONBodyMonitoringEnabledLogs CreateAgentPolicyJSONBodyMonitoringEnabled = "logs" - CreateAgentPolicyJSONBodyMonitoringEnabledMetrics CreateAgentPolicyJSONBodyMonitoringEnabled = "metrics" - CreateAgentPolicyJSONBodyMonitoringEnabledTraces CreateAgentPolicyJSONBodyMonitoringEnabled = "traces" + PostFleetAgentPoliciesJSONBodyMonitoringEnabledLogs PostFleetAgentPoliciesJSONBodyMonitoringEnabled = "logs" + PostFleetAgentPoliciesJSONBodyMonitoringEnabledMetrics PostFleetAgentPoliciesJSONBodyMonitoringEnabled = "metrics" + PostFleetAgentPoliciesJSONBodyMonitoringEnabledTraces PostFleetAgentPoliciesJSONBodyMonitoringEnabled = "traces" ) -// Defines values for GetAgentPolicyParamsFormat. +// Defines values for GetFleetAgentPoliciesAgentpolicyidParamsFormat. const ( - GetAgentPolicyParamsFormatLegacy GetAgentPolicyParamsFormat = "legacy" - GetAgentPolicyParamsFormatSimplified GetAgentPolicyParamsFormat = "simplified" + GetFleetAgentPoliciesAgentpolicyidParamsFormatLegacy GetFleetAgentPoliciesAgentpolicyidParamsFormat = "legacy" + GetFleetAgentPoliciesAgentpolicyidParamsFormatSimplified GetFleetAgentPoliciesAgentpolicyidParamsFormat = "simplified" ) -// Defines values for UpdateAgentPolicyParamsFormat. +// Defines values for PutFleetAgentPoliciesAgentpolicyidParamsFormat. const ( - UpdateAgentPolicyParamsFormatLegacy UpdateAgentPolicyParamsFormat = "legacy" - UpdateAgentPolicyParamsFormatSimplified UpdateAgentPolicyParamsFormat = "simplified" + PutFleetAgentPoliciesAgentpolicyidParamsFormatLegacy PutFleetAgentPoliciesAgentpolicyidParamsFormat = "legacy" + PutFleetAgentPoliciesAgentpolicyidParamsFormatSimplified PutFleetAgentPoliciesAgentpolicyidParamsFormat = "simplified" ) -// Defines values for UpdateAgentPolicyJSONBodyMonitoringEnabled. +// Defines values for PutFleetAgentPoliciesAgentpolicyidJSONBodyMonitoringEnabled. const ( - Logs UpdateAgentPolicyJSONBodyMonitoringEnabled = "logs" - Metrics UpdateAgentPolicyJSONBodyMonitoringEnabled = "metrics" - Traces UpdateAgentPolicyJSONBodyMonitoringEnabled = "traces" + Logs PutFleetAgentPoliciesAgentpolicyidJSONBodyMonitoringEnabled = "logs" + Metrics PutFleetAgentPoliciesAgentpolicyidJSONBodyMonitoringEnabled = "metrics" + Traces PutFleetAgentPoliciesAgentpolicyidJSONBodyMonitoringEnabled = "traces" ) -// Defines values for GetPackagePoliciesParamsSortOrder. +// Defines values for GetFleetPackagePoliciesParamsSortOrder. const ( - GetPackagePoliciesParamsSortOrderAsc GetPackagePoliciesParamsSortOrder = "asc" - GetPackagePoliciesParamsSortOrderDesc GetPackagePoliciesParamsSortOrder = "desc" + GetFleetPackagePoliciesParamsSortOrderAsc GetFleetPackagePoliciesParamsSortOrder = "asc" + GetFleetPackagePoliciesParamsSortOrderDesc GetFleetPackagePoliciesParamsSortOrder = "desc" ) -// Defines values for GetPackagePoliciesParamsFormat. +// Defines values for GetFleetPackagePoliciesParamsFormat. const ( - GetPackagePoliciesParamsFormatLegacy GetPackagePoliciesParamsFormat = "legacy" - GetPackagePoliciesParamsFormatSimplified GetPackagePoliciesParamsFormat = "simplified" + GetFleetPackagePoliciesParamsFormatLegacy GetFleetPackagePoliciesParamsFormat = "legacy" + GetFleetPackagePoliciesParamsFormatSimplified GetFleetPackagePoliciesParamsFormat = "simplified" ) -// Defines values for CreatePackagePolicyParamsFormat. +// Defines values for PostFleetPackagePoliciesParamsFormat. const ( - CreatePackagePolicyParamsFormatLegacy CreatePackagePolicyParamsFormat = "legacy" - CreatePackagePolicyParamsFormatSimplified CreatePackagePolicyParamsFormat = "simplified" + PostFleetPackagePoliciesParamsFormatLegacy PostFleetPackagePoliciesParamsFormat = "legacy" + PostFleetPackagePoliciesParamsFormatSimplified PostFleetPackagePoliciesParamsFormat = "simplified" ) -// Defines values for GetPackagePolicyParamsFormat. +// Defines values for GetFleetPackagePoliciesPackagepolicyidParamsFormat. const ( - GetPackagePolicyParamsFormatLegacy GetPackagePolicyParamsFormat = "legacy" - GetPackagePolicyParamsFormatSimplified GetPackagePolicyParamsFormat = "simplified" + GetFleetPackagePoliciesPackagepolicyidParamsFormatLegacy GetFleetPackagePoliciesPackagepolicyidParamsFormat = "legacy" + GetFleetPackagePoliciesPackagepolicyidParamsFormatSimplified GetFleetPackagePoliciesPackagepolicyidParamsFormat = "simplified" ) -// Defines values for UpdatePackagePolicyParamsFormat. +// Defines values for PutFleetPackagePoliciesPackagepolicyidParamsFormat. const ( - Legacy UpdatePackagePolicyParamsFormat = "legacy" - Simplified UpdatePackagePolicyParamsFormat = "simplified" + Legacy PutFleetPackagePoliciesPackagepolicyidParamsFormat = "legacy" + Simplified PutFleetPackagePoliciesPackagepolicyidParamsFormat = "simplified" ) // DataViews400Response defines model for Data_views_400_response. @@ -2444,14 +2444,14 @@ type DataViewsViewId = string // SpaceId defines model for spaceId. type SpaceId = string -// GetAgentPoliciesParams defines parameters for GetAgentPolicies. -type GetAgentPoliciesParams struct { - Page *float32 `form:"page,omitempty" json:"page,omitempty"` - PerPage *float32 `form:"perPage,omitempty" json:"perPage,omitempty"` - SortField *string `form:"sortField,omitempty" json:"sortField,omitempty"` - SortOrder *GetAgentPoliciesParamsSortOrder `form:"sortOrder,omitempty" json:"sortOrder,omitempty"` - ShowUpgradeable *bool `form:"showUpgradeable,omitempty" json:"showUpgradeable,omitempty"` - Kuery *string `form:"kuery,omitempty" json:"kuery,omitempty"` +// GetFleetAgentPoliciesParams defines parameters for GetFleetAgentPolicies. +type GetFleetAgentPoliciesParams struct { + Page *float32 `form:"page,omitempty" json:"page,omitempty"` + PerPage *float32 `form:"perPage,omitempty" json:"perPage,omitempty"` + SortField *string `form:"sortField,omitempty" json:"sortField,omitempty"` + SortOrder *GetFleetAgentPoliciesParamsSortOrder `form:"sortOrder,omitempty" json:"sortOrder,omitempty"` + ShowUpgradeable *bool `form:"showUpgradeable,omitempty" json:"showUpgradeable,omitempty"` + Kuery *string `form:"kuery,omitempty" json:"kuery,omitempty"` // NoAgentCount use withAgentCount instead NoAgentCount *bool `form:"noAgentCount,omitempty" json:"noAgentCount,omitempty"` @@ -2460,18 +2460,18 @@ type GetAgentPoliciesParams struct { WithAgentCount *bool `form:"withAgentCount,omitempty" json:"withAgentCount,omitempty"` // Full get full policies with package policies populated - Full *bool `form:"full,omitempty" json:"full,omitempty"` - Format *GetAgentPoliciesParamsFormat `form:"format,omitempty" json:"format,omitempty"` + Full *bool `form:"full,omitempty" json:"full,omitempty"` + Format *GetFleetAgentPoliciesParamsFormat `form:"format,omitempty" json:"format,omitempty"` } -// GetAgentPoliciesParamsSortOrder defines parameters for GetAgentPolicies. -type GetAgentPoliciesParamsSortOrder string +// GetFleetAgentPoliciesParamsSortOrder defines parameters for GetFleetAgentPolicies. +type GetFleetAgentPoliciesParamsSortOrder string -// GetAgentPoliciesParamsFormat defines parameters for GetAgentPolicies. -type GetAgentPoliciesParamsFormat string +// GetFleetAgentPoliciesParamsFormat defines parameters for GetFleetAgentPolicies. +type GetFleetAgentPoliciesParamsFormat string -// CreateAgentPolicyJSONBody defines parameters for CreateAgentPolicy. -type CreateAgentPolicyJSONBody struct { +// PostFleetAgentPoliciesJSONBody defines parameters for PostFleetAgentPolicies. +type PostFleetAgentPoliciesJSONBody struct { AdvancedSettings *struct { AgentDownloadTargetDirectory *interface{} `json:"agent_download_target_directory"` AgentDownloadTimeout *interface{} `json:"agent_download_timeout"` @@ -2491,8 +2491,8 @@ type CreateAgentPolicyJSONBody struct { // GlobalDataTags User defined data tags that are added to all of the inputs. The values can be strings or numbers. GlobalDataTags *[]struct { - Name string `json:"name"` - Value CreateAgentPolicyJSONBody_GlobalDataTags_Value `json:"value"` + Name string `json:"name"` + Value PostFleetAgentPoliciesJSONBody_GlobalDataTags_Value `json:"value"` } `json:"global_data_tags,omitempty"` HasFleetServer *bool `json:"has_fleet_server,omitempty"` Id *string `json:"id,omitempty"` @@ -2515,7 +2515,7 @@ type CreateAgentPolicyJSONBody struct { MaxRetries *float32 `json:"max_retries,omitempty"` } `json:"uploader,omitempty"` } `json:"monitoring_diagnostics,omitempty"` - MonitoringEnabled *[]CreateAgentPolicyJSONBodyMonitoringEnabled `json:"monitoring_enabled,omitempty"` + MonitoringEnabled *[]PostFleetAgentPoliciesJSONBodyMonitoringEnabled `json:"monitoring_enabled,omitempty"` MonitoringHttp *struct { Buffer *struct { Enabled *bool `json:"enabled,omitempty"` @@ -2538,43 +2538,43 @@ type CreateAgentPolicyJSONBody struct { UnenrollTimeout *float32 `json:"unenroll_timeout,omitempty"` } -// CreateAgentPolicyParams defines parameters for CreateAgentPolicy. -type CreateAgentPolicyParams struct { +// PostFleetAgentPoliciesParams defines parameters for PostFleetAgentPolicies. +type PostFleetAgentPoliciesParams struct { SysMonitoring *bool `form:"sys_monitoring,omitempty" json:"sys_monitoring,omitempty"` } -// CreateAgentPolicyJSONBodyGlobalDataTagsValue0 defines parameters for CreateAgentPolicy. -type CreateAgentPolicyJSONBodyGlobalDataTagsValue0 = string +// PostFleetAgentPoliciesJSONBodyGlobalDataTagsValue0 defines parameters for PostFleetAgentPolicies. +type PostFleetAgentPoliciesJSONBodyGlobalDataTagsValue0 = string -// CreateAgentPolicyJSONBodyGlobalDataTagsValue1 defines parameters for CreateAgentPolicy. -type CreateAgentPolicyJSONBodyGlobalDataTagsValue1 = float32 +// PostFleetAgentPoliciesJSONBodyGlobalDataTagsValue1 defines parameters for PostFleetAgentPolicies. +type PostFleetAgentPoliciesJSONBodyGlobalDataTagsValue1 = float32 -// CreateAgentPolicyJSONBody_GlobalDataTags_Value defines parameters for CreateAgentPolicy. -type CreateAgentPolicyJSONBody_GlobalDataTags_Value struct { +// PostFleetAgentPoliciesJSONBody_GlobalDataTags_Value defines parameters for PostFleetAgentPolicies. +type PostFleetAgentPoliciesJSONBody_GlobalDataTags_Value struct { union json.RawMessage } -// CreateAgentPolicyJSONBodyMonitoringEnabled defines parameters for CreateAgentPolicy. -type CreateAgentPolicyJSONBodyMonitoringEnabled string +// PostFleetAgentPoliciesJSONBodyMonitoringEnabled defines parameters for PostFleetAgentPolicies. +type PostFleetAgentPoliciesJSONBodyMonitoringEnabled string -// DeleteAgentPolicyJSONBody defines parameters for DeleteAgentPolicy. -type DeleteAgentPolicyJSONBody struct { +// PostFleetAgentPoliciesDeleteJSONBody defines parameters for PostFleetAgentPoliciesDelete. +type PostFleetAgentPoliciesDeleteJSONBody struct { AgentPolicyId string `json:"agentPolicyId"` // Force bypass validation checks that can prevent agent policy deletion Force *bool `json:"force,omitempty"` } -// GetAgentPolicyParams defines parameters for GetAgentPolicy. -type GetAgentPolicyParams struct { - Format *GetAgentPolicyParamsFormat `form:"format,omitempty" json:"format,omitempty"` +// GetFleetAgentPoliciesAgentpolicyidParams defines parameters for GetFleetAgentPoliciesAgentpolicyid. +type GetFleetAgentPoliciesAgentpolicyidParams struct { + Format *GetFleetAgentPoliciesAgentpolicyidParamsFormat `form:"format,omitempty" json:"format,omitempty"` } -// GetAgentPolicyParamsFormat defines parameters for GetAgentPolicy. -type GetAgentPolicyParamsFormat string +// GetFleetAgentPoliciesAgentpolicyidParamsFormat defines parameters for GetFleetAgentPoliciesAgentpolicyid. +type GetFleetAgentPoliciesAgentpolicyidParamsFormat string -// UpdateAgentPolicyJSONBody defines parameters for UpdateAgentPolicy. -type UpdateAgentPolicyJSONBody struct { +// PutFleetAgentPoliciesAgentpolicyidJSONBody defines parameters for PutFleetAgentPoliciesAgentpolicyid. +type PutFleetAgentPoliciesAgentpolicyidJSONBody struct { AdvancedSettings *struct { AgentDownloadTargetDirectory *interface{} `json:"agent_download_target_directory"` AgentDownloadTimeout *interface{} `json:"agent_download_timeout"` @@ -2594,8 +2594,8 @@ type UpdateAgentPolicyJSONBody struct { // GlobalDataTags User defined data tags that are added to all of the inputs. The values can be strings or numbers. GlobalDataTags *[]struct { - Name string `json:"name"` - Value UpdateAgentPolicyJSONBody_GlobalDataTags_Value `json:"value"` + Name string `json:"name"` + Value PutFleetAgentPoliciesAgentpolicyidJSONBody_GlobalDataTags_Value `json:"value"` } `json:"global_data_tags,omitempty"` HasFleetServer *bool `json:"has_fleet_server,omitempty"` Id *string `json:"id,omitempty"` @@ -2618,7 +2618,7 @@ type UpdateAgentPolicyJSONBody struct { MaxRetries *float32 `json:"max_retries,omitempty"` } `json:"uploader,omitempty"` } `json:"monitoring_diagnostics,omitempty"` - MonitoringEnabled *[]UpdateAgentPolicyJSONBodyMonitoringEnabled `json:"monitoring_enabled,omitempty"` + MonitoringEnabled *[]PutFleetAgentPoliciesAgentpolicyidJSONBodyMonitoringEnabled `json:"monitoring_enabled,omitempty"` MonitoringHttp *struct { Buffer *struct { Enabled *bool `json:"enabled,omitempty"` @@ -2641,82 +2641,82 @@ type UpdateAgentPolicyJSONBody struct { UnenrollTimeout *float32 `json:"unenroll_timeout,omitempty"` } -// UpdateAgentPolicyParams defines parameters for UpdateAgentPolicy. -type UpdateAgentPolicyParams struct { - Format *UpdateAgentPolicyParamsFormat `form:"format,omitempty" json:"format,omitempty"` +// PutFleetAgentPoliciesAgentpolicyidParams defines parameters for PutFleetAgentPoliciesAgentpolicyid. +type PutFleetAgentPoliciesAgentpolicyidParams struct { + Format *PutFleetAgentPoliciesAgentpolicyidParamsFormat `form:"format,omitempty" json:"format,omitempty"` } -// UpdateAgentPolicyParamsFormat defines parameters for UpdateAgentPolicy. -type UpdateAgentPolicyParamsFormat string +// PutFleetAgentPoliciesAgentpolicyidParamsFormat defines parameters for PutFleetAgentPoliciesAgentpolicyid. +type PutFleetAgentPoliciesAgentpolicyidParamsFormat string -// UpdateAgentPolicyJSONBodyGlobalDataTagsValue0 defines parameters for UpdateAgentPolicy. -type UpdateAgentPolicyJSONBodyGlobalDataTagsValue0 = string +// PutFleetAgentPoliciesAgentpolicyidJSONBodyGlobalDataTagsValue0 defines parameters for PutFleetAgentPoliciesAgentpolicyid. +type PutFleetAgentPoliciesAgentpolicyidJSONBodyGlobalDataTagsValue0 = string -// UpdateAgentPolicyJSONBodyGlobalDataTagsValue1 defines parameters for UpdateAgentPolicy. -type UpdateAgentPolicyJSONBodyGlobalDataTagsValue1 = float32 +// PutFleetAgentPoliciesAgentpolicyidJSONBodyGlobalDataTagsValue1 defines parameters for PutFleetAgentPoliciesAgentpolicyid. +type PutFleetAgentPoliciesAgentpolicyidJSONBodyGlobalDataTagsValue1 = float32 -// UpdateAgentPolicyJSONBody_GlobalDataTags_Value defines parameters for UpdateAgentPolicy. -type UpdateAgentPolicyJSONBody_GlobalDataTags_Value struct { +// PutFleetAgentPoliciesAgentpolicyidJSONBody_GlobalDataTags_Value defines parameters for PutFleetAgentPoliciesAgentpolicyid. +type PutFleetAgentPoliciesAgentpolicyidJSONBody_GlobalDataTags_Value struct { union json.RawMessage } -// UpdateAgentPolicyJSONBodyMonitoringEnabled defines parameters for UpdateAgentPolicy. -type UpdateAgentPolicyJSONBodyMonitoringEnabled string +// PutFleetAgentPoliciesAgentpolicyidJSONBodyMonitoringEnabled defines parameters for PutFleetAgentPoliciesAgentpolicyid. +type PutFleetAgentPoliciesAgentpolicyidJSONBodyMonitoringEnabled string -// GetEnrollmentApiKeysParams defines parameters for GetEnrollmentApiKeys. -type GetEnrollmentApiKeysParams struct { +// GetFleetEnrollmentApiKeysParams defines parameters for GetFleetEnrollmentApiKeys. +type GetFleetEnrollmentApiKeysParams struct { Page *float32 `form:"page,omitempty" json:"page,omitempty"` PerPage *float32 `form:"perPage,omitempty" json:"perPage,omitempty"` Kuery *string `form:"kuery,omitempty" json:"kuery,omitempty"` } -// ListPackagesParams defines parameters for ListPackages. -type ListPackagesParams struct { +// GetFleetEpmPackagesParams defines parameters for GetFleetEpmPackages. +type GetFleetEpmPackagesParams struct { Category *string `form:"category,omitempty" json:"category,omitempty"` Prerelease *bool `form:"prerelease,omitempty" json:"prerelease,omitempty"` Experimental *bool `form:"experimental,omitempty" json:"experimental,omitempty"` ExcludeInstallStatus *bool `form:"excludeInstallStatus,omitempty" json:"excludeInstallStatus,omitempty"` } -// InstallPackageByUploadParams defines parameters for InstallPackageByUpload. -type InstallPackageByUploadParams struct { +// PostFleetEpmPackagesParams defines parameters for PostFleetEpmPackages. +type PostFleetEpmPackagesParams struct { IgnoreMappingUpdateErrors *bool `form:"ignoreMappingUpdateErrors,omitempty" json:"ignoreMappingUpdateErrors,omitempty"` SkipDataStreamRollover *bool `form:"skipDataStreamRollover,omitempty" json:"skipDataStreamRollover,omitempty"` } -// DeletePackageJSONBody defines parameters for DeletePackage. -type DeletePackageJSONBody struct { +// DeleteFleetEpmPackagesPkgnamePkgversionJSONBody defines parameters for DeleteFleetEpmPackagesPkgnamePkgversion. +type DeleteFleetEpmPackagesPkgnamePkgversionJSONBody struct { Force bool `json:"force"` } -// DeletePackageParams defines parameters for DeletePackage. -type DeletePackageParams struct { +// DeleteFleetEpmPackagesPkgnamePkgversionParams defines parameters for DeleteFleetEpmPackagesPkgnamePkgversion. +type DeleteFleetEpmPackagesPkgnamePkgversionParams struct { Force *bool `form:"force,omitempty" json:"force,omitempty"` } -// GetPackageParams defines parameters for GetPackage. -type GetPackageParams struct { +// GetFleetEpmPackagesPkgnamePkgversionParams defines parameters for GetFleetEpmPackagesPkgnamePkgversion. +type GetFleetEpmPackagesPkgnamePkgversionParams struct { IgnoreUnverified *bool `form:"ignoreUnverified,omitempty" json:"ignoreUnverified,omitempty"` Prerelease *bool `form:"prerelease,omitempty" json:"prerelease,omitempty"` Full *bool `form:"full,omitempty" json:"full,omitempty"` WithMetadata *bool `form:"withMetadata,omitempty" json:"withMetadata,omitempty"` } -// InstallPackageJSONBody defines parameters for InstallPackage. -type InstallPackageJSONBody struct { +// PostFleetEpmPackagesPkgnamePkgversionJSONBody defines parameters for PostFleetEpmPackagesPkgnamePkgversion. +type PostFleetEpmPackagesPkgnamePkgversionJSONBody struct { Force *bool `json:"force,omitempty"` IgnoreConstraints *bool `json:"ignore_constraints,omitempty"` } -// InstallPackageParams defines parameters for InstallPackage. -type InstallPackageParams struct { +// PostFleetEpmPackagesPkgnamePkgversionParams defines parameters for PostFleetEpmPackagesPkgnamePkgversion. +type PostFleetEpmPackagesPkgnamePkgversionParams struct { Prerelease *bool `form:"prerelease,omitempty" json:"prerelease,omitempty"` IgnoreMappingUpdateErrors *bool `form:"ignoreMappingUpdateErrors,omitempty" json:"ignoreMappingUpdateErrors,omitempty"` SkipDataStreamRollover *bool `form:"skipDataStreamRollover,omitempty" json:"skipDataStreamRollover,omitempty"` } -// CreateFleetServerHostJSONBody defines parameters for CreateFleetServerHost. -type CreateFleetServerHostJSONBody struct { +// PostFleetFleetServerHostsJSONBody defines parameters for PostFleetFleetServerHosts. +type PostFleetFleetServerHostsJSONBody struct { HostUrls []string `json:"host_urls"` Id *string `json:"id,omitempty"` IsDefault *bool `json:"is_default,omitempty"` @@ -2726,8 +2726,8 @@ type CreateFleetServerHostJSONBody struct { ProxyId *string `json:"proxy_id,omitempty"` } -// UpdateFleetServerHostJSONBody defines parameters for UpdateFleetServerHost. -type UpdateFleetServerHostJSONBody struct { +// PutFleetFleetServerHostsItemidJSONBody defines parameters for PutFleetFleetServerHostsItemid. +type PutFleetFleetServerHostsItemidJSONBody struct { HostUrls *[]string `json:"host_urls,omitempty"` IsDefault *bool `json:"is_default,omitempty"` IsInternal *bool `json:"is_internal,omitempty"` @@ -2735,91 +2735,91 @@ type UpdateFleetServerHostJSONBody struct { ProxyId *string `json:"proxy_id,omitempty"` } -// GetPackagePoliciesParams defines parameters for GetPackagePolicies. -type GetPackagePoliciesParams struct { - Page *float32 `form:"page,omitempty" json:"page,omitempty"` - PerPage *float32 `form:"perPage,omitempty" json:"perPage,omitempty"` - SortField *string `form:"sortField,omitempty" json:"sortField,omitempty"` - SortOrder *GetPackagePoliciesParamsSortOrder `form:"sortOrder,omitempty" json:"sortOrder,omitempty"` - ShowUpgradeable *bool `form:"showUpgradeable,omitempty" json:"showUpgradeable,omitempty"` - Kuery *string `form:"kuery,omitempty" json:"kuery,omitempty"` - Format *GetPackagePoliciesParamsFormat `form:"format,omitempty" json:"format,omitempty"` - WithAgentCount *bool `form:"withAgentCount,omitempty" json:"withAgentCount,omitempty"` +// GetFleetPackagePoliciesParams defines parameters for GetFleetPackagePolicies. +type GetFleetPackagePoliciesParams struct { + Page *float32 `form:"page,omitempty" json:"page,omitempty"` + PerPage *float32 `form:"perPage,omitempty" json:"perPage,omitempty"` + SortField *string `form:"sortField,omitempty" json:"sortField,omitempty"` + SortOrder *GetFleetPackagePoliciesParamsSortOrder `form:"sortOrder,omitempty" json:"sortOrder,omitempty"` + ShowUpgradeable *bool `form:"showUpgradeable,omitempty" json:"showUpgradeable,omitempty"` + Kuery *string `form:"kuery,omitempty" json:"kuery,omitempty"` + Format *GetFleetPackagePoliciesParamsFormat `form:"format,omitempty" json:"format,omitempty"` + WithAgentCount *bool `form:"withAgentCount,omitempty" json:"withAgentCount,omitempty"` } -// GetPackagePoliciesParamsSortOrder defines parameters for GetPackagePolicies. -type GetPackagePoliciesParamsSortOrder string +// GetFleetPackagePoliciesParamsSortOrder defines parameters for GetFleetPackagePolicies. +type GetFleetPackagePoliciesParamsSortOrder string -// GetPackagePoliciesParamsFormat defines parameters for GetPackagePolicies. -type GetPackagePoliciesParamsFormat string +// GetFleetPackagePoliciesParamsFormat defines parameters for GetFleetPackagePolicies. +type GetFleetPackagePoliciesParamsFormat string -// CreatePackagePolicyParams defines parameters for CreatePackagePolicy. -type CreatePackagePolicyParams struct { - Format *CreatePackagePolicyParamsFormat `form:"format,omitempty" json:"format,omitempty"` +// PostFleetPackagePoliciesParams defines parameters for PostFleetPackagePolicies. +type PostFleetPackagePoliciesParams struct { + Format *PostFleetPackagePoliciesParamsFormat `form:"format,omitempty" json:"format,omitempty"` } -// CreatePackagePolicyParamsFormat defines parameters for CreatePackagePolicy. -type CreatePackagePolicyParamsFormat string +// PostFleetPackagePoliciesParamsFormat defines parameters for PostFleetPackagePolicies. +type PostFleetPackagePoliciesParamsFormat string -// DeletePackagePolicyParams defines parameters for DeletePackagePolicy. -type DeletePackagePolicyParams struct { +// DeleteFleetPackagePoliciesPackagepolicyidParams defines parameters for DeleteFleetPackagePoliciesPackagepolicyid. +type DeleteFleetPackagePoliciesPackagepolicyidParams struct { Force *bool `form:"force,omitempty" json:"force,omitempty"` } -// GetPackagePolicyParams defines parameters for GetPackagePolicy. -type GetPackagePolicyParams struct { - Format *GetPackagePolicyParamsFormat `form:"format,omitempty" json:"format,omitempty"` +// GetFleetPackagePoliciesPackagepolicyidParams defines parameters for GetFleetPackagePoliciesPackagepolicyid. +type GetFleetPackagePoliciesPackagepolicyidParams struct { + Format *GetFleetPackagePoliciesPackagepolicyidParamsFormat `form:"format,omitempty" json:"format,omitempty"` } -// GetPackagePolicyParamsFormat defines parameters for GetPackagePolicy. -type GetPackagePolicyParamsFormat string +// GetFleetPackagePoliciesPackagepolicyidParamsFormat defines parameters for GetFleetPackagePoliciesPackagepolicyid. +type GetFleetPackagePoliciesPackagepolicyidParamsFormat string -// UpdatePackagePolicyParams defines parameters for UpdatePackagePolicy. -type UpdatePackagePolicyParams struct { - Format *UpdatePackagePolicyParamsFormat `form:"format,omitempty" json:"format,omitempty"` +// PutFleetPackagePoliciesPackagepolicyidParams defines parameters for PutFleetPackagePoliciesPackagepolicyid. +type PutFleetPackagePoliciesPackagepolicyidParams struct { + Format *PutFleetPackagePoliciesPackagepolicyidParamsFormat `form:"format,omitempty" json:"format,omitempty"` } -// UpdatePackagePolicyParamsFormat defines parameters for UpdatePackagePolicy. -type UpdatePackagePolicyParamsFormat string +// PutFleetPackagePoliciesPackagepolicyidParamsFormat defines parameters for PutFleetPackagePoliciesPackagepolicyid. +type PutFleetPackagePoliciesPackagepolicyidParamsFormat string -// CreateAgentPolicyJSONRequestBody defines body for CreateAgentPolicy for application/json ContentType. -type CreateAgentPolicyJSONRequestBody CreateAgentPolicyJSONBody +// PostFleetAgentPoliciesJSONRequestBody defines body for PostFleetAgentPolicies for application/json ContentType. +type PostFleetAgentPoliciesJSONRequestBody PostFleetAgentPoliciesJSONBody -// DeleteAgentPolicyJSONRequestBody defines body for DeleteAgentPolicy for application/json ContentType. -type DeleteAgentPolicyJSONRequestBody DeleteAgentPolicyJSONBody +// PostFleetAgentPoliciesDeleteJSONRequestBody defines body for PostFleetAgentPoliciesDelete for application/json ContentType. +type PostFleetAgentPoliciesDeleteJSONRequestBody PostFleetAgentPoliciesDeleteJSONBody -// UpdateAgentPolicyJSONRequestBody defines body for UpdateAgentPolicy for application/json ContentType. -type UpdateAgentPolicyJSONRequestBody UpdateAgentPolicyJSONBody +// PutFleetAgentPoliciesAgentpolicyidJSONRequestBody defines body for PutFleetAgentPoliciesAgentpolicyid for application/json ContentType. +type PutFleetAgentPoliciesAgentpolicyidJSONRequestBody PutFleetAgentPoliciesAgentpolicyidJSONBody -// DeletePackageJSONRequestBody defines body for DeletePackage for application/json ContentType. -type DeletePackageJSONRequestBody DeletePackageJSONBody +// DeleteFleetEpmPackagesPkgnamePkgversionJSONRequestBody defines body for DeleteFleetEpmPackagesPkgnamePkgversion for application/json ContentType. +type DeleteFleetEpmPackagesPkgnamePkgversionJSONRequestBody DeleteFleetEpmPackagesPkgnamePkgversionJSONBody -// InstallPackageJSONRequestBody defines body for InstallPackage for application/json ContentType. -type InstallPackageJSONRequestBody InstallPackageJSONBody +// PostFleetEpmPackagesPkgnamePkgversionJSONRequestBody defines body for PostFleetEpmPackagesPkgnamePkgversion for application/json ContentType. +type PostFleetEpmPackagesPkgnamePkgversionJSONRequestBody PostFleetEpmPackagesPkgnamePkgversionJSONBody -// CreateFleetServerHostJSONRequestBody defines body for CreateFleetServerHost for application/json ContentType. -type CreateFleetServerHostJSONRequestBody CreateFleetServerHostJSONBody +// PostFleetFleetServerHostsJSONRequestBody defines body for PostFleetFleetServerHosts for application/json ContentType. +type PostFleetFleetServerHostsJSONRequestBody PostFleetFleetServerHostsJSONBody -// UpdateFleetServerHostJSONRequestBody defines body for UpdateFleetServerHost for application/json ContentType. -type UpdateFleetServerHostJSONRequestBody UpdateFleetServerHostJSONBody +// PutFleetFleetServerHostsItemidJSONRequestBody defines body for PutFleetFleetServerHostsItemid for application/json ContentType. +type PutFleetFleetServerHostsItemidJSONRequestBody PutFleetFleetServerHostsItemidJSONBody -// CreateOutputJSONRequestBody defines body for CreateOutput for application/json ContentType. -type CreateOutputJSONRequestBody = NewOutputUnion +// PostFleetOutputsJSONRequestBody defines body for PostFleetOutputs for application/json ContentType. +type PostFleetOutputsJSONRequestBody = NewOutputUnion -// UpdateOutputJSONRequestBody defines body for UpdateOutput for application/json ContentType. -type UpdateOutputJSONRequestBody = UpdateOutputUnion +// PutFleetOutputsOutputidJSONRequestBody defines body for PutFleetOutputsOutputid for application/json ContentType. +type PutFleetOutputsOutputidJSONRequestBody = UpdateOutputUnion -// CreatePackagePolicyJSONRequestBody defines body for CreatePackagePolicy for application/json ContentType. -type CreatePackagePolicyJSONRequestBody = PackagePolicyRequest +// PostFleetPackagePoliciesJSONRequestBody defines body for PostFleetPackagePolicies for application/json ContentType. +type PostFleetPackagePoliciesJSONRequestBody = PackagePolicyRequest -// UpdatePackagePolicyJSONRequestBody defines body for UpdatePackagePolicy for application/json ContentType. -type UpdatePackagePolicyJSONRequestBody = PackagePolicyRequest +// PutFleetPackagePoliciesPackagepolicyidJSONRequestBody defines body for PutFleetPackagePoliciesPackagepolicyid for application/json ContentType. +type PutFleetPackagePoliciesPackagepolicyidJSONRequestBody = PackagePolicyRequest -// CreateDataViewJSONRequestBody defines body for CreateDataView for application/json ContentType. -type CreateDataViewJSONRequestBody = DataViewsCreateDataViewRequestObject +// CreateDataViewDefaultwJSONRequestBody defines body for CreateDataViewDefaultw for application/json ContentType. +type CreateDataViewDefaultwJSONRequestBody = DataViewsCreateDataViewRequestObject -// UpdateDataViewJSONRequestBody defines body for UpdateDataView for application/json ContentType. -type UpdateDataViewJSONRequestBody = DataViewsUpdateDataViewRequestObject +// UpdateDataViewDefaultJSONRequestBody defines body for UpdateDataViewDefault for application/json ContentType. +type UpdateDataViewDefaultJSONRequestBody = DataViewsUpdateDataViewRequestObject // Getter for additional properties for AgentPolicy_PackagePolicies_1_Elasticsearch_Privileges. Returns the specified // element and whether it was found @@ -11793,128 +11793,128 @@ func WithRequestEditorFn(fn RequestEditorFn) ClientOption { // The interface specification for the client above. type ClientInterface interface { - // GetAgentPolicies request - GetAgentPolicies(ctx context.Context, params *GetAgentPoliciesParams, reqEditors ...RequestEditorFn) (*http.Response, error) + // GetFleetAgentPolicies request + GetFleetAgentPolicies(ctx context.Context, params *GetFleetAgentPoliciesParams, reqEditors ...RequestEditorFn) (*http.Response, error) - // CreateAgentPolicyWithBody request with any body - CreateAgentPolicyWithBody(ctx context.Context, params *CreateAgentPolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // PostFleetAgentPoliciesWithBody request with any body + PostFleetAgentPoliciesWithBody(ctx context.Context, params *PostFleetAgentPoliciesParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - CreateAgentPolicy(ctx context.Context, params *CreateAgentPolicyParams, body CreateAgentPolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + PostFleetAgentPolicies(ctx context.Context, params *PostFleetAgentPoliciesParams, body PostFleetAgentPoliciesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // DeleteAgentPolicyWithBody request with any body - DeleteAgentPolicyWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // PostFleetAgentPoliciesDeleteWithBody request with any body + PostFleetAgentPoliciesDeleteWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - DeleteAgentPolicy(ctx context.Context, body DeleteAgentPolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + PostFleetAgentPoliciesDelete(ctx context.Context, body PostFleetAgentPoliciesDeleteJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetAgentPolicy request - GetAgentPolicy(ctx context.Context, agentPolicyId string, params *GetAgentPolicyParams, reqEditors ...RequestEditorFn) (*http.Response, error) + // GetFleetAgentPoliciesAgentpolicyid request + GetFleetAgentPoliciesAgentpolicyid(ctx context.Context, agentPolicyId string, params *GetFleetAgentPoliciesAgentpolicyidParams, reqEditors ...RequestEditorFn) (*http.Response, error) - // UpdateAgentPolicyWithBody request with any body - UpdateAgentPolicyWithBody(ctx context.Context, agentPolicyId string, params *UpdateAgentPolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // PutFleetAgentPoliciesAgentpolicyidWithBody request with any body + PutFleetAgentPoliciesAgentpolicyidWithBody(ctx context.Context, agentPolicyId string, params *PutFleetAgentPoliciesAgentpolicyidParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - UpdateAgentPolicy(ctx context.Context, agentPolicyId string, params *UpdateAgentPolicyParams, body UpdateAgentPolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + PutFleetAgentPoliciesAgentpolicyid(ctx context.Context, agentPolicyId string, params *PutFleetAgentPoliciesAgentpolicyidParams, body PutFleetAgentPoliciesAgentpolicyidJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetEnrollmentApiKeys request - GetEnrollmentApiKeys(ctx context.Context, params *GetEnrollmentApiKeysParams, reqEditors ...RequestEditorFn) (*http.Response, error) + // GetFleetEnrollmentApiKeys request + GetFleetEnrollmentApiKeys(ctx context.Context, params *GetFleetEnrollmentApiKeysParams, reqEditors ...RequestEditorFn) (*http.Response, error) - // ListPackages request - ListPackages(ctx context.Context, params *ListPackagesParams, reqEditors ...RequestEditorFn) (*http.Response, error) + // GetFleetEpmPackages request + GetFleetEpmPackages(ctx context.Context, params *GetFleetEpmPackagesParams, reqEditors ...RequestEditorFn) (*http.Response, error) - // InstallPackageByUploadWithBody request with any body - InstallPackageByUploadWithBody(ctx context.Context, params *InstallPackageByUploadParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // PostFleetEpmPackagesWithBody request with any body + PostFleetEpmPackagesWithBody(ctx context.Context, params *PostFleetEpmPackagesParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - // DeletePackageWithBody request with any body - DeletePackageWithBody(ctx context.Context, pkgName string, pkgVersion string, params *DeletePackageParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // DeleteFleetEpmPackagesPkgnamePkgversionWithBody request with any body + DeleteFleetEpmPackagesPkgnamePkgversionWithBody(ctx context.Context, pkgName string, pkgVersion string, params *DeleteFleetEpmPackagesPkgnamePkgversionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - DeletePackage(ctx context.Context, pkgName string, pkgVersion string, params *DeletePackageParams, body DeletePackageJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + DeleteFleetEpmPackagesPkgnamePkgversion(ctx context.Context, pkgName string, pkgVersion string, params *DeleteFleetEpmPackagesPkgnamePkgversionParams, body DeleteFleetEpmPackagesPkgnamePkgversionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetPackage request - GetPackage(ctx context.Context, pkgName string, pkgVersion string, params *GetPackageParams, reqEditors ...RequestEditorFn) (*http.Response, error) + // GetFleetEpmPackagesPkgnamePkgversion request + GetFleetEpmPackagesPkgnamePkgversion(ctx context.Context, pkgName string, pkgVersion string, params *GetFleetEpmPackagesPkgnamePkgversionParams, reqEditors ...RequestEditorFn) (*http.Response, error) - // InstallPackageWithBody request with any body - InstallPackageWithBody(ctx context.Context, pkgName string, pkgVersion string, params *InstallPackageParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // PostFleetEpmPackagesPkgnamePkgversionWithBody request with any body + PostFleetEpmPackagesPkgnamePkgversionWithBody(ctx context.Context, pkgName string, pkgVersion string, params *PostFleetEpmPackagesPkgnamePkgversionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - InstallPackage(ctx context.Context, pkgName string, pkgVersion string, params *InstallPackageParams, body InstallPackageJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + PostFleetEpmPackagesPkgnamePkgversion(ctx context.Context, pkgName string, pkgVersion string, params *PostFleetEpmPackagesPkgnamePkgversionParams, body PostFleetEpmPackagesPkgnamePkgversionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetFleetServerHosts request - GetFleetServerHosts(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + // GetFleetFleetServerHosts request + GetFleetFleetServerHosts(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - // CreateFleetServerHostWithBody request with any body - CreateFleetServerHostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // PostFleetFleetServerHostsWithBody request with any body + PostFleetFleetServerHostsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - CreateFleetServerHost(ctx context.Context, body CreateFleetServerHostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + PostFleetFleetServerHosts(ctx context.Context, body PostFleetFleetServerHostsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // DeleteFleetServerHost request - DeleteFleetServerHost(ctx context.Context, itemId string, reqEditors ...RequestEditorFn) (*http.Response, error) + // DeleteFleetFleetServerHostsItemid request + DeleteFleetFleetServerHostsItemid(ctx context.Context, itemId string, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetFleetServerHost request - GetFleetServerHost(ctx context.Context, itemId string, reqEditors ...RequestEditorFn) (*http.Response, error) + // GetFleetFleetServerHostsItemid request + GetFleetFleetServerHostsItemid(ctx context.Context, itemId string, reqEditors ...RequestEditorFn) (*http.Response, error) - // UpdateFleetServerHostWithBody request with any body - UpdateFleetServerHostWithBody(ctx context.Context, itemId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // PutFleetFleetServerHostsItemidWithBody request with any body + PutFleetFleetServerHostsItemidWithBody(ctx context.Context, itemId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - UpdateFleetServerHost(ctx context.Context, itemId string, body UpdateFleetServerHostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + PutFleetFleetServerHostsItemid(ctx context.Context, itemId string, body PutFleetFleetServerHostsItemidJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetOutputs request - GetOutputs(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + // GetFleetOutputs request + GetFleetOutputs(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) - // CreateOutputWithBody request with any body - CreateOutputWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // PostFleetOutputsWithBody request with any body + PostFleetOutputsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - CreateOutput(ctx context.Context, body CreateOutputJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + PostFleetOutputs(ctx context.Context, body PostFleetOutputsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // DeleteOutput request - DeleteOutput(ctx context.Context, outputId string, reqEditors ...RequestEditorFn) (*http.Response, error) + // DeleteFleetOutputsOutputid request + DeleteFleetOutputsOutputid(ctx context.Context, outputId string, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetOutput request - GetOutput(ctx context.Context, outputId string, reqEditors ...RequestEditorFn) (*http.Response, error) + // GetFleetOutputsOutputid request + GetFleetOutputsOutputid(ctx context.Context, outputId string, reqEditors ...RequestEditorFn) (*http.Response, error) - // UpdateOutputWithBody request with any body - UpdateOutputWithBody(ctx context.Context, outputId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // PutFleetOutputsOutputidWithBody request with any body + PutFleetOutputsOutputidWithBody(ctx context.Context, outputId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - UpdateOutput(ctx context.Context, outputId string, body UpdateOutputJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + PutFleetOutputsOutputid(ctx context.Context, outputId string, body PutFleetOutputsOutputidJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetPackagePolicies request - GetPackagePolicies(ctx context.Context, params *GetPackagePoliciesParams, reqEditors ...RequestEditorFn) (*http.Response, error) + // GetFleetPackagePolicies request + GetFleetPackagePolicies(ctx context.Context, params *GetFleetPackagePoliciesParams, reqEditors ...RequestEditorFn) (*http.Response, error) - // CreatePackagePolicyWithBody request with any body - CreatePackagePolicyWithBody(ctx context.Context, params *CreatePackagePolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // PostFleetPackagePoliciesWithBody request with any body + PostFleetPackagePoliciesWithBody(ctx context.Context, params *PostFleetPackagePoliciesParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - CreatePackagePolicy(ctx context.Context, params *CreatePackagePolicyParams, body CreatePackagePolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + PostFleetPackagePolicies(ctx context.Context, params *PostFleetPackagePoliciesParams, body PostFleetPackagePoliciesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // DeletePackagePolicy request - DeletePackagePolicy(ctx context.Context, packagePolicyId string, params *DeletePackagePolicyParams, reqEditors ...RequestEditorFn) (*http.Response, error) + // DeleteFleetPackagePoliciesPackagepolicyid request + DeleteFleetPackagePoliciesPackagepolicyid(ctx context.Context, packagePolicyId string, params *DeleteFleetPackagePoliciesPackagepolicyidParams, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetPackagePolicy request - GetPackagePolicy(ctx context.Context, packagePolicyId string, params *GetPackagePolicyParams, reqEditors ...RequestEditorFn) (*http.Response, error) + // GetFleetPackagePoliciesPackagepolicyid request + GetFleetPackagePoliciesPackagepolicyid(ctx context.Context, packagePolicyId string, params *GetFleetPackagePoliciesPackagepolicyidParams, reqEditors ...RequestEditorFn) (*http.Response, error) - // UpdatePackagePolicyWithBody request with any body - UpdatePackagePolicyWithBody(ctx context.Context, packagePolicyId string, params *UpdatePackagePolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // PutFleetPackagePoliciesPackagepolicyidWithBody request with any body + PutFleetPackagePoliciesPackagepolicyidWithBody(ctx context.Context, packagePolicyId string, params *PutFleetPackagePoliciesPackagepolicyidParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - UpdatePackagePolicy(ctx context.Context, packagePolicyId string, params *UpdatePackagePolicyParams, body UpdatePackagePolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + PutFleetPackagePoliciesPackagepolicyid(ctx context.Context, packagePolicyId string, params *PutFleetPackagePoliciesPackagepolicyidParams, body PutFleetPackagePoliciesPackagepolicyidJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetDataViews request - GetDataViews(ctx context.Context, spaceId SpaceId, reqEditors ...RequestEditorFn) (*http.Response, error) + // GetAllDataViewsDefault request + GetAllDataViewsDefault(ctx context.Context, spaceId SpaceId, reqEditors ...RequestEditorFn) (*http.Response, error) - // CreateDataViewWithBody request with any body - CreateDataViewWithBody(ctx context.Context, spaceId SpaceId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // CreateDataViewDefaultwWithBody request with any body + CreateDataViewDefaultwWithBody(ctx context.Context, spaceId SpaceId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - CreateDataView(ctx context.Context, spaceId SpaceId, body CreateDataViewJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + CreateDataViewDefaultw(ctx context.Context, spaceId SpaceId, body CreateDataViewDefaultwJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // DeleteDataView request - DeleteDataView(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, reqEditors ...RequestEditorFn) (*http.Response, error) + // DeleteDataViewDefault request + DeleteDataViewDefault(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, reqEditors ...RequestEditorFn) (*http.Response, error) - // GetDataView request - GetDataView(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, reqEditors ...RequestEditorFn) (*http.Response, error) + // GetDataViewDefault request + GetDataViewDefault(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, reqEditors ...RequestEditorFn) (*http.Response, error) - // UpdateDataViewWithBody request with any body - UpdateDataViewWithBody(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + // UpdateDataViewDefaultWithBody request with any body + UpdateDataViewDefaultWithBody(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - UpdateDataView(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, body UpdateDataViewJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + UpdateDataViewDefault(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, body UpdateDataViewDefaultJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) } -func (c *Client) GetAgentPolicies(ctx context.Context, params *GetAgentPoliciesParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetAgentPoliciesRequest(c.Server, params) +func (c *Client) GetFleetAgentPolicies(ctx context.Context, params *GetFleetAgentPoliciesParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetFleetAgentPoliciesRequest(c.Server, params) if err != nil { return nil, err } @@ -11925,8 +11925,8 @@ func (c *Client) GetAgentPolicies(ctx context.Context, params *GetAgentPoliciesP return c.Client.Do(req) } -func (c *Client) CreateAgentPolicyWithBody(ctx context.Context, params *CreateAgentPolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateAgentPolicyRequestWithBody(c.Server, params, contentType, body) +func (c *Client) PostFleetAgentPoliciesWithBody(ctx context.Context, params *PostFleetAgentPoliciesParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostFleetAgentPoliciesRequestWithBody(c.Server, params, contentType, body) if err != nil { return nil, err } @@ -11937,8 +11937,8 @@ func (c *Client) CreateAgentPolicyWithBody(ctx context.Context, params *CreateAg return c.Client.Do(req) } -func (c *Client) CreateAgentPolicy(ctx context.Context, params *CreateAgentPolicyParams, body CreateAgentPolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateAgentPolicyRequest(c.Server, params, body) +func (c *Client) PostFleetAgentPolicies(ctx context.Context, params *PostFleetAgentPoliciesParams, body PostFleetAgentPoliciesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostFleetAgentPoliciesRequest(c.Server, params, body) if err != nil { return nil, err } @@ -11949,8 +11949,8 @@ func (c *Client) CreateAgentPolicy(ctx context.Context, params *CreateAgentPolic return c.Client.Do(req) } -func (c *Client) DeleteAgentPolicyWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewDeleteAgentPolicyRequestWithBody(c.Server, contentType, body) +func (c *Client) PostFleetAgentPoliciesDeleteWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostFleetAgentPoliciesDeleteRequestWithBody(c.Server, contentType, body) if err != nil { return nil, err } @@ -11961,8 +11961,8 @@ func (c *Client) DeleteAgentPolicyWithBody(ctx context.Context, contentType stri return c.Client.Do(req) } -func (c *Client) DeleteAgentPolicy(ctx context.Context, body DeleteAgentPolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewDeleteAgentPolicyRequest(c.Server, body) +func (c *Client) PostFleetAgentPoliciesDelete(ctx context.Context, body PostFleetAgentPoliciesDeleteJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostFleetAgentPoliciesDeleteRequest(c.Server, body) if err != nil { return nil, err } @@ -11973,8 +11973,8 @@ func (c *Client) DeleteAgentPolicy(ctx context.Context, body DeleteAgentPolicyJS return c.Client.Do(req) } -func (c *Client) GetAgentPolicy(ctx context.Context, agentPolicyId string, params *GetAgentPolicyParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetAgentPolicyRequest(c.Server, agentPolicyId, params) +func (c *Client) GetFleetAgentPoliciesAgentpolicyid(ctx context.Context, agentPolicyId string, params *GetFleetAgentPoliciesAgentpolicyidParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetFleetAgentPoliciesAgentpolicyidRequest(c.Server, agentPolicyId, params) if err != nil { return nil, err } @@ -11985,8 +11985,8 @@ func (c *Client) GetAgentPolicy(ctx context.Context, agentPolicyId string, param return c.Client.Do(req) } -func (c *Client) UpdateAgentPolicyWithBody(ctx context.Context, agentPolicyId string, params *UpdateAgentPolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewUpdateAgentPolicyRequestWithBody(c.Server, agentPolicyId, params, contentType, body) +func (c *Client) PutFleetAgentPoliciesAgentpolicyidWithBody(ctx context.Context, agentPolicyId string, params *PutFleetAgentPoliciesAgentpolicyidParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPutFleetAgentPoliciesAgentpolicyidRequestWithBody(c.Server, agentPolicyId, params, contentType, body) if err != nil { return nil, err } @@ -11997,8 +11997,8 @@ func (c *Client) UpdateAgentPolicyWithBody(ctx context.Context, agentPolicyId st return c.Client.Do(req) } -func (c *Client) UpdateAgentPolicy(ctx context.Context, agentPolicyId string, params *UpdateAgentPolicyParams, body UpdateAgentPolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewUpdateAgentPolicyRequest(c.Server, agentPolicyId, params, body) +func (c *Client) PutFleetAgentPoliciesAgentpolicyid(ctx context.Context, agentPolicyId string, params *PutFleetAgentPoliciesAgentpolicyidParams, body PutFleetAgentPoliciesAgentpolicyidJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPutFleetAgentPoliciesAgentpolicyidRequest(c.Server, agentPolicyId, params, body) if err != nil { return nil, err } @@ -12009,8 +12009,8 @@ func (c *Client) UpdateAgentPolicy(ctx context.Context, agentPolicyId string, pa return c.Client.Do(req) } -func (c *Client) GetEnrollmentApiKeys(ctx context.Context, params *GetEnrollmentApiKeysParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetEnrollmentApiKeysRequest(c.Server, params) +func (c *Client) GetFleetEnrollmentApiKeys(ctx context.Context, params *GetFleetEnrollmentApiKeysParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetFleetEnrollmentApiKeysRequest(c.Server, params) if err != nil { return nil, err } @@ -12021,8 +12021,8 @@ func (c *Client) GetEnrollmentApiKeys(ctx context.Context, params *GetEnrollment return c.Client.Do(req) } -func (c *Client) ListPackages(ctx context.Context, params *ListPackagesParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewListPackagesRequest(c.Server, params) +func (c *Client) GetFleetEpmPackages(ctx context.Context, params *GetFleetEpmPackagesParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetFleetEpmPackagesRequest(c.Server, params) if err != nil { return nil, err } @@ -12033,8 +12033,8 @@ func (c *Client) ListPackages(ctx context.Context, params *ListPackagesParams, r return c.Client.Do(req) } -func (c *Client) InstallPackageByUploadWithBody(ctx context.Context, params *InstallPackageByUploadParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewInstallPackageByUploadRequestWithBody(c.Server, params, contentType, body) +func (c *Client) PostFleetEpmPackagesWithBody(ctx context.Context, params *PostFleetEpmPackagesParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostFleetEpmPackagesRequestWithBody(c.Server, params, contentType, body) if err != nil { return nil, err } @@ -12045,8 +12045,8 @@ func (c *Client) InstallPackageByUploadWithBody(ctx context.Context, params *Ins return c.Client.Do(req) } -func (c *Client) DeletePackageWithBody(ctx context.Context, pkgName string, pkgVersion string, params *DeletePackageParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewDeletePackageRequestWithBody(c.Server, pkgName, pkgVersion, params, contentType, body) +func (c *Client) DeleteFleetEpmPackagesPkgnamePkgversionWithBody(ctx context.Context, pkgName string, pkgVersion string, params *DeleteFleetEpmPackagesPkgnamePkgversionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteFleetEpmPackagesPkgnamePkgversionRequestWithBody(c.Server, pkgName, pkgVersion, params, contentType, body) if err != nil { return nil, err } @@ -12057,8 +12057,8 @@ func (c *Client) DeletePackageWithBody(ctx context.Context, pkgName string, pkgV return c.Client.Do(req) } -func (c *Client) DeletePackage(ctx context.Context, pkgName string, pkgVersion string, params *DeletePackageParams, body DeletePackageJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewDeletePackageRequest(c.Server, pkgName, pkgVersion, params, body) +func (c *Client) DeleteFleetEpmPackagesPkgnamePkgversion(ctx context.Context, pkgName string, pkgVersion string, params *DeleteFleetEpmPackagesPkgnamePkgversionParams, body DeleteFleetEpmPackagesPkgnamePkgversionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteFleetEpmPackagesPkgnamePkgversionRequest(c.Server, pkgName, pkgVersion, params, body) if err != nil { return nil, err } @@ -12069,8 +12069,8 @@ func (c *Client) DeletePackage(ctx context.Context, pkgName string, pkgVersion s return c.Client.Do(req) } -func (c *Client) GetPackage(ctx context.Context, pkgName string, pkgVersion string, params *GetPackageParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetPackageRequest(c.Server, pkgName, pkgVersion, params) +func (c *Client) GetFleetEpmPackagesPkgnamePkgversion(ctx context.Context, pkgName string, pkgVersion string, params *GetFleetEpmPackagesPkgnamePkgversionParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetFleetEpmPackagesPkgnamePkgversionRequest(c.Server, pkgName, pkgVersion, params) if err != nil { return nil, err } @@ -12081,8 +12081,8 @@ func (c *Client) GetPackage(ctx context.Context, pkgName string, pkgVersion stri return c.Client.Do(req) } -func (c *Client) InstallPackageWithBody(ctx context.Context, pkgName string, pkgVersion string, params *InstallPackageParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewInstallPackageRequestWithBody(c.Server, pkgName, pkgVersion, params, contentType, body) +func (c *Client) PostFleetEpmPackagesPkgnamePkgversionWithBody(ctx context.Context, pkgName string, pkgVersion string, params *PostFleetEpmPackagesPkgnamePkgversionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostFleetEpmPackagesPkgnamePkgversionRequestWithBody(c.Server, pkgName, pkgVersion, params, contentType, body) if err != nil { return nil, err } @@ -12093,8 +12093,8 @@ func (c *Client) InstallPackageWithBody(ctx context.Context, pkgName string, pkg return c.Client.Do(req) } -func (c *Client) InstallPackage(ctx context.Context, pkgName string, pkgVersion string, params *InstallPackageParams, body InstallPackageJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewInstallPackageRequest(c.Server, pkgName, pkgVersion, params, body) +func (c *Client) PostFleetEpmPackagesPkgnamePkgversion(ctx context.Context, pkgName string, pkgVersion string, params *PostFleetEpmPackagesPkgnamePkgversionParams, body PostFleetEpmPackagesPkgnamePkgversionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostFleetEpmPackagesPkgnamePkgversionRequest(c.Server, pkgName, pkgVersion, params, body) if err != nil { return nil, err } @@ -12105,8 +12105,8 @@ func (c *Client) InstallPackage(ctx context.Context, pkgName string, pkgVersion return c.Client.Do(req) } -func (c *Client) GetFleetServerHosts(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetFleetServerHostsRequest(c.Server) +func (c *Client) GetFleetFleetServerHosts(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetFleetFleetServerHostsRequest(c.Server) if err != nil { return nil, err } @@ -12117,8 +12117,8 @@ func (c *Client) GetFleetServerHosts(ctx context.Context, reqEditors ...RequestE return c.Client.Do(req) } -func (c *Client) CreateFleetServerHostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateFleetServerHostRequestWithBody(c.Server, contentType, body) +func (c *Client) PostFleetFleetServerHostsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostFleetFleetServerHostsRequestWithBody(c.Server, contentType, body) if err != nil { return nil, err } @@ -12129,8 +12129,8 @@ func (c *Client) CreateFleetServerHostWithBody(ctx context.Context, contentType return c.Client.Do(req) } -func (c *Client) CreateFleetServerHost(ctx context.Context, body CreateFleetServerHostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateFleetServerHostRequest(c.Server, body) +func (c *Client) PostFleetFleetServerHosts(ctx context.Context, body PostFleetFleetServerHostsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostFleetFleetServerHostsRequest(c.Server, body) if err != nil { return nil, err } @@ -12141,8 +12141,8 @@ func (c *Client) CreateFleetServerHost(ctx context.Context, body CreateFleetServ return c.Client.Do(req) } -func (c *Client) DeleteFleetServerHost(ctx context.Context, itemId string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewDeleteFleetServerHostRequest(c.Server, itemId) +func (c *Client) DeleteFleetFleetServerHostsItemid(ctx context.Context, itemId string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteFleetFleetServerHostsItemidRequest(c.Server, itemId) if err != nil { return nil, err } @@ -12153,8 +12153,8 @@ func (c *Client) DeleteFleetServerHost(ctx context.Context, itemId string, reqEd return c.Client.Do(req) } -func (c *Client) GetFleetServerHost(ctx context.Context, itemId string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetFleetServerHostRequest(c.Server, itemId) +func (c *Client) GetFleetFleetServerHostsItemid(ctx context.Context, itemId string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetFleetFleetServerHostsItemidRequest(c.Server, itemId) if err != nil { return nil, err } @@ -12165,8 +12165,8 @@ func (c *Client) GetFleetServerHost(ctx context.Context, itemId string, reqEdito return c.Client.Do(req) } -func (c *Client) UpdateFleetServerHostWithBody(ctx context.Context, itemId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewUpdateFleetServerHostRequestWithBody(c.Server, itemId, contentType, body) +func (c *Client) PutFleetFleetServerHostsItemidWithBody(ctx context.Context, itemId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPutFleetFleetServerHostsItemidRequestWithBody(c.Server, itemId, contentType, body) if err != nil { return nil, err } @@ -12177,8 +12177,8 @@ func (c *Client) UpdateFleetServerHostWithBody(ctx context.Context, itemId strin return c.Client.Do(req) } -func (c *Client) UpdateFleetServerHost(ctx context.Context, itemId string, body UpdateFleetServerHostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewUpdateFleetServerHostRequest(c.Server, itemId, body) +func (c *Client) PutFleetFleetServerHostsItemid(ctx context.Context, itemId string, body PutFleetFleetServerHostsItemidJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPutFleetFleetServerHostsItemidRequest(c.Server, itemId, body) if err != nil { return nil, err } @@ -12189,8 +12189,8 @@ func (c *Client) UpdateFleetServerHost(ctx context.Context, itemId string, body return c.Client.Do(req) } -func (c *Client) GetOutputs(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetOutputsRequest(c.Server) +func (c *Client) GetFleetOutputs(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetFleetOutputsRequest(c.Server) if err != nil { return nil, err } @@ -12201,8 +12201,8 @@ func (c *Client) GetOutputs(ctx context.Context, reqEditors ...RequestEditorFn) return c.Client.Do(req) } -func (c *Client) CreateOutputWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateOutputRequestWithBody(c.Server, contentType, body) +func (c *Client) PostFleetOutputsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostFleetOutputsRequestWithBody(c.Server, contentType, body) if err != nil { return nil, err } @@ -12213,8 +12213,8 @@ func (c *Client) CreateOutputWithBody(ctx context.Context, contentType string, b return c.Client.Do(req) } -func (c *Client) CreateOutput(ctx context.Context, body CreateOutputJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateOutputRequest(c.Server, body) +func (c *Client) PostFleetOutputs(ctx context.Context, body PostFleetOutputsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostFleetOutputsRequest(c.Server, body) if err != nil { return nil, err } @@ -12225,8 +12225,8 @@ func (c *Client) CreateOutput(ctx context.Context, body CreateOutputJSONRequestB return c.Client.Do(req) } -func (c *Client) DeleteOutput(ctx context.Context, outputId string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewDeleteOutputRequest(c.Server, outputId) +func (c *Client) DeleteFleetOutputsOutputid(ctx context.Context, outputId string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteFleetOutputsOutputidRequest(c.Server, outputId) if err != nil { return nil, err } @@ -12237,8 +12237,8 @@ func (c *Client) DeleteOutput(ctx context.Context, outputId string, reqEditors . return c.Client.Do(req) } -func (c *Client) GetOutput(ctx context.Context, outputId string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetOutputRequest(c.Server, outputId) +func (c *Client) GetFleetOutputsOutputid(ctx context.Context, outputId string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetFleetOutputsOutputidRequest(c.Server, outputId) if err != nil { return nil, err } @@ -12249,8 +12249,8 @@ func (c *Client) GetOutput(ctx context.Context, outputId string, reqEditors ...R return c.Client.Do(req) } -func (c *Client) UpdateOutputWithBody(ctx context.Context, outputId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewUpdateOutputRequestWithBody(c.Server, outputId, contentType, body) +func (c *Client) PutFleetOutputsOutputidWithBody(ctx context.Context, outputId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPutFleetOutputsOutputidRequestWithBody(c.Server, outputId, contentType, body) if err != nil { return nil, err } @@ -12261,8 +12261,8 @@ func (c *Client) UpdateOutputWithBody(ctx context.Context, outputId string, cont return c.Client.Do(req) } -func (c *Client) UpdateOutput(ctx context.Context, outputId string, body UpdateOutputJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewUpdateOutputRequest(c.Server, outputId, body) +func (c *Client) PutFleetOutputsOutputid(ctx context.Context, outputId string, body PutFleetOutputsOutputidJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPutFleetOutputsOutputidRequest(c.Server, outputId, body) if err != nil { return nil, err } @@ -12273,8 +12273,8 @@ func (c *Client) UpdateOutput(ctx context.Context, outputId string, body UpdateO return c.Client.Do(req) } -func (c *Client) GetPackagePolicies(ctx context.Context, params *GetPackagePoliciesParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetPackagePoliciesRequest(c.Server, params) +func (c *Client) GetFleetPackagePolicies(ctx context.Context, params *GetFleetPackagePoliciesParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetFleetPackagePoliciesRequest(c.Server, params) if err != nil { return nil, err } @@ -12285,8 +12285,8 @@ func (c *Client) GetPackagePolicies(ctx context.Context, params *GetPackagePolic return c.Client.Do(req) } -func (c *Client) CreatePackagePolicyWithBody(ctx context.Context, params *CreatePackagePolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreatePackagePolicyRequestWithBody(c.Server, params, contentType, body) +func (c *Client) PostFleetPackagePoliciesWithBody(ctx context.Context, params *PostFleetPackagePoliciesParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostFleetPackagePoliciesRequestWithBody(c.Server, params, contentType, body) if err != nil { return nil, err } @@ -12297,8 +12297,8 @@ func (c *Client) CreatePackagePolicyWithBody(ctx context.Context, params *Create return c.Client.Do(req) } -func (c *Client) CreatePackagePolicy(ctx context.Context, params *CreatePackagePolicyParams, body CreatePackagePolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreatePackagePolicyRequest(c.Server, params, body) +func (c *Client) PostFleetPackagePolicies(ctx context.Context, params *PostFleetPackagePoliciesParams, body PostFleetPackagePoliciesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPostFleetPackagePoliciesRequest(c.Server, params, body) if err != nil { return nil, err } @@ -12309,8 +12309,8 @@ func (c *Client) CreatePackagePolicy(ctx context.Context, params *CreatePackageP return c.Client.Do(req) } -func (c *Client) DeletePackagePolicy(ctx context.Context, packagePolicyId string, params *DeletePackagePolicyParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewDeletePackagePolicyRequest(c.Server, packagePolicyId, params) +func (c *Client) DeleteFleetPackagePoliciesPackagepolicyid(ctx context.Context, packagePolicyId string, params *DeleteFleetPackagePoliciesPackagepolicyidParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteFleetPackagePoliciesPackagepolicyidRequest(c.Server, packagePolicyId, params) if err != nil { return nil, err } @@ -12321,8 +12321,8 @@ func (c *Client) DeletePackagePolicy(ctx context.Context, packagePolicyId string return c.Client.Do(req) } -func (c *Client) GetPackagePolicy(ctx context.Context, packagePolicyId string, params *GetPackagePolicyParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetPackagePolicyRequest(c.Server, packagePolicyId, params) +func (c *Client) GetFleetPackagePoliciesPackagepolicyid(ctx context.Context, packagePolicyId string, params *GetFleetPackagePoliciesPackagepolicyidParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetFleetPackagePoliciesPackagepolicyidRequest(c.Server, packagePolicyId, params) if err != nil { return nil, err } @@ -12333,8 +12333,8 @@ func (c *Client) GetPackagePolicy(ctx context.Context, packagePolicyId string, p return c.Client.Do(req) } -func (c *Client) UpdatePackagePolicyWithBody(ctx context.Context, packagePolicyId string, params *UpdatePackagePolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewUpdatePackagePolicyRequestWithBody(c.Server, packagePolicyId, params, contentType, body) +func (c *Client) PutFleetPackagePoliciesPackagepolicyidWithBody(ctx context.Context, packagePolicyId string, params *PutFleetPackagePoliciesPackagepolicyidParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPutFleetPackagePoliciesPackagepolicyidRequestWithBody(c.Server, packagePolicyId, params, contentType, body) if err != nil { return nil, err } @@ -12345,8 +12345,8 @@ func (c *Client) UpdatePackagePolicyWithBody(ctx context.Context, packagePolicyI return c.Client.Do(req) } -func (c *Client) UpdatePackagePolicy(ctx context.Context, packagePolicyId string, params *UpdatePackagePolicyParams, body UpdatePackagePolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewUpdatePackagePolicyRequest(c.Server, packagePolicyId, params, body) +func (c *Client) PutFleetPackagePoliciesPackagepolicyid(ctx context.Context, packagePolicyId string, params *PutFleetPackagePoliciesPackagepolicyidParams, body PutFleetPackagePoliciesPackagepolicyidJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPutFleetPackagePoliciesPackagepolicyidRequest(c.Server, packagePolicyId, params, body) if err != nil { return nil, err } @@ -12357,8 +12357,8 @@ func (c *Client) UpdatePackagePolicy(ctx context.Context, packagePolicyId string return c.Client.Do(req) } -func (c *Client) GetDataViews(ctx context.Context, spaceId SpaceId, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetDataViewsRequest(c.Server, spaceId) +func (c *Client) GetAllDataViewsDefault(ctx context.Context, spaceId SpaceId, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetAllDataViewsDefaultRequest(c.Server, spaceId) if err != nil { return nil, err } @@ -12369,8 +12369,8 @@ func (c *Client) GetDataViews(ctx context.Context, spaceId SpaceId, reqEditors . return c.Client.Do(req) } -func (c *Client) CreateDataViewWithBody(ctx context.Context, spaceId SpaceId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateDataViewRequestWithBody(c.Server, spaceId, contentType, body) +func (c *Client) CreateDataViewDefaultwWithBody(ctx context.Context, spaceId SpaceId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateDataViewDefaultwRequestWithBody(c.Server, spaceId, contentType, body) if err != nil { return nil, err } @@ -12381,8 +12381,8 @@ func (c *Client) CreateDataViewWithBody(ctx context.Context, spaceId SpaceId, co return c.Client.Do(req) } -func (c *Client) CreateDataView(ctx context.Context, spaceId SpaceId, body CreateDataViewJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewCreateDataViewRequest(c.Server, spaceId, body) +func (c *Client) CreateDataViewDefaultw(ctx context.Context, spaceId SpaceId, body CreateDataViewDefaultwJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateDataViewDefaultwRequest(c.Server, spaceId, body) if err != nil { return nil, err } @@ -12393,8 +12393,8 @@ func (c *Client) CreateDataView(ctx context.Context, spaceId SpaceId, body Creat return c.Client.Do(req) } -func (c *Client) DeleteDataView(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewDeleteDataViewRequest(c.Server, spaceId, viewId) +func (c *Client) DeleteDataViewDefault(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteDataViewDefaultRequest(c.Server, spaceId, viewId) if err != nil { return nil, err } @@ -12405,8 +12405,8 @@ func (c *Client) DeleteDataView(ctx context.Context, spaceId SpaceId, viewId Dat return c.Client.Do(req) } -func (c *Client) GetDataView(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetDataViewRequest(c.Server, spaceId, viewId) +func (c *Client) GetDataViewDefault(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetDataViewDefaultRequest(c.Server, spaceId, viewId) if err != nil { return nil, err } @@ -12417,8 +12417,8 @@ func (c *Client) GetDataView(ctx context.Context, spaceId SpaceId, viewId DataVi return c.Client.Do(req) } -func (c *Client) UpdateDataViewWithBody(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewUpdateDataViewRequestWithBody(c.Server, spaceId, viewId, contentType, body) +func (c *Client) UpdateDataViewDefaultWithBody(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateDataViewDefaultRequestWithBody(c.Server, spaceId, viewId, contentType, body) if err != nil { return nil, err } @@ -12429,8 +12429,8 @@ func (c *Client) UpdateDataViewWithBody(ctx context.Context, spaceId SpaceId, vi return c.Client.Do(req) } -func (c *Client) UpdateDataView(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, body UpdateDataViewJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewUpdateDataViewRequest(c.Server, spaceId, viewId, body) +func (c *Client) UpdateDataViewDefault(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, body UpdateDataViewDefaultJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateDataViewDefaultRequest(c.Server, spaceId, viewId, body) if err != nil { return nil, err } @@ -12441,8 +12441,8 @@ func (c *Client) UpdateDataView(ctx context.Context, spaceId SpaceId, viewId Dat return c.Client.Do(req) } -// NewGetAgentPoliciesRequest generates requests for GetAgentPolicies -func NewGetAgentPoliciesRequest(server string, params *GetAgentPoliciesParams) (*http.Request, error) { +// NewGetFleetAgentPoliciesRequest generates requests for GetFleetAgentPolicies +func NewGetFleetAgentPoliciesRequest(server string, params *GetFleetAgentPoliciesParams) (*http.Request, error) { var err error serverURL, err := url.Parse(server) @@ -12634,19 +12634,19 @@ func NewGetAgentPoliciesRequest(server string, params *GetAgentPoliciesParams) ( return req, nil } -// NewCreateAgentPolicyRequest calls the generic CreateAgentPolicy builder with application/json body -func NewCreateAgentPolicyRequest(server string, params *CreateAgentPolicyParams, body CreateAgentPolicyJSONRequestBody) (*http.Request, error) { +// NewPostFleetAgentPoliciesRequest calls the generic PostFleetAgentPolicies builder with application/json body +func NewPostFleetAgentPoliciesRequest(server string, params *PostFleetAgentPoliciesParams, body PostFleetAgentPoliciesJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewCreateAgentPolicyRequestWithBody(server, params, "application/json", bodyReader) + return NewPostFleetAgentPoliciesRequestWithBody(server, params, "application/json", bodyReader) } -// NewCreateAgentPolicyRequestWithBody generates requests for CreateAgentPolicy with any type of body -func NewCreateAgentPolicyRequestWithBody(server string, params *CreateAgentPolicyParams, contentType string, body io.Reader) (*http.Request, error) { +// NewPostFleetAgentPoliciesRequestWithBody generates requests for PostFleetAgentPolicies with any type of body +func NewPostFleetAgentPoliciesRequestWithBody(server string, params *PostFleetAgentPoliciesParams, contentType string, body io.Reader) (*http.Request, error) { var err error serverURL, err := url.Parse(server) @@ -12696,19 +12696,19 @@ func NewCreateAgentPolicyRequestWithBody(server string, params *CreateAgentPolic return req, nil } -// NewDeleteAgentPolicyRequest calls the generic DeleteAgentPolicy builder with application/json body -func NewDeleteAgentPolicyRequest(server string, body DeleteAgentPolicyJSONRequestBody) (*http.Request, error) { +// NewPostFleetAgentPoliciesDeleteRequest calls the generic PostFleetAgentPoliciesDelete builder with application/json body +func NewPostFleetAgentPoliciesDeleteRequest(server string, body PostFleetAgentPoliciesDeleteJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewDeleteAgentPolicyRequestWithBody(server, "application/json", bodyReader) + return NewPostFleetAgentPoliciesDeleteRequestWithBody(server, "application/json", bodyReader) } -// NewDeleteAgentPolicyRequestWithBody generates requests for DeleteAgentPolicy with any type of body -func NewDeleteAgentPolicyRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { +// NewPostFleetAgentPoliciesDeleteRequestWithBody generates requests for PostFleetAgentPoliciesDelete with any type of body +func NewPostFleetAgentPoliciesDeleteRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error serverURL, err := url.Parse(server) @@ -12736,8 +12736,8 @@ func NewDeleteAgentPolicyRequestWithBody(server string, contentType string, body return req, nil } -// NewGetAgentPolicyRequest generates requests for GetAgentPolicy -func NewGetAgentPolicyRequest(server string, agentPolicyId string, params *GetAgentPolicyParams) (*http.Request, error) { +// NewGetFleetAgentPoliciesAgentpolicyidRequest generates requests for GetFleetAgentPoliciesAgentpolicyid +func NewGetFleetAgentPoliciesAgentpolicyidRequest(server string, agentPolicyId string, params *GetFleetAgentPoliciesAgentpolicyidParams) (*http.Request, error) { var err error var pathParam0 string @@ -12792,19 +12792,19 @@ func NewGetAgentPolicyRequest(server string, agentPolicyId string, params *GetAg return req, nil } -// NewUpdateAgentPolicyRequest calls the generic UpdateAgentPolicy builder with application/json body -func NewUpdateAgentPolicyRequest(server string, agentPolicyId string, params *UpdateAgentPolicyParams, body UpdateAgentPolicyJSONRequestBody) (*http.Request, error) { +// NewPutFleetAgentPoliciesAgentpolicyidRequest calls the generic PutFleetAgentPoliciesAgentpolicyid builder with application/json body +func NewPutFleetAgentPoliciesAgentpolicyidRequest(server string, agentPolicyId string, params *PutFleetAgentPoliciesAgentpolicyidParams, body PutFleetAgentPoliciesAgentpolicyidJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewUpdateAgentPolicyRequestWithBody(server, agentPolicyId, params, "application/json", bodyReader) + return NewPutFleetAgentPoliciesAgentpolicyidRequestWithBody(server, agentPolicyId, params, "application/json", bodyReader) } -// NewUpdateAgentPolicyRequestWithBody generates requests for UpdateAgentPolicy with any type of body -func NewUpdateAgentPolicyRequestWithBody(server string, agentPolicyId string, params *UpdateAgentPolicyParams, contentType string, body io.Reader) (*http.Request, error) { +// NewPutFleetAgentPoliciesAgentpolicyidRequestWithBody generates requests for PutFleetAgentPoliciesAgentpolicyid with any type of body +func NewPutFleetAgentPoliciesAgentpolicyidRequestWithBody(server string, agentPolicyId string, params *PutFleetAgentPoliciesAgentpolicyidParams, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -12861,8 +12861,8 @@ func NewUpdateAgentPolicyRequestWithBody(server string, agentPolicyId string, pa return req, nil } -// NewGetEnrollmentApiKeysRequest generates requests for GetEnrollmentApiKeys -func NewGetEnrollmentApiKeysRequest(server string, params *GetEnrollmentApiKeysParams) (*http.Request, error) { +// NewGetFleetEnrollmentApiKeysRequest generates requests for GetFleetEnrollmentApiKeys +func NewGetFleetEnrollmentApiKeysRequest(server string, params *GetFleetEnrollmentApiKeysParams) (*http.Request, error) { var err error serverURL, err := url.Parse(server) @@ -12942,8 +12942,8 @@ func NewGetEnrollmentApiKeysRequest(server string, params *GetEnrollmentApiKeysP return req, nil } -// NewListPackagesRequest generates requests for ListPackages -func NewListPackagesRequest(server string, params *ListPackagesParams) (*http.Request, error) { +// NewGetFleetEpmPackagesRequest generates requests for GetFleetEpmPackages +func NewGetFleetEpmPackagesRequest(server string, params *GetFleetEpmPackagesParams) (*http.Request, error) { var err error serverURL, err := url.Parse(server) @@ -13039,8 +13039,8 @@ func NewListPackagesRequest(server string, params *ListPackagesParams) (*http.Re return req, nil } -// NewInstallPackageByUploadRequestWithBody generates requests for InstallPackageByUpload with any type of body -func NewInstallPackageByUploadRequestWithBody(server string, params *InstallPackageByUploadParams, contentType string, body io.Reader) (*http.Request, error) { +// NewPostFleetEpmPackagesRequestWithBody generates requests for PostFleetEpmPackages with any type of body +func NewPostFleetEpmPackagesRequestWithBody(server string, params *PostFleetEpmPackagesParams, contentType string, body io.Reader) (*http.Request, error) { var err error serverURL, err := url.Parse(server) @@ -13106,19 +13106,19 @@ func NewInstallPackageByUploadRequestWithBody(server string, params *InstallPack return req, nil } -// NewDeletePackageRequest calls the generic DeletePackage builder with application/json body -func NewDeletePackageRequest(server string, pkgName string, pkgVersion string, params *DeletePackageParams, body DeletePackageJSONRequestBody) (*http.Request, error) { +// NewDeleteFleetEpmPackagesPkgnamePkgversionRequest calls the generic DeleteFleetEpmPackagesPkgnamePkgversion builder with application/json body +func NewDeleteFleetEpmPackagesPkgnamePkgversionRequest(server string, pkgName string, pkgVersion string, params *DeleteFleetEpmPackagesPkgnamePkgversionParams, body DeleteFleetEpmPackagesPkgnamePkgversionJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewDeletePackageRequestWithBody(server, pkgName, pkgVersion, params, "application/json", bodyReader) + return NewDeleteFleetEpmPackagesPkgnamePkgversionRequestWithBody(server, pkgName, pkgVersion, params, "application/json", bodyReader) } -// NewDeletePackageRequestWithBody generates requests for DeletePackage with any type of body -func NewDeletePackageRequestWithBody(server string, pkgName string, pkgVersion string, params *DeletePackageParams, contentType string, body io.Reader) (*http.Request, error) { +// NewDeleteFleetEpmPackagesPkgnamePkgversionRequestWithBody generates requests for DeleteFleetEpmPackagesPkgnamePkgversion with any type of body +func NewDeleteFleetEpmPackagesPkgnamePkgversionRequestWithBody(server string, pkgName string, pkgVersion string, params *DeleteFleetEpmPackagesPkgnamePkgversionParams, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -13182,8 +13182,8 @@ func NewDeletePackageRequestWithBody(server string, pkgName string, pkgVersion s return req, nil } -// NewGetPackageRequest generates requests for GetPackage -func NewGetPackageRequest(server string, pkgName string, pkgVersion string, params *GetPackageParams) (*http.Request, error) { +// NewGetFleetEpmPackagesPkgnamePkgversionRequest generates requests for GetFleetEpmPackagesPkgnamePkgversion +func NewGetFleetEpmPackagesPkgnamePkgversionRequest(server string, pkgName string, pkgVersion string, params *GetFleetEpmPackagesPkgnamePkgversionParams) (*http.Request, error) { var err error var pathParam0 string @@ -13293,19 +13293,19 @@ func NewGetPackageRequest(server string, pkgName string, pkgVersion string, para return req, nil } -// NewInstallPackageRequest calls the generic InstallPackage builder with application/json body -func NewInstallPackageRequest(server string, pkgName string, pkgVersion string, params *InstallPackageParams, body InstallPackageJSONRequestBody) (*http.Request, error) { +// NewPostFleetEpmPackagesPkgnamePkgversionRequest calls the generic PostFleetEpmPackagesPkgnamePkgversion builder with application/json body +func NewPostFleetEpmPackagesPkgnamePkgversionRequest(server string, pkgName string, pkgVersion string, params *PostFleetEpmPackagesPkgnamePkgversionParams, body PostFleetEpmPackagesPkgnamePkgversionJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewInstallPackageRequestWithBody(server, pkgName, pkgVersion, params, "application/json", bodyReader) + return NewPostFleetEpmPackagesPkgnamePkgversionRequestWithBody(server, pkgName, pkgVersion, params, "application/json", bodyReader) } -// NewInstallPackageRequestWithBody generates requests for InstallPackage with any type of body -func NewInstallPackageRequestWithBody(server string, pkgName string, pkgVersion string, params *InstallPackageParams, contentType string, body io.Reader) (*http.Request, error) { +// NewPostFleetEpmPackagesPkgnamePkgversionRequestWithBody generates requests for PostFleetEpmPackagesPkgnamePkgversion with any type of body +func NewPostFleetEpmPackagesPkgnamePkgversionRequestWithBody(server string, pkgName string, pkgVersion string, params *PostFleetEpmPackagesPkgnamePkgversionParams, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -13401,8 +13401,8 @@ func NewInstallPackageRequestWithBody(server string, pkgName string, pkgVersion return req, nil } -// NewGetFleetServerHostsRequest generates requests for GetFleetServerHosts -func NewGetFleetServerHostsRequest(server string) (*http.Request, error) { +// NewGetFleetFleetServerHostsRequest generates requests for GetFleetFleetServerHosts +func NewGetFleetFleetServerHostsRequest(server string) (*http.Request, error) { var err error serverURL, err := url.Parse(server) @@ -13428,19 +13428,19 @@ func NewGetFleetServerHostsRequest(server string) (*http.Request, error) { return req, nil } -// NewCreateFleetServerHostRequest calls the generic CreateFleetServerHost builder with application/json body -func NewCreateFleetServerHostRequest(server string, body CreateFleetServerHostJSONRequestBody) (*http.Request, error) { +// NewPostFleetFleetServerHostsRequest calls the generic PostFleetFleetServerHosts builder with application/json body +func NewPostFleetFleetServerHostsRequest(server string, body PostFleetFleetServerHostsJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewCreateFleetServerHostRequestWithBody(server, "application/json", bodyReader) + return NewPostFleetFleetServerHostsRequestWithBody(server, "application/json", bodyReader) } -// NewCreateFleetServerHostRequestWithBody generates requests for CreateFleetServerHost with any type of body -func NewCreateFleetServerHostRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { +// NewPostFleetFleetServerHostsRequestWithBody generates requests for PostFleetFleetServerHosts with any type of body +func NewPostFleetFleetServerHostsRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error serverURL, err := url.Parse(server) @@ -13468,8 +13468,8 @@ func NewCreateFleetServerHostRequestWithBody(server string, contentType string, return req, nil } -// NewDeleteFleetServerHostRequest generates requests for DeleteFleetServerHost -func NewDeleteFleetServerHostRequest(server string, itemId string) (*http.Request, error) { +// NewDeleteFleetFleetServerHostsItemidRequest generates requests for DeleteFleetFleetServerHostsItemid +func NewDeleteFleetFleetServerHostsItemidRequest(server string, itemId string) (*http.Request, error) { var err error var pathParam0 string @@ -13502,8 +13502,8 @@ func NewDeleteFleetServerHostRequest(server string, itemId string) (*http.Reques return req, nil } -// NewGetFleetServerHostRequest generates requests for GetFleetServerHost -func NewGetFleetServerHostRequest(server string, itemId string) (*http.Request, error) { +// NewGetFleetFleetServerHostsItemidRequest generates requests for GetFleetFleetServerHostsItemid +func NewGetFleetFleetServerHostsItemidRequest(server string, itemId string) (*http.Request, error) { var err error var pathParam0 string @@ -13536,19 +13536,19 @@ func NewGetFleetServerHostRequest(server string, itemId string) (*http.Request, return req, nil } -// NewUpdateFleetServerHostRequest calls the generic UpdateFleetServerHost builder with application/json body -func NewUpdateFleetServerHostRequest(server string, itemId string, body UpdateFleetServerHostJSONRequestBody) (*http.Request, error) { +// NewPutFleetFleetServerHostsItemidRequest calls the generic PutFleetFleetServerHostsItemid builder with application/json body +func NewPutFleetFleetServerHostsItemidRequest(server string, itemId string, body PutFleetFleetServerHostsItemidJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewUpdateFleetServerHostRequestWithBody(server, itemId, "application/json", bodyReader) + return NewPutFleetFleetServerHostsItemidRequestWithBody(server, itemId, "application/json", bodyReader) } -// NewUpdateFleetServerHostRequestWithBody generates requests for UpdateFleetServerHost with any type of body -func NewUpdateFleetServerHostRequestWithBody(server string, itemId string, contentType string, body io.Reader) (*http.Request, error) { +// NewPutFleetFleetServerHostsItemidRequestWithBody generates requests for PutFleetFleetServerHostsItemid with any type of body +func NewPutFleetFleetServerHostsItemidRequestWithBody(server string, itemId string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -13583,8 +13583,8 @@ func NewUpdateFleetServerHostRequestWithBody(server string, itemId string, conte return req, nil } -// NewGetOutputsRequest generates requests for GetOutputs -func NewGetOutputsRequest(server string) (*http.Request, error) { +// NewGetFleetOutputsRequest generates requests for GetFleetOutputs +func NewGetFleetOutputsRequest(server string) (*http.Request, error) { var err error serverURL, err := url.Parse(server) @@ -13610,19 +13610,19 @@ func NewGetOutputsRequest(server string) (*http.Request, error) { return req, nil } -// NewCreateOutputRequest calls the generic CreateOutput builder with application/json body -func NewCreateOutputRequest(server string, body CreateOutputJSONRequestBody) (*http.Request, error) { +// NewPostFleetOutputsRequest calls the generic PostFleetOutputs builder with application/json body +func NewPostFleetOutputsRequest(server string, body PostFleetOutputsJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewCreateOutputRequestWithBody(server, "application/json", bodyReader) + return NewPostFleetOutputsRequestWithBody(server, "application/json", bodyReader) } -// NewCreateOutputRequestWithBody generates requests for CreateOutput with any type of body -func NewCreateOutputRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { +// NewPostFleetOutputsRequestWithBody generates requests for PostFleetOutputs with any type of body +func NewPostFleetOutputsRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error serverURL, err := url.Parse(server) @@ -13650,8 +13650,8 @@ func NewCreateOutputRequestWithBody(server string, contentType string, body io.R return req, nil } -// NewDeleteOutputRequest generates requests for DeleteOutput -func NewDeleteOutputRequest(server string, outputId string) (*http.Request, error) { +// NewDeleteFleetOutputsOutputidRequest generates requests for DeleteFleetOutputsOutputid +func NewDeleteFleetOutputsOutputidRequest(server string, outputId string) (*http.Request, error) { var err error var pathParam0 string @@ -13684,8 +13684,8 @@ func NewDeleteOutputRequest(server string, outputId string) (*http.Request, erro return req, nil } -// NewGetOutputRequest generates requests for GetOutput -func NewGetOutputRequest(server string, outputId string) (*http.Request, error) { +// NewGetFleetOutputsOutputidRequest generates requests for GetFleetOutputsOutputid +func NewGetFleetOutputsOutputidRequest(server string, outputId string) (*http.Request, error) { var err error var pathParam0 string @@ -13718,19 +13718,19 @@ func NewGetOutputRequest(server string, outputId string) (*http.Request, error) return req, nil } -// NewUpdateOutputRequest calls the generic UpdateOutput builder with application/json body -func NewUpdateOutputRequest(server string, outputId string, body UpdateOutputJSONRequestBody) (*http.Request, error) { +// NewPutFleetOutputsOutputidRequest calls the generic PutFleetOutputsOutputid builder with application/json body +func NewPutFleetOutputsOutputidRequest(server string, outputId string, body PutFleetOutputsOutputidJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewUpdateOutputRequestWithBody(server, outputId, "application/json", bodyReader) + return NewPutFleetOutputsOutputidRequestWithBody(server, outputId, "application/json", bodyReader) } -// NewUpdateOutputRequestWithBody generates requests for UpdateOutput with any type of body -func NewUpdateOutputRequestWithBody(server string, outputId string, contentType string, body io.Reader) (*http.Request, error) { +// NewPutFleetOutputsOutputidRequestWithBody generates requests for PutFleetOutputsOutputid with any type of body +func NewPutFleetOutputsOutputidRequestWithBody(server string, outputId string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -13765,8 +13765,8 @@ func NewUpdateOutputRequestWithBody(server string, outputId string, contentType return req, nil } -// NewGetPackagePoliciesRequest generates requests for GetPackagePolicies -func NewGetPackagePoliciesRequest(server string, params *GetPackagePoliciesParams) (*http.Request, error) { +// NewGetFleetPackagePoliciesRequest generates requests for GetFleetPackagePolicies +func NewGetFleetPackagePoliciesRequest(server string, params *GetFleetPackagePoliciesParams) (*http.Request, error) { var err error serverURL, err := url.Parse(server) @@ -13926,19 +13926,19 @@ func NewGetPackagePoliciesRequest(server string, params *GetPackagePoliciesParam return req, nil } -// NewCreatePackagePolicyRequest calls the generic CreatePackagePolicy builder with application/json body -func NewCreatePackagePolicyRequest(server string, params *CreatePackagePolicyParams, body CreatePackagePolicyJSONRequestBody) (*http.Request, error) { +// NewPostFleetPackagePoliciesRequest calls the generic PostFleetPackagePolicies builder with application/json body +func NewPostFleetPackagePoliciesRequest(server string, params *PostFleetPackagePoliciesParams, body PostFleetPackagePoliciesJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewCreatePackagePolicyRequestWithBody(server, params, "application/json", bodyReader) + return NewPostFleetPackagePoliciesRequestWithBody(server, params, "application/json", bodyReader) } -// NewCreatePackagePolicyRequestWithBody generates requests for CreatePackagePolicy with any type of body -func NewCreatePackagePolicyRequestWithBody(server string, params *CreatePackagePolicyParams, contentType string, body io.Reader) (*http.Request, error) { +// NewPostFleetPackagePoliciesRequestWithBody generates requests for PostFleetPackagePolicies with any type of body +func NewPostFleetPackagePoliciesRequestWithBody(server string, params *PostFleetPackagePoliciesParams, contentType string, body io.Reader) (*http.Request, error) { var err error serverURL, err := url.Parse(server) @@ -13988,8 +13988,8 @@ func NewCreatePackagePolicyRequestWithBody(server string, params *CreatePackageP return req, nil } -// NewDeletePackagePolicyRequest generates requests for DeletePackagePolicy -func NewDeletePackagePolicyRequest(server string, packagePolicyId string, params *DeletePackagePolicyParams) (*http.Request, error) { +// NewDeleteFleetPackagePoliciesPackagepolicyidRequest generates requests for DeleteFleetPackagePoliciesPackagepolicyid +func NewDeleteFleetPackagePoliciesPackagepolicyidRequest(server string, packagePolicyId string, params *DeleteFleetPackagePoliciesPackagepolicyidParams) (*http.Request, error) { var err error var pathParam0 string @@ -14044,8 +14044,8 @@ func NewDeletePackagePolicyRequest(server string, packagePolicyId string, params return req, nil } -// NewGetPackagePolicyRequest generates requests for GetPackagePolicy -func NewGetPackagePolicyRequest(server string, packagePolicyId string, params *GetPackagePolicyParams) (*http.Request, error) { +// NewGetFleetPackagePoliciesPackagepolicyidRequest generates requests for GetFleetPackagePoliciesPackagepolicyid +func NewGetFleetPackagePoliciesPackagepolicyidRequest(server string, packagePolicyId string, params *GetFleetPackagePoliciesPackagepolicyidParams) (*http.Request, error) { var err error var pathParam0 string @@ -14100,19 +14100,19 @@ func NewGetPackagePolicyRequest(server string, packagePolicyId string, params *G return req, nil } -// NewUpdatePackagePolicyRequest calls the generic UpdatePackagePolicy builder with application/json body -func NewUpdatePackagePolicyRequest(server string, packagePolicyId string, params *UpdatePackagePolicyParams, body UpdatePackagePolicyJSONRequestBody) (*http.Request, error) { +// NewPutFleetPackagePoliciesPackagepolicyidRequest calls the generic PutFleetPackagePoliciesPackagepolicyid builder with application/json body +func NewPutFleetPackagePoliciesPackagepolicyidRequest(server string, packagePolicyId string, params *PutFleetPackagePoliciesPackagepolicyidParams, body PutFleetPackagePoliciesPackagepolicyidJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewUpdatePackagePolicyRequestWithBody(server, packagePolicyId, params, "application/json", bodyReader) + return NewPutFleetPackagePoliciesPackagepolicyidRequestWithBody(server, packagePolicyId, params, "application/json", bodyReader) } -// NewUpdatePackagePolicyRequestWithBody generates requests for UpdatePackagePolicy with any type of body -func NewUpdatePackagePolicyRequestWithBody(server string, packagePolicyId string, params *UpdatePackagePolicyParams, contentType string, body io.Reader) (*http.Request, error) { +// NewPutFleetPackagePoliciesPackagepolicyidRequestWithBody generates requests for PutFleetPackagePoliciesPackagepolicyid with any type of body +func NewPutFleetPackagePoliciesPackagepolicyidRequestWithBody(server string, packagePolicyId string, params *PutFleetPackagePoliciesPackagepolicyidParams, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -14169,8 +14169,8 @@ func NewUpdatePackagePolicyRequestWithBody(server string, packagePolicyId string return req, nil } -// NewGetDataViewsRequest generates requests for GetDataViews -func NewGetDataViewsRequest(server string, spaceId SpaceId) (*http.Request, error) { +// NewGetAllDataViewsDefaultRequest generates requests for GetAllDataViewsDefault +func NewGetAllDataViewsDefaultRequest(server string, spaceId SpaceId) (*http.Request, error) { var err error var pathParam0 string @@ -14203,19 +14203,19 @@ func NewGetDataViewsRequest(server string, spaceId SpaceId) (*http.Request, erro return req, nil } -// NewCreateDataViewRequest calls the generic CreateDataView builder with application/json body -func NewCreateDataViewRequest(server string, spaceId SpaceId, body CreateDataViewJSONRequestBody) (*http.Request, error) { +// NewCreateDataViewDefaultwRequest calls the generic CreateDataViewDefaultw builder with application/json body +func NewCreateDataViewDefaultwRequest(server string, spaceId SpaceId, body CreateDataViewDefaultwJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewCreateDataViewRequestWithBody(server, spaceId, "application/json", bodyReader) + return NewCreateDataViewDefaultwRequestWithBody(server, spaceId, "application/json", bodyReader) } -// NewCreateDataViewRequestWithBody generates requests for CreateDataView with any type of body -func NewCreateDataViewRequestWithBody(server string, spaceId SpaceId, contentType string, body io.Reader) (*http.Request, error) { +// NewCreateDataViewDefaultwRequestWithBody generates requests for CreateDataViewDefaultw with any type of body +func NewCreateDataViewDefaultwRequestWithBody(server string, spaceId SpaceId, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -14250,8 +14250,8 @@ func NewCreateDataViewRequestWithBody(server string, spaceId SpaceId, contentTyp return req, nil } -// NewDeleteDataViewRequest generates requests for DeleteDataView -func NewDeleteDataViewRequest(server string, spaceId SpaceId, viewId DataViewsViewId) (*http.Request, error) { +// NewDeleteDataViewDefaultRequest generates requests for DeleteDataViewDefault +func NewDeleteDataViewDefaultRequest(server string, spaceId SpaceId, viewId DataViewsViewId) (*http.Request, error) { var err error var pathParam0 string @@ -14291,8 +14291,8 @@ func NewDeleteDataViewRequest(server string, spaceId SpaceId, viewId DataViewsVi return req, nil } -// NewGetDataViewRequest generates requests for GetDataView -func NewGetDataViewRequest(server string, spaceId SpaceId, viewId DataViewsViewId) (*http.Request, error) { +// NewGetDataViewDefaultRequest generates requests for GetDataViewDefault +func NewGetDataViewDefaultRequest(server string, spaceId SpaceId, viewId DataViewsViewId) (*http.Request, error) { var err error var pathParam0 string @@ -14332,19 +14332,19 @@ func NewGetDataViewRequest(server string, spaceId SpaceId, viewId DataViewsViewI return req, nil } -// NewUpdateDataViewRequest calls the generic UpdateDataView builder with application/json body -func NewUpdateDataViewRequest(server string, spaceId SpaceId, viewId DataViewsViewId, body UpdateDataViewJSONRequestBody) (*http.Request, error) { +// NewUpdateDataViewDefaultRequest calls the generic UpdateDataViewDefault builder with application/json body +func NewUpdateDataViewDefaultRequest(server string, spaceId SpaceId, viewId DataViewsViewId, body UpdateDataViewDefaultJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewUpdateDataViewRequestWithBody(server, spaceId, viewId, "application/json", bodyReader) + return NewUpdateDataViewDefaultRequestWithBody(server, spaceId, viewId, "application/json", bodyReader) } -// NewUpdateDataViewRequestWithBody generates requests for UpdateDataView with any type of body -func NewUpdateDataViewRequestWithBody(server string, spaceId SpaceId, viewId DataViewsViewId, contentType string, body io.Reader) (*http.Request, error) { +// NewUpdateDataViewDefaultRequestWithBody generates requests for UpdateDataViewDefault with any type of body +func NewUpdateDataViewDefaultRequestWithBody(server string, spaceId SpaceId, viewId DataViewsViewId, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -14429,127 +14429,127 @@ func WithBaseURL(baseURL string) ClientOption { // ClientWithResponsesInterface is the interface specification for the client with responses above. type ClientWithResponsesInterface interface { - // GetAgentPoliciesWithResponse request - GetAgentPoliciesWithResponse(ctx context.Context, params *GetAgentPoliciesParams, reqEditors ...RequestEditorFn) (*GetAgentPoliciesResponse, error) + // GetFleetAgentPoliciesWithResponse request + GetFleetAgentPoliciesWithResponse(ctx context.Context, params *GetFleetAgentPoliciesParams, reqEditors ...RequestEditorFn) (*GetFleetAgentPoliciesResponse, error) - // CreateAgentPolicyWithBodyWithResponse request with any body - CreateAgentPolicyWithBodyWithResponse(ctx context.Context, params *CreateAgentPolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateAgentPolicyResponse, error) + // PostFleetAgentPoliciesWithBodyWithResponse request with any body + PostFleetAgentPoliciesWithBodyWithResponse(ctx context.Context, params *PostFleetAgentPoliciesParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostFleetAgentPoliciesResponse, error) - CreateAgentPolicyWithResponse(ctx context.Context, params *CreateAgentPolicyParams, body CreateAgentPolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateAgentPolicyResponse, error) + PostFleetAgentPoliciesWithResponse(ctx context.Context, params *PostFleetAgentPoliciesParams, body PostFleetAgentPoliciesJSONRequestBody, reqEditors ...RequestEditorFn) (*PostFleetAgentPoliciesResponse, error) - // DeleteAgentPolicyWithBodyWithResponse request with any body - DeleteAgentPolicyWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DeleteAgentPolicyResponse, error) + // PostFleetAgentPoliciesDeleteWithBodyWithResponse request with any body + PostFleetAgentPoliciesDeleteWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostFleetAgentPoliciesDeleteResponse, error) - DeleteAgentPolicyWithResponse(ctx context.Context, body DeleteAgentPolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*DeleteAgentPolicyResponse, error) + PostFleetAgentPoliciesDeleteWithResponse(ctx context.Context, body PostFleetAgentPoliciesDeleteJSONRequestBody, reqEditors ...RequestEditorFn) (*PostFleetAgentPoliciesDeleteResponse, error) - // GetAgentPolicyWithResponse request - GetAgentPolicyWithResponse(ctx context.Context, agentPolicyId string, params *GetAgentPolicyParams, reqEditors ...RequestEditorFn) (*GetAgentPolicyResponse, error) + // GetFleetAgentPoliciesAgentpolicyidWithResponse request + GetFleetAgentPoliciesAgentpolicyidWithResponse(ctx context.Context, agentPolicyId string, params *GetFleetAgentPoliciesAgentpolicyidParams, reqEditors ...RequestEditorFn) (*GetFleetAgentPoliciesAgentpolicyidResponse, error) - // UpdateAgentPolicyWithBodyWithResponse request with any body - UpdateAgentPolicyWithBodyWithResponse(ctx context.Context, agentPolicyId string, params *UpdateAgentPolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateAgentPolicyResponse, error) + // PutFleetAgentPoliciesAgentpolicyidWithBodyWithResponse request with any body + PutFleetAgentPoliciesAgentpolicyidWithBodyWithResponse(ctx context.Context, agentPolicyId string, params *PutFleetAgentPoliciesAgentpolicyidParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutFleetAgentPoliciesAgentpolicyidResponse, error) - UpdateAgentPolicyWithResponse(ctx context.Context, agentPolicyId string, params *UpdateAgentPolicyParams, body UpdateAgentPolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateAgentPolicyResponse, error) + PutFleetAgentPoliciesAgentpolicyidWithResponse(ctx context.Context, agentPolicyId string, params *PutFleetAgentPoliciesAgentpolicyidParams, body PutFleetAgentPoliciesAgentpolicyidJSONRequestBody, reqEditors ...RequestEditorFn) (*PutFleetAgentPoliciesAgentpolicyidResponse, error) - // GetEnrollmentApiKeysWithResponse request - GetEnrollmentApiKeysWithResponse(ctx context.Context, params *GetEnrollmentApiKeysParams, reqEditors ...RequestEditorFn) (*GetEnrollmentApiKeysResponse, error) + // GetFleetEnrollmentApiKeysWithResponse request + GetFleetEnrollmentApiKeysWithResponse(ctx context.Context, params *GetFleetEnrollmentApiKeysParams, reqEditors ...RequestEditorFn) (*GetFleetEnrollmentApiKeysResponse, error) - // ListPackagesWithResponse request - ListPackagesWithResponse(ctx context.Context, params *ListPackagesParams, reqEditors ...RequestEditorFn) (*ListPackagesResponse, error) + // GetFleetEpmPackagesWithResponse request + GetFleetEpmPackagesWithResponse(ctx context.Context, params *GetFleetEpmPackagesParams, reqEditors ...RequestEditorFn) (*GetFleetEpmPackagesResponse, error) - // InstallPackageByUploadWithBodyWithResponse request with any body - InstallPackageByUploadWithBodyWithResponse(ctx context.Context, params *InstallPackageByUploadParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*InstallPackageByUploadResponse, error) + // PostFleetEpmPackagesWithBodyWithResponse request with any body + PostFleetEpmPackagesWithBodyWithResponse(ctx context.Context, params *PostFleetEpmPackagesParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostFleetEpmPackagesResponse, error) - // DeletePackageWithBodyWithResponse request with any body - DeletePackageWithBodyWithResponse(ctx context.Context, pkgName string, pkgVersion string, params *DeletePackageParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DeletePackageResponse, error) + // DeleteFleetEpmPackagesPkgnamePkgversionWithBodyWithResponse request with any body + DeleteFleetEpmPackagesPkgnamePkgversionWithBodyWithResponse(ctx context.Context, pkgName string, pkgVersion string, params *DeleteFleetEpmPackagesPkgnamePkgversionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DeleteFleetEpmPackagesPkgnamePkgversionResponse, error) - DeletePackageWithResponse(ctx context.Context, pkgName string, pkgVersion string, params *DeletePackageParams, body DeletePackageJSONRequestBody, reqEditors ...RequestEditorFn) (*DeletePackageResponse, error) + DeleteFleetEpmPackagesPkgnamePkgversionWithResponse(ctx context.Context, pkgName string, pkgVersion string, params *DeleteFleetEpmPackagesPkgnamePkgversionParams, body DeleteFleetEpmPackagesPkgnamePkgversionJSONRequestBody, reqEditors ...RequestEditorFn) (*DeleteFleetEpmPackagesPkgnamePkgversionResponse, error) - // GetPackageWithResponse request - GetPackageWithResponse(ctx context.Context, pkgName string, pkgVersion string, params *GetPackageParams, reqEditors ...RequestEditorFn) (*GetPackageResponse, error) + // GetFleetEpmPackagesPkgnamePkgversionWithResponse request + GetFleetEpmPackagesPkgnamePkgversionWithResponse(ctx context.Context, pkgName string, pkgVersion string, params *GetFleetEpmPackagesPkgnamePkgversionParams, reqEditors ...RequestEditorFn) (*GetFleetEpmPackagesPkgnamePkgversionResponse, error) - // InstallPackageWithBodyWithResponse request with any body - InstallPackageWithBodyWithResponse(ctx context.Context, pkgName string, pkgVersion string, params *InstallPackageParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*InstallPackageResponse, error) + // PostFleetEpmPackagesPkgnamePkgversionWithBodyWithResponse request with any body + PostFleetEpmPackagesPkgnamePkgversionWithBodyWithResponse(ctx context.Context, pkgName string, pkgVersion string, params *PostFleetEpmPackagesPkgnamePkgversionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostFleetEpmPackagesPkgnamePkgversionResponse, error) - InstallPackageWithResponse(ctx context.Context, pkgName string, pkgVersion string, params *InstallPackageParams, body InstallPackageJSONRequestBody, reqEditors ...RequestEditorFn) (*InstallPackageResponse, error) + PostFleetEpmPackagesPkgnamePkgversionWithResponse(ctx context.Context, pkgName string, pkgVersion string, params *PostFleetEpmPackagesPkgnamePkgversionParams, body PostFleetEpmPackagesPkgnamePkgversionJSONRequestBody, reqEditors ...RequestEditorFn) (*PostFleetEpmPackagesPkgnamePkgversionResponse, error) - // GetFleetServerHostsWithResponse request - GetFleetServerHostsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetFleetServerHostsResponse, error) + // GetFleetFleetServerHostsWithResponse request + GetFleetFleetServerHostsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetFleetFleetServerHostsResponse, error) - // CreateFleetServerHostWithBodyWithResponse request with any body - CreateFleetServerHostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateFleetServerHostResponse, error) + // PostFleetFleetServerHostsWithBodyWithResponse request with any body + PostFleetFleetServerHostsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostFleetFleetServerHostsResponse, error) - CreateFleetServerHostWithResponse(ctx context.Context, body CreateFleetServerHostJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateFleetServerHostResponse, error) + PostFleetFleetServerHostsWithResponse(ctx context.Context, body PostFleetFleetServerHostsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostFleetFleetServerHostsResponse, error) - // DeleteFleetServerHostWithResponse request - DeleteFleetServerHostWithResponse(ctx context.Context, itemId string, reqEditors ...RequestEditorFn) (*DeleteFleetServerHostResponse, error) + // DeleteFleetFleetServerHostsItemidWithResponse request + DeleteFleetFleetServerHostsItemidWithResponse(ctx context.Context, itemId string, reqEditors ...RequestEditorFn) (*DeleteFleetFleetServerHostsItemidResponse, error) - // GetFleetServerHostWithResponse request - GetFleetServerHostWithResponse(ctx context.Context, itemId string, reqEditors ...RequestEditorFn) (*GetFleetServerHostResponse, error) + // GetFleetFleetServerHostsItemidWithResponse request + GetFleetFleetServerHostsItemidWithResponse(ctx context.Context, itemId string, reqEditors ...RequestEditorFn) (*GetFleetFleetServerHostsItemidResponse, error) - // UpdateFleetServerHostWithBodyWithResponse request with any body - UpdateFleetServerHostWithBodyWithResponse(ctx context.Context, itemId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateFleetServerHostResponse, error) + // PutFleetFleetServerHostsItemidWithBodyWithResponse request with any body + PutFleetFleetServerHostsItemidWithBodyWithResponse(ctx context.Context, itemId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutFleetFleetServerHostsItemidResponse, error) - UpdateFleetServerHostWithResponse(ctx context.Context, itemId string, body UpdateFleetServerHostJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateFleetServerHostResponse, error) + PutFleetFleetServerHostsItemidWithResponse(ctx context.Context, itemId string, body PutFleetFleetServerHostsItemidJSONRequestBody, reqEditors ...RequestEditorFn) (*PutFleetFleetServerHostsItemidResponse, error) - // GetOutputsWithResponse request - GetOutputsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetOutputsResponse, error) + // GetFleetOutputsWithResponse request + GetFleetOutputsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetFleetOutputsResponse, error) - // CreateOutputWithBodyWithResponse request with any body - CreateOutputWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateOutputResponse, error) + // PostFleetOutputsWithBodyWithResponse request with any body + PostFleetOutputsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostFleetOutputsResponse, error) - CreateOutputWithResponse(ctx context.Context, body CreateOutputJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateOutputResponse, error) + PostFleetOutputsWithResponse(ctx context.Context, body PostFleetOutputsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostFleetOutputsResponse, error) - // DeleteOutputWithResponse request - DeleteOutputWithResponse(ctx context.Context, outputId string, reqEditors ...RequestEditorFn) (*DeleteOutputResponse, error) + // DeleteFleetOutputsOutputidWithResponse request + DeleteFleetOutputsOutputidWithResponse(ctx context.Context, outputId string, reqEditors ...RequestEditorFn) (*DeleteFleetOutputsOutputidResponse, error) - // GetOutputWithResponse request - GetOutputWithResponse(ctx context.Context, outputId string, reqEditors ...RequestEditorFn) (*GetOutputResponse, error) + // GetFleetOutputsOutputidWithResponse request + GetFleetOutputsOutputidWithResponse(ctx context.Context, outputId string, reqEditors ...RequestEditorFn) (*GetFleetOutputsOutputidResponse, error) - // UpdateOutputWithBodyWithResponse request with any body - UpdateOutputWithBodyWithResponse(ctx context.Context, outputId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateOutputResponse, error) + // PutFleetOutputsOutputidWithBodyWithResponse request with any body + PutFleetOutputsOutputidWithBodyWithResponse(ctx context.Context, outputId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutFleetOutputsOutputidResponse, error) - UpdateOutputWithResponse(ctx context.Context, outputId string, body UpdateOutputJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateOutputResponse, error) + PutFleetOutputsOutputidWithResponse(ctx context.Context, outputId string, body PutFleetOutputsOutputidJSONRequestBody, reqEditors ...RequestEditorFn) (*PutFleetOutputsOutputidResponse, error) - // GetPackagePoliciesWithResponse request - GetPackagePoliciesWithResponse(ctx context.Context, params *GetPackagePoliciesParams, reqEditors ...RequestEditorFn) (*GetPackagePoliciesResponse, error) + // GetFleetPackagePoliciesWithResponse request + GetFleetPackagePoliciesWithResponse(ctx context.Context, params *GetFleetPackagePoliciesParams, reqEditors ...RequestEditorFn) (*GetFleetPackagePoliciesResponse, error) - // CreatePackagePolicyWithBodyWithResponse request with any body - CreatePackagePolicyWithBodyWithResponse(ctx context.Context, params *CreatePackagePolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreatePackagePolicyResponse, error) + // PostFleetPackagePoliciesWithBodyWithResponse request with any body + PostFleetPackagePoliciesWithBodyWithResponse(ctx context.Context, params *PostFleetPackagePoliciesParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostFleetPackagePoliciesResponse, error) - CreatePackagePolicyWithResponse(ctx context.Context, params *CreatePackagePolicyParams, body CreatePackagePolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*CreatePackagePolicyResponse, error) + PostFleetPackagePoliciesWithResponse(ctx context.Context, params *PostFleetPackagePoliciesParams, body PostFleetPackagePoliciesJSONRequestBody, reqEditors ...RequestEditorFn) (*PostFleetPackagePoliciesResponse, error) - // DeletePackagePolicyWithResponse request - DeletePackagePolicyWithResponse(ctx context.Context, packagePolicyId string, params *DeletePackagePolicyParams, reqEditors ...RequestEditorFn) (*DeletePackagePolicyResponse, error) + // DeleteFleetPackagePoliciesPackagepolicyidWithResponse request + DeleteFleetPackagePoliciesPackagepolicyidWithResponse(ctx context.Context, packagePolicyId string, params *DeleteFleetPackagePoliciesPackagepolicyidParams, reqEditors ...RequestEditorFn) (*DeleteFleetPackagePoliciesPackagepolicyidResponse, error) - // GetPackagePolicyWithResponse request - GetPackagePolicyWithResponse(ctx context.Context, packagePolicyId string, params *GetPackagePolicyParams, reqEditors ...RequestEditorFn) (*GetPackagePolicyResponse, error) + // GetFleetPackagePoliciesPackagepolicyidWithResponse request + GetFleetPackagePoliciesPackagepolicyidWithResponse(ctx context.Context, packagePolicyId string, params *GetFleetPackagePoliciesPackagepolicyidParams, reqEditors ...RequestEditorFn) (*GetFleetPackagePoliciesPackagepolicyidResponse, error) - // UpdatePackagePolicyWithBodyWithResponse request with any body - UpdatePackagePolicyWithBodyWithResponse(ctx context.Context, packagePolicyId string, params *UpdatePackagePolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdatePackagePolicyResponse, error) + // PutFleetPackagePoliciesPackagepolicyidWithBodyWithResponse request with any body + PutFleetPackagePoliciesPackagepolicyidWithBodyWithResponse(ctx context.Context, packagePolicyId string, params *PutFleetPackagePoliciesPackagepolicyidParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutFleetPackagePoliciesPackagepolicyidResponse, error) - UpdatePackagePolicyWithResponse(ctx context.Context, packagePolicyId string, params *UpdatePackagePolicyParams, body UpdatePackagePolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdatePackagePolicyResponse, error) + PutFleetPackagePoliciesPackagepolicyidWithResponse(ctx context.Context, packagePolicyId string, params *PutFleetPackagePoliciesPackagepolicyidParams, body PutFleetPackagePoliciesPackagepolicyidJSONRequestBody, reqEditors ...RequestEditorFn) (*PutFleetPackagePoliciesPackagepolicyidResponse, error) - // GetDataViewsWithResponse request - GetDataViewsWithResponse(ctx context.Context, spaceId SpaceId, reqEditors ...RequestEditorFn) (*GetDataViewsResponse, error) + // GetAllDataViewsDefaultWithResponse request + GetAllDataViewsDefaultWithResponse(ctx context.Context, spaceId SpaceId, reqEditors ...RequestEditorFn) (*GetAllDataViewsDefaultResponse, error) - // CreateDataViewWithBodyWithResponse request with any body - CreateDataViewWithBodyWithResponse(ctx context.Context, spaceId SpaceId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateDataViewResponse, error) + // CreateDataViewDefaultwWithBodyWithResponse request with any body + CreateDataViewDefaultwWithBodyWithResponse(ctx context.Context, spaceId SpaceId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateDataViewDefaultwResponse, error) - CreateDataViewWithResponse(ctx context.Context, spaceId SpaceId, body CreateDataViewJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateDataViewResponse, error) + CreateDataViewDefaultwWithResponse(ctx context.Context, spaceId SpaceId, body CreateDataViewDefaultwJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateDataViewDefaultwResponse, error) - // DeleteDataViewWithResponse request - DeleteDataViewWithResponse(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, reqEditors ...RequestEditorFn) (*DeleteDataViewResponse, error) + // DeleteDataViewDefaultWithResponse request + DeleteDataViewDefaultWithResponse(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, reqEditors ...RequestEditorFn) (*DeleteDataViewDefaultResponse, error) - // GetDataViewWithResponse request - GetDataViewWithResponse(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, reqEditors ...RequestEditorFn) (*GetDataViewResponse, error) + // GetDataViewDefaultWithResponse request + GetDataViewDefaultWithResponse(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, reqEditors ...RequestEditorFn) (*GetDataViewDefaultResponse, error) - // UpdateDataViewWithBodyWithResponse request with any body - UpdateDataViewWithBodyWithResponse(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateDataViewResponse, error) + // UpdateDataViewDefaultWithBodyWithResponse request with any body + UpdateDataViewDefaultWithBodyWithResponse(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateDataViewDefaultResponse, error) - UpdateDataViewWithResponse(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, body UpdateDataViewJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateDataViewResponse, error) + UpdateDataViewDefaultWithResponse(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, body UpdateDataViewDefaultJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateDataViewDefaultResponse, error) } -type GetAgentPoliciesResponse struct { +type GetFleetAgentPoliciesResponse struct { Body []byte HTTPResponse *http.Response JSON200 *struct { @@ -14566,7 +14566,7 @@ type GetAgentPoliciesResponse struct { } // Status returns HTTPResponse.Status -func (r GetAgentPoliciesResponse) Status() string { +func (r GetFleetAgentPoliciesResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -14574,14 +14574,14 @@ func (r GetAgentPoliciesResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetAgentPoliciesResponse) StatusCode() int { +func (r GetFleetAgentPoliciesResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type CreateAgentPolicyResponse struct { +type PostFleetAgentPoliciesResponse struct { Body []byte HTTPResponse *http.Response JSON200 *struct { @@ -14595,7 +14595,7 @@ type CreateAgentPolicyResponse struct { } // Status returns HTTPResponse.Status -func (r CreateAgentPolicyResponse) Status() string { +func (r PostFleetAgentPoliciesResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -14603,14 +14603,14 @@ func (r CreateAgentPolicyResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r CreateAgentPolicyResponse) StatusCode() int { +func (r PostFleetAgentPoliciesResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type DeleteAgentPolicyResponse struct { +type PostFleetAgentPoliciesDeleteResponse struct { Body []byte HTTPResponse *http.Response JSON200 *struct { @@ -14625,7 +14625,7 @@ type DeleteAgentPolicyResponse struct { } // Status returns HTTPResponse.Status -func (r DeleteAgentPolicyResponse) Status() string { +func (r PostFleetAgentPoliciesDeleteResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -14633,14 +14633,14 @@ func (r DeleteAgentPolicyResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r DeleteAgentPolicyResponse) StatusCode() int { +func (r PostFleetAgentPoliciesDeleteResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type GetAgentPolicyResponse struct { +type GetFleetAgentPoliciesAgentpolicyidResponse struct { Body []byte HTTPResponse *http.Response JSON200 *struct { @@ -14654,7 +14654,7 @@ type GetAgentPolicyResponse struct { } // Status returns HTTPResponse.Status -func (r GetAgentPolicyResponse) Status() string { +func (r GetFleetAgentPoliciesAgentpolicyidResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -14662,14 +14662,14 @@ func (r GetAgentPolicyResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetAgentPolicyResponse) StatusCode() int { +func (r GetFleetAgentPoliciesAgentpolicyidResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type UpdateAgentPolicyResponse struct { +type PutFleetAgentPoliciesAgentpolicyidResponse struct { Body []byte HTTPResponse *http.Response JSON200 *struct { @@ -14683,7 +14683,7 @@ type UpdateAgentPolicyResponse struct { } // Status returns HTTPResponse.Status -func (r UpdateAgentPolicyResponse) Status() string { +func (r PutFleetAgentPoliciesAgentpolicyidResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -14691,14 +14691,14 @@ func (r UpdateAgentPolicyResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r UpdateAgentPolicyResponse) StatusCode() int { +func (r PutFleetAgentPoliciesAgentpolicyidResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type GetEnrollmentApiKeysResponse struct { +type GetFleetEnrollmentApiKeysResponse struct { Body []byte HTTPResponse *http.Response JSON200 *struct { @@ -14734,7 +14734,7 @@ type GetEnrollmentApiKeysResponse struct { } // Status returns HTTPResponse.Status -func (r GetEnrollmentApiKeysResponse) Status() string { +func (r GetFleetEnrollmentApiKeysResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -14742,19 +14742,19 @@ func (r GetEnrollmentApiKeysResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetEnrollmentApiKeysResponse) StatusCode() int { +func (r GetFleetEnrollmentApiKeysResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type ListPackagesResponse struct { +type GetFleetEpmPackagesResponse struct { Body []byte HTTPResponse *http.Response JSON200 *struct { - Items []PackageListItem `json:"items"` - Response *[]ListPackages_200_Response_Item `json:"response,omitempty"` + Items []PackageListItem `json:"items"` + Response *[]GetFleetEpmPackages_200_Response_Item `json:"response,omitempty"` } JSON400 *struct { Error *string `json:"error,omitempty"` @@ -14762,29 +14762,29 @@ type ListPackagesResponse struct { StatusCode *float32 `json:"statusCode,omitempty"` } } -type ListPackages_200_Response_Conditions_Elastic struct { +type GetFleetEpmPackages_200_Response_Conditions_Elastic struct { Capabilities *[]string `json:"capabilities,omitempty"` Subscription *string `json:"subscription,omitempty"` AdditionalProperties map[string]interface{} `json:"-"` } -type ListPackages_200_Response_Conditions_Kibana struct { +type GetFleetEpmPackages_200_Response_Conditions_Kibana struct { Version *string `json:"version,omitempty"` AdditionalProperties map[string]interface{} `json:"-"` } -type ListPackages_200_Response_Conditions struct { - Elastic *ListPackages_200_Response_Conditions_Elastic `json:"elastic,omitempty"` - Kibana *ListPackages_200_Response_Conditions_Kibana `json:"kibana,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` +type GetFleetEpmPackages_200_Response_Conditions struct { + Elastic *GetFleetEpmPackages_200_Response_Conditions_Elastic `json:"elastic,omitempty"` + Kibana *GetFleetEpmPackages_200_Response_Conditions_Kibana `json:"kibana,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` } -type ListPackages_200_Response_Discovery_Fields_Item struct { +type GetFleetEpmPackages_200_Response_Discovery_Fields_Item struct { Name string `json:"name"` AdditionalProperties map[string]interface{} `json:"-"` } -type ListPackages_200_Response_Discovery struct { - Fields *[]ListPackages_200_Response_Discovery_Fields_Item `json:"fields,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` +type GetFleetEpmPackages_200_Response_Discovery struct { + Fields *[]GetFleetEpmPackages_200_Response_Discovery_Fields_Item `json:"fields,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` } -type ListPackages_200_Response_Icons_Item struct { +type GetFleetEpmPackages_200_Response_Icons_Item struct { DarkMode *bool `json:"dark_mode,omitempty"` Path *string `json:"path,omitempty"` Size *string `json:"size,omitempty"` @@ -14793,127 +14793,127 @@ type ListPackages_200_Response_Icons_Item struct { Type *string `json:"type,omitempty"` AdditionalProperties map[string]interface{} `json:"-"` } -type ListPackages200ResponseInstallationInfoAdditionalSpacesInstalledKibanaType string -type ListPackages_200_Response_InstallationInfo_AdditionalSpacesInstalledKibana_Item struct { - Id string `json:"id"` - OriginId *string `json:"originId,omitempty"` - Type ListPackages200ResponseInstallationInfoAdditionalSpacesInstalledKibanaType `json:"type"` - AdditionalProperties map[string]interface{} `json:"-"` +type GetFleetEpmPackages200ResponseInstallationInfoAdditionalSpacesInstalledKibanaType string +type GetFleetEpmPackages_200_Response_InstallationInfo_AdditionalSpacesInstalledKibana_Item struct { + Id string `json:"id"` + OriginId *string `json:"originId,omitempty"` + Type GetFleetEpmPackages200ResponseInstallationInfoAdditionalSpacesInstalledKibanaType `json:"type"` + AdditionalProperties map[string]interface{} `json:"-"` } -type ListPackages_200_Response_InstallationInfo_ExperimentalDataStreamFeatures_Features struct { +type GetFleetEpmPackages_200_Response_InstallationInfo_ExperimentalDataStreamFeatures_Features struct { DocValueOnlyNumeric *bool `json:"doc_value_only_numeric,omitempty"` DocValueOnlyOther *bool `json:"doc_value_only_other,omitempty"` SyntheticSource *bool `json:"synthetic_source,omitempty"` Tsdb *bool `json:"tsdb,omitempty"` AdditionalProperties map[string]interface{} `json:"-"` } -type ListPackages_200_Response_InstallationInfo_ExperimentalDataStreamFeatures_Item struct { - DataStream string `json:"data_stream"` - Features ListPackages_200_Response_InstallationInfo_ExperimentalDataStreamFeatures_Features `json:"features"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type ListPackages200ResponseInstallationInfoInstallSource string -type ListPackages200ResponseInstallationInfoInstallStatus string -type ListPackages200ResponseInstallationInfoInstalledEsType string -type ListPackages_200_Response_InstallationInfo_InstalledEs_Item struct { - Deferred *bool `json:"deferred,omitempty"` - Id string `json:"id"` - Type ListPackages200ResponseInstallationInfoInstalledEsType `json:"type"` - Version *string `json:"version,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type ListPackages200ResponseInstallationInfoInstalledKibanaType string -type ListPackages_200_Response_InstallationInfo_InstalledKibana_Item struct { - Id string `json:"id"` - OriginId *string `json:"originId,omitempty"` - Type ListPackages200ResponseInstallationInfoInstalledKibanaType `json:"type"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type ListPackages_200_Response_InstallationInfo_LatestExecutedState struct { +type GetFleetEpmPackages_200_Response_InstallationInfo_ExperimentalDataStreamFeatures_Item struct { + DataStream string `json:"data_stream"` + Features GetFleetEpmPackages_200_Response_InstallationInfo_ExperimentalDataStreamFeatures_Features `json:"features"` + AdditionalProperties map[string]interface{} `json:"-"` +} +type GetFleetEpmPackages200ResponseInstallationInfoInstallSource string +type GetFleetEpmPackages200ResponseInstallationInfoInstallStatus string +type GetFleetEpmPackages200ResponseInstallationInfoInstalledEsType string +type GetFleetEpmPackages_200_Response_InstallationInfo_InstalledEs_Item struct { + Deferred *bool `json:"deferred,omitempty"` + Id string `json:"id"` + Type GetFleetEpmPackages200ResponseInstallationInfoInstalledEsType `json:"type"` + Version *string `json:"version,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` +} +type GetFleetEpmPackages200ResponseInstallationInfoInstalledKibanaType string +type GetFleetEpmPackages_200_Response_InstallationInfo_InstalledKibana_Item struct { + Id string `json:"id"` + OriginId *string `json:"originId,omitempty"` + Type GetFleetEpmPackages200ResponseInstallationInfoInstalledKibanaType `json:"type"` + AdditionalProperties map[string]interface{} `json:"-"` +} +type GetFleetEpmPackages_200_Response_InstallationInfo_LatestExecutedState struct { Error *string `json:"error,omitempty"` Name string `json:"name"` StartedAt string `json:"started_at"` AdditionalProperties map[string]interface{} `json:"-"` } -type ListPackages_200_Response_InstallationInfo_LatestInstallFailedAttempts_Error struct { +type GetFleetEpmPackages_200_Response_InstallationInfo_LatestInstallFailedAttempts_Error struct { Message string `json:"message"` Name string `json:"name"` Stack *string `json:"stack,omitempty"` AdditionalProperties map[string]interface{} `json:"-"` } -type ListPackages_200_Response_InstallationInfo_LatestInstallFailedAttempts_Item struct { - CreatedAt string `json:"created_at"` - Error ListPackages_200_Response_InstallationInfo_LatestInstallFailedAttempts_Error `json:"error"` - TargetVersion string `json:"target_version"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type ListPackages200ResponseInstallationInfoVerificationStatus string -type ListPackages_200_Response_InstallationInfo struct { - AdditionalSpacesInstalledKibana *map[string][]ListPackages_200_Response_InstallationInfo_AdditionalSpacesInstalledKibana_Item `json:"additional_spaces_installed_kibana,omitempty"` - CreatedAt *string `json:"created_at,omitempty"` - ExperimentalDataStreamFeatures *[]ListPackages_200_Response_InstallationInfo_ExperimentalDataStreamFeatures_Item `json:"experimental_data_stream_features,omitempty"` - InstallFormatSchemaVersion *string `json:"install_format_schema_version,omitempty"` - InstallSource ListPackages200ResponseInstallationInfoInstallSource `json:"install_source"` - InstallStatus ListPackages200ResponseInstallationInfoInstallStatus `json:"install_status"` - InstalledEs []ListPackages_200_Response_InstallationInfo_InstalledEs_Item `json:"installed_es"` - InstalledKibana []ListPackages_200_Response_InstallationInfo_InstalledKibana_Item `json:"installed_kibana"` - InstalledKibanaSpaceId *string `json:"installed_kibana_space_id,omitempty"` - LatestExecutedState *ListPackages_200_Response_InstallationInfo_LatestExecutedState `json:"latest_executed_state,omitempty"` - LatestInstallFailedAttempts *[]ListPackages_200_Response_InstallationInfo_LatestInstallFailedAttempts_Item `json:"latest_install_failed_attempts,omitempty"` - Name string `json:"name"` - Namespaces *[]string `json:"namespaces,omitempty"` - Type string `json:"type"` - UpdatedAt *string `json:"updated_at,omitempty"` - VerificationKeyId *string `json:"verification_key_id"` - VerificationStatus ListPackages200ResponseInstallationInfoVerificationStatus `json:"verification_status"` - Version string `json:"version"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type ListPackages200ResponseOwnerType string -type ListPackages_200_Response_Owner struct { - Github *string `json:"github,omitempty"` - Type *ListPackages200ResponseOwnerType `json:"type,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` +type GetFleetEpmPackages_200_Response_InstallationInfo_LatestInstallFailedAttempts_Item struct { + CreatedAt string `json:"created_at"` + Error GetFleetEpmPackages_200_Response_InstallationInfo_LatestInstallFailedAttempts_Error `json:"error"` + TargetVersion string `json:"target_version"` + AdditionalProperties map[string]interface{} `json:"-"` +} +type GetFleetEpmPackages200ResponseInstallationInfoVerificationStatus string +type GetFleetEpmPackages_200_Response_InstallationInfo struct { + AdditionalSpacesInstalledKibana *map[string][]GetFleetEpmPackages_200_Response_InstallationInfo_AdditionalSpacesInstalledKibana_Item `json:"additional_spaces_installed_kibana,omitempty"` + CreatedAt *string `json:"created_at,omitempty"` + ExperimentalDataStreamFeatures *[]GetFleetEpmPackages_200_Response_InstallationInfo_ExperimentalDataStreamFeatures_Item `json:"experimental_data_stream_features,omitempty"` + InstallFormatSchemaVersion *string `json:"install_format_schema_version,omitempty"` + InstallSource GetFleetEpmPackages200ResponseInstallationInfoInstallSource `json:"install_source"` + InstallStatus GetFleetEpmPackages200ResponseInstallationInfoInstallStatus `json:"install_status"` + InstalledEs []GetFleetEpmPackages_200_Response_InstallationInfo_InstalledEs_Item `json:"installed_es"` + InstalledKibana []GetFleetEpmPackages_200_Response_InstallationInfo_InstalledKibana_Item `json:"installed_kibana"` + InstalledKibanaSpaceId *string `json:"installed_kibana_space_id,omitempty"` + LatestExecutedState *GetFleetEpmPackages_200_Response_InstallationInfo_LatestExecutedState `json:"latest_executed_state,omitempty"` + LatestInstallFailedAttempts *[]GetFleetEpmPackages_200_Response_InstallationInfo_LatestInstallFailedAttempts_Item `json:"latest_install_failed_attempts,omitempty"` + Name string `json:"name"` + Namespaces *[]string `json:"namespaces,omitempty"` + Type string `json:"type"` + UpdatedAt *string `json:"updated_at,omitempty"` + VerificationKeyId *string `json:"verification_key_id"` + VerificationStatus GetFleetEpmPackages200ResponseInstallationInfoVerificationStatus `json:"verification_status"` + Version string `json:"version"` + AdditionalProperties map[string]interface{} `json:"-"` +} +type GetFleetEpmPackages200ResponseOwnerType string +type GetFleetEpmPackages_200_Response_Owner struct { + Github *string `json:"github,omitempty"` + Type *GetFleetEpmPackages200ResponseOwnerType `json:"type,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` } -type ListPackages200ResponseRelease string -type ListPackages_200_Response_Source struct { +type GetFleetEpmPackages200ResponseRelease string +type GetFleetEpmPackages_200_Response_Source struct { License string `json:"license"` AdditionalProperties map[string]interface{} `json:"-"` } -type ListPackages200ResponseType string -type ListPackages_200_Response_Item struct { - Categories *[]string `json:"categories,omitempty"` - Conditions *ListPackages_200_Response_Conditions `json:"conditions,omitempty"` - DataStreams *[]map[string]interface{} `json:"data_streams,omitempty"` - Description *string `json:"description,omitempty"` - Discovery *ListPackages_200_Response_Discovery `json:"discovery,omitempty"` - Download *string `json:"download,omitempty"` - FormatVersion *string `json:"format_version,omitempty"` - Icons *[]ListPackages_200_Response_Icons_Item `json:"icons,omitempty"` - Id string `json:"id"` - InstallationInfo *ListPackages_200_Response_InstallationInfo `json:"installationInfo,omitempty"` - Integration *string `json:"integration,omitempty"` - Internal *bool `json:"internal,omitempty"` - LatestVersion *string `json:"latestVersion,omitempty"` - Name string `json:"name"` - Owner *ListPackages_200_Response_Owner `json:"owner,omitempty"` - Path *string `json:"path,omitempty"` - PolicyTemplates *[]map[string]interface{} `json:"policy_templates,omitempty"` - Readme *string `json:"readme,omitempty"` - Release *ListPackages200ResponseRelease `json:"release,omitempty"` - SavedObject interface{} `json:"savedObject"` - SignaturePath *string `json:"signature_path,omitempty"` - Source *ListPackages_200_Response_Source `json:"source,omitempty"` - Status *string `json:"status,omitempty"` - Title string `json:"title"` - Type *ListPackages200ResponseType `json:"type,omitempty"` - Vars *[]map[string]interface{} `json:"vars,omitempty"` - Version string `json:"version"` - AdditionalProperties map[string]interface{} `json:"-"` +type GetFleetEpmPackages200ResponseType string +type GetFleetEpmPackages_200_Response_Item struct { + Categories *[]string `json:"categories,omitempty"` + Conditions *GetFleetEpmPackages_200_Response_Conditions `json:"conditions,omitempty"` + DataStreams *[]map[string]interface{} `json:"data_streams,omitempty"` + Description *string `json:"description,omitempty"` + Discovery *GetFleetEpmPackages_200_Response_Discovery `json:"discovery,omitempty"` + Download *string `json:"download,omitempty"` + FormatVersion *string `json:"format_version,omitempty"` + Icons *[]GetFleetEpmPackages_200_Response_Icons_Item `json:"icons,omitempty"` + Id string `json:"id"` + InstallationInfo *GetFleetEpmPackages_200_Response_InstallationInfo `json:"installationInfo,omitempty"` + Integration *string `json:"integration,omitempty"` + Internal *bool `json:"internal,omitempty"` + LatestVersion *string `json:"latestVersion,omitempty"` + Name string `json:"name"` + Owner *GetFleetEpmPackages_200_Response_Owner `json:"owner,omitempty"` + Path *string `json:"path,omitempty"` + PolicyTemplates *[]map[string]interface{} `json:"policy_templates,omitempty"` + Readme *string `json:"readme,omitempty"` + Release *GetFleetEpmPackages200ResponseRelease `json:"release,omitempty"` + SavedObject interface{} `json:"savedObject"` + SignaturePath *string `json:"signature_path,omitempty"` + Source *GetFleetEpmPackages_200_Response_Source `json:"source,omitempty"` + Status *string `json:"status,omitempty"` + Title string `json:"title"` + Type *GetFleetEpmPackages200ResponseType `json:"type,omitempty"` + Vars *[]map[string]interface{} `json:"vars,omitempty"` + Version string `json:"version"` + AdditionalProperties map[string]interface{} `json:"-"` } // Status returns HTTPResponse.Status -func (r ListPackagesResponse) Status() string { +func (r GetFleetEpmPackagesResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -14921,20 +14921,20 @@ func (r ListPackagesResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ListPackagesResponse) StatusCode() int { +func (r GetFleetEpmPackagesResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type InstallPackageByUploadResponse struct { +type PostFleetEpmPackagesResponse struct { Body []byte HTTPResponse *http.Response } // Status returns HTTPResponse.Status -func (r InstallPackageByUploadResponse) Status() string { +func (r PostFleetEpmPackagesResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -14942,20 +14942,20 @@ func (r InstallPackageByUploadResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r InstallPackageByUploadResponse) StatusCode() int { +func (r PostFleetEpmPackagesResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type DeletePackageResponse struct { +type DeleteFleetEpmPackagesPkgnamePkgversionResponse struct { Body []byte HTTPResponse *http.Response JSON200 *struct { - Items []DeletePackage_200_Items_Item `json:"items"` + Items []DeleteFleetEpmPackagesPkgnamePkgversion_200_Items_Item `json:"items"` // Deprecated: - Response *[]DeletePackage_200_Response_Item `json:"response,omitempty"` + Response *[]DeleteFleetEpmPackagesPkgnamePkgversion_200_Response_Item `json:"response,omitempty"` } JSON400 *struct { Error *string `json:"error,omitempty"` @@ -14963,41 +14963,41 @@ type DeletePackageResponse struct { StatusCode *float32 `json:"statusCode,omitempty"` } } -type DeletePackage200Items0 struct { - Id string `json:"id"` - OriginId *string `json:"originId,omitempty"` - Type DeletePackage200Items0Type `json:"type"` +type DeleteFleetEpmPackagesPkgnamePkgversion200Items0 struct { + Id string `json:"id"` + OriginId *string `json:"originId,omitempty"` + Type DeleteFleetEpmPackagesPkgnamePkgversion200Items0Type `json:"type"` } -type DeletePackage200Items0Type string -type DeletePackage200Items1 struct { - Deferred *bool `json:"deferred,omitempty"` - Id string `json:"id"` - Type DeletePackage200Items1Type `json:"type"` - Version *string `json:"version,omitempty"` +type DeleteFleetEpmPackagesPkgnamePkgversion200Items0Type string +type DeleteFleetEpmPackagesPkgnamePkgversion200Items1 struct { + Deferred *bool `json:"deferred,omitempty"` + Id string `json:"id"` + Type DeleteFleetEpmPackagesPkgnamePkgversion200Items1Type `json:"type"` + Version *string `json:"version,omitempty"` } -type DeletePackage200Items1Type string -type DeletePackage_200_Items_Item struct { +type DeleteFleetEpmPackagesPkgnamePkgversion200Items1Type string +type DeleteFleetEpmPackagesPkgnamePkgversion_200_Items_Item struct { union json.RawMessage } -type DeletePackage200Response0 struct { - Id string `json:"id"` - OriginId *string `json:"originId,omitempty"` - Type DeletePackage200Response0Type `json:"type"` +type DeleteFleetEpmPackagesPkgnamePkgversion200Response0 struct { + Id string `json:"id"` + OriginId *string `json:"originId,omitempty"` + Type DeleteFleetEpmPackagesPkgnamePkgversion200Response0Type `json:"type"` } -type DeletePackage200Response0Type string -type DeletePackage200Response1 struct { - Deferred *bool `json:"deferred,omitempty"` - Id string `json:"id"` - Type DeletePackage200Response1Type `json:"type"` - Version *string `json:"version,omitempty"` +type DeleteFleetEpmPackagesPkgnamePkgversion200Response0Type string +type DeleteFleetEpmPackagesPkgnamePkgversion200Response1 struct { + Deferred *bool `json:"deferred,omitempty"` + Id string `json:"id"` + Type DeleteFleetEpmPackagesPkgnamePkgversion200Response1Type `json:"type"` + Version *string `json:"version,omitempty"` } -type DeletePackage200Response1Type string -type DeletePackage_200_Response_Item struct { +type DeleteFleetEpmPackagesPkgnamePkgversion200Response1Type string +type DeleteFleetEpmPackagesPkgnamePkgversion_200_Response_Item struct { union json.RawMessage } // Status returns HTTPResponse.Status -func (r DeletePackageResponse) Status() string { +func (r DeleteFleetEpmPackagesPkgnamePkgversionResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -15005,14 +15005,14 @@ func (r DeletePackageResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r DeletePackageResponse) StatusCode() int { +func (r DeleteFleetEpmPackagesPkgnamePkgversionResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type GetPackageResponse struct { +type GetFleetEpmPackagesPkgnamePkgversionResponse struct { Body []byte HTTPResponse *http.Response JSON200 *struct { @@ -15021,7 +15021,7 @@ type GetPackageResponse struct { HasPolicies bool `json:"has_policies"` } `json:"metadata,omitempty"` // Deprecated: - Response *GetPackage_200_Response `json:"response,omitempty"` + Response *GetFleetEpmPackagesPkgnamePkgversion_200_Response `json:"response,omitempty"` } JSON400 *struct { Error *string `json:"error,omitempty"` @@ -15029,29 +15029,29 @@ type GetPackageResponse struct { StatusCode *float32 `json:"statusCode,omitempty"` } } -type GetPackage_200_Response_Conditions_Elastic struct { +type GetFleetEpmPackagesPkgnamePkgversion_200_Response_Conditions_Elastic struct { Capabilities *[]string `json:"capabilities,omitempty"` Subscription *string `json:"subscription,omitempty"` AdditionalProperties map[string]interface{} `json:"-"` } -type GetPackage_200_Response_Conditions_Kibana struct { +type GetFleetEpmPackagesPkgnamePkgversion_200_Response_Conditions_Kibana struct { Version *string `json:"version,omitempty"` AdditionalProperties map[string]interface{} `json:"-"` } -type GetPackage_200_Response_Conditions struct { - Elastic *GetPackage_200_Response_Conditions_Elastic `json:"elastic,omitempty"` - Kibana *GetPackage_200_Response_Conditions_Kibana `json:"kibana,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` +type GetFleetEpmPackagesPkgnamePkgversion_200_Response_Conditions struct { + Elastic *GetFleetEpmPackagesPkgnamePkgversion_200_Response_Conditions_Elastic `json:"elastic,omitempty"` + Kibana *GetFleetEpmPackagesPkgnamePkgversion_200_Response_Conditions_Kibana `json:"kibana,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` } -type GetPackage_200_Response_Discovery_Fields_Item struct { +type GetFleetEpmPackagesPkgnamePkgversion_200_Response_Discovery_Fields_Item struct { Name string `json:"name"` AdditionalProperties map[string]interface{} `json:"-"` } -type GetPackage_200_Response_Discovery struct { - Fields *[]GetPackage_200_Response_Discovery_Fields_Item `json:"fields,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` +type GetFleetEpmPackagesPkgnamePkgversion_200_Response_Discovery struct { + Fields *[]GetFleetEpmPackagesPkgnamePkgversion_200_Response_Discovery_Fields_Item `json:"fields,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` } -type GetPackage_200_Response_Icons_Item struct { +type GetFleetEpmPackagesPkgnamePkgversion_200_Response_Icons_Item struct { DarkMode *bool `json:"dark_mode,omitempty"` Path *string `json:"path,omitempty"` Size *string `json:"size,omitempty"` @@ -15060,95 +15060,95 @@ type GetPackage_200_Response_Icons_Item struct { Type *string `json:"type,omitempty"` AdditionalProperties map[string]interface{} `json:"-"` } -type GetPackage200ResponseInstallationInfoAdditionalSpacesInstalledKibanaType string -type GetPackage_200_Response_InstallationInfo_AdditionalSpacesInstalledKibana_Item struct { - Id string `json:"id"` - OriginId *string `json:"originId,omitempty"` - Type GetPackage200ResponseInstallationInfoAdditionalSpacesInstalledKibanaType `json:"type"` - AdditionalProperties map[string]interface{} `json:"-"` +type GetFleetEpmPackagesPkgnamePkgversion200ResponseInstallationInfoAdditionalSpacesInstalledKibanaType string +type GetFleetEpmPackagesPkgnamePkgversion_200_Response_InstallationInfo_AdditionalSpacesInstalledKibana_Item struct { + Id string `json:"id"` + OriginId *string `json:"originId,omitempty"` + Type GetFleetEpmPackagesPkgnamePkgversion200ResponseInstallationInfoAdditionalSpacesInstalledKibanaType `json:"type"` + AdditionalProperties map[string]interface{} `json:"-"` } -type GetPackage_200_Response_InstallationInfo_ExperimentalDataStreamFeatures_Features struct { +type GetFleetEpmPackagesPkgnamePkgversion_200_Response_InstallationInfo_ExperimentalDataStreamFeatures_Features struct { DocValueOnlyNumeric *bool `json:"doc_value_only_numeric,omitempty"` DocValueOnlyOther *bool `json:"doc_value_only_other,omitempty"` SyntheticSource *bool `json:"synthetic_source,omitempty"` Tsdb *bool `json:"tsdb,omitempty"` AdditionalProperties map[string]interface{} `json:"-"` } -type GetPackage_200_Response_InstallationInfo_ExperimentalDataStreamFeatures_Item struct { - DataStream string `json:"data_stream"` - Features GetPackage_200_Response_InstallationInfo_ExperimentalDataStreamFeatures_Features `json:"features"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type GetPackage200ResponseInstallationInfoInstallSource string -type GetPackage200ResponseInstallationInfoInstallStatus string -type GetPackage200ResponseInstallationInfoInstalledEsType string -type GetPackage_200_Response_InstallationInfo_InstalledEs_Item struct { - Deferred *bool `json:"deferred,omitempty"` - Id string `json:"id"` - Type GetPackage200ResponseInstallationInfoInstalledEsType `json:"type"` - Version *string `json:"version,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type GetPackage200ResponseInstallationInfoInstalledKibanaType string -type GetPackage_200_Response_InstallationInfo_InstalledKibana_Item struct { - Id string `json:"id"` - OriginId *string `json:"originId,omitempty"` - Type GetPackage200ResponseInstallationInfoInstalledKibanaType `json:"type"` - AdditionalProperties map[string]interface{} `json:"-"` +type GetFleetEpmPackagesPkgnamePkgversion_200_Response_InstallationInfo_ExperimentalDataStreamFeatures_Item struct { + DataStream string `json:"data_stream"` + Features GetFleetEpmPackagesPkgnamePkgversion_200_Response_InstallationInfo_ExperimentalDataStreamFeatures_Features `json:"features"` + AdditionalProperties map[string]interface{} `json:"-"` +} +type GetFleetEpmPackagesPkgnamePkgversion200ResponseInstallationInfoInstallSource string +type GetFleetEpmPackagesPkgnamePkgversion200ResponseInstallationInfoInstallStatus string +type GetFleetEpmPackagesPkgnamePkgversion200ResponseInstallationInfoInstalledEsType string +type GetFleetEpmPackagesPkgnamePkgversion_200_Response_InstallationInfo_InstalledEs_Item struct { + Deferred *bool `json:"deferred,omitempty"` + Id string `json:"id"` + Type GetFleetEpmPackagesPkgnamePkgversion200ResponseInstallationInfoInstalledEsType `json:"type"` + Version *string `json:"version,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` +} +type GetFleetEpmPackagesPkgnamePkgversion200ResponseInstallationInfoInstalledKibanaType string +type GetFleetEpmPackagesPkgnamePkgversion_200_Response_InstallationInfo_InstalledKibana_Item struct { + Id string `json:"id"` + OriginId *string `json:"originId,omitempty"` + Type GetFleetEpmPackagesPkgnamePkgversion200ResponseInstallationInfoInstalledKibanaType `json:"type"` + AdditionalProperties map[string]interface{} `json:"-"` } -type GetPackage_200_Response_InstallationInfo_LatestExecutedState struct { +type GetFleetEpmPackagesPkgnamePkgversion_200_Response_InstallationInfo_LatestExecutedState struct { Error *string `json:"error,omitempty"` Name string `json:"name"` StartedAt string `json:"started_at"` AdditionalProperties map[string]interface{} `json:"-"` } -type GetPackage_200_Response_InstallationInfo_LatestInstallFailedAttempts_Error struct { +type GetFleetEpmPackagesPkgnamePkgversion_200_Response_InstallationInfo_LatestInstallFailedAttempts_Error struct { Message string `json:"message"` Name string `json:"name"` Stack *string `json:"stack,omitempty"` AdditionalProperties map[string]interface{} `json:"-"` } -type GetPackage_200_Response_InstallationInfo_LatestInstallFailedAttempts_Item struct { - CreatedAt string `json:"created_at"` - Error GetPackage_200_Response_InstallationInfo_LatestInstallFailedAttempts_Error `json:"error"` - TargetVersion string `json:"target_version"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type GetPackage200ResponseInstallationInfoVerificationStatus string -type GetPackage_200_Response_InstallationInfo struct { - AdditionalSpacesInstalledKibana *map[string][]GetPackage_200_Response_InstallationInfo_AdditionalSpacesInstalledKibana_Item `json:"additional_spaces_installed_kibana,omitempty"` - CreatedAt *string `json:"created_at,omitempty"` - ExperimentalDataStreamFeatures *[]GetPackage_200_Response_InstallationInfo_ExperimentalDataStreamFeatures_Item `json:"experimental_data_stream_features,omitempty"` - InstallFormatSchemaVersion *string `json:"install_format_schema_version,omitempty"` - InstallSource GetPackage200ResponseInstallationInfoInstallSource `json:"install_source"` - InstallStatus GetPackage200ResponseInstallationInfoInstallStatus `json:"install_status"` - InstalledEs []GetPackage_200_Response_InstallationInfo_InstalledEs_Item `json:"installed_es"` - InstalledKibana []GetPackage_200_Response_InstallationInfo_InstalledKibana_Item `json:"installed_kibana"` - InstalledKibanaSpaceId *string `json:"installed_kibana_space_id,omitempty"` - LatestExecutedState *GetPackage_200_Response_InstallationInfo_LatestExecutedState `json:"latest_executed_state,omitempty"` - LatestInstallFailedAttempts *[]GetPackage_200_Response_InstallationInfo_LatestInstallFailedAttempts_Item `json:"latest_install_failed_attempts,omitempty"` - Name string `json:"name"` - Namespaces *[]string `json:"namespaces,omitempty"` - Type string `json:"type"` - UpdatedAt *string `json:"updated_at,omitempty"` - VerificationKeyId *string `json:"verification_key_id"` - VerificationStatus GetPackage200ResponseInstallationInfoVerificationStatus `json:"verification_status"` - Version string `json:"version"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type GetPackage200ResponseOwnerType string -type GetPackage_200_Response_Owner struct { - Github *string `json:"github,omitempty"` - Type *GetPackage200ResponseOwnerType `json:"type,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type GetPackage200ResponseRelease string -type GetPackage_200_Response_Source struct { +type GetFleetEpmPackagesPkgnamePkgversion_200_Response_InstallationInfo_LatestInstallFailedAttempts_Item struct { + CreatedAt string `json:"created_at"` + Error GetFleetEpmPackagesPkgnamePkgversion_200_Response_InstallationInfo_LatestInstallFailedAttempts_Error `json:"error"` + TargetVersion string `json:"target_version"` + AdditionalProperties map[string]interface{} `json:"-"` +} +type GetFleetEpmPackagesPkgnamePkgversion200ResponseInstallationInfoVerificationStatus string +type GetFleetEpmPackagesPkgnamePkgversion_200_Response_InstallationInfo struct { + AdditionalSpacesInstalledKibana *map[string][]GetFleetEpmPackagesPkgnamePkgversion_200_Response_InstallationInfo_AdditionalSpacesInstalledKibana_Item `json:"additional_spaces_installed_kibana,omitempty"` + CreatedAt *string `json:"created_at,omitempty"` + ExperimentalDataStreamFeatures *[]GetFleetEpmPackagesPkgnamePkgversion_200_Response_InstallationInfo_ExperimentalDataStreamFeatures_Item `json:"experimental_data_stream_features,omitempty"` + InstallFormatSchemaVersion *string `json:"install_format_schema_version,omitempty"` + InstallSource GetFleetEpmPackagesPkgnamePkgversion200ResponseInstallationInfoInstallSource `json:"install_source"` + InstallStatus GetFleetEpmPackagesPkgnamePkgversion200ResponseInstallationInfoInstallStatus `json:"install_status"` + InstalledEs []GetFleetEpmPackagesPkgnamePkgversion_200_Response_InstallationInfo_InstalledEs_Item `json:"installed_es"` + InstalledKibana []GetFleetEpmPackagesPkgnamePkgversion_200_Response_InstallationInfo_InstalledKibana_Item `json:"installed_kibana"` + InstalledKibanaSpaceId *string `json:"installed_kibana_space_id,omitempty"` + LatestExecutedState *GetFleetEpmPackagesPkgnamePkgversion_200_Response_InstallationInfo_LatestExecutedState `json:"latest_executed_state,omitempty"` + LatestInstallFailedAttempts *[]GetFleetEpmPackagesPkgnamePkgversion_200_Response_InstallationInfo_LatestInstallFailedAttempts_Item `json:"latest_install_failed_attempts,omitempty"` + Name string `json:"name"` + Namespaces *[]string `json:"namespaces,omitempty"` + Type string `json:"type"` + UpdatedAt *string `json:"updated_at,omitempty"` + VerificationKeyId *string `json:"verification_key_id"` + VerificationStatus GetFleetEpmPackagesPkgnamePkgversion200ResponseInstallationInfoVerificationStatus `json:"verification_status"` + Version string `json:"version"` + AdditionalProperties map[string]interface{} `json:"-"` +} +type GetFleetEpmPackagesPkgnamePkgversion200ResponseOwnerType string +type GetFleetEpmPackagesPkgnamePkgversion_200_Response_Owner struct { + Github *string `json:"github,omitempty"` + Type *GetFleetEpmPackagesPkgnamePkgversion200ResponseOwnerType `json:"type,omitempty"` + AdditionalProperties map[string]interface{} `json:"-"` +} +type GetFleetEpmPackagesPkgnamePkgversion200ResponseRelease string +type GetFleetEpmPackagesPkgnamePkgversion_200_Response_Source struct { License string `json:"license"` AdditionalProperties map[string]interface{} `json:"-"` } -type GetPackage200ResponseType string -type GetPackage_200_Response struct { +type GetFleetEpmPackagesPkgnamePkgversion200ResponseType string +type GetFleetEpmPackagesPkgnamePkgversion_200_Response struct { Agent *struct { Privileges *struct { Root *bool `json:"root,omitempty"` @@ -15159,30 +15159,30 @@ type GetPackage_200_Response struct { AssetTypes *[]string `json:"asset_types,omitempty"` Text string `json:"text"` } `json:"asset_tags,omitempty"` - Assets map[string]interface{} `json:"assets"` - Categories *[]string `json:"categories,omitempty"` - Conditions *GetPackage_200_Response_Conditions `json:"conditions,omitempty"` - DataStreams *[]map[string]interface{} `json:"data_streams,omitempty"` - Description *string `json:"description,omitempty"` - Discovery *GetPackage_200_Response_Discovery `json:"discovery,omitempty"` - Download *string `json:"download,omitempty"` - Elasticsearch *map[string]interface{} `json:"elasticsearch,omitempty"` - FormatVersion *string `json:"format_version,omitempty"` - Icons *[]GetPackage_200_Response_Icons_Item `json:"icons,omitempty"` - InstallationInfo *GetPackage_200_Response_InstallationInfo `json:"installationInfo,omitempty"` - Internal *bool `json:"internal,omitempty"` - KeepPoliciesUpToDate *bool `json:"keepPoliciesUpToDate,omitempty"` - LatestVersion *string `json:"latestVersion,omitempty"` - License *string `json:"license,omitempty"` - LicensePath *string `json:"licensePath,omitempty"` - Name string `json:"name"` - Notice *string `json:"notice,omitempty"` - Owner *GetPackage_200_Response_Owner `json:"owner,omitempty"` - Path *string `json:"path,omitempty"` - PolicyTemplates *[]map[string]interface{} `json:"policy_templates,omitempty"` - Readme *string `json:"readme,omitempty"` - Release *GetPackage200ResponseRelease `json:"release,omitempty"` - SavedObject interface{} `json:"savedObject"` + Assets map[string]interface{} `json:"assets"` + Categories *[]string `json:"categories,omitempty"` + Conditions *GetFleetEpmPackagesPkgnamePkgversion_200_Response_Conditions `json:"conditions,omitempty"` + DataStreams *[]map[string]interface{} `json:"data_streams,omitempty"` + Description *string `json:"description,omitempty"` + Discovery *GetFleetEpmPackagesPkgnamePkgversion_200_Response_Discovery `json:"discovery,omitempty"` + Download *string `json:"download,omitempty"` + Elasticsearch *map[string]interface{} `json:"elasticsearch,omitempty"` + FormatVersion *string `json:"format_version,omitempty"` + Icons *[]GetFleetEpmPackagesPkgnamePkgversion_200_Response_Icons_Item `json:"icons,omitempty"` + InstallationInfo *GetFleetEpmPackagesPkgnamePkgversion_200_Response_InstallationInfo `json:"installationInfo,omitempty"` + Internal *bool `json:"internal,omitempty"` + KeepPoliciesUpToDate *bool `json:"keepPoliciesUpToDate,omitempty"` + LatestVersion *string `json:"latestVersion,omitempty"` + License *string `json:"license,omitempty"` + LicensePath *string `json:"licensePath,omitempty"` + Name string `json:"name"` + Notice *string `json:"notice,omitempty"` + Owner *GetFleetEpmPackagesPkgnamePkgversion_200_Response_Owner `json:"owner,omitempty"` + Path *string `json:"path,omitempty"` + PolicyTemplates *[]map[string]interface{} `json:"policy_templates,omitempty"` + Readme *string `json:"readme,omitempty"` + Release *GetFleetEpmPackagesPkgnamePkgversion200ResponseRelease `json:"release,omitempty"` + SavedObject interface{} `json:"savedObject"` Screenshots *[]struct { DarkMode *bool `json:"dark_mode,omitempty"` Path *string `json:"path,omitempty"` @@ -15191,18 +15191,18 @@ type GetPackage_200_Response struct { Title *string `json:"title,omitempty"` Type *string `json:"type,omitempty"` } `json:"screenshots,omitempty"` - SignaturePath *string `json:"signature_path,omitempty"` - Source *GetPackage_200_Response_Source `json:"source,omitempty"` - Status *string `json:"status,omitempty"` - Title string `json:"title"` - Type *GetPackage200ResponseType `json:"type,omitempty"` - Vars *[]map[string]interface{} `json:"vars,omitempty"` - Version string `json:"version"` - AdditionalProperties map[string]interface{} `json:"-"` + SignaturePath *string `json:"signature_path,omitempty"` + Source *GetFleetEpmPackagesPkgnamePkgversion_200_Response_Source `json:"source,omitempty"` + Status *string `json:"status,omitempty"` + Title string `json:"title"` + Type *GetFleetEpmPackagesPkgnamePkgversion200ResponseType `json:"type,omitempty"` + Vars *[]map[string]interface{} `json:"vars,omitempty"` + Version string `json:"version"` + AdditionalProperties map[string]interface{} `json:"-"` } // Status returns HTTPResponse.Status -func (r GetPackageResponse) Status() string { +func (r GetFleetEpmPackagesPkgnamePkgversionResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -15210,23 +15210,23 @@ func (r GetPackageResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetPackageResponse) StatusCode() int { +func (r GetFleetEpmPackagesPkgnamePkgversionResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type InstallPackageResponse struct { +type PostFleetEpmPackagesPkgnamePkgversionResponse struct { Body []byte HTTPResponse *http.Response JSON200 *struct { Meta struct { InstallSource string `json:"install_source"` } `json:"_meta"` - Items []InstallPackage_200_Items_Item `json:"items"` + Items []PostFleetEpmPackagesPkgnamePkgversion_200_Items_Item `json:"items"` // Deprecated: - Response *[]InstallPackage_200_Response_Item `json:"response,omitempty"` + Response *[]PostFleetEpmPackagesPkgnamePkgversion_200_Response_Item `json:"response,omitempty"` } JSON400 *struct { Error *string `json:"error,omitempty"` @@ -15234,41 +15234,41 @@ type InstallPackageResponse struct { StatusCode *float32 `json:"statusCode,omitempty"` } } -type InstallPackage200Items0 struct { - Id string `json:"id"` - OriginId *string `json:"originId,omitempty"` - Type InstallPackage200Items0Type `json:"type"` +type PostFleetEpmPackagesPkgnamePkgversion200Items0 struct { + Id string `json:"id"` + OriginId *string `json:"originId,omitempty"` + Type PostFleetEpmPackagesPkgnamePkgversion200Items0Type `json:"type"` } -type InstallPackage200Items0Type string -type InstallPackage200Items1 struct { - Deferred *bool `json:"deferred,omitempty"` - Id string `json:"id"` - Type InstallPackage200Items1Type `json:"type"` - Version *string `json:"version,omitempty"` +type PostFleetEpmPackagesPkgnamePkgversion200Items0Type string +type PostFleetEpmPackagesPkgnamePkgversion200Items1 struct { + Deferred *bool `json:"deferred,omitempty"` + Id string `json:"id"` + Type PostFleetEpmPackagesPkgnamePkgversion200Items1Type `json:"type"` + Version *string `json:"version,omitempty"` } -type InstallPackage200Items1Type string -type InstallPackage_200_Items_Item struct { +type PostFleetEpmPackagesPkgnamePkgversion200Items1Type string +type PostFleetEpmPackagesPkgnamePkgversion_200_Items_Item struct { union json.RawMessage } -type InstallPackage200Response0 struct { - Id string `json:"id"` - OriginId *string `json:"originId,omitempty"` - Type InstallPackage200Response0Type `json:"type"` +type PostFleetEpmPackagesPkgnamePkgversion200Response0 struct { + Id string `json:"id"` + OriginId *string `json:"originId,omitempty"` + Type PostFleetEpmPackagesPkgnamePkgversion200Response0Type `json:"type"` } -type InstallPackage200Response0Type string -type InstallPackage200Response1 struct { - Deferred *bool `json:"deferred,omitempty"` - Id string `json:"id"` - Type InstallPackage200Response1Type `json:"type"` - Version *string `json:"version,omitempty"` +type PostFleetEpmPackagesPkgnamePkgversion200Response0Type string +type PostFleetEpmPackagesPkgnamePkgversion200Response1 struct { + Deferred *bool `json:"deferred,omitempty"` + Id string `json:"id"` + Type PostFleetEpmPackagesPkgnamePkgversion200Response1Type `json:"type"` + Version *string `json:"version,omitempty"` } -type InstallPackage200Response1Type string -type InstallPackage_200_Response_Item struct { +type PostFleetEpmPackagesPkgnamePkgversion200Response1Type string +type PostFleetEpmPackagesPkgnamePkgversion_200_Response_Item struct { union json.RawMessage } // Status returns HTTPResponse.Status -func (r InstallPackageResponse) Status() string { +func (r PostFleetEpmPackagesPkgnamePkgversionResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -15276,14 +15276,14 @@ func (r InstallPackageResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r InstallPackageResponse) StatusCode() int { +func (r PostFleetEpmPackagesPkgnamePkgversionResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type GetFleetServerHostsResponse struct { +type GetFleetFleetServerHostsResponse struct { Body []byte HTTPResponse *http.Response JSON200 *struct { @@ -15300,7 +15300,7 @@ type GetFleetServerHostsResponse struct { } // Status returns HTTPResponse.Status -func (r GetFleetServerHostsResponse) Status() string { +func (r GetFleetFleetServerHostsResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -15308,14 +15308,14 @@ func (r GetFleetServerHostsResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetFleetServerHostsResponse) StatusCode() int { +func (r GetFleetFleetServerHostsResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type CreateFleetServerHostResponse struct { +type PostFleetFleetServerHostsResponse struct { Body []byte HTTPResponse *http.Response JSON200 *struct { @@ -15329,7 +15329,7 @@ type CreateFleetServerHostResponse struct { } // Status returns HTTPResponse.Status -func (r CreateFleetServerHostResponse) Status() string { +func (r PostFleetFleetServerHostsResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -15337,14 +15337,14 @@ func (r CreateFleetServerHostResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r CreateFleetServerHostResponse) StatusCode() int { +func (r PostFleetFleetServerHostsResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type DeleteFleetServerHostResponse struct { +type DeleteFleetFleetServerHostsItemidResponse struct { Body []byte HTTPResponse *http.Response JSON200 *struct { @@ -15358,7 +15358,7 @@ type DeleteFleetServerHostResponse struct { } // Status returns HTTPResponse.Status -func (r DeleteFleetServerHostResponse) Status() string { +func (r DeleteFleetFleetServerHostsItemidResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -15366,14 +15366,14 @@ func (r DeleteFleetServerHostResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r DeleteFleetServerHostResponse) StatusCode() int { +func (r DeleteFleetFleetServerHostsItemidResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type GetFleetServerHostResponse struct { +type GetFleetFleetServerHostsItemidResponse struct { Body []byte HTTPResponse *http.Response JSON200 *struct { @@ -15387,7 +15387,7 @@ type GetFleetServerHostResponse struct { } // Status returns HTTPResponse.Status -func (r GetFleetServerHostResponse) Status() string { +func (r GetFleetFleetServerHostsItemidResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -15395,14 +15395,14 @@ func (r GetFleetServerHostResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetFleetServerHostResponse) StatusCode() int { +func (r GetFleetFleetServerHostsItemidResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type UpdateFleetServerHostResponse struct { +type PutFleetFleetServerHostsItemidResponse struct { Body []byte HTTPResponse *http.Response JSON200 *struct { @@ -15416,7 +15416,7 @@ type UpdateFleetServerHostResponse struct { } // Status returns HTTPResponse.Status -func (r UpdateFleetServerHostResponse) Status() string { +func (r PutFleetFleetServerHostsItemidResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -15424,14 +15424,14 @@ func (r UpdateFleetServerHostResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r UpdateFleetServerHostResponse) StatusCode() int { +func (r PutFleetFleetServerHostsItemidResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type GetOutputsResponse struct { +type GetFleetOutputsResponse struct { Body []byte HTTPResponse *http.Response JSON200 *struct { @@ -15448,7 +15448,7 @@ type GetOutputsResponse struct { } // Status returns HTTPResponse.Status -func (r GetOutputsResponse) Status() string { +func (r GetFleetOutputsResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -15456,14 +15456,14 @@ func (r GetOutputsResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetOutputsResponse) StatusCode() int { +func (r GetFleetOutputsResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type CreateOutputResponse struct { +type PostFleetOutputsResponse struct { Body []byte HTTPResponse *http.Response JSON200 *struct { @@ -15477,7 +15477,7 @@ type CreateOutputResponse struct { } // Status returns HTTPResponse.Status -func (r CreateOutputResponse) Status() string { +func (r PostFleetOutputsResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -15485,14 +15485,14 @@ func (r CreateOutputResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r CreateOutputResponse) StatusCode() int { +func (r PostFleetOutputsResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type DeleteOutputResponse struct { +type DeleteFleetOutputsOutputidResponse struct { Body []byte HTTPResponse *http.Response JSON200 *struct { @@ -15511,7 +15511,7 @@ type DeleteOutputResponse struct { } // Status returns HTTPResponse.Status -func (r DeleteOutputResponse) Status() string { +func (r DeleteFleetOutputsOutputidResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -15519,14 +15519,14 @@ func (r DeleteOutputResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r DeleteOutputResponse) StatusCode() int { +func (r DeleteFleetOutputsOutputidResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type GetOutputResponse struct { +type GetFleetOutputsOutputidResponse struct { Body []byte HTTPResponse *http.Response JSON200 *struct { @@ -15540,7 +15540,7 @@ type GetOutputResponse struct { } // Status returns HTTPResponse.Status -func (r GetOutputResponse) Status() string { +func (r GetFleetOutputsOutputidResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -15548,14 +15548,14 @@ func (r GetOutputResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetOutputResponse) StatusCode() int { +func (r GetFleetOutputsOutputidResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type UpdateOutputResponse struct { +type PutFleetOutputsOutputidResponse struct { Body []byte HTTPResponse *http.Response JSON200 *struct { @@ -15569,7 +15569,7 @@ type UpdateOutputResponse struct { } // Status returns HTTPResponse.Status -func (r UpdateOutputResponse) Status() string { +func (r PutFleetOutputsOutputidResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -15577,14 +15577,14 @@ func (r UpdateOutputResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r UpdateOutputResponse) StatusCode() int { +func (r PutFleetOutputsOutputidResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type GetPackagePoliciesResponse struct { +type GetFleetPackagePoliciesResponse struct { Body []byte HTTPResponse *http.Response JSON200 *struct { @@ -15601,7 +15601,7 @@ type GetPackagePoliciesResponse struct { } // Status returns HTTPResponse.Status -func (r GetPackagePoliciesResponse) Status() string { +func (r GetFleetPackagePoliciesResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -15609,14 +15609,14 @@ func (r GetPackagePoliciesResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetPackagePoliciesResponse) StatusCode() int { +func (r GetFleetPackagePoliciesResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type CreatePackagePolicyResponse struct { +type PostFleetPackagePoliciesResponse struct { Body []byte HTTPResponse *http.Response JSON200 *struct { @@ -15635,7 +15635,7 @@ type CreatePackagePolicyResponse struct { } // Status returns HTTPResponse.Status -func (r CreatePackagePolicyResponse) Status() string { +func (r PostFleetPackagePoliciesResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -15643,14 +15643,14 @@ func (r CreatePackagePolicyResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r CreatePackagePolicyResponse) StatusCode() int { +func (r PostFleetPackagePoliciesResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type DeletePackagePolicyResponse struct { +type DeleteFleetPackagePoliciesPackagepolicyidResponse struct { Body []byte HTTPResponse *http.Response JSON200 *struct { @@ -15664,7 +15664,7 @@ type DeletePackagePolicyResponse struct { } // Status returns HTTPResponse.Status -func (r DeletePackagePolicyResponse) Status() string { +func (r DeleteFleetPackagePoliciesPackagepolicyidResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -15672,14 +15672,14 @@ func (r DeletePackagePolicyResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r DeletePackagePolicyResponse) StatusCode() int { +func (r DeleteFleetPackagePoliciesPackagepolicyidResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type GetPackagePolicyResponse struct { +type GetFleetPackagePoliciesPackagepolicyidResponse struct { Body []byte HTTPResponse *http.Response JSON200 *struct { @@ -15696,7 +15696,7 @@ type GetPackagePolicyResponse struct { } // Status returns HTTPResponse.Status -func (r GetPackagePolicyResponse) Status() string { +func (r GetFleetPackagePoliciesPackagepolicyidResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -15704,14 +15704,14 @@ func (r GetPackagePolicyResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetPackagePolicyResponse) StatusCode() int { +func (r GetFleetPackagePoliciesPackagepolicyidResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type UpdatePackagePolicyResponse struct { +type PutFleetPackagePoliciesPackagepolicyidResponse struct { Body []byte HTTPResponse *http.Response JSON200 *struct { @@ -15730,7 +15730,7 @@ type UpdatePackagePolicyResponse struct { } // Status returns HTTPResponse.Status -func (r UpdatePackagePolicyResponse) Status() string { +func (r PutFleetPackagePoliciesPackagepolicyidResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -15738,14 +15738,14 @@ func (r UpdatePackagePolicyResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r UpdatePackagePolicyResponse) StatusCode() int { +func (r PutFleetPackagePoliciesPackagepolicyidResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type GetDataViewsResponse struct { +type GetAllDataViewsDefaultResponse struct { Body []byte HTTPResponse *http.Response JSON200 *struct { @@ -15755,7 +15755,7 @@ type GetDataViewsResponse struct { } // Status returns HTTPResponse.Status -func (r GetDataViewsResponse) Status() string { +func (r GetAllDataViewsDefaultResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -15763,14 +15763,14 @@ func (r GetDataViewsResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetDataViewsResponse) StatusCode() int { +func (r GetAllDataViewsDefaultResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type CreateDataViewResponse struct { +type CreateDataViewDefaultwResponse struct { Body []byte HTTPResponse *http.Response JSON200 *DataViewsDataViewResponseObject @@ -15778,7 +15778,7 @@ type CreateDataViewResponse struct { } // Status returns HTTPResponse.Status -func (r CreateDataViewResponse) Status() string { +func (r CreateDataViewDefaultwResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -15786,21 +15786,21 @@ func (r CreateDataViewResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r CreateDataViewResponse) StatusCode() int { +func (r CreateDataViewDefaultwResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type DeleteDataViewResponse struct { +type DeleteDataViewDefaultResponse struct { Body []byte HTTPResponse *http.Response JSON404 *DataViews404Response } // Status returns HTTPResponse.Status -func (r DeleteDataViewResponse) Status() string { +func (r DeleteDataViewDefaultResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -15808,14 +15808,14 @@ func (r DeleteDataViewResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r DeleteDataViewResponse) StatusCode() int { +func (r DeleteDataViewDefaultResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type GetDataViewResponse struct { +type GetDataViewDefaultResponse struct { Body []byte HTTPResponse *http.Response JSON200 *DataViewsDataViewResponseObject @@ -15823,7 +15823,7 @@ type GetDataViewResponse struct { } // Status returns HTTPResponse.Status -func (r GetDataViewResponse) Status() string { +func (r GetDataViewDefaultResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -15831,14 +15831,14 @@ func (r GetDataViewResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetDataViewResponse) StatusCode() int { +func (r GetDataViewDefaultResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type UpdateDataViewResponse struct { +type UpdateDataViewDefaultResponse struct { Body []byte HTTPResponse *http.Response JSON200 *DataViewsDataViewResponseObject @@ -15846,7 +15846,7 @@ type UpdateDataViewResponse struct { } // Status returns HTTPResponse.Status -func (r UpdateDataViewResponse) Status() string { +func (r UpdateDataViewDefaultResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -15854,405 +15854,405 @@ func (r UpdateDataViewResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r UpdateDataViewResponse) StatusCode() int { +func (r UpdateDataViewDefaultResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -// GetAgentPoliciesWithResponse request returning *GetAgentPoliciesResponse -func (c *ClientWithResponses) GetAgentPoliciesWithResponse(ctx context.Context, params *GetAgentPoliciesParams, reqEditors ...RequestEditorFn) (*GetAgentPoliciesResponse, error) { - rsp, err := c.GetAgentPolicies(ctx, params, reqEditors...) +// GetFleetAgentPoliciesWithResponse request returning *GetFleetAgentPoliciesResponse +func (c *ClientWithResponses) GetFleetAgentPoliciesWithResponse(ctx context.Context, params *GetFleetAgentPoliciesParams, reqEditors ...RequestEditorFn) (*GetFleetAgentPoliciesResponse, error) { + rsp, err := c.GetFleetAgentPolicies(ctx, params, reqEditors...) if err != nil { return nil, err } - return ParseGetAgentPoliciesResponse(rsp) + return ParseGetFleetAgentPoliciesResponse(rsp) } -// CreateAgentPolicyWithBodyWithResponse request with arbitrary body returning *CreateAgentPolicyResponse -func (c *ClientWithResponses) CreateAgentPolicyWithBodyWithResponse(ctx context.Context, params *CreateAgentPolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateAgentPolicyResponse, error) { - rsp, err := c.CreateAgentPolicyWithBody(ctx, params, contentType, body, reqEditors...) +// PostFleetAgentPoliciesWithBodyWithResponse request with arbitrary body returning *PostFleetAgentPoliciesResponse +func (c *ClientWithResponses) PostFleetAgentPoliciesWithBodyWithResponse(ctx context.Context, params *PostFleetAgentPoliciesParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostFleetAgentPoliciesResponse, error) { + rsp, err := c.PostFleetAgentPoliciesWithBody(ctx, params, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseCreateAgentPolicyResponse(rsp) + return ParsePostFleetAgentPoliciesResponse(rsp) } -func (c *ClientWithResponses) CreateAgentPolicyWithResponse(ctx context.Context, params *CreateAgentPolicyParams, body CreateAgentPolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateAgentPolicyResponse, error) { - rsp, err := c.CreateAgentPolicy(ctx, params, body, reqEditors...) +func (c *ClientWithResponses) PostFleetAgentPoliciesWithResponse(ctx context.Context, params *PostFleetAgentPoliciesParams, body PostFleetAgentPoliciesJSONRequestBody, reqEditors ...RequestEditorFn) (*PostFleetAgentPoliciesResponse, error) { + rsp, err := c.PostFleetAgentPolicies(ctx, params, body, reqEditors...) if err != nil { return nil, err } - return ParseCreateAgentPolicyResponse(rsp) + return ParsePostFleetAgentPoliciesResponse(rsp) } -// DeleteAgentPolicyWithBodyWithResponse request with arbitrary body returning *DeleteAgentPolicyResponse -func (c *ClientWithResponses) DeleteAgentPolicyWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DeleteAgentPolicyResponse, error) { - rsp, err := c.DeleteAgentPolicyWithBody(ctx, contentType, body, reqEditors...) +// PostFleetAgentPoliciesDeleteWithBodyWithResponse request with arbitrary body returning *PostFleetAgentPoliciesDeleteResponse +func (c *ClientWithResponses) PostFleetAgentPoliciesDeleteWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostFleetAgentPoliciesDeleteResponse, error) { + rsp, err := c.PostFleetAgentPoliciesDeleteWithBody(ctx, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseDeleteAgentPolicyResponse(rsp) + return ParsePostFleetAgentPoliciesDeleteResponse(rsp) } -func (c *ClientWithResponses) DeleteAgentPolicyWithResponse(ctx context.Context, body DeleteAgentPolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*DeleteAgentPolicyResponse, error) { - rsp, err := c.DeleteAgentPolicy(ctx, body, reqEditors...) +func (c *ClientWithResponses) PostFleetAgentPoliciesDeleteWithResponse(ctx context.Context, body PostFleetAgentPoliciesDeleteJSONRequestBody, reqEditors ...RequestEditorFn) (*PostFleetAgentPoliciesDeleteResponse, error) { + rsp, err := c.PostFleetAgentPoliciesDelete(ctx, body, reqEditors...) if err != nil { return nil, err } - return ParseDeleteAgentPolicyResponse(rsp) + return ParsePostFleetAgentPoliciesDeleteResponse(rsp) } -// GetAgentPolicyWithResponse request returning *GetAgentPolicyResponse -func (c *ClientWithResponses) GetAgentPolicyWithResponse(ctx context.Context, agentPolicyId string, params *GetAgentPolicyParams, reqEditors ...RequestEditorFn) (*GetAgentPolicyResponse, error) { - rsp, err := c.GetAgentPolicy(ctx, agentPolicyId, params, reqEditors...) +// GetFleetAgentPoliciesAgentpolicyidWithResponse request returning *GetFleetAgentPoliciesAgentpolicyidResponse +func (c *ClientWithResponses) GetFleetAgentPoliciesAgentpolicyidWithResponse(ctx context.Context, agentPolicyId string, params *GetFleetAgentPoliciesAgentpolicyidParams, reqEditors ...RequestEditorFn) (*GetFleetAgentPoliciesAgentpolicyidResponse, error) { + rsp, err := c.GetFleetAgentPoliciesAgentpolicyid(ctx, agentPolicyId, params, reqEditors...) if err != nil { return nil, err } - return ParseGetAgentPolicyResponse(rsp) + return ParseGetFleetAgentPoliciesAgentpolicyidResponse(rsp) } -// UpdateAgentPolicyWithBodyWithResponse request with arbitrary body returning *UpdateAgentPolicyResponse -func (c *ClientWithResponses) UpdateAgentPolicyWithBodyWithResponse(ctx context.Context, agentPolicyId string, params *UpdateAgentPolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateAgentPolicyResponse, error) { - rsp, err := c.UpdateAgentPolicyWithBody(ctx, agentPolicyId, params, contentType, body, reqEditors...) +// PutFleetAgentPoliciesAgentpolicyidWithBodyWithResponse request with arbitrary body returning *PutFleetAgentPoliciesAgentpolicyidResponse +func (c *ClientWithResponses) PutFleetAgentPoliciesAgentpolicyidWithBodyWithResponse(ctx context.Context, agentPolicyId string, params *PutFleetAgentPoliciesAgentpolicyidParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutFleetAgentPoliciesAgentpolicyidResponse, error) { + rsp, err := c.PutFleetAgentPoliciesAgentpolicyidWithBody(ctx, agentPolicyId, params, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseUpdateAgentPolicyResponse(rsp) + return ParsePutFleetAgentPoliciesAgentpolicyidResponse(rsp) } -func (c *ClientWithResponses) UpdateAgentPolicyWithResponse(ctx context.Context, agentPolicyId string, params *UpdateAgentPolicyParams, body UpdateAgentPolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateAgentPolicyResponse, error) { - rsp, err := c.UpdateAgentPolicy(ctx, agentPolicyId, params, body, reqEditors...) +func (c *ClientWithResponses) PutFleetAgentPoliciesAgentpolicyidWithResponse(ctx context.Context, agentPolicyId string, params *PutFleetAgentPoliciesAgentpolicyidParams, body PutFleetAgentPoliciesAgentpolicyidJSONRequestBody, reqEditors ...RequestEditorFn) (*PutFleetAgentPoliciesAgentpolicyidResponse, error) { + rsp, err := c.PutFleetAgentPoliciesAgentpolicyid(ctx, agentPolicyId, params, body, reqEditors...) if err != nil { return nil, err } - return ParseUpdateAgentPolicyResponse(rsp) + return ParsePutFleetAgentPoliciesAgentpolicyidResponse(rsp) } -// GetEnrollmentApiKeysWithResponse request returning *GetEnrollmentApiKeysResponse -func (c *ClientWithResponses) GetEnrollmentApiKeysWithResponse(ctx context.Context, params *GetEnrollmentApiKeysParams, reqEditors ...RequestEditorFn) (*GetEnrollmentApiKeysResponse, error) { - rsp, err := c.GetEnrollmentApiKeys(ctx, params, reqEditors...) +// GetFleetEnrollmentApiKeysWithResponse request returning *GetFleetEnrollmentApiKeysResponse +func (c *ClientWithResponses) GetFleetEnrollmentApiKeysWithResponse(ctx context.Context, params *GetFleetEnrollmentApiKeysParams, reqEditors ...RequestEditorFn) (*GetFleetEnrollmentApiKeysResponse, error) { + rsp, err := c.GetFleetEnrollmentApiKeys(ctx, params, reqEditors...) if err != nil { return nil, err } - return ParseGetEnrollmentApiKeysResponse(rsp) + return ParseGetFleetEnrollmentApiKeysResponse(rsp) } -// ListPackagesWithResponse request returning *ListPackagesResponse -func (c *ClientWithResponses) ListPackagesWithResponse(ctx context.Context, params *ListPackagesParams, reqEditors ...RequestEditorFn) (*ListPackagesResponse, error) { - rsp, err := c.ListPackages(ctx, params, reqEditors...) +// GetFleetEpmPackagesWithResponse request returning *GetFleetEpmPackagesResponse +func (c *ClientWithResponses) GetFleetEpmPackagesWithResponse(ctx context.Context, params *GetFleetEpmPackagesParams, reqEditors ...RequestEditorFn) (*GetFleetEpmPackagesResponse, error) { + rsp, err := c.GetFleetEpmPackages(ctx, params, reqEditors...) if err != nil { return nil, err } - return ParseListPackagesResponse(rsp) + return ParseGetFleetEpmPackagesResponse(rsp) } -// InstallPackageByUploadWithBodyWithResponse request with arbitrary body returning *InstallPackageByUploadResponse -func (c *ClientWithResponses) InstallPackageByUploadWithBodyWithResponse(ctx context.Context, params *InstallPackageByUploadParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*InstallPackageByUploadResponse, error) { - rsp, err := c.InstallPackageByUploadWithBody(ctx, params, contentType, body, reqEditors...) +// PostFleetEpmPackagesWithBodyWithResponse request with arbitrary body returning *PostFleetEpmPackagesResponse +func (c *ClientWithResponses) PostFleetEpmPackagesWithBodyWithResponse(ctx context.Context, params *PostFleetEpmPackagesParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostFleetEpmPackagesResponse, error) { + rsp, err := c.PostFleetEpmPackagesWithBody(ctx, params, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseInstallPackageByUploadResponse(rsp) + return ParsePostFleetEpmPackagesResponse(rsp) } -// DeletePackageWithBodyWithResponse request with arbitrary body returning *DeletePackageResponse -func (c *ClientWithResponses) DeletePackageWithBodyWithResponse(ctx context.Context, pkgName string, pkgVersion string, params *DeletePackageParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DeletePackageResponse, error) { - rsp, err := c.DeletePackageWithBody(ctx, pkgName, pkgVersion, params, contentType, body, reqEditors...) +// DeleteFleetEpmPackagesPkgnamePkgversionWithBodyWithResponse request with arbitrary body returning *DeleteFleetEpmPackagesPkgnamePkgversionResponse +func (c *ClientWithResponses) DeleteFleetEpmPackagesPkgnamePkgversionWithBodyWithResponse(ctx context.Context, pkgName string, pkgVersion string, params *DeleteFleetEpmPackagesPkgnamePkgversionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DeleteFleetEpmPackagesPkgnamePkgversionResponse, error) { + rsp, err := c.DeleteFleetEpmPackagesPkgnamePkgversionWithBody(ctx, pkgName, pkgVersion, params, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseDeletePackageResponse(rsp) + return ParseDeleteFleetEpmPackagesPkgnamePkgversionResponse(rsp) } -func (c *ClientWithResponses) DeletePackageWithResponse(ctx context.Context, pkgName string, pkgVersion string, params *DeletePackageParams, body DeletePackageJSONRequestBody, reqEditors ...RequestEditorFn) (*DeletePackageResponse, error) { - rsp, err := c.DeletePackage(ctx, pkgName, pkgVersion, params, body, reqEditors...) +func (c *ClientWithResponses) DeleteFleetEpmPackagesPkgnamePkgversionWithResponse(ctx context.Context, pkgName string, pkgVersion string, params *DeleteFleetEpmPackagesPkgnamePkgversionParams, body DeleteFleetEpmPackagesPkgnamePkgversionJSONRequestBody, reqEditors ...RequestEditorFn) (*DeleteFleetEpmPackagesPkgnamePkgversionResponse, error) { + rsp, err := c.DeleteFleetEpmPackagesPkgnamePkgversion(ctx, pkgName, pkgVersion, params, body, reqEditors...) if err != nil { return nil, err } - return ParseDeletePackageResponse(rsp) + return ParseDeleteFleetEpmPackagesPkgnamePkgversionResponse(rsp) } -// GetPackageWithResponse request returning *GetPackageResponse -func (c *ClientWithResponses) GetPackageWithResponse(ctx context.Context, pkgName string, pkgVersion string, params *GetPackageParams, reqEditors ...RequestEditorFn) (*GetPackageResponse, error) { - rsp, err := c.GetPackage(ctx, pkgName, pkgVersion, params, reqEditors...) +// GetFleetEpmPackagesPkgnamePkgversionWithResponse request returning *GetFleetEpmPackagesPkgnamePkgversionResponse +func (c *ClientWithResponses) GetFleetEpmPackagesPkgnamePkgversionWithResponse(ctx context.Context, pkgName string, pkgVersion string, params *GetFleetEpmPackagesPkgnamePkgversionParams, reqEditors ...RequestEditorFn) (*GetFleetEpmPackagesPkgnamePkgversionResponse, error) { + rsp, err := c.GetFleetEpmPackagesPkgnamePkgversion(ctx, pkgName, pkgVersion, params, reqEditors...) if err != nil { return nil, err } - return ParseGetPackageResponse(rsp) + return ParseGetFleetEpmPackagesPkgnamePkgversionResponse(rsp) } -// InstallPackageWithBodyWithResponse request with arbitrary body returning *InstallPackageResponse -func (c *ClientWithResponses) InstallPackageWithBodyWithResponse(ctx context.Context, pkgName string, pkgVersion string, params *InstallPackageParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*InstallPackageResponse, error) { - rsp, err := c.InstallPackageWithBody(ctx, pkgName, pkgVersion, params, contentType, body, reqEditors...) +// PostFleetEpmPackagesPkgnamePkgversionWithBodyWithResponse request with arbitrary body returning *PostFleetEpmPackagesPkgnamePkgversionResponse +func (c *ClientWithResponses) PostFleetEpmPackagesPkgnamePkgversionWithBodyWithResponse(ctx context.Context, pkgName string, pkgVersion string, params *PostFleetEpmPackagesPkgnamePkgversionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostFleetEpmPackagesPkgnamePkgversionResponse, error) { + rsp, err := c.PostFleetEpmPackagesPkgnamePkgversionWithBody(ctx, pkgName, pkgVersion, params, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseInstallPackageResponse(rsp) + return ParsePostFleetEpmPackagesPkgnamePkgversionResponse(rsp) } -func (c *ClientWithResponses) InstallPackageWithResponse(ctx context.Context, pkgName string, pkgVersion string, params *InstallPackageParams, body InstallPackageJSONRequestBody, reqEditors ...RequestEditorFn) (*InstallPackageResponse, error) { - rsp, err := c.InstallPackage(ctx, pkgName, pkgVersion, params, body, reqEditors...) +func (c *ClientWithResponses) PostFleetEpmPackagesPkgnamePkgversionWithResponse(ctx context.Context, pkgName string, pkgVersion string, params *PostFleetEpmPackagesPkgnamePkgversionParams, body PostFleetEpmPackagesPkgnamePkgversionJSONRequestBody, reqEditors ...RequestEditorFn) (*PostFleetEpmPackagesPkgnamePkgversionResponse, error) { + rsp, err := c.PostFleetEpmPackagesPkgnamePkgversion(ctx, pkgName, pkgVersion, params, body, reqEditors...) if err != nil { return nil, err } - return ParseInstallPackageResponse(rsp) + return ParsePostFleetEpmPackagesPkgnamePkgversionResponse(rsp) } -// GetFleetServerHostsWithResponse request returning *GetFleetServerHostsResponse -func (c *ClientWithResponses) GetFleetServerHostsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetFleetServerHostsResponse, error) { - rsp, err := c.GetFleetServerHosts(ctx, reqEditors...) +// GetFleetFleetServerHostsWithResponse request returning *GetFleetFleetServerHostsResponse +func (c *ClientWithResponses) GetFleetFleetServerHostsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetFleetFleetServerHostsResponse, error) { + rsp, err := c.GetFleetFleetServerHosts(ctx, reqEditors...) if err != nil { return nil, err } - return ParseGetFleetServerHostsResponse(rsp) + return ParseGetFleetFleetServerHostsResponse(rsp) } -// CreateFleetServerHostWithBodyWithResponse request with arbitrary body returning *CreateFleetServerHostResponse -func (c *ClientWithResponses) CreateFleetServerHostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateFleetServerHostResponse, error) { - rsp, err := c.CreateFleetServerHostWithBody(ctx, contentType, body, reqEditors...) +// PostFleetFleetServerHostsWithBodyWithResponse request with arbitrary body returning *PostFleetFleetServerHostsResponse +func (c *ClientWithResponses) PostFleetFleetServerHostsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostFleetFleetServerHostsResponse, error) { + rsp, err := c.PostFleetFleetServerHostsWithBody(ctx, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseCreateFleetServerHostResponse(rsp) + return ParsePostFleetFleetServerHostsResponse(rsp) } -func (c *ClientWithResponses) CreateFleetServerHostWithResponse(ctx context.Context, body CreateFleetServerHostJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateFleetServerHostResponse, error) { - rsp, err := c.CreateFleetServerHost(ctx, body, reqEditors...) +func (c *ClientWithResponses) PostFleetFleetServerHostsWithResponse(ctx context.Context, body PostFleetFleetServerHostsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostFleetFleetServerHostsResponse, error) { + rsp, err := c.PostFleetFleetServerHosts(ctx, body, reqEditors...) if err != nil { return nil, err } - return ParseCreateFleetServerHostResponse(rsp) + return ParsePostFleetFleetServerHostsResponse(rsp) } -// DeleteFleetServerHostWithResponse request returning *DeleteFleetServerHostResponse -func (c *ClientWithResponses) DeleteFleetServerHostWithResponse(ctx context.Context, itemId string, reqEditors ...RequestEditorFn) (*DeleteFleetServerHostResponse, error) { - rsp, err := c.DeleteFleetServerHost(ctx, itemId, reqEditors...) +// DeleteFleetFleetServerHostsItemidWithResponse request returning *DeleteFleetFleetServerHostsItemidResponse +func (c *ClientWithResponses) DeleteFleetFleetServerHostsItemidWithResponse(ctx context.Context, itemId string, reqEditors ...RequestEditorFn) (*DeleteFleetFleetServerHostsItemidResponse, error) { + rsp, err := c.DeleteFleetFleetServerHostsItemid(ctx, itemId, reqEditors...) if err != nil { return nil, err } - return ParseDeleteFleetServerHostResponse(rsp) + return ParseDeleteFleetFleetServerHostsItemidResponse(rsp) } -// GetFleetServerHostWithResponse request returning *GetFleetServerHostResponse -func (c *ClientWithResponses) GetFleetServerHostWithResponse(ctx context.Context, itemId string, reqEditors ...RequestEditorFn) (*GetFleetServerHostResponse, error) { - rsp, err := c.GetFleetServerHost(ctx, itemId, reqEditors...) +// GetFleetFleetServerHostsItemidWithResponse request returning *GetFleetFleetServerHostsItemidResponse +func (c *ClientWithResponses) GetFleetFleetServerHostsItemidWithResponse(ctx context.Context, itemId string, reqEditors ...RequestEditorFn) (*GetFleetFleetServerHostsItemidResponse, error) { + rsp, err := c.GetFleetFleetServerHostsItemid(ctx, itemId, reqEditors...) if err != nil { return nil, err } - return ParseGetFleetServerHostResponse(rsp) + return ParseGetFleetFleetServerHostsItemidResponse(rsp) } -// UpdateFleetServerHostWithBodyWithResponse request with arbitrary body returning *UpdateFleetServerHostResponse -func (c *ClientWithResponses) UpdateFleetServerHostWithBodyWithResponse(ctx context.Context, itemId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateFleetServerHostResponse, error) { - rsp, err := c.UpdateFleetServerHostWithBody(ctx, itemId, contentType, body, reqEditors...) +// PutFleetFleetServerHostsItemidWithBodyWithResponse request with arbitrary body returning *PutFleetFleetServerHostsItemidResponse +func (c *ClientWithResponses) PutFleetFleetServerHostsItemidWithBodyWithResponse(ctx context.Context, itemId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutFleetFleetServerHostsItemidResponse, error) { + rsp, err := c.PutFleetFleetServerHostsItemidWithBody(ctx, itemId, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseUpdateFleetServerHostResponse(rsp) + return ParsePutFleetFleetServerHostsItemidResponse(rsp) } -func (c *ClientWithResponses) UpdateFleetServerHostWithResponse(ctx context.Context, itemId string, body UpdateFleetServerHostJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateFleetServerHostResponse, error) { - rsp, err := c.UpdateFleetServerHost(ctx, itemId, body, reqEditors...) +func (c *ClientWithResponses) PutFleetFleetServerHostsItemidWithResponse(ctx context.Context, itemId string, body PutFleetFleetServerHostsItemidJSONRequestBody, reqEditors ...RequestEditorFn) (*PutFleetFleetServerHostsItemidResponse, error) { + rsp, err := c.PutFleetFleetServerHostsItemid(ctx, itemId, body, reqEditors...) if err != nil { return nil, err } - return ParseUpdateFleetServerHostResponse(rsp) + return ParsePutFleetFleetServerHostsItemidResponse(rsp) } -// GetOutputsWithResponse request returning *GetOutputsResponse -func (c *ClientWithResponses) GetOutputsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetOutputsResponse, error) { - rsp, err := c.GetOutputs(ctx, reqEditors...) +// GetFleetOutputsWithResponse request returning *GetFleetOutputsResponse +func (c *ClientWithResponses) GetFleetOutputsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetFleetOutputsResponse, error) { + rsp, err := c.GetFleetOutputs(ctx, reqEditors...) if err != nil { return nil, err } - return ParseGetOutputsResponse(rsp) + return ParseGetFleetOutputsResponse(rsp) } -// CreateOutputWithBodyWithResponse request with arbitrary body returning *CreateOutputResponse -func (c *ClientWithResponses) CreateOutputWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateOutputResponse, error) { - rsp, err := c.CreateOutputWithBody(ctx, contentType, body, reqEditors...) +// PostFleetOutputsWithBodyWithResponse request with arbitrary body returning *PostFleetOutputsResponse +func (c *ClientWithResponses) PostFleetOutputsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostFleetOutputsResponse, error) { + rsp, err := c.PostFleetOutputsWithBody(ctx, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseCreateOutputResponse(rsp) + return ParsePostFleetOutputsResponse(rsp) } -func (c *ClientWithResponses) CreateOutputWithResponse(ctx context.Context, body CreateOutputJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateOutputResponse, error) { - rsp, err := c.CreateOutput(ctx, body, reqEditors...) +func (c *ClientWithResponses) PostFleetOutputsWithResponse(ctx context.Context, body PostFleetOutputsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostFleetOutputsResponse, error) { + rsp, err := c.PostFleetOutputs(ctx, body, reqEditors...) if err != nil { return nil, err } - return ParseCreateOutputResponse(rsp) + return ParsePostFleetOutputsResponse(rsp) } -// DeleteOutputWithResponse request returning *DeleteOutputResponse -func (c *ClientWithResponses) DeleteOutputWithResponse(ctx context.Context, outputId string, reqEditors ...RequestEditorFn) (*DeleteOutputResponse, error) { - rsp, err := c.DeleteOutput(ctx, outputId, reqEditors...) +// DeleteFleetOutputsOutputidWithResponse request returning *DeleteFleetOutputsOutputidResponse +func (c *ClientWithResponses) DeleteFleetOutputsOutputidWithResponse(ctx context.Context, outputId string, reqEditors ...RequestEditorFn) (*DeleteFleetOutputsOutputidResponse, error) { + rsp, err := c.DeleteFleetOutputsOutputid(ctx, outputId, reqEditors...) if err != nil { return nil, err } - return ParseDeleteOutputResponse(rsp) + return ParseDeleteFleetOutputsOutputidResponse(rsp) } -// GetOutputWithResponse request returning *GetOutputResponse -func (c *ClientWithResponses) GetOutputWithResponse(ctx context.Context, outputId string, reqEditors ...RequestEditorFn) (*GetOutputResponse, error) { - rsp, err := c.GetOutput(ctx, outputId, reqEditors...) +// GetFleetOutputsOutputidWithResponse request returning *GetFleetOutputsOutputidResponse +func (c *ClientWithResponses) GetFleetOutputsOutputidWithResponse(ctx context.Context, outputId string, reqEditors ...RequestEditorFn) (*GetFleetOutputsOutputidResponse, error) { + rsp, err := c.GetFleetOutputsOutputid(ctx, outputId, reqEditors...) if err != nil { return nil, err } - return ParseGetOutputResponse(rsp) + return ParseGetFleetOutputsOutputidResponse(rsp) } -// UpdateOutputWithBodyWithResponse request with arbitrary body returning *UpdateOutputResponse -func (c *ClientWithResponses) UpdateOutputWithBodyWithResponse(ctx context.Context, outputId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateOutputResponse, error) { - rsp, err := c.UpdateOutputWithBody(ctx, outputId, contentType, body, reqEditors...) +// PutFleetOutputsOutputidWithBodyWithResponse request with arbitrary body returning *PutFleetOutputsOutputidResponse +func (c *ClientWithResponses) PutFleetOutputsOutputidWithBodyWithResponse(ctx context.Context, outputId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutFleetOutputsOutputidResponse, error) { + rsp, err := c.PutFleetOutputsOutputidWithBody(ctx, outputId, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseUpdateOutputResponse(rsp) + return ParsePutFleetOutputsOutputidResponse(rsp) } -func (c *ClientWithResponses) UpdateOutputWithResponse(ctx context.Context, outputId string, body UpdateOutputJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateOutputResponse, error) { - rsp, err := c.UpdateOutput(ctx, outputId, body, reqEditors...) +func (c *ClientWithResponses) PutFleetOutputsOutputidWithResponse(ctx context.Context, outputId string, body PutFleetOutputsOutputidJSONRequestBody, reqEditors ...RequestEditorFn) (*PutFleetOutputsOutputidResponse, error) { + rsp, err := c.PutFleetOutputsOutputid(ctx, outputId, body, reqEditors...) if err != nil { return nil, err } - return ParseUpdateOutputResponse(rsp) + return ParsePutFleetOutputsOutputidResponse(rsp) } -// GetPackagePoliciesWithResponse request returning *GetPackagePoliciesResponse -func (c *ClientWithResponses) GetPackagePoliciesWithResponse(ctx context.Context, params *GetPackagePoliciesParams, reqEditors ...RequestEditorFn) (*GetPackagePoliciesResponse, error) { - rsp, err := c.GetPackagePolicies(ctx, params, reqEditors...) +// GetFleetPackagePoliciesWithResponse request returning *GetFleetPackagePoliciesResponse +func (c *ClientWithResponses) GetFleetPackagePoliciesWithResponse(ctx context.Context, params *GetFleetPackagePoliciesParams, reqEditors ...RequestEditorFn) (*GetFleetPackagePoliciesResponse, error) { + rsp, err := c.GetFleetPackagePolicies(ctx, params, reqEditors...) if err != nil { return nil, err } - return ParseGetPackagePoliciesResponse(rsp) + return ParseGetFleetPackagePoliciesResponse(rsp) } -// CreatePackagePolicyWithBodyWithResponse request with arbitrary body returning *CreatePackagePolicyResponse -func (c *ClientWithResponses) CreatePackagePolicyWithBodyWithResponse(ctx context.Context, params *CreatePackagePolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreatePackagePolicyResponse, error) { - rsp, err := c.CreatePackagePolicyWithBody(ctx, params, contentType, body, reqEditors...) +// PostFleetPackagePoliciesWithBodyWithResponse request with arbitrary body returning *PostFleetPackagePoliciesResponse +func (c *ClientWithResponses) PostFleetPackagePoliciesWithBodyWithResponse(ctx context.Context, params *PostFleetPackagePoliciesParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostFleetPackagePoliciesResponse, error) { + rsp, err := c.PostFleetPackagePoliciesWithBody(ctx, params, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseCreatePackagePolicyResponse(rsp) + return ParsePostFleetPackagePoliciesResponse(rsp) } -func (c *ClientWithResponses) CreatePackagePolicyWithResponse(ctx context.Context, params *CreatePackagePolicyParams, body CreatePackagePolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*CreatePackagePolicyResponse, error) { - rsp, err := c.CreatePackagePolicy(ctx, params, body, reqEditors...) +func (c *ClientWithResponses) PostFleetPackagePoliciesWithResponse(ctx context.Context, params *PostFleetPackagePoliciesParams, body PostFleetPackagePoliciesJSONRequestBody, reqEditors ...RequestEditorFn) (*PostFleetPackagePoliciesResponse, error) { + rsp, err := c.PostFleetPackagePolicies(ctx, params, body, reqEditors...) if err != nil { return nil, err } - return ParseCreatePackagePolicyResponse(rsp) + return ParsePostFleetPackagePoliciesResponse(rsp) } -// DeletePackagePolicyWithResponse request returning *DeletePackagePolicyResponse -func (c *ClientWithResponses) DeletePackagePolicyWithResponse(ctx context.Context, packagePolicyId string, params *DeletePackagePolicyParams, reqEditors ...RequestEditorFn) (*DeletePackagePolicyResponse, error) { - rsp, err := c.DeletePackagePolicy(ctx, packagePolicyId, params, reqEditors...) +// DeleteFleetPackagePoliciesPackagepolicyidWithResponse request returning *DeleteFleetPackagePoliciesPackagepolicyidResponse +func (c *ClientWithResponses) DeleteFleetPackagePoliciesPackagepolicyidWithResponse(ctx context.Context, packagePolicyId string, params *DeleteFleetPackagePoliciesPackagepolicyidParams, reqEditors ...RequestEditorFn) (*DeleteFleetPackagePoliciesPackagepolicyidResponse, error) { + rsp, err := c.DeleteFleetPackagePoliciesPackagepolicyid(ctx, packagePolicyId, params, reqEditors...) if err != nil { return nil, err } - return ParseDeletePackagePolicyResponse(rsp) + return ParseDeleteFleetPackagePoliciesPackagepolicyidResponse(rsp) } -// GetPackagePolicyWithResponse request returning *GetPackagePolicyResponse -func (c *ClientWithResponses) GetPackagePolicyWithResponse(ctx context.Context, packagePolicyId string, params *GetPackagePolicyParams, reqEditors ...RequestEditorFn) (*GetPackagePolicyResponse, error) { - rsp, err := c.GetPackagePolicy(ctx, packagePolicyId, params, reqEditors...) +// GetFleetPackagePoliciesPackagepolicyidWithResponse request returning *GetFleetPackagePoliciesPackagepolicyidResponse +func (c *ClientWithResponses) GetFleetPackagePoliciesPackagepolicyidWithResponse(ctx context.Context, packagePolicyId string, params *GetFleetPackagePoliciesPackagepolicyidParams, reqEditors ...RequestEditorFn) (*GetFleetPackagePoliciesPackagepolicyidResponse, error) { + rsp, err := c.GetFleetPackagePoliciesPackagepolicyid(ctx, packagePolicyId, params, reqEditors...) if err != nil { return nil, err } - return ParseGetPackagePolicyResponse(rsp) + return ParseGetFleetPackagePoliciesPackagepolicyidResponse(rsp) } -// UpdatePackagePolicyWithBodyWithResponse request with arbitrary body returning *UpdatePackagePolicyResponse -func (c *ClientWithResponses) UpdatePackagePolicyWithBodyWithResponse(ctx context.Context, packagePolicyId string, params *UpdatePackagePolicyParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdatePackagePolicyResponse, error) { - rsp, err := c.UpdatePackagePolicyWithBody(ctx, packagePolicyId, params, contentType, body, reqEditors...) +// PutFleetPackagePoliciesPackagepolicyidWithBodyWithResponse request with arbitrary body returning *PutFleetPackagePoliciesPackagepolicyidResponse +func (c *ClientWithResponses) PutFleetPackagePoliciesPackagepolicyidWithBodyWithResponse(ctx context.Context, packagePolicyId string, params *PutFleetPackagePoliciesPackagepolicyidParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutFleetPackagePoliciesPackagepolicyidResponse, error) { + rsp, err := c.PutFleetPackagePoliciesPackagepolicyidWithBody(ctx, packagePolicyId, params, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseUpdatePackagePolicyResponse(rsp) + return ParsePutFleetPackagePoliciesPackagepolicyidResponse(rsp) } -func (c *ClientWithResponses) UpdatePackagePolicyWithResponse(ctx context.Context, packagePolicyId string, params *UpdatePackagePolicyParams, body UpdatePackagePolicyJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdatePackagePolicyResponse, error) { - rsp, err := c.UpdatePackagePolicy(ctx, packagePolicyId, params, body, reqEditors...) +func (c *ClientWithResponses) PutFleetPackagePoliciesPackagepolicyidWithResponse(ctx context.Context, packagePolicyId string, params *PutFleetPackagePoliciesPackagepolicyidParams, body PutFleetPackagePoliciesPackagepolicyidJSONRequestBody, reqEditors ...RequestEditorFn) (*PutFleetPackagePoliciesPackagepolicyidResponse, error) { + rsp, err := c.PutFleetPackagePoliciesPackagepolicyid(ctx, packagePolicyId, params, body, reqEditors...) if err != nil { return nil, err } - return ParseUpdatePackagePolicyResponse(rsp) + return ParsePutFleetPackagePoliciesPackagepolicyidResponse(rsp) } -// GetDataViewsWithResponse request returning *GetDataViewsResponse -func (c *ClientWithResponses) GetDataViewsWithResponse(ctx context.Context, spaceId SpaceId, reqEditors ...RequestEditorFn) (*GetDataViewsResponse, error) { - rsp, err := c.GetDataViews(ctx, spaceId, reqEditors...) +// GetAllDataViewsDefaultWithResponse request returning *GetAllDataViewsDefaultResponse +func (c *ClientWithResponses) GetAllDataViewsDefaultWithResponse(ctx context.Context, spaceId SpaceId, reqEditors ...RequestEditorFn) (*GetAllDataViewsDefaultResponse, error) { + rsp, err := c.GetAllDataViewsDefault(ctx, spaceId, reqEditors...) if err != nil { return nil, err } - return ParseGetDataViewsResponse(rsp) + return ParseGetAllDataViewsDefaultResponse(rsp) } -// CreateDataViewWithBodyWithResponse request with arbitrary body returning *CreateDataViewResponse -func (c *ClientWithResponses) CreateDataViewWithBodyWithResponse(ctx context.Context, spaceId SpaceId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateDataViewResponse, error) { - rsp, err := c.CreateDataViewWithBody(ctx, spaceId, contentType, body, reqEditors...) +// CreateDataViewDefaultwWithBodyWithResponse request with arbitrary body returning *CreateDataViewDefaultwResponse +func (c *ClientWithResponses) CreateDataViewDefaultwWithBodyWithResponse(ctx context.Context, spaceId SpaceId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateDataViewDefaultwResponse, error) { + rsp, err := c.CreateDataViewDefaultwWithBody(ctx, spaceId, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseCreateDataViewResponse(rsp) + return ParseCreateDataViewDefaultwResponse(rsp) } -func (c *ClientWithResponses) CreateDataViewWithResponse(ctx context.Context, spaceId SpaceId, body CreateDataViewJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateDataViewResponse, error) { - rsp, err := c.CreateDataView(ctx, spaceId, body, reqEditors...) +func (c *ClientWithResponses) CreateDataViewDefaultwWithResponse(ctx context.Context, spaceId SpaceId, body CreateDataViewDefaultwJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateDataViewDefaultwResponse, error) { + rsp, err := c.CreateDataViewDefaultw(ctx, spaceId, body, reqEditors...) if err != nil { return nil, err } - return ParseCreateDataViewResponse(rsp) + return ParseCreateDataViewDefaultwResponse(rsp) } -// DeleteDataViewWithResponse request returning *DeleteDataViewResponse -func (c *ClientWithResponses) DeleteDataViewWithResponse(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, reqEditors ...RequestEditorFn) (*DeleteDataViewResponse, error) { - rsp, err := c.DeleteDataView(ctx, spaceId, viewId, reqEditors...) +// DeleteDataViewDefaultWithResponse request returning *DeleteDataViewDefaultResponse +func (c *ClientWithResponses) DeleteDataViewDefaultWithResponse(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, reqEditors ...RequestEditorFn) (*DeleteDataViewDefaultResponse, error) { + rsp, err := c.DeleteDataViewDefault(ctx, spaceId, viewId, reqEditors...) if err != nil { return nil, err } - return ParseDeleteDataViewResponse(rsp) + return ParseDeleteDataViewDefaultResponse(rsp) } -// GetDataViewWithResponse request returning *GetDataViewResponse -func (c *ClientWithResponses) GetDataViewWithResponse(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, reqEditors ...RequestEditorFn) (*GetDataViewResponse, error) { - rsp, err := c.GetDataView(ctx, spaceId, viewId, reqEditors...) +// GetDataViewDefaultWithResponse request returning *GetDataViewDefaultResponse +func (c *ClientWithResponses) GetDataViewDefaultWithResponse(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, reqEditors ...RequestEditorFn) (*GetDataViewDefaultResponse, error) { + rsp, err := c.GetDataViewDefault(ctx, spaceId, viewId, reqEditors...) if err != nil { return nil, err } - return ParseGetDataViewResponse(rsp) + return ParseGetDataViewDefaultResponse(rsp) } -// UpdateDataViewWithBodyWithResponse request with arbitrary body returning *UpdateDataViewResponse -func (c *ClientWithResponses) UpdateDataViewWithBodyWithResponse(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateDataViewResponse, error) { - rsp, err := c.UpdateDataViewWithBody(ctx, spaceId, viewId, contentType, body, reqEditors...) +// UpdateDataViewDefaultWithBodyWithResponse request with arbitrary body returning *UpdateDataViewDefaultResponse +func (c *ClientWithResponses) UpdateDataViewDefaultWithBodyWithResponse(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateDataViewDefaultResponse, error) { + rsp, err := c.UpdateDataViewDefaultWithBody(ctx, spaceId, viewId, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseUpdateDataViewResponse(rsp) + return ParseUpdateDataViewDefaultResponse(rsp) } -func (c *ClientWithResponses) UpdateDataViewWithResponse(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, body UpdateDataViewJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateDataViewResponse, error) { - rsp, err := c.UpdateDataView(ctx, spaceId, viewId, body, reqEditors...) +func (c *ClientWithResponses) UpdateDataViewDefaultWithResponse(ctx context.Context, spaceId SpaceId, viewId DataViewsViewId, body UpdateDataViewDefaultJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateDataViewDefaultResponse, error) { + rsp, err := c.UpdateDataViewDefault(ctx, spaceId, viewId, body, reqEditors...) if err != nil { return nil, err } - return ParseUpdateDataViewResponse(rsp) + return ParseUpdateDataViewDefaultResponse(rsp) } -// ParseGetAgentPoliciesResponse parses an HTTP response from a GetAgentPoliciesWithResponse call -func ParseGetAgentPoliciesResponse(rsp *http.Response) (*GetAgentPoliciesResponse, error) { +// ParseGetFleetAgentPoliciesResponse parses an HTTP response from a GetFleetAgentPoliciesWithResponse call +func ParseGetFleetAgentPoliciesResponse(rsp *http.Response) (*GetFleetAgentPoliciesResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetAgentPoliciesResponse{ + response := &GetFleetAgentPoliciesResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -16286,15 +16286,15 @@ func ParseGetAgentPoliciesResponse(rsp *http.Response) (*GetAgentPoliciesRespons return response, nil } -// ParseCreateAgentPolicyResponse parses an HTTP response from a CreateAgentPolicyWithResponse call -func ParseCreateAgentPolicyResponse(rsp *http.Response) (*CreateAgentPolicyResponse, error) { +// ParsePostFleetAgentPoliciesResponse parses an HTTP response from a PostFleetAgentPoliciesWithResponse call +func ParsePostFleetAgentPoliciesResponse(rsp *http.Response) (*PostFleetAgentPoliciesResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &CreateAgentPolicyResponse{ + response := &PostFleetAgentPoliciesResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -16325,15 +16325,15 @@ func ParseCreateAgentPolicyResponse(rsp *http.Response) (*CreateAgentPolicyRespo return response, nil } -// ParseDeleteAgentPolicyResponse parses an HTTP response from a DeleteAgentPolicyWithResponse call -func ParseDeleteAgentPolicyResponse(rsp *http.Response) (*DeleteAgentPolicyResponse, error) { +// ParsePostFleetAgentPoliciesDeleteResponse parses an HTTP response from a PostFleetAgentPoliciesDeleteWithResponse call +func ParsePostFleetAgentPoliciesDeleteResponse(rsp *http.Response) (*PostFleetAgentPoliciesDeleteResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &DeleteAgentPolicyResponse{ + response := &PostFleetAgentPoliciesDeleteResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -16365,15 +16365,15 @@ func ParseDeleteAgentPolicyResponse(rsp *http.Response) (*DeleteAgentPolicyRespo return response, nil } -// ParseGetAgentPolicyResponse parses an HTTP response from a GetAgentPolicyWithResponse call -func ParseGetAgentPolicyResponse(rsp *http.Response) (*GetAgentPolicyResponse, error) { +// ParseGetFleetAgentPoliciesAgentpolicyidResponse parses an HTTP response from a GetFleetAgentPoliciesAgentpolicyidWithResponse call +func ParseGetFleetAgentPoliciesAgentpolicyidResponse(rsp *http.Response) (*GetFleetAgentPoliciesAgentpolicyidResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetAgentPolicyResponse{ + response := &GetFleetAgentPoliciesAgentpolicyidResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -16404,15 +16404,15 @@ func ParseGetAgentPolicyResponse(rsp *http.Response) (*GetAgentPolicyResponse, e return response, nil } -// ParseUpdateAgentPolicyResponse parses an HTTP response from a UpdateAgentPolicyWithResponse call -func ParseUpdateAgentPolicyResponse(rsp *http.Response) (*UpdateAgentPolicyResponse, error) { +// ParsePutFleetAgentPoliciesAgentpolicyidResponse parses an HTTP response from a PutFleetAgentPoliciesAgentpolicyidWithResponse call +func ParsePutFleetAgentPoliciesAgentpolicyidResponse(rsp *http.Response) (*PutFleetAgentPoliciesAgentpolicyidResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &UpdateAgentPolicyResponse{ + response := &PutFleetAgentPoliciesAgentpolicyidResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -16443,15 +16443,15 @@ func ParseUpdateAgentPolicyResponse(rsp *http.Response) (*UpdateAgentPolicyRespo return response, nil } -// ParseGetEnrollmentApiKeysResponse parses an HTTP response from a GetEnrollmentApiKeysWithResponse call -func ParseGetEnrollmentApiKeysResponse(rsp *http.Response) (*GetEnrollmentApiKeysResponse, error) { +// ParseGetFleetEnrollmentApiKeysResponse parses an HTTP response from a GetFleetEnrollmentApiKeysWithResponse call +func ParseGetFleetEnrollmentApiKeysResponse(rsp *http.Response) (*GetFleetEnrollmentApiKeysResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetEnrollmentApiKeysResponse{ + response := &GetFleetEnrollmentApiKeysResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -16504,15 +16504,15 @@ func ParseGetEnrollmentApiKeysResponse(rsp *http.Response) (*GetEnrollmentApiKey return response, nil } -// ParseListPackagesResponse parses an HTTP response from a ListPackagesWithResponse call -func ParseListPackagesResponse(rsp *http.Response) (*ListPackagesResponse, error) { +// ParseGetFleetEpmPackagesResponse parses an HTTP response from a GetFleetEpmPackagesWithResponse call +func ParseGetFleetEpmPackagesResponse(rsp *http.Response) (*GetFleetEpmPackagesResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ListPackagesResponse{ + response := &GetFleetEpmPackagesResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -16520,8 +16520,8 @@ func ParseListPackagesResponse(rsp *http.Response) (*ListPackagesResponse, error switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest struct { - Items []PackageListItem `json:"items"` - Response *[]ListPackages_200_Response_Item `json:"response,omitempty"` + Items []PackageListItem `json:"items"` + Response *[]GetFleetEpmPackages_200_Response_Item `json:"response,omitempty"` } if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err @@ -16544,15 +16544,15 @@ func ParseListPackagesResponse(rsp *http.Response) (*ListPackagesResponse, error return response, nil } -// ParseInstallPackageByUploadResponse parses an HTTP response from a InstallPackageByUploadWithResponse call -func ParseInstallPackageByUploadResponse(rsp *http.Response) (*InstallPackageByUploadResponse, error) { +// ParsePostFleetEpmPackagesResponse parses an HTTP response from a PostFleetEpmPackagesWithResponse call +func ParsePostFleetEpmPackagesResponse(rsp *http.Response) (*PostFleetEpmPackagesResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &InstallPackageByUploadResponse{ + response := &PostFleetEpmPackagesResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -16560,15 +16560,15 @@ func ParseInstallPackageByUploadResponse(rsp *http.Response) (*InstallPackageByU return response, nil } -// ParseDeletePackageResponse parses an HTTP response from a DeletePackageWithResponse call -func ParseDeletePackageResponse(rsp *http.Response) (*DeletePackageResponse, error) { +// ParseDeleteFleetEpmPackagesPkgnamePkgversionResponse parses an HTTP response from a DeleteFleetEpmPackagesPkgnamePkgversionWithResponse call +func ParseDeleteFleetEpmPackagesPkgnamePkgversionResponse(rsp *http.Response) (*DeleteFleetEpmPackagesPkgnamePkgversionResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &DeletePackageResponse{ + response := &DeleteFleetEpmPackagesPkgnamePkgversionResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -16576,9 +16576,9 @@ func ParseDeletePackageResponse(rsp *http.Response) (*DeletePackageResponse, err switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest struct { - Items []DeletePackage_200_Items_Item `json:"items"` + Items []DeleteFleetEpmPackagesPkgnamePkgversion_200_Items_Item `json:"items"` // Deprecated: - Response *[]DeletePackage_200_Response_Item `json:"response,omitempty"` + Response *[]DeleteFleetEpmPackagesPkgnamePkgversion_200_Response_Item `json:"response,omitempty"` } if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err @@ -16601,15 +16601,15 @@ func ParseDeletePackageResponse(rsp *http.Response) (*DeletePackageResponse, err return response, nil } -// ParseGetPackageResponse parses an HTTP response from a GetPackageWithResponse call -func ParseGetPackageResponse(rsp *http.Response) (*GetPackageResponse, error) { +// ParseGetFleetEpmPackagesPkgnamePkgversionResponse parses an HTTP response from a GetFleetEpmPackagesPkgnamePkgversionWithResponse call +func ParseGetFleetEpmPackagesPkgnamePkgversionResponse(rsp *http.Response) (*GetFleetEpmPackagesPkgnamePkgversionResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetPackageResponse{ + response := &GetFleetEpmPackagesPkgnamePkgversionResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -16622,7 +16622,7 @@ func ParseGetPackageResponse(rsp *http.Response) (*GetPackageResponse, error) { HasPolicies bool `json:"has_policies"` } `json:"metadata,omitempty"` // Deprecated: - Response *GetPackage_200_Response `json:"response,omitempty"` + Response *GetFleetEpmPackagesPkgnamePkgversion_200_Response `json:"response,omitempty"` } if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err @@ -16645,15 +16645,15 @@ func ParseGetPackageResponse(rsp *http.Response) (*GetPackageResponse, error) { return response, nil } -// ParseInstallPackageResponse parses an HTTP response from a InstallPackageWithResponse call -func ParseInstallPackageResponse(rsp *http.Response) (*InstallPackageResponse, error) { +// ParsePostFleetEpmPackagesPkgnamePkgversionResponse parses an HTTP response from a PostFleetEpmPackagesPkgnamePkgversionWithResponse call +func ParsePostFleetEpmPackagesPkgnamePkgversionResponse(rsp *http.Response) (*PostFleetEpmPackagesPkgnamePkgversionResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &InstallPackageResponse{ + response := &PostFleetEpmPackagesPkgnamePkgversionResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -16664,9 +16664,9 @@ func ParseInstallPackageResponse(rsp *http.Response) (*InstallPackageResponse, e Meta struct { InstallSource string `json:"install_source"` } `json:"_meta"` - Items []InstallPackage_200_Items_Item `json:"items"` + Items []PostFleetEpmPackagesPkgnamePkgversion_200_Items_Item `json:"items"` // Deprecated: - Response *[]InstallPackage_200_Response_Item `json:"response,omitempty"` + Response *[]PostFleetEpmPackagesPkgnamePkgversion_200_Response_Item `json:"response,omitempty"` } if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err @@ -16689,15 +16689,15 @@ func ParseInstallPackageResponse(rsp *http.Response) (*InstallPackageResponse, e return response, nil } -// ParseGetFleetServerHostsResponse parses an HTTP response from a GetFleetServerHostsWithResponse call -func ParseGetFleetServerHostsResponse(rsp *http.Response) (*GetFleetServerHostsResponse, error) { +// ParseGetFleetFleetServerHostsResponse parses an HTTP response from a GetFleetFleetServerHostsWithResponse call +func ParseGetFleetFleetServerHostsResponse(rsp *http.Response) (*GetFleetFleetServerHostsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetFleetServerHostsResponse{ + response := &GetFleetFleetServerHostsResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -16731,15 +16731,15 @@ func ParseGetFleetServerHostsResponse(rsp *http.Response) (*GetFleetServerHostsR return response, nil } -// ParseCreateFleetServerHostResponse parses an HTTP response from a CreateFleetServerHostWithResponse call -func ParseCreateFleetServerHostResponse(rsp *http.Response) (*CreateFleetServerHostResponse, error) { +// ParsePostFleetFleetServerHostsResponse parses an HTTP response from a PostFleetFleetServerHostsWithResponse call +func ParsePostFleetFleetServerHostsResponse(rsp *http.Response) (*PostFleetFleetServerHostsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &CreateFleetServerHostResponse{ + response := &PostFleetFleetServerHostsResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -16770,15 +16770,15 @@ func ParseCreateFleetServerHostResponse(rsp *http.Response) (*CreateFleetServerH return response, nil } -// ParseDeleteFleetServerHostResponse parses an HTTP response from a DeleteFleetServerHostWithResponse call -func ParseDeleteFleetServerHostResponse(rsp *http.Response) (*DeleteFleetServerHostResponse, error) { +// ParseDeleteFleetFleetServerHostsItemidResponse parses an HTTP response from a DeleteFleetFleetServerHostsItemidWithResponse call +func ParseDeleteFleetFleetServerHostsItemidResponse(rsp *http.Response) (*DeleteFleetFleetServerHostsItemidResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &DeleteFleetServerHostResponse{ + response := &DeleteFleetFleetServerHostsItemidResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -16809,15 +16809,15 @@ func ParseDeleteFleetServerHostResponse(rsp *http.Response) (*DeleteFleetServerH return response, nil } -// ParseGetFleetServerHostResponse parses an HTTP response from a GetFleetServerHostWithResponse call -func ParseGetFleetServerHostResponse(rsp *http.Response) (*GetFleetServerHostResponse, error) { +// ParseGetFleetFleetServerHostsItemidResponse parses an HTTP response from a GetFleetFleetServerHostsItemidWithResponse call +func ParseGetFleetFleetServerHostsItemidResponse(rsp *http.Response) (*GetFleetFleetServerHostsItemidResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetFleetServerHostResponse{ + response := &GetFleetFleetServerHostsItemidResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -16848,15 +16848,15 @@ func ParseGetFleetServerHostResponse(rsp *http.Response) (*GetFleetServerHostRes return response, nil } -// ParseUpdateFleetServerHostResponse parses an HTTP response from a UpdateFleetServerHostWithResponse call -func ParseUpdateFleetServerHostResponse(rsp *http.Response) (*UpdateFleetServerHostResponse, error) { +// ParsePutFleetFleetServerHostsItemidResponse parses an HTTP response from a PutFleetFleetServerHostsItemidWithResponse call +func ParsePutFleetFleetServerHostsItemidResponse(rsp *http.Response) (*PutFleetFleetServerHostsItemidResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &UpdateFleetServerHostResponse{ + response := &PutFleetFleetServerHostsItemidResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -16887,15 +16887,15 @@ func ParseUpdateFleetServerHostResponse(rsp *http.Response) (*UpdateFleetServerH return response, nil } -// ParseGetOutputsResponse parses an HTTP response from a GetOutputsWithResponse call -func ParseGetOutputsResponse(rsp *http.Response) (*GetOutputsResponse, error) { +// ParseGetFleetOutputsResponse parses an HTTP response from a GetFleetOutputsWithResponse call +func ParseGetFleetOutputsResponse(rsp *http.Response) (*GetFleetOutputsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetOutputsResponse{ + response := &GetFleetOutputsResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -16929,15 +16929,15 @@ func ParseGetOutputsResponse(rsp *http.Response) (*GetOutputsResponse, error) { return response, nil } -// ParseCreateOutputResponse parses an HTTP response from a CreateOutputWithResponse call -func ParseCreateOutputResponse(rsp *http.Response) (*CreateOutputResponse, error) { +// ParsePostFleetOutputsResponse parses an HTTP response from a PostFleetOutputsWithResponse call +func ParsePostFleetOutputsResponse(rsp *http.Response) (*PostFleetOutputsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &CreateOutputResponse{ + response := &PostFleetOutputsResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -16968,15 +16968,15 @@ func ParseCreateOutputResponse(rsp *http.Response) (*CreateOutputResponse, error return response, nil } -// ParseDeleteOutputResponse parses an HTTP response from a DeleteOutputWithResponse call -func ParseDeleteOutputResponse(rsp *http.Response) (*DeleteOutputResponse, error) { +// ParseDeleteFleetOutputsOutputidResponse parses an HTTP response from a DeleteFleetOutputsOutputidWithResponse call +func ParseDeleteFleetOutputsOutputidResponse(rsp *http.Response) (*DeleteFleetOutputsOutputidResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &DeleteOutputResponse{ + response := &DeleteFleetOutputsOutputidResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -17018,15 +17018,15 @@ func ParseDeleteOutputResponse(rsp *http.Response) (*DeleteOutputResponse, error return response, nil } -// ParseGetOutputResponse parses an HTTP response from a GetOutputWithResponse call -func ParseGetOutputResponse(rsp *http.Response) (*GetOutputResponse, error) { +// ParseGetFleetOutputsOutputidResponse parses an HTTP response from a GetFleetOutputsOutputidWithResponse call +func ParseGetFleetOutputsOutputidResponse(rsp *http.Response) (*GetFleetOutputsOutputidResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetOutputResponse{ + response := &GetFleetOutputsOutputidResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -17057,15 +17057,15 @@ func ParseGetOutputResponse(rsp *http.Response) (*GetOutputResponse, error) { return response, nil } -// ParseUpdateOutputResponse parses an HTTP response from a UpdateOutputWithResponse call -func ParseUpdateOutputResponse(rsp *http.Response) (*UpdateOutputResponse, error) { +// ParsePutFleetOutputsOutputidResponse parses an HTTP response from a PutFleetOutputsOutputidWithResponse call +func ParsePutFleetOutputsOutputidResponse(rsp *http.Response) (*PutFleetOutputsOutputidResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &UpdateOutputResponse{ + response := &PutFleetOutputsOutputidResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -17096,15 +17096,15 @@ func ParseUpdateOutputResponse(rsp *http.Response) (*UpdateOutputResponse, error return response, nil } -// ParseGetPackagePoliciesResponse parses an HTTP response from a GetPackagePoliciesWithResponse call -func ParseGetPackagePoliciesResponse(rsp *http.Response) (*GetPackagePoliciesResponse, error) { +// ParseGetFleetPackagePoliciesResponse parses an HTTP response from a GetFleetPackagePoliciesWithResponse call +func ParseGetFleetPackagePoliciesResponse(rsp *http.Response) (*GetFleetPackagePoliciesResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetPackagePoliciesResponse{ + response := &GetFleetPackagePoliciesResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -17138,15 +17138,15 @@ func ParseGetPackagePoliciesResponse(rsp *http.Response) (*GetPackagePoliciesRes return response, nil } -// ParseCreatePackagePolicyResponse parses an HTTP response from a CreatePackagePolicyWithResponse call -func ParseCreatePackagePolicyResponse(rsp *http.Response) (*CreatePackagePolicyResponse, error) { +// ParsePostFleetPackagePoliciesResponse parses an HTTP response from a PostFleetPackagePoliciesWithResponse call +func ParsePostFleetPackagePoliciesResponse(rsp *http.Response) (*PostFleetPackagePoliciesResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &CreatePackagePolicyResponse{ + response := &PostFleetPackagePoliciesResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -17188,15 +17188,15 @@ func ParseCreatePackagePolicyResponse(rsp *http.Response) (*CreatePackagePolicyR return response, nil } -// ParseDeletePackagePolicyResponse parses an HTTP response from a DeletePackagePolicyWithResponse call -func ParseDeletePackagePolicyResponse(rsp *http.Response) (*DeletePackagePolicyResponse, error) { +// ParseDeleteFleetPackagePoliciesPackagepolicyidResponse parses an HTTP response from a DeleteFleetPackagePoliciesPackagepolicyidWithResponse call +func ParseDeleteFleetPackagePoliciesPackagepolicyidResponse(rsp *http.Response) (*DeleteFleetPackagePoliciesPackagepolicyidResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &DeletePackagePolicyResponse{ + response := &DeleteFleetPackagePoliciesPackagepolicyidResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -17227,15 +17227,15 @@ func ParseDeletePackagePolicyResponse(rsp *http.Response) (*DeletePackagePolicyR return response, nil } -// ParseGetPackagePolicyResponse parses an HTTP response from a GetPackagePolicyWithResponse call -func ParseGetPackagePolicyResponse(rsp *http.Response) (*GetPackagePolicyResponse, error) { +// ParseGetFleetPackagePoliciesPackagepolicyidResponse parses an HTTP response from a GetFleetPackagePoliciesPackagepolicyidWithResponse call +func ParseGetFleetPackagePoliciesPackagepolicyidResponse(rsp *http.Response) (*GetFleetPackagePoliciesPackagepolicyidResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetPackagePolicyResponse{ + response := &GetFleetPackagePoliciesPackagepolicyidResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -17275,15 +17275,15 @@ func ParseGetPackagePolicyResponse(rsp *http.Response) (*GetPackagePolicyRespons return response, nil } -// ParseUpdatePackagePolicyResponse parses an HTTP response from a UpdatePackagePolicyWithResponse call -func ParseUpdatePackagePolicyResponse(rsp *http.Response) (*UpdatePackagePolicyResponse, error) { +// ParsePutFleetPackagePoliciesPackagepolicyidResponse parses an HTTP response from a PutFleetPackagePoliciesPackagepolicyidWithResponse call +func ParsePutFleetPackagePoliciesPackagepolicyidResponse(rsp *http.Response) (*PutFleetPackagePoliciesPackagepolicyidResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &UpdatePackagePolicyResponse{ + response := &PutFleetPackagePoliciesPackagepolicyidResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -17325,15 +17325,15 @@ func ParseUpdatePackagePolicyResponse(rsp *http.Response) (*UpdatePackagePolicyR return response, nil } -// ParseGetDataViewsResponse parses an HTTP response from a GetDataViewsWithResponse call -func ParseGetDataViewsResponse(rsp *http.Response) (*GetDataViewsResponse, error) { +// ParseGetAllDataViewsDefaultResponse parses an HTTP response from a GetAllDataViewsDefaultWithResponse call +func ParseGetAllDataViewsDefaultResponse(rsp *http.Response) (*GetAllDataViewsDefaultResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetDataViewsResponse{ + response := &GetAllDataViewsDefaultResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -17360,15 +17360,15 @@ func ParseGetDataViewsResponse(rsp *http.Response) (*GetDataViewsResponse, error return response, nil } -// ParseCreateDataViewResponse parses an HTTP response from a CreateDataViewWithResponse call -func ParseCreateDataViewResponse(rsp *http.Response) (*CreateDataViewResponse, error) { +// ParseCreateDataViewDefaultwResponse parses an HTTP response from a CreateDataViewDefaultwWithResponse call +func ParseCreateDataViewDefaultwResponse(rsp *http.Response) (*CreateDataViewDefaultwResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &CreateDataViewResponse{ + response := &CreateDataViewDefaultwResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -17393,15 +17393,15 @@ func ParseCreateDataViewResponse(rsp *http.Response) (*CreateDataViewResponse, e return response, nil } -// ParseDeleteDataViewResponse parses an HTTP response from a DeleteDataViewWithResponse call -func ParseDeleteDataViewResponse(rsp *http.Response) (*DeleteDataViewResponse, error) { +// ParseDeleteDataViewDefaultResponse parses an HTTP response from a DeleteDataViewDefaultWithResponse call +func ParseDeleteDataViewDefaultResponse(rsp *http.Response) (*DeleteDataViewDefaultResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &DeleteDataViewResponse{ + response := &DeleteDataViewDefaultResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -17419,15 +17419,15 @@ func ParseDeleteDataViewResponse(rsp *http.Response) (*DeleteDataViewResponse, e return response, nil } -// ParseGetDataViewResponse parses an HTTP response from a GetDataViewWithResponse call -func ParseGetDataViewResponse(rsp *http.Response) (*GetDataViewResponse, error) { +// ParseGetDataViewDefaultResponse parses an HTTP response from a GetDataViewDefaultWithResponse call +func ParseGetDataViewDefaultResponse(rsp *http.Response) (*GetDataViewDefaultResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetDataViewResponse{ + response := &GetDataViewDefaultResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -17452,15 +17452,15 @@ func ParseGetDataViewResponse(rsp *http.Response) (*GetDataViewResponse, error) return response, nil } -// ParseUpdateDataViewResponse parses an HTTP response from a UpdateDataViewWithResponse call -func ParseUpdateDataViewResponse(rsp *http.Response) (*UpdateDataViewResponse, error) { +// ParseUpdateDataViewDefaultResponse parses an HTTP response from a UpdateDataViewDefaultWithResponse call +func ParseUpdateDataViewDefaultResponse(rsp *http.Response) (*UpdateDataViewDefaultResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &UpdateDataViewResponse{ + response := &UpdateDataViewDefaultResponse{ Body: bodyBytes, HTTPResponse: rsp, } diff --git a/generated/kibana/transform_schema.go b/generated/kibana/transform_schema.go index 5daad8653..1bf32292d 100644 --- a/generated/kibana/transform_schema.go +++ b/generated/kibana/transform_schema.go @@ -542,7 +542,6 @@ var transformers = []TransformFunc{ transformRemoveKbnXsrf, transformRemoveApiVersionParam, transformSimplifyContentType, - transformOperationIDs, transformAddMisingDescriptions, transformKibanaPaths, transformFleetPaths, @@ -691,82 +690,6 @@ func transformSimplifyContentType(schema *Schema) { } } -// transformOperationIDs fixes each path's operationId. -func transformOperationIDs(schema *Schema) { - operationIds := map[string]map[string]string{ - "/api/data_views": { - "get": "get_data_views", - }, - "/api/data_views/data_view": { - "post": "create_data_view", - }, - "/api/data_views/data_view/{viewId}": { - "get": "get_data_view", - "post": "update_data_view", - "delete": "delete_data_view", - }, - "/api/fleet/agent_policies": { - "get": "get_agent_policies", - "post": "create_agent_policy", - }, - "/api/fleet/agent_policies/delete": { - "post": "delete_agent_policy", - }, - "/api/fleet/agent_policies/{agentPolicyId}": { - "get": "get_agent_policy", - "put": "update_agent_policy", - }, - "/api/fleet/enrollment_api_keys": { - "get": "get_enrollment_api_keys", - }, - "/api/fleet/epm/packages": { - "get": "list_packages", - "post": "install_package_by_upload", - }, - "/api/fleet/epm/packages/{pkgName}/{pkgVersion}": { - "get": "get_package", - "post": "install_package", - "delete": "delete_package", - }, - "/api/fleet/fleet_server_hosts": { - "get": "get_fleet_server_hosts", - "post": "create_fleet_server_host", - }, - "/api/fleet/fleet_server_hosts/{itemId}": { - "get": "get_fleet_server_host", - "put": "update_fleet_server_host", - "delete": "delete_fleet_server_host", - }, - "/api/fleet/outputs": { - "get": "get_outputs", - "post": "create_output", - }, - "/api/fleet/outputs/{outputId}": { - "get": "get_output", - "put": "update_output", - "delete": "delete_output", - }, - "/api/fleet/package_policies": { - "get": "get_package_policies", - "post": "create_package_policy", - }, - "/api/fleet/package_policies/{packagePolicyId}": { - "get": "get_package_policy", - "put": "update_package_policy", - "delete": "delete_package_policy", - }, - } - - // Set each missing operationId - for path, methods := range operationIds { - pathInfo := schema.MustGetPath(path) - for method, operationId := range methods { - endpoint := pathInfo.GetEndpoint(method) - endpoint.Set("operationId", operationId) - } - } -} - // transformAddMisingDescriptions adds descriptions to each path missing one. func transformAddMisingDescriptions(schema *Schema) { for _, pathInfo := range schema.Paths { diff --git a/internal/clients/fleet/fleet.go b/internal/clients/fleet/fleet.go index fc2bb2ba2..edaef837b 100644 --- a/internal/clients/fleet/fleet.go +++ b/internal/clients/fleet/fleet.go @@ -17,7 +17,7 @@ var ( // GetEnrollmentTokens reads all enrollment tokens from the API. func GetEnrollmentTokens(ctx context.Context, client *Client) ([]kbapi.EnrollmentApiKey, diag.Diagnostics) { - resp, err := client.API.GetEnrollmentApiKeysWithResponse(ctx, nil) + resp, err := client.API.GetFleetEnrollmentApiKeysWithResponse(ctx, nil) if err != nil { return nil, utils.FrameworkDiagFromError(err) } @@ -32,11 +32,11 @@ func GetEnrollmentTokens(ctx context.Context, client *Client) ([]kbapi.Enrollmen // GetEnrollmentTokensByPolicy Get enrollment tokens by given policy ID. func GetEnrollmentTokensByPolicy(ctx context.Context, client *Client, policyID string) ([]kbapi.EnrollmentApiKey, diag.Diagnostics) { - params := kbapi.GetEnrollmentApiKeysParams{ + params := kbapi.GetFleetEnrollmentApiKeysParams{ Kuery: utils.Pointer("policy_id:" + policyID), } - resp, err := client.API.GetEnrollmentApiKeysWithResponse(ctx, ¶ms) + resp, err := client.API.GetFleetEnrollmentApiKeysWithResponse(ctx, ¶ms) if err != nil { return nil, utils.FrameworkDiagFromError(err) } @@ -51,7 +51,7 @@ func GetEnrollmentTokensByPolicy(ctx context.Context, client *Client, policyID s // GetAgentPolicy reads a specific agent policy from the API. func GetAgentPolicy(ctx context.Context, client *Client, id string) (*kbapi.AgentPolicy, diag.Diagnostics) { - resp, err := client.API.GetAgentPolicyWithResponse(ctx, id, nil) + resp, err := client.API.GetFleetAgentPoliciesAgentpolicyidWithResponse(ctx, id, nil) if err != nil { return nil, utils.FrameworkDiagFromError(err) } @@ -67,12 +67,12 @@ func GetAgentPolicy(ctx context.Context, client *Client, id string) (*kbapi.Agen } // CreateAgentPolicy creates a new agent policy. -func CreateAgentPolicy(ctx context.Context, client *Client, req kbapi.CreateAgentPolicyJSONRequestBody, sysMonitoring bool) (*kbapi.AgentPolicy, diag.Diagnostics) { - params := kbapi.CreateAgentPolicyParams{ +func CreateAgentPolicy(ctx context.Context, client *Client, req kbapi.PostFleetAgentPoliciesJSONRequestBody, sysMonitoring bool) (*kbapi.AgentPolicy, diag.Diagnostics) { + params := kbapi.PostFleetAgentPoliciesParams{ SysMonitoring: utils.Pointer(sysMonitoring), } - resp, err := client.API.CreateAgentPolicyWithResponse(ctx, ¶ms, req) + resp, err := client.API.PostFleetAgentPoliciesWithResponse(ctx, ¶ms, req) if err != nil { return nil, utils.FrameworkDiagFromError(err) } @@ -86,8 +86,8 @@ func CreateAgentPolicy(ctx context.Context, client *Client, req kbapi.CreateAgen } // UpdateAgentPolicy updates an existing agent policy. -func UpdateAgentPolicy(ctx context.Context, client *Client, id string, req kbapi.UpdateAgentPolicyJSONRequestBody) (*kbapi.AgentPolicy, diag.Diagnostics) { - resp, err := client.API.UpdateAgentPolicyWithResponse(ctx, id, nil, req) +func UpdateAgentPolicy(ctx context.Context, client *Client, id string, req kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody) (*kbapi.AgentPolicy, diag.Diagnostics) { + resp, err := client.API.PutFleetAgentPoliciesAgentpolicyidWithResponse(ctx, id, nil, req) if err != nil { return nil, utils.FrameworkDiagFromError(err) } @@ -102,11 +102,11 @@ func UpdateAgentPolicy(ctx context.Context, client *Client, id string, req kbapi // DeleteAgentPolicy deletes an existing agent policy. func DeleteAgentPolicy(ctx context.Context, client *Client, id string) diag.Diagnostics { - body := kbapi.DeleteAgentPolicyJSONRequestBody{ + body := kbapi.PostFleetAgentPoliciesDeleteJSONRequestBody{ AgentPolicyId: id, } - resp, err := client.API.DeleteAgentPolicyWithResponse(ctx, body) + resp, err := client.API.PostFleetAgentPoliciesDeleteWithResponse(ctx, body) if err != nil { return utils.FrameworkDiagFromError(err) } @@ -123,7 +123,7 @@ func DeleteAgentPolicy(ctx context.Context, client *Client, id string) diag.Diag // GetOutput reads a specific output from the API. func GetOutput(ctx context.Context, client *Client, id string) (*kbapi.OutputUnion, diag.Diagnostics) { - resp, err := client.API.GetOutputWithResponse(ctx, id) + resp, err := client.API.GetFleetOutputsOutputidWithResponse(ctx, id) if err != nil { return nil, utils.FrameworkDiagFromError(err) } @@ -140,7 +140,7 @@ func GetOutput(ctx context.Context, client *Client, id string) (*kbapi.OutputUni // CreateOutput creates a new output. func CreateOutput(ctx context.Context, client *Client, req kbapi.NewOutputUnion) (*kbapi.OutputUnion, diag.Diagnostics) { - resp, err := client.API.CreateOutputWithResponse(ctx, req) + resp, err := client.API.PostFleetOutputsWithResponse(ctx, req) if err != nil { return nil, utils.FrameworkDiagFromError(err) } @@ -155,7 +155,7 @@ func CreateOutput(ctx context.Context, client *Client, req kbapi.NewOutputUnion) // UpdateOutput updates an existing output. func UpdateOutput(ctx context.Context, client *Client, id string, req kbapi.UpdateOutputUnion) (*kbapi.OutputUnion, diag.Diagnostics) { - resp, err := client.API.UpdateOutputWithResponse(ctx, id, req) + resp, err := client.API.PutFleetOutputsOutputidWithResponse(ctx, id, req) if err != nil { return nil, utils.FrameworkDiagFromError(err) } @@ -170,7 +170,7 @@ func UpdateOutput(ctx context.Context, client *Client, id string, req kbapi.Upda // DeleteOutput deletes an existing output. func DeleteOutput(ctx context.Context, client *Client, id string) diag.Diagnostics { - resp, err := client.API.DeleteOutputWithResponse(ctx, id) + resp, err := client.API.DeleteFleetOutputsOutputidWithResponse(ctx, id) if err != nil { return utils.FrameworkDiagFromError(err) } @@ -187,7 +187,7 @@ func DeleteOutput(ctx context.Context, client *Client, id string) diag.Diagnosti // GetFleetServerHost reads a specific fleet server host from the API. func GetFleetServerHost(ctx context.Context, client *Client, id string) (*kbapi.ServerHost, diag.Diagnostics) { - resp, err := client.API.GetFleetServerHostWithResponse(ctx, id) + resp, err := client.API.GetFleetFleetServerHostsItemidWithResponse(ctx, id) if err != nil { return nil, utils.FrameworkDiagFromError(err) } @@ -203,8 +203,8 @@ func GetFleetServerHost(ctx context.Context, client *Client, id string) (*kbapi. } // CreateFleetServerHost creates a new fleet server host. -func CreateFleetServerHost(ctx context.Context, client *Client, req kbapi.CreateFleetServerHostJSONRequestBody) (*kbapi.ServerHost, diag.Diagnostics) { - resp, err := client.API.CreateFleetServerHostWithResponse(ctx, req) +func CreateFleetServerHost(ctx context.Context, client *Client, req kbapi.PostFleetFleetServerHostsJSONRequestBody) (*kbapi.ServerHost, diag.Diagnostics) { + resp, err := client.API.PostFleetFleetServerHostsWithResponse(ctx, req) if err != nil { return nil, utils.FrameworkDiagFromError(err) } @@ -218,8 +218,8 @@ func CreateFleetServerHost(ctx context.Context, client *Client, req kbapi.Create } // UpdateFleetServerHost updates an existing fleet server host. -func UpdateFleetServerHost(ctx context.Context, client *Client, id string, req kbapi.UpdateFleetServerHostJSONRequestBody) (*kbapi.ServerHost, diag.Diagnostics) { - resp, err := client.API.UpdateFleetServerHostWithResponse(ctx, id, req) +func UpdateFleetServerHost(ctx context.Context, client *Client, id string, req kbapi.PutFleetFleetServerHostsItemidJSONRequestBody) (*kbapi.ServerHost, diag.Diagnostics) { + resp, err := client.API.PutFleetFleetServerHostsItemidWithResponse(ctx, id, req) if err != nil { return nil, utils.FrameworkDiagFromError(err) } @@ -234,7 +234,7 @@ func UpdateFleetServerHost(ctx context.Context, client *Client, id string, req k // DeleteFleetServerHost deletes an existing fleet server host. func DeleteFleetServerHost(ctx context.Context, client *Client, id string) diag.Diagnostics { - resp, err := client.API.DeleteFleetServerHostWithResponse(ctx, id) + resp, err := client.API.DeleteFleetFleetServerHostsItemidWithResponse(ctx, id) if err != nil { return utils.FrameworkDiagFromError(err) } @@ -251,11 +251,11 @@ func DeleteFleetServerHost(ctx context.Context, client *Client, id string) diag. // GetPackagePolicy reads a specific package policy from the API. func GetPackagePolicy(ctx context.Context, client *Client, id string) (*kbapi.PackagePolicy, diag.Diagnostics) { - params := kbapi.GetPackagePolicyParams{ - Format: utils.Pointer(kbapi.GetPackagePolicyParamsFormatSimplified), + params := kbapi.GetFleetPackagePoliciesPackagepolicyidParams{ + Format: utils.Pointer(kbapi.GetFleetPackagePoliciesPackagepolicyidParamsFormatSimplified), } - resp, err := client.API.GetPackagePolicyWithResponse(ctx, id, ¶ms) + resp, err := client.API.GetFleetPackagePoliciesPackagepolicyidWithResponse(ctx, id, ¶ms) if err != nil { return nil, utils.FrameworkDiagFromError(err) } @@ -271,12 +271,12 @@ func GetPackagePolicy(ctx context.Context, client *Client, id string) (*kbapi.Pa } // CreatePackagePolicy creates a new package policy. -func CreatePackagePolicy(ctx context.Context, client *Client, req kbapi.CreatePackagePolicyJSONRequestBody) (*kbapi.PackagePolicy, diag.Diagnostics) { - params := kbapi.CreatePackagePolicyParams{ - Format: utils.Pointer(kbapi.CreatePackagePolicyParamsFormatSimplified), +func CreatePackagePolicy(ctx context.Context, client *Client, req kbapi.PackagePolicyRequest) (*kbapi.PackagePolicy, diag.Diagnostics) { + params := kbapi.PostFleetPackagePoliciesParams{ + Format: utils.Pointer(kbapi.PostFleetPackagePoliciesParamsFormatSimplified), } - resp, err := client.API.CreatePackagePolicyWithResponse(ctx, ¶ms, req) + resp, err := client.API.PostFleetPackagePoliciesWithResponse(ctx, ¶ms, req) if err != nil { return nil, utils.FrameworkDiagFromError(err) } @@ -290,12 +290,12 @@ func CreatePackagePolicy(ctx context.Context, client *Client, req kbapi.CreatePa } // UpdatePackagePolicy updates an existing package policy. -func UpdatePackagePolicy(ctx context.Context, client *Client, id string, req kbapi.UpdatePackagePolicyJSONRequestBody) (*kbapi.PackagePolicy, diag.Diagnostics) { - params := kbapi.UpdatePackagePolicyParams{ +func UpdatePackagePolicy(ctx context.Context, client *Client, id string, req kbapi.PackagePolicyRequest) (*kbapi.PackagePolicy, diag.Diagnostics) { + params := kbapi.PutFleetPackagePoliciesPackagepolicyidParams{ Format: utils.Pointer(kbapi.Simplified), } - resp, err := client.API.UpdatePackagePolicyWithResponse(ctx, id, ¶ms, req) + resp, err := client.API.PutFleetPackagePoliciesPackagepolicyidWithResponse(ctx, id, ¶ms, req) if err != nil { return nil, utils.FrameworkDiagFromError(err) } @@ -310,11 +310,11 @@ func UpdatePackagePolicy(ctx context.Context, client *Client, id string, req kba // DeletePackagePolicy deletes an existing package policy. func DeletePackagePolicy(ctx context.Context, client *Client, id string, force bool) diag.Diagnostics { - params := kbapi.DeletePackagePolicyParams{ + params := kbapi.DeleteFleetPackagePoliciesPackagepolicyidParams{ Force: &force, } - resp, err := client.API.DeletePackagePolicyWithResponse(ctx, id, ¶ms) + resp, err := client.API.DeleteFleetPackagePoliciesPackagepolicyidWithResponse(ctx, id, ¶ms) if err != nil { return utils.FrameworkDiagFromError(err) } @@ -331,9 +331,9 @@ func DeletePackagePolicy(ctx context.Context, client *Client, id string, force b // GetPackage reads a specific package from the API. func GetPackage(ctx context.Context, client *Client, name, version string) (*kbapi.PackageInfo, diag.Diagnostics) { - params := kbapi.GetPackageParams{} + params := kbapi.GetFleetEpmPackagesPkgnamePkgversionParams{} - resp, err := client.API.GetPackageWithResponse(ctx, name, version, ¶ms) + resp, err := client.API.GetFleetEpmPackagesPkgnamePkgversionWithResponse(ctx, name, version, ¶ms) if err != nil { return nil, utils.FrameworkDiagFromError(err) } @@ -350,12 +350,12 @@ func GetPackage(ctx context.Context, client *Client, name, version string) (*kba // InstallPackage installs a package. func InstallPackage(ctx context.Context, client *Client, name, version string, force bool) diag.Diagnostics { - params := kbapi.InstallPackageParams{} - body := kbapi.InstallPackageJSONRequestBody{ + params := kbapi.PostFleetEpmPackagesPkgnamePkgversionParams{} + body := kbapi.PostFleetEpmPackagesPkgnamePkgversionJSONRequestBody{ Force: &force, } - resp, err := client.API.InstallPackageWithResponse(ctx, name, version, ¶ms, body) + resp, err := client.API.PostFleetEpmPackagesPkgnamePkgversionWithResponse(ctx, name, version, ¶ms, body) if err != nil { return utils.FrameworkDiagFromError(err) } @@ -370,11 +370,11 @@ func InstallPackage(ctx context.Context, client *Client, name, version string, f // Uninstall uninstalls a package. func Uninstall(ctx context.Context, client *Client, name, version string, force bool) diag.Diagnostics { - body := kbapi.DeletePackageJSONRequestBody{ + body := kbapi.DeleteFleetEpmPackagesPkgnamePkgversionJSONRequestBody{ Force: force, } - resp, err := client.API.DeletePackageWithResponse(ctx, name, version, nil, body) + resp, err := client.API.DeleteFleetEpmPackagesPkgnamePkgversionWithResponse(ctx, name, version, nil, body) if err != nil { return utils.FrameworkDiagFromError(err) } @@ -398,11 +398,11 @@ func Uninstall(ctx context.Context, client *Client, name, version string, force // GetPackages returns information about the latest packages known to Fleet. func GetPackages(ctx context.Context, client *Client, prerelease bool) ([]kbapi.PackageListItem, diag.Diagnostics) { - params := kbapi.ListPackagesParams{ + params := kbapi.GetFleetEpmPackagesParams{ Prerelease: &prerelease, } - resp, err := client.API.ListPackagesWithResponse(ctx, ¶ms) + resp, err := client.API.GetFleetEpmPackagesWithResponse(ctx, ¶ms) if err != nil { return nil, utils.FrameworkDiagFromError(err) } diff --git a/internal/clients/kibana2/data_views.go b/internal/clients/kibana2/data_views.go index c81ac68e9..4ee9d5e52 100644 --- a/internal/clients/kibana2/data_views.go +++ b/internal/clients/kibana2/data_views.go @@ -11,7 +11,7 @@ import ( // GetDataViews reads all data views from the API. func GetDataViews(ctx context.Context, client *Client, spaceID string) ([]kbapi.GetDataViewsResponseItem, diag.Diagnostics) { - resp, err := client.API.GetDataViewsWithResponse(ctx, spaceID) + resp, err := client.API.GetAllDataViewsDefaultWithResponse(ctx, spaceID) if err != nil { return nil, utils.FrameworkDiagFromError(err) } @@ -26,7 +26,7 @@ func GetDataViews(ctx context.Context, client *Client, spaceID string) ([]kbapi. // GetDataView reads a specific data view from the API. func GetDataView(ctx context.Context, client *Client, spaceID string, viewID string) (*kbapi.DataViewsDataViewResponseObject, diag.Diagnostics) { - resp, err := client.API.GetDataViewWithResponse(ctx, spaceID, viewID) + resp, err := client.API.GetDataViewDefaultWithResponse(ctx, spaceID, viewID) if err != nil { return nil, utils.FrameworkDiagFromError(err) } @@ -42,8 +42,8 @@ func GetDataView(ctx context.Context, client *Client, spaceID string, viewID str } // CreateDataView creates a new data view. -func CreateDataView(ctx context.Context, client *Client, spaceID string, req kbapi.CreateDataViewJSONRequestBody) (*kbapi.DataViewsDataViewResponseObject, diag.Diagnostics) { - resp, err := client.API.CreateDataViewWithResponse(ctx, spaceID, req) +func CreateDataView(ctx context.Context, client *Client, spaceID string, req kbapi.DataViewsCreateDataViewRequestObject) (*kbapi.DataViewsDataViewResponseObject, diag.Diagnostics) { + resp, err := client.API.CreateDataViewDefaultwWithResponse(ctx, spaceID, req) if err != nil { return nil, utils.FrameworkDiagFromError(err) } @@ -57,8 +57,8 @@ func CreateDataView(ctx context.Context, client *Client, spaceID string, req kba } // UpdateDataView updates an existing data view. -func UpdateDataView(ctx context.Context, client *Client, spaceID string, viewID string, req kbapi.UpdateDataViewJSONRequestBody) (*kbapi.DataViewsDataViewResponseObject, diag.Diagnostics) { - resp, err := client.API.UpdateDataViewWithResponse(ctx, spaceID, viewID, req) +func UpdateDataView(ctx context.Context, client *Client, spaceID string, viewID string, req kbapi.DataViewsUpdateDataViewRequestObject) (*kbapi.DataViewsDataViewResponseObject, diag.Diagnostics) { + resp, err := client.API.UpdateDataViewDefaultWithResponse(ctx, spaceID, viewID, req) if err != nil { return nil, utils.FrameworkDiagFromError(err) } @@ -73,7 +73,7 @@ func UpdateDataView(ctx context.Context, client *Client, spaceID string, viewID // DeleteDataView deletes an existing data view. func DeleteDataView(ctx context.Context, client *Client, spaceID string, viewID string) diag.Diagnostics { - resp, err := client.API.DeleteDataViewWithResponse(ctx, spaceID, viewID) + resp, err := client.API.DeleteDataViewDefaultWithResponse(ctx, spaceID, viewID) if err != nil { return utils.FrameworkDiagFromError(err) } diff --git a/internal/fleet/agent_policy/models.go b/internal/fleet/agent_policy/models.go index 3e1018d5e..7acc8390f 100644 --- a/internal/fleet/agent_policy/models.go +++ b/internal/fleet/agent_policy/models.go @@ -56,16 +56,16 @@ func (model *agentPolicyModel) populateFromAPI(data *kbapi.AgentPolicy) { model.Namespace = types.StringValue(data.Namespace) } -func (model agentPolicyModel) toAPICreateModel() kbapi.CreateAgentPolicyJSONRequestBody { - monitoring := make([]kbapi.CreateAgentPolicyJSONBodyMonitoringEnabled, 0, 2) +func (model agentPolicyModel) toAPICreateModel() kbapi.PostFleetAgentPoliciesJSONRequestBody { + monitoring := make([]kbapi.PostFleetAgentPoliciesJSONBodyMonitoringEnabled, 0, 2) if model.MonitorLogs.ValueBool() { - monitoring = append(monitoring, kbapi.CreateAgentPolicyJSONBodyMonitoringEnabledLogs) + monitoring = append(monitoring, kbapi.PostFleetAgentPoliciesJSONBodyMonitoringEnabledLogs) } if model.MonitorMetrics.ValueBool() { - monitoring = append(monitoring, kbapi.CreateAgentPolicyJSONBodyMonitoringEnabledMetrics) + monitoring = append(monitoring, kbapi.PostFleetAgentPoliciesJSONBodyMonitoringEnabledMetrics) } - body := kbapi.CreateAgentPolicyJSONRequestBody{ + body := kbapi.PostFleetAgentPoliciesJSONRequestBody{ DataOutputId: model.DataOutputId.ValueStringPointer(), Description: model.Description.ValueStringPointer(), DownloadSourceId: model.DownloadSourceId.ValueStringPointer(), @@ -80,8 +80,8 @@ func (model agentPolicyModel) toAPICreateModel() kbapi.CreateAgentPolicyJSONRequ return body } -func (model agentPolicyModel) toAPIUpdateModel() kbapi.UpdateAgentPolicyJSONRequestBody { - monitoring := make([]kbapi.UpdateAgentPolicyJSONBodyMonitoringEnabled, 0, 2) +func (model agentPolicyModel) toAPIUpdateModel() kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody { + monitoring := make([]kbapi.PutFleetAgentPoliciesAgentpolicyidJSONBodyMonitoringEnabled, 0, 2) if model.MonitorLogs.ValueBool() { monitoring = append(monitoring, kbapi.Logs) } @@ -89,7 +89,7 @@ func (model agentPolicyModel) toAPIUpdateModel() kbapi.UpdateAgentPolicyJSONRequ monitoring = append(monitoring, kbapi.Metrics) } - body := kbapi.UpdateAgentPolicyJSONRequestBody{ + body := kbapi.PutFleetAgentPoliciesAgentpolicyidJSONRequestBody{ DataOutputId: model.DataOutputId.ValueStringPointer(), Description: model.Description.ValueStringPointer(), DownloadSourceId: model.DownloadSourceId.ValueStringPointer(), diff --git a/internal/fleet/server_host/models.go b/internal/fleet/server_host/models.go index 171af5da2..d17bd314a 100644 --- a/internal/fleet/server_host/models.go +++ b/internal/fleet/server_host/models.go @@ -32,8 +32,8 @@ func (model *serverHostModel) populateFromAPI(ctx context.Context, data *kbapi.S return } -func (model serverHostModel) toAPICreateModel(ctx context.Context) (body kbapi.CreateFleetServerHostJSONRequestBody, diags diag.Diagnostics) { - body = kbapi.CreateFleetServerHostJSONRequestBody{ +func (model serverHostModel) toAPICreateModel(ctx context.Context) (body kbapi.PostFleetFleetServerHostsJSONRequestBody, diags diag.Diagnostics) { + body = kbapi.PostFleetFleetServerHostsJSONRequestBody{ HostUrls: utils.ListTypeToSlice_String(ctx, model.Hosts, path.Root("hosts"), &diags), Id: model.HostID.ValueStringPointer(), IsDefault: model.Default.ValueBoolPointer(), @@ -42,8 +42,8 @@ func (model serverHostModel) toAPICreateModel(ctx context.Context) (body kbapi.C return } -func (model serverHostModel) toAPIUpdateModel(ctx context.Context) (body kbapi.UpdateFleetServerHostJSONRequestBody, diags diag.Diagnostics) { - body = kbapi.UpdateFleetServerHostJSONRequestBody{ +func (model serverHostModel) toAPIUpdateModel(ctx context.Context) (body kbapi.PutFleetFleetServerHostsItemidJSONRequestBody, diags diag.Diagnostics) { + body = kbapi.PutFleetFleetServerHostsItemidJSONRequestBody{ HostUrls: utils.SliceRef(utils.ListTypeToSlice_String(ctx, model.Hosts, path.Root("hosts"), &diags)), IsDefault: model.Default.ValueBoolPointer(), Name: model.Name.ValueStringPointer(), From 760333d907bcd9969a3f0271813736727b34ac93 Mon Sep 17 00:00:00 2001 From: Raymond Lynch Date: Tue, 12 Nov 2024 10:53:42 -0500 Subject: [PATCH 12/15] Fresh copy of the OAS docs --- generated/kibana/kibana.gen.go | 792 ++------------------------------ internal/clients/fleet/fleet.go | 6 +- 2 files changed, 31 insertions(+), 767 deletions(-) diff --git a/generated/kibana/kibana.gen.go b/generated/kibana/kibana.gen.go index 0af2931c7..b4f26a027 100644 --- a/generated/kibana/kibana.gen.go +++ b/generated/kibana/kibana.gen.go @@ -103,13 +103,6 @@ const ( NewOutputKafkaSaslMechanismSCRAMSHA512 NewOutputKafkaSaslMechanism = "SCRAM-SHA-512" ) -// Defines values for NewOutputKafkaTopicsWhenType. -const ( - NewOutputKafkaTopicsWhenTypeContains NewOutputKafkaTopicsWhenType = "contains" - NewOutputKafkaTopicsWhenTypeEquals NewOutputKafkaTopicsWhenType = "equals" - NewOutputKafkaTopicsWhenTypeRegexp NewOutputKafkaTopicsWhenType = "regexp" -) - // Defines values for NewOutputKafkaType. const ( NewOutputKafkaTypeKafka NewOutputKafkaType = "kafka" @@ -193,13 +186,6 @@ const ( OutputKafkaSaslMechanismSCRAMSHA512 OutputKafkaSaslMechanism = "SCRAM-SHA-512" ) -// Defines values for OutputKafkaTopicsWhenType. -const ( - OutputKafkaTopicsWhenTypeContains OutputKafkaTopicsWhenType = "contains" - OutputKafkaTopicsWhenTypeEquals OutputKafkaTopicsWhenType = "equals" - OutputKafkaTopicsWhenTypeRegexp OutputKafkaTopicsWhenType = "regexp" -) - // Defines values for OutputKafkaType. const ( OutputKafkaTypeKafka OutputKafkaType = "kafka" @@ -457,13 +443,6 @@ const ( SCRAMSHA512 UpdateOutputKafkaSaslMechanism = "SCRAM-SHA-512" ) -// Defines values for UpdateOutputKafkaTopicsWhenType. -const ( - Contains UpdateOutputKafkaTopicsWhenType = "contains" - Equals UpdateOutputKafkaTopicsWhenType = "equals" - Regexp UpdateOutputKafkaTopicsWhenType = "regexp" -) - // Defines values for UpdateOutputKafkaType. const ( Kafka UpdateOutputKafkaType = "kafka" @@ -1122,17 +1101,10 @@ type NewOutputKafka struct { Key NewOutputKafka_Secrets_Ssl_Key `json:"key"` } `json:"ssl,omitempty"` } `json:"secrets,omitempty"` - Shipper *NewOutputShipper `json:"shipper,omitempty"` - Ssl *NewOutputSsl `json:"ssl,omitempty"` - Timeout *float32 `json:"timeout,omitempty"` - Topic *string `json:"topic,omitempty"` - Topics *[]struct { - Topic string `json:"topic"` - When *struct { - Condition *string `json:"condition,omitempty"` - Type *NewOutputKafkaTopicsWhenType `json:"type,omitempty"` - } `json:"when,omitempty"` - } `json:"topics,omitempty"` + Shipper *NewOutputShipper `json:"shipper,omitempty"` + Ssl *NewOutputSsl `json:"ssl,omitempty"` + Timeout *float32 `json:"timeout,omitempty"` + Topic *string `json:"topic,omitempty"` Type NewOutputKafkaType `json:"type"` Username interface{} `json:"username"` Version *string `json:"version,omitempty"` @@ -1179,9 +1151,6 @@ type NewOutputKafka_Secrets_Ssl_Key struct { union json.RawMessage } -// NewOutputKafkaTopicsWhenType defines model for NewOutputKafka.Topics.When.Type. -type NewOutputKafkaTopicsWhenType string - // NewOutputKafkaType defines model for NewOutputKafka.Type. type NewOutputKafkaType string @@ -1359,7 +1328,6 @@ type OutputKafka struct { Ssl *OutputSsl `json:"ssl"` Timeout *float32 `json:"timeout,omitempty"` Topic *string `json:"topic,omitempty"` - Topics *[]OutputKafka_Topics_Item `json:"topics,omitempty"` Type OutputKafkaType `json:"type"` Username interface{} `json:"username"` Version *string `json:"version,omitempty"` @@ -1454,23 +1422,6 @@ type OutputKafka_Secrets struct { AdditionalProperties map[string]interface{} `json:"-"` } -// OutputKafkaTopicsWhenType defines model for OutputKafka.Topics.When.Type. -type OutputKafkaTopicsWhenType string - -// OutputKafka_Topics_When defines model for OutputKafka.Topics.When. -type OutputKafka_Topics_When struct { - Condition *string `json:"condition,omitempty"` - Type *OutputKafkaTopicsWhenType `json:"type,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// OutputKafka_Topics_Item defines model for output_kafka.topics.Item. -type OutputKafka_Topics_Item struct { - Topic string `json:"topic"` - When *OutputKafka_Topics_When `json:"when,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} - // OutputKafkaType defines model for OutputKafka.Type. type OutputKafkaType string @@ -1640,7 +1591,6 @@ type PackageInfo struct { PolicyTemplates *[]map[string]interface{} `json:"policy_templates,omitempty"` Readme *string `json:"readme,omitempty"` Release *PackageInfoRelease `json:"release,omitempty"` - SavedObject interface{} `json:"savedObject"` Screenshots *[]struct { DarkMode *bool `json:"dark_mode,omitempty"` Path *string `json:"path,omitempty"` @@ -1851,7 +1801,6 @@ type PackageListItem struct { PolicyTemplates *[]map[string]interface{} `json:"policy_templates,omitempty"` Readme *string `json:"readme,omitempty"` Release *PackageListItemRelease `json:"release,omitempty"` - SavedObject interface{} `json:"savedObject"` SignaturePath *string `json:"signature_path,omitempty"` Source *PackageListItem_Source `json:"source,omitempty"` Status *string `json:"status,omitempty"` @@ -2264,17 +2213,10 @@ type UpdateOutputKafka struct { Key UpdateOutputKafka_Secrets_Ssl_Key `json:"key"` } `json:"ssl,omitempty"` } `json:"secrets,omitempty"` - Shipper *UpdateOutputShipper `json:"shipper,omitempty"` - Ssl *UpdateOutputSsl `json:"ssl,omitempty"` - Timeout *float32 `json:"timeout,omitempty"` - Topic *string `json:"topic,omitempty"` - Topics *[]struct { - Topic string `json:"topic"` - When *struct { - Condition *string `json:"condition,omitempty"` - Type *UpdateOutputKafkaTopicsWhenType `json:"type,omitempty"` - } `json:"when,omitempty"` - } `json:"topics,omitempty"` + Shipper *UpdateOutputShipper `json:"shipper,omitempty"` + Ssl *UpdateOutputSsl `json:"ssl,omitempty"` + Timeout *float32 `json:"timeout,omitempty"` + Topic *string `json:"topic,omitempty"` Type *UpdateOutputKafkaType `json:"type,omitempty"` Username interface{} `json:"username"` Version *string `json:"version,omitempty"` @@ -2321,9 +2263,6 @@ type UpdateOutputKafka_Secrets_Ssl_Key struct { union json.RawMessage } -// UpdateOutputKafkaTopicsWhenType defines model for UpdateOutputKafka.Topics.When.Type. -type UpdateOutputKafkaTopicsWhenType string - // UpdateOutputKafkaType defines model for UpdateOutputKafka.Type. type UpdateOutputKafkaType string @@ -2674,7 +2613,6 @@ type GetFleetEnrollmentApiKeysParams struct { type GetFleetEpmPackagesParams struct { Category *string `form:"category,omitempty" json:"category,omitempty"` Prerelease *bool `form:"prerelease,omitempty" json:"prerelease,omitempty"` - Experimental *bool `form:"experimental,omitempty" json:"experimental,omitempty"` ExcludeInstallStatus *bool `form:"excludeInstallStatus,omitempty" json:"excludeInstallStatus,omitempty"` } @@ -2684,11 +2622,6 @@ type PostFleetEpmPackagesParams struct { SkipDataStreamRollover *bool `form:"skipDataStreamRollover,omitempty" json:"skipDataStreamRollover,omitempty"` } -// DeleteFleetEpmPackagesPkgnamePkgversionJSONBody defines parameters for DeleteFleetEpmPackagesPkgnamePkgversion. -type DeleteFleetEpmPackagesPkgnamePkgversionJSONBody struct { - Force bool `json:"force"` -} - // DeleteFleetEpmPackagesPkgnamePkgversionParams defines parameters for DeleteFleetEpmPackagesPkgnamePkgversion. type DeleteFleetEpmPackagesPkgnamePkgversionParams struct { Force *bool `form:"force,omitempty" json:"force,omitempty"` @@ -2791,9 +2724,6 @@ type PostFleetAgentPoliciesDeleteJSONRequestBody PostFleetAgentPoliciesDeleteJSO // PutFleetAgentPoliciesAgentpolicyidJSONRequestBody defines body for PutFleetAgentPoliciesAgentpolicyid for application/json ContentType. type PutFleetAgentPoliciesAgentpolicyidJSONRequestBody PutFleetAgentPoliciesAgentpolicyidJSONBody -// DeleteFleetEpmPackagesPkgnamePkgversionJSONRequestBody defines body for DeleteFleetEpmPackagesPkgnamePkgversion for application/json ContentType. -type DeleteFleetEpmPackagesPkgnamePkgversionJSONRequestBody DeleteFleetEpmPackagesPkgnamePkgversionJSONBody - // PostFleetEpmPackagesPkgnamePkgversionJSONRequestBody defines body for PostFleetEpmPackagesPkgnamePkgversion for application/json ContentType. type PostFleetEpmPackagesPkgnamePkgversionJSONRequestBody PostFleetEpmPackagesPkgnamePkgversionJSONBody @@ -3525,14 +3455,6 @@ func (a *OutputKafka) UnmarshalJSON(b []byte) error { delete(object, "topic") } - if raw, found := object["topics"]; found { - err = json.Unmarshal(raw, &a.Topics) - if err != nil { - return fmt.Errorf("error reading 'topics': %w", err) - } - delete(object, "topics") - } - if raw, found := object["type"]; found { err = json.Unmarshal(raw, &a.Type) if err != nil { @@ -3788,13 +3710,6 @@ func (a OutputKafka) MarshalJSON() ([]byte, error) { } } - if a.Topics != nil { - object["topics"], err = json.Marshal(a.Topics) - if err != nil { - return nil, fmt.Errorf("error marshaling 'topics': %w", err) - } - } - object["type"], err = json.Marshal(a.Type) if err != nil { return nil, fmt.Errorf("error marshaling 'type': %w", err) @@ -4468,170 +4383,6 @@ func (a OutputKafka_Secrets) MarshalJSON() ([]byte, error) { return json.Marshal(object) } -// Getter for additional properties for OutputKafka_Topics_When. Returns the specified -// element and whether it was found -func (a OutputKafka_Topics_When) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for OutputKafka_Topics_When -func (a *OutputKafka_Topics_When) Set(fieldName string, value interface{}) { - if a.AdditionalProperties == nil { - a.AdditionalProperties = make(map[string]interface{}) - } - a.AdditionalProperties[fieldName] = value -} - -// Override default JSON handling for OutputKafka_Topics_When to handle AdditionalProperties -func (a *OutputKafka_Topics_When) UnmarshalJSON(b []byte) error { - object := make(map[string]json.RawMessage) - err := json.Unmarshal(b, &object) - if err != nil { - return err - } - - if raw, found := object["condition"]; found { - err = json.Unmarshal(raw, &a.Condition) - if err != nil { - return fmt.Errorf("error reading 'condition': %w", err) - } - delete(object, "condition") - } - - if raw, found := object["type"]; found { - err = json.Unmarshal(raw, &a.Type) - if err != nil { - return fmt.Errorf("error reading 'type': %w", err) - } - delete(object, "type") - } - - if len(object) != 0 { - a.AdditionalProperties = make(map[string]interface{}) - for fieldName, fieldBuf := range object { - var fieldVal interface{} - err := json.Unmarshal(fieldBuf, &fieldVal) - if err != nil { - return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) - } - a.AdditionalProperties[fieldName] = fieldVal - } - } - return nil -} - -// Override default JSON handling for OutputKafka_Topics_When to handle AdditionalProperties -func (a OutputKafka_Topics_When) MarshalJSON() ([]byte, error) { - var err error - object := make(map[string]json.RawMessage) - - if a.Condition != nil { - object["condition"], err = json.Marshal(a.Condition) - if err != nil { - return nil, fmt.Errorf("error marshaling 'condition': %w", err) - } - } - - if a.Type != nil { - object["type"], err = json.Marshal(a.Type) - if err != nil { - return nil, fmt.Errorf("error marshaling 'type': %w", err) - } - } - - for fieldName, field := range a.AdditionalProperties { - object[fieldName], err = json.Marshal(field) - if err != nil { - return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) - } - } - return json.Marshal(object) -} - -// Getter for additional properties for OutputKafka_Topics_Item. Returns the specified -// element and whether it was found -func (a OutputKafka_Topics_Item) Get(fieldName string) (value interface{}, found bool) { - if a.AdditionalProperties != nil { - value, found = a.AdditionalProperties[fieldName] - } - return -} - -// Setter for additional properties for OutputKafka_Topics_Item -func (a *OutputKafka_Topics_Item) Set(fieldName string, value interface{}) { - if a.AdditionalProperties == nil { - a.AdditionalProperties = make(map[string]interface{}) - } - a.AdditionalProperties[fieldName] = value -} - -// Override default JSON handling for OutputKafka_Topics_Item to handle AdditionalProperties -func (a *OutputKafka_Topics_Item) UnmarshalJSON(b []byte) error { - object := make(map[string]json.RawMessage) - err := json.Unmarshal(b, &object) - if err != nil { - return err - } - - if raw, found := object["topic"]; found { - err = json.Unmarshal(raw, &a.Topic) - if err != nil { - return fmt.Errorf("error reading 'topic': %w", err) - } - delete(object, "topic") - } - - if raw, found := object["when"]; found { - err = json.Unmarshal(raw, &a.When) - if err != nil { - return fmt.Errorf("error reading 'when': %w", err) - } - delete(object, "when") - } - - if len(object) != 0 { - a.AdditionalProperties = make(map[string]interface{}) - for fieldName, fieldBuf := range object { - var fieldVal interface{} - err := json.Unmarshal(fieldBuf, &fieldVal) - if err != nil { - return fmt.Errorf("error unmarshaling field %s: %w", fieldName, err) - } - a.AdditionalProperties[fieldName] = fieldVal - } - } - return nil -} - -// Override default JSON handling for OutputKafka_Topics_Item to handle AdditionalProperties -func (a OutputKafka_Topics_Item) MarshalJSON() ([]byte, error) { - var err error - object := make(map[string]json.RawMessage) - - object["topic"], err = json.Marshal(a.Topic) - if err != nil { - return nil, fmt.Errorf("error marshaling 'topic': %w", err) - } - - if a.When != nil { - object["when"], err = json.Marshal(a.When) - if err != nil { - return nil, fmt.Errorf("error marshaling 'when': %w", err) - } - } - - for fieldName, field := range a.AdditionalProperties { - object[fieldName], err = json.Marshal(field) - if err != nil { - return nil, fmt.Errorf("error marshaling '%s': %w", fieldName, err) - } - } - return json.Marshal(object) -} - // Getter for additional properties for OutputLogstash. Returns the specified // element and whether it was found func (a OutputLogstash) Get(fieldName string) (value interface{}, found bool) { @@ -6095,14 +5846,6 @@ func (a *PackageInfo) UnmarshalJSON(b []byte) error { delete(object, "release") } - if raw, found := object["savedObject"]; found { - err = json.Unmarshal(raw, &a.SavedObject) - if err != nil { - return fmt.Errorf("error reading 'savedObject': %w", err) - } - delete(object, "savedObject") - } - if raw, found := object["screenshots"]; found { err = json.Unmarshal(raw, &a.Screenshots) if err != nil { @@ -6357,11 +6100,6 @@ func (a PackageInfo) MarshalJSON() ([]byte, error) { } } - object["savedObject"], err = json.Marshal(a.SavedObject) - if err != nil { - return nil, fmt.Errorf("error marshaling 'savedObject': %w", err) - } - if a.Screenshots != nil { object["screenshots"], err = json.Marshal(a.Screenshots) if err != nil { @@ -8334,14 +8072,6 @@ func (a *PackageListItem) UnmarshalJSON(b []byte) error { delete(object, "release") } - if raw, found := object["savedObject"]; found { - err = json.Unmarshal(raw, &a.SavedObject) - if err != nil { - return fmt.Errorf("error reading 'savedObject': %w", err) - } - delete(object, "savedObject") - } - if raw, found := object["signature_path"]; found { err = json.Unmarshal(raw, &a.SignaturePath) if err != nil { @@ -8546,11 +8276,6 @@ func (a PackageListItem) MarshalJSON() ([]byte, error) { } } - object["savedObject"], err = json.Marshal(a.SavedObject) - if err != nil { - return nil, fmt.Errorf("error marshaling 'savedObject': %w", err) - } - if a.SignaturePath != nil { object["signature_path"], err = json.Marshal(a.SignaturePath) if err != nil { @@ -11823,10 +11548,8 @@ type ClientInterface interface { // PostFleetEpmPackagesWithBody request with any body PostFleetEpmPackagesWithBody(ctx context.Context, params *PostFleetEpmPackagesParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - // DeleteFleetEpmPackagesPkgnamePkgversionWithBody request with any body - DeleteFleetEpmPackagesPkgnamePkgversionWithBody(ctx context.Context, pkgName string, pkgVersion string, params *DeleteFleetEpmPackagesPkgnamePkgversionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) - - DeleteFleetEpmPackagesPkgnamePkgversion(ctx context.Context, pkgName string, pkgVersion string, params *DeleteFleetEpmPackagesPkgnamePkgversionParams, body DeleteFleetEpmPackagesPkgnamePkgversionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // DeleteFleetEpmPackagesPkgnamePkgversion request + DeleteFleetEpmPackagesPkgnamePkgversion(ctx context.Context, pkgName string, pkgVersion string, params *DeleteFleetEpmPackagesPkgnamePkgversionParams, reqEditors ...RequestEditorFn) (*http.Response, error) // GetFleetEpmPackagesPkgnamePkgversion request GetFleetEpmPackagesPkgnamePkgversion(ctx context.Context, pkgName string, pkgVersion string, params *GetFleetEpmPackagesPkgnamePkgversionParams, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -12045,20 +11768,8 @@ func (c *Client) PostFleetEpmPackagesWithBody(ctx context.Context, params *PostF return c.Client.Do(req) } -func (c *Client) DeleteFleetEpmPackagesPkgnamePkgversionWithBody(ctx context.Context, pkgName string, pkgVersion string, params *DeleteFleetEpmPackagesPkgnamePkgversionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewDeleteFleetEpmPackagesPkgnamePkgversionRequestWithBody(c.Server, pkgName, pkgVersion, params, contentType, body) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - -func (c *Client) DeleteFleetEpmPackagesPkgnamePkgversion(ctx context.Context, pkgName string, pkgVersion string, params *DeleteFleetEpmPackagesPkgnamePkgversionParams, body DeleteFleetEpmPackagesPkgnamePkgversionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewDeleteFleetEpmPackagesPkgnamePkgversionRequest(c.Server, pkgName, pkgVersion, params, body) +func (c *Client) DeleteFleetEpmPackagesPkgnamePkgversion(ctx context.Context, pkgName string, pkgVersion string, params *DeleteFleetEpmPackagesPkgnamePkgversionParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteFleetEpmPackagesPkgnamePkgversionRequest(c.Server, pkgName, pkgVersion, params) if err != nil { return nil, err } @@ -12996,22 +12707,6 @@ func NewGetFleetEpmPackagesRequest(server string, params *GetFleetEpmPackagesPar } - if params.Experimental != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "experimental", runtime.ParamLocationQuery, *params.Experimental); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - if params.ExcludeInstallStatus != nil { if queryFrag, err := runtime.StyleParamWithLocation("form", true, "excludeInstallStatus", runtime.ParamLocationQuery, *params.ExcludeInstallStatus); err != nil { @@ -13106,19 +12801,8 @@ func NewPostFleetEpmPackagesRequestWithBody(server string, params *PostFleetEpmP return req, nil } -// NewDeleteFleetEpmPackagesPkgnamePkgversionRequest calls the generic DeleteFleetEpmPackagesPkgnamePkgversion builder with application/json body -func NewDeleteFleetEpmPackagesPkgnamePkgversionRequest(server string, pkgName string, pkgVersion string, params *DeleteFleetEpmPackagesPkgnamePkgversionParams, body DeleteFleetEpmPackagesPkgnamePkgversionJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewDeleteFleetEpmPackagesPkgnamePkgversionRequestWithBody(server, pkgName, pkgVersion, params, "application/json", bodyReader) -} - -// NewDeleteFleetEpmPackagesPkgnamePkgversionRequestWithBody generates requests for DeleteFleetEpmPackagesPkgnamePkgversion with any type of body -func NewDeleteFleetEpmPackagesPkgnamePkgversionRequestWithBody(server string, pkgName string, pkgVersion string, params *DeleteFleetEpmPackagesPkgnamePkgversionParams, contentType string, body io.Reader) (*http.Request, error) { +// NewDeleteFleetEpmPackagesPkgnamePkgversionRequest generates requests for DeleteFleetEpmPackagesPkgnamePkgversion +func NewDeleteFleetEpmPackagesPkgnamePkgversionRequest(server string, pkgName string, pkgVersion string, params *DeleteFleetEpmPackagesPkgnamePkgversionParams) (*http.Request, error) { var err error var pathParam0 string @@ -13172,13 +12856,11 @@ func NewDeleteFleetEpmPackagesPkgnamePkgversionRequestWithBody(server string, pk queryURL.RawQuery = queryValues.Encode() } - req, err := http.NewRequest("DELETE", queryURL.String(), body) + req, err := http.NewRequest("DELETE", queryURL.String(), nil) if err != nil { return nil, err } - req.Header.Add("Content-Type", contentType) - return req, nil } @@ -14459,10 +14141,8 @@ type ClientWithResponsesInterface interface { // PostFleetEpmPackagesWithBodyWithResponse request with any body PostFleetEpmPackagesWithBodyWithResponse(ctx context.Context, params *PostFleetEpmPackagesParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostFleetEpmPackagesResponse, error) - // DeleteFleetEpmPackagesPkgnamePkgversionWithBodyWithResponse request with any body - DeleteFleetEpmPackagesPkgnamePkgversionWithBodyWithResponse(ctx context.Context, pkgName string, pkgVersion string, params *DeleteFleetEpmPackagesPkgnamePkgversionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DeleteFleetEpmPackagesPkgnamePkgversionResponse, error) - - DeleteFleetEpmPackagesPkgnamePkgversionWithResponse(ctx context.Context, pkgName string, pkgVersion string, params *DeleteFleetEpmPackagesPkgnamePkgversionParams, body DeleteFleetEpmPackagesPkgnamePkgversionJSONRequestBody, reqEditors ...RequestEditorFn) (*DeleteFleetEpmPackagesPkgnamePkgversionResponse, error) + // DeleteFleetEpmPackagesPkgnamePkgversionWithResponse request + DeleteFleetEpmPackagesPkgnamePkgversionWithResponse(ctx context.Context, pkgName string, pkgVersion string, params *DeleteFleetEpmPackagesPkgnamePkgversionParams, reqEditors ...RequestEditorFn) (*DeleteFleetEpmPackagesPkgnamePkgversionResponse, error) // GetFleetEpmPackagesPkgnamePkgversionWithResponse request GetFleetEpmPackagesPkgnamePkgversionWithResponse(ctx context.Context, pkgName string, pkgVersion string, params *GetFleetEpmPackagesPkgnamePkgversionParams, reqEditors ...RequestEditorFn) (*GetFleetEpmPackagesPkgnamePkgversionResponse, error) @@ -14702,29 +14382,10 @@ type GetFleetEnrollmentApiKeysResponse struct { Body []byte HTTPResponse *http.Response JSON200 *struct { - Items []EnrollmentApiKey `json:"items"` - // Deprecated: - List []struct { - // Active When false, the enrollment API key is revoked and cannot be used for enrolling Elastic Agents. - Active bool `json:"active"` - - // ApiKey The enrollment API key (token) used for enrolling Elastic Agents. - ApiKey string `json:"api_key"` - - // ApiKeyId The ID of the API key in the Security API. - ApiKeyId string `json:"api_key_id"` - CreatedAt string `json:"created_at"` - Id string `json:"id"` - - // Name The name of the enrollment API key. - Name *string `json:"name,omitempty"` - - // PolicyId The ID of the agent policy the Elastic Agent will be enrolled in. - PolicyId *string `json:"policy_id,omitempty"` - } `json:"list"` - Page float32 `json:"page"` - PerPage float32 `json:"perPage"` - Total float32 `json:"total"` + Items []EnrollmentApiKey `json:"items"` + Page float32 `json:"page"` + PerPage float32 `json:"perPage"` + Total float32 `json:"total"` } JSON400 *struct { Error *string `json:"error,omitempty"` @@ -14753,8 +14414,7 @@ type GetFleetEpmPackagesResponse struct { Body []byte HTTPResponse *http.Response JSON200 *struct { - Items []PackageListItem `json:"items"` - Response *[]GetFleetEpmPackages_200_Response_Item `json:"response,omitempty"` + Items []PackageListItem `json:"items"` } JSON400 *struct { Error *string `json:"error,omitempty"` @@ -14762,155 +14422,6 @@ type GetFleetEpmPackagesResponse struct { StatusCode *float32 `json:"statusCode,omitempty"` } } -type GetFleetEpmPackages_200_Response_Conditions_Elastic struct { - Capabilities *[]string `json:"capabilities,omitempty"` - Subscription *string `json:"subscription,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type GetFleetEpmPackages_200_Response_Conditions_Kibana struct { - Version *string `json:"version,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type GetFleetEpmPackages_200_Response_Conditions struct { - Elastic *GetFleetEpmPackages_200_Response_Conditions_Elastic `json:"elastic,omitempty"` - Kibana *GetFleetEpmPackages_200_Response_Conditions_Kibana `json:"kibana,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type GetFleetEpmPackages_200_Response_Discovery_Fields_Item struct { - Name string `json:"name"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type GetFleetEpmPackages_200_Response_Discovery struct { - Fields *[]GetFleetEpmPackages_200_Response_Discovery_Fields_Item `json:"fields,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type GetFleetEpmPackages_200_Response_Icons_Item struct { - DarkMode *bool `json:"dark_mode,omitempty"` - Path *string `json:"path,omitempty"` - Size *string `json:"size,omitempty"` - Src string `json:"src"` - Title *string `json:"title,omitempty"` - Type *string `json:"type,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type GetFleetEpmPackages200ResponseInstallationInfoAdditionalSpacesInstalledKibanaType string -type GetFleetEpmPackages_200_Response_InstallationInfo_AdditionalSpacesInstalledKibana_Item struct { - Id string `json:"id"` - OriginId *string `json:"originId,omitempty"` - Type GetFleetEpmPackages200ResponseInstallationInfoAdditionalSpacesInstalledKibanaType `json:"type"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type GetFleetEpmPackages_200_Response_InstallationInfo_ExperimentalDataStreamFeatures_Features struct { - DocValueOnlyNumeric *bool `json:"doc_value_only_numeric,omitempty"` - DocValueOnlyOther *bool `json:"doc_value_only_other,omitempty"` - SyntheticSource *bool `json:"synthetic_source,omitempty"` - Tsdb *bool `json:"tsdb,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type GetFleetEpmPackages_200_Response_InstallationInfo_ExperimentalDataStreamFeatures_Item struct { - DataStream string `json:"data_stream"` - Features GetFleetEpmPackages_200_Response_InstallationInfo_ExperimentalDataStreamFeatures_Features `json:"features"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type GetFleetEpmPackages200ResponseInstallationInfoInstallSource string -type GetFleetEpmPackages200ResponseInstallationInfoInstallStatus string -type GetFleetEpmPackages200ResponseInstallationInfoInstalledEsType string -type GetFleetEpmPackages_200_Response_InstallationInfo_InstalledEs_Item struct { - Deferred *bool `json:"deferred,omitempty"` - Id string `json:"id"` - Type GetFleetEpmPackages200ResponseInstallationInfoInstalledEsType `json:"type"` - Version *string `json:"version,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type GetFleetEpmPackages200ResponseInstallationInfoInstalledKibanaType string -type GetFleetEpmPackages_200_Response_InstallationInfo_InstalledKibana_Item struct { - Id string `json:"id"` - OriginId *string `json:"originId,omitempty"` - Type GetFleetEpmPackages200ResponseInstallationInfoInstalledKibanaType `json:"type"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type GetFleetEpmPackages_200_Response_InstallationInfo_LatestExecutedState struct { - Error *string `json:"error,omitempty"` - Name string `json:"name"` - StartedAt string `json:"started_at"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type GetFleetEpmPackages_200_Response_InstallationInfo_LatestInstallFailedAttempts_Error struct { - Message string `json:"message"` - Name string `json:"name"` - Stack *string `json:"stack,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type GetFleetEpmPackages_200_Response_InstallationInfo_LatestInstallFailedAttempts_Item struct { - CreatedAt string `json:"created_at"` - Error GetFleetEpmPackages_200_Response_InstallationInfo_LatestInstallFailedAttempts_Error `json:"error"` - TargetVersion string `json:"target_version"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type GetFleetEpmPackages200ResponseInstallationInfoVerificationStatus string -type GetFleetEpmPackages_200_Response_InstallationInfo struct { - AdditionalSpacesInstalledKibana *map[string][]GetFleetEpmPackages_200_Response_InstallationInfo_AdditionalSpacesInstalledKibana_Item `json:"additional_spaces_installed_kibana,omitempty"` - CreatedAt *string `json:"created_at,omitempty"` - ExperimentalDataStreamFeatures *[]GetFleetEpmPackages_200_Response_InstallationInfo_ExperimentalDataStreamFeatures_Item `json:"experimental_data_stream_features,omitempty"` - InstallFormatSchemaVersion *string `json:"install_format_schema_version,omitempty"` - InstallSource GetFleetEpmPackages200ResponseInstallationInfoInstallSource `json:"install_source"` - InstallStatus GetFleetEpmPackages200ResponseInstallationInfoInstallStatus `json:"install_status"` - InstalledEs []GetFleetEpmPackages_200_Response_InstallationInfo_InstalledEs_Item `json:"installed_es"` - InstalledKibana []GetFleetEpmPackages_200_Response_InstallationInfo_InstalledKibana_Item `json:"installed_kibana"` - InstalledKibanaSpaceId *string `json:"installed_kibana_space_id,omitempty"` - LatestExecutedState *GetFleetEpmPackages_200_Response_InstallationInfo_LatestExecutedState `json:"latest_executed_state,omitempty"` - LatestInstallFailedAttempts *[]GetFleetEpmPackages_200_Response_InstallationInfo_LatestInstallFailedAttempts_Item `json:"latest_install_failed_attempts,omitempty"` - Name string `json:"name"` - Namespaces *[]string `json:"namespaces,omitempty"` - Type string `json:"type"` - UpdatedAt *string `json:"updated_at,omitempty"` - VerificationKeyId *string `json:"verification_key_id"` - VerificationStatus GetFleetEpmPackages200ResponseInstallationInfoVerificationStatus `json:"verification_status"` - Version string `json:"version"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type GetFleetEpmPackages200ResponseOwnerType string -type GetFleetEpmPackages_200_Response_Owner struct { - Github *string `json:"github,omitempty"` - Type *GetFleetEpmPackages200ResponseOwnerType `json:"type,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type GetFleetEpmPackages200ResponseRelease string -type GetFleetEpmPackages_200_Response_Source struct { - License string `json:"license"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type GetFleetEpmPackages200ResponseType string -type GetFleetEpmPackages_200_Response_Item struct { - Categories *[]string `json:"categories,omitempty"` - Conditions *GetFleetEpmPackages_200_Response_Conditions `json:"conditions,omitempty"` - DataStreams *[]map[string]interface{} `json:"data_streams,omitempty"` - Description *string `json:"description,omitempty"` - Discovery *GetFleetEpmPackages_200_Response_Discovery `json:"discovery,omitempty"` - Download *string `json:"download,omitempty"` - FormatVersion *string `json:"format_version,omitempty"` - Icons *[]GetFleetEpmPackages_200_Response_Icons_Item `json:"icons,omitempty"` - Id string `json:"id"` - InstallationInfo *GetFleetEpmPackages_200_Response_InstallationInfo `json:"installationInfo,omitempty"` - Integration *string `json:"integration,omitempty"` - Internal *bool `json:"internal,omitempty"` - LatestVersion *string `json:"latestVersion,omitempty"` - Name string `json:"name"` - Owner *GetFleetEpmPackages_200_Response_Owner `json:"owner,omitempty"` - Path *string `json:"path,omitempty"` - PolicyTemplates *[]map[string]interface{} `json:"policy_templates,omitempty"` - Readme *string `json:"readme,omitempty"` - Release *GetFleetEpmPackages200ResponseRelease `json:"release,omitempty"` - SavedObject interface{} `json:"savedObject"` - SignaturePath *string `json:"signature_path,omitempty"` - Source *GetFleetEpmPackages_200_Response_Source `json:"source,omitempty"` - Status *string `json:"status,omitempty"` - Title string `json:"title"` - Type *GetFleetEpmPackages200ResponseType `json:"type,omitempty"` - Vars *[]map[string]interface{} `json:"vars,omitempty"` - Version string `json:"version"` - AdditionalProperties map[string]interface{} `json:"-"` -} // Status returns HTTPResponse.Status func (r GetFleetEpmPackagesResponse) Status() string { @@ -14954,8 +14465,6 @@ type DeleteFleetEpmPackagesPkgnamePkgversionResponse struct { HTTPResponse *http.Response JSON200 *struct { Items []DeleteFleetEpmPackagesPkgnamePkgversion_200_Items_Item `json:"items"` - // Deprecated: - Response *[]DeleteFleetEpmPackagesPkgnamePkgversion_200_Response_Item `json:"response,omitempty"` } JSON400 *struct { Error *string `json:"error,omitempty"` @@ -14979,22 +14488,6 @@ type DeleteFleetEpmPackagesPkgnamePkgversion200Items1Type string type DeleteFleetEpmPackagesPkgnamePkgversion_200_Items_Item struct { union json.RawMessage } -type DeleteFleetEpmPackagesPkgnamePkgversion200Response0 struct { - Id string `json:"id"` - OriginId *string `json:"originId,omitempty"` - Type DeleteFleetEpmPackagesPkgnamePkgversion200Response0Type `json:"type"` -} -type DeleteFleetEpmPackagesPkgnamePkgversion200Response0Type string -type DeleteFleetEpmPackagesPkgnamePkgversion200Response1 struct { - Deferred *bool `json:"deferred,omitempty"` - Id string `json:"id"` - Type DeleteFleetEpmPackagesPkgnamePkgversion200Response1Type `json:"type"` - Version *string `json:"version,omitempty"` -} -type DeleteFleetEpmPackagesPkgnamePkgversion200Response1Type string -type DeleteFleetEpmPackagesPkgnamePkgversion_200_Response_Item struct { - union json.RawMessage -} // Status returns HTTPResponse.Status func (r DeleteFleetEpmPackagesPkgnamePkgversionResponse) Status() string { @@ -15020,8 +14513,6 @@ type GetFleetEpmPackagesPkgnamePkgversionResponse struct { Metadata *struct { HasPolicies bool `json:"has_policies"` } `json:"metadata,omitempty"` - // Deprecated: - Response *GetFleetEpmPackagesPkgnamePkgversion_200_Response `json:"response,omitempty"` } JSON400 *struct { Error *string `json:"error,omitempty"` @@ -15029,177 +14520,6 @@ type GetFleetEpmPackagesPkgnamePkgversionResponse struct { StatusCode *float32 `json:"statusCode,omitempty"` } } -type GetFleetEpmPackagesPkgnamePkgversion_200_Response_Conditions_Elastic struct { - Capabilities *[]string `json:"capabilities,omitempty"` - Subscription *string `json:"subscription,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type GetFleetEpmPackagesPkgnamePkgversion_200_Response_Conditions_Kibana struct { - Version *string `json:"version,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type GetFleetEpmPackagesPkgnamePkgversion_200_Response_Conditions struct { - Elastic *GetFleetEpmPackagesPkgnamePkgversion_200_Response_Conditions_Elastic `json:"elastic,omitempty"` - Kibana *GetFleetEpmPackagesPkgnamePkgversion_200_Response_Conditions_Kibana `json:"kibana,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type GetFleetEpmPackagesPkgnamePkgversion_200_Response_Discovery_Fields_Item struct { - Name string `json:"name"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type GetFleetEpmPackagesPkgnamePkgversion_200_Response_Discovery struct { - Fields *[]GetFleetEpmPackagesPkgnamePkgversion_200_Response_Discovery_Fields_Item `json:"fields,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type GetFleetEpmPackagesPkgnamePkgversion_200_Response_Icons_Item struct { - DarkMode *bool `json:"dark_mode,omitempty"` - Path *string `json:"path,omitempty"` - Size *string `json:"size,omitempty"` - Src string `json:"src"` - Title *string `json:"title,omitempty"` - Type *string `json:"type,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type GetFleetEpmPackagesPkgnamePkgversion200ResponseInstallationInfoAdditionalSpacesInstalledKibanaType string -type GetFleetEpmPackagesPkgnamePkgversion_200_Response_InstallationInfo_AdditionalSpacesInstalledKibana_Item struct { - Id string `json:"id"` - OriginId *string `json:"originId,omitempty"` - Type GetFleetEpmPackagesPkgnamePkgversion200ResponseInstallationInfoAdditionalSpacesInstalledKibanaType `json:"type"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type GetFleetEpmPackagesPkgnamePkgversion_200_Response_InstallationInfo_ExperimentalDataStreamFeatures_Features struct { - DocValueOnlyNumeric *bool `json:"doc_value_only_numeric,omitempty"` - DocValueOnlyOther *bool `json:"doc_value_only_other,omitempty"` - SyntheticSource *bool `json:"synthetic_source,omitempty"` - Tsdb *bool `json:"tsdb,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type GetFleetEpmPackagesPkgnamePkgversion_200_Response_InstallationInfo_ExperimentalDataStreamFeatures_Item struct { - DataStream string `json:"data_stream"` - Features GetFleetEpmPackagesPkgnamePkgversion_200_Response_InstallationInfo_ExperimentalDataStreamFeatures_Features `json:"features"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type GetFleetEpmPackagesPkgnamePkgversion200ResponseInstallationInfoInstallSource string -type GetFleetEpmPackagesPkgnamePkgversion200ResponseInstallationInfoInstallStatus string -type GetFleetEpmPackagesPkgnamePkgversion200ResponseInstallationInfoInstalledEsType string -type GetFleetEpmPackagesPkgnamePkgversion_200_Response_InstallationInfo_InstalledEs_Item struct { - Deferred *bool `json:"deferred,omitempty"` - Id string `json:"id"` - Type GetFleetEpmPackagesPkgnamePkgversion200ResponseInstallationInfoInstalledEsType `json:"type"` - Version *string `json:"version,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type GetFleetEpmPackagesPkgnamePkgversion200ResponseInstallationInfoInstalledKibanaType string -type GetFleetEpmPackagesPkgnamePkgversion_200_Response_InstallationInfo_InstalledKibana_Item struct { - Id string `json:"id"` - OriginId *string `json:"originId,omitempty"` - Type GetFleetEpmPackagesPkgnamePkgversion200ResponseInstallationInfoInstalledKibanaType `json:"type"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type GetFleetEpmPackagesPkgnamePkgversion_200_Response_InstallationInfo_LatestExecutedState struct { - Error *string `json:"error,omitempty"` - Name string `json:"name"` - StartedAt string `json:"started_at"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type GetFleetEpmPackagesPkgnamePkgversion_200_Response_InstallationInfo_LatestInstallFailedAttempts_Error struct { - Message string `json:"message"` - Name string `json:"name"` - Stack *string `json:"stack,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type GetFleetEpmPackagesPkgnamePkgversion_200_Response_InstallationInfo_LatestInstallFailedAttempts_Item struct { - CreatedAt string `json:"created_at"` - Error GetFleetEpmPackagesPkgnamePkgversion_200_Response_InstallationInfo_LatestInstallFailedAttempts_Error `json:"error"` - TargetVersion string `json:"target_version"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type GetFleetEpmPackagesPkgnamePkgversion200ResponseInstallationInfoVerificationStatus string -type GetFleetEpmPackagesPkgnamePkgversion_200_Response_InstallationInfo struct { - AdditionalSpacesInstalledKibana *map[string][]GetFleetEpmPackagesPkgnamePkgversion_200_Response_InstallationInfo_AdditionalSpacesInstalledKibana_Item `json:"additional_spaces_installed_kibana,omitempty"` - CreatedAt *string `json:"created_at,omitempty"` - ExperimentalDataStreamFeatures *[]GetFleetEpmPackagesPkgnamePkgversion_200_Response_InstallationInfo_ExperimentalDataStreamFeatures_Item `json:"experimental_data_stream_features,omitempty"` - InstallFormatSchemaVersion *string `json:"install_format_schema_version,omitempty"` - InstallSource GetFleetEpmPackagesPkgnamePkgversion200ResponseInstallationInfoInstallSource `json:"install_source"` - InstallStatus GetFleetEpmPackagesPkgnamePkgversion200ResponseInstallationInfoInstallStatus `json:"install_status"` - InstalledEs []GetFleetEpmPackagesPkgnamePkgversion_200_Response_InstallationInfo_InstalledEs_Item `json:"installed_es"` - InstalledKibana []GetFleetEpmPackagesPkgnamePkgversion_200_Response_InstallationInfo_InstalledKibana_Item `json:"installed_kibana"` - InstalledKibanaSpaceId *string `json:"installed_kibana_space_id,omitempty"` - LatestExecutedState *GetFleetEpmPackagesPkgnamePkgversion_200_Response_InstallationInfo_LatestExecutedState `json:"latest_executed_state,omitempty"` - LatestInstallFailedAttempts *[]GetFleetEpmPackagesPkgnamePkgversion_200_Response_InstallationInfo_LatestInstallFailedAttempts_Item `json:"latest_install_failed_attempts,omitempty"` - Name string `json:"name"` - Namespaces *[]string `json:"namespaces,omitempty"` - Type string `json:"type"` - UpdatedAt *string `json:"updated_at,omitempty"` - VerificationKeyId *string `json:"verification_key_id"` - VerificationStatus GetFleetEpmPackagesPkgnamePkgversion200ResponseInstallationInfoVerificationStatus `json:"verification_status"` - Version string `json:"version"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type GetFleetEpmPackagesPkgnamePkgversion200ResponseOwnerType string -type GetFleetEpmPackagesPkgnamePkgversion_200_Response_Owner struct { - Github *string `json:"github,omitempty"` - Type *GetFleetEpmPackagesPkgnamePkgversion200ResponseOwnerType `json:"type,omitempty"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type GetFleetEpmPackagesPkgnamePkgversion200ResponseRelease string -type GetFleetEpmPackagesPkgnamePkgversion_200_Response_Source struct { - License string `json:"license"` - AdditionalProperties map[string]interface{} `json:"-"` -} -type GetFleetEpmPackagesPkgnamePkgversion200ResponseType string -type GetFleetEpmPackagesPkgnamePkgversion_200_Response struct { - Agent *struct { - Privileges *struct { - Root *bool `json:"root,omitempty"` - } `json:"privileges,omitempty"` - } `json:"agent,omitempty"` - AssetTags *[]struct { - AssetIds *[]string `json:"asset_ids,omitempty"` - AssetTypes *[]string `json:"asset_types,omitempty"` - Text string `json:"text"` - } `json:"asset_tags,omitempty"` - Assets map[string]interface{} `json:"assets"` - Categories *[]string `json:"categories,omitempty"` - Conditions *GetFleetEpmPackagesPkgnamePkgversion_200_Response_Conditions `json:"conditions,omitempty"` - DataStreams *[]map[string]interface{} `json:"data_streams,omitempty"` - Description *string `json:"description,omitempty"` - Discovery *GetFleetEpmPackagesPkgnamePkgversion_200_Response_Discovery `json:"discovery,omitempty"` - Download *string `json:"download,omitempty"` - Elasticsearch *map[string]interface{} `json:"elasticsearch,omitempty"` - FormatVersion *string `json:"format_version,omitempty"` - Icons *[]GetFleetEpmPackagesPkgnamePkgversion_200_Response_Icons_Item `json:"icons,omitempty"` - InstallationInfo *GetFleetEpmPackagesPkgnamePkgversion_200_Response_InstallationInfo `json:"installationInfo,omitempty"` - Internal *bool `json:"internal,omitempty"` - KeepPoliciesUpToDate *bool `json:"keepPoliciesUpToDate,omitempty"` - LatestVersion *string `json:"latestVersion,omitempty"` - License *string `json:"license,omitempty"` - LicensePath *string `json:"licensePath,omitempty"` - Name string `json:"name"` - Notice *string `json:"notice,omitempty"` - Owner *GetFleetEpmPackagesPkgnamePkgversion_200_Response_Owner `json:"owner,omitempty"` - Path *string `json:"path,omitempty"` - PolicyTemplates *[]map[string]interface{} `json:"policy_templates,omitempty"` - Readme *string `json:"readme,omitempty"` - Release *GetFleetEpmPackagesPkgnamePkgversion200ResponseRelease `json:"release,omitempty"` - SavedObject interface{} `json:"savedObject"` - Screenshots *[]struct { - DarkMode *bool `json:"dark_mode,omitempty"` - Path *string `json:"path,omitempty"` - Size *string `json:"size,omitempty"` - Src string `json:"src"` - Title *string `json:"title,omitempty"` - Type *string `json:"type,omitempty"` - } `json:"screenshots,omitempty"` - SignaturePath *string `json:"signature_path,omitempty"` - Source *GetFleetEpmPackagesPkgnamePkgversion_200_Response_Source `json:"source,omitempty"` - Status *string `json:"status,omitempty"` - Title string `json:"title"` - Type *GetFleetEpmPackagesPkgnamePkgversion200ResponseType `json:"type,omitempty"` - Vars *[]map[string]interface{} `json:"vars,omitempty"` - Version string `json:"version"` - AdditionalProperties map[string]interface{} `json:"-"` -} // Status returns HTTPResponse.Status func (r GetFleetEpmPackagesPkgnamePkgversionResponse) Status() string { @@ -15225,8 +14545,6 @@ type PostFleetEpmPackagesPkgnamePkgversionResponse struct { InstallSource string `json:"install_source"` } `json:"_meta"` Items []PostFleetEpmPackagesPkgnamePkgversion_200_Items_Item `json:"items"` - // Deprecated: - Response *[]PostFleetEpmPackagesPkgnamePkgversion_200_Response_Item `json:"response,omitempty"` } JSON400 *struct { Error *string `json:"error,omitempty"` @@ -15250,22 +14568,6 @@ type PostFleetEpmPackagesPkgnamePkgversion200Items1Type string type PostFleetEpmPackagesPkgnamePkgversion_200_Items_Item struct { union json.RawMessage } -type PostFleetEpmPackagesPkgnamePkgversion200Response0 struct { - Id string `json:"id"` - OriginId *string `json:"originId,omitempty"` - Type PostFleetEpmPackagesPkgnamePkgversion200Response0Type `json:"type"` -} -type PostFleetEpmPackagesPkgnamePkgversion200Response0Type string -type PostFleetEpmPackagesPkgnamePkgversion200Response1 struct { - Deferred *bool `json:"deferred,omitempty"` - Id string `json:"id"` - Type PostFleetEpmPackagesPkgnamePkgversion200Response1Type `json:"type"` - Version *string `json:"version,omitempty"` -} -type PostFleetEpmPackagesPkgnamePkgversion200Response1Type string -type PostFleetEpmPackagesPkgnamePkgversion_200_Response_Item struct { - union json.RawMessage -} // Status returns HTTPResponse.Status func (r PostFleetEpmPackagesPkgnamePkgversionResponse) Status() string { @@ -15957,17 +15259,9 @@ func (c *ClientWithResponses) PostFleetEpmPackagesWithBodyWithResponse(ctx conte return ParsePostFleetEpmPackagesResponse(rsp) } -// DeleteFleetEpmPackagesPkgnamePkgversionWithBodyWithResponse request with arbitrary body returning *DeleteFleetEpmPackagesPkgnamePkgversionResponse -func (c *ClientWithResponses) DeleteFleetEpmPackagesPkgnamePkgversionWithBodyWithResponse(ctx context.Context, pkgName string, pkgVersion string, params *DeleteFleetEpmPackagesPkgnamePkgversionParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DeleteFleetEpmPackagesPkgnamePkgversionResponse, error) { - rsp, err := c.DeleteFleetEpmPackagesPkgnamePkgversionWithBody(ctx, pkgName, pkgVersion, params, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseDeleteFleetEpmPackagesPkgnamePkgversionResponse(rsp) -} - -func (c *ClientWithResponses) DeleteFleetEpmPackagesPkgnamePkgversionWithResponse(ctx context.Context, pkgName string, pkgVersion string, params *DeleteFleetEpmPackagesPkgnamePkgversionParams, body DeleteFleetEpmPackagesPkgnamePkgversionJSONRequestBody, reqEditors ...RequestEditorFn) (*DeleteFleetEpmPackagesPkgnamePkgversionResponse, error) { - rsp, err := c.DeleteFleetEpmPackagesPkgnamePkgversion(ctx, pkgName, pkgVersion, params, body, reqEditors...) +// DeleteFleetEpmPackagesPkgnamePkgversionWithResponse request returning *DeleteFleetEpmPackagesPkgnamePkgversionResponse +func (c *ClientWithResponses) DeleteFleetEpmPackagesPkgnamePkgversionWithResponse(ctx context.Context, pkgName string, pkgVersion string, params *DeleteFleetEpmPackagesPkgnamePkgversionParams, reqEditors ...RequestEditorFn) (*DeleteFleetEpmPackagesPkgnamePkgversionResponse, error) { + rsp, err := c.DeleteFleetEpmPackagesPkgnamePkgversion(ctx, pkgName, pkgVersion, params, reqEditors...) if err != nil { return nil, err } @@ -16459,29 +15753,10 @@ func ParseGetFleetEnrollmentApiKeysResponse(rsp *http.Response) (*GetFleetEnroll switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest struct { - Items []EnrollmentApiKey `json:"items"` - // Deprecated: - List []struct { - // Active When false, the enrollment API key is revoked and cannot be used for enrolling Elastic Agents. - Active bool `json:"active"` - - // ApiKey The enrollment API key (token) used for enrolling Elastic Agents. - ApiKey string `json:"api_key"` - - // ApiKeyId The ID of the API key in the Security API. - ApiKeyId string `json:"api_key_id"` - CreatedAt string `json:"created_at"` - Id string `json:"id"` - - // Name The name of the enrollment API key. - Name *string `json:"name,omitempty"` - - // PolicyId The ID of the agent policy the Elastic Agent will be enrolled in. - PolicyId *string `json:"policy_id,omitempty"` - } `json:"list"` - Page float32 `json:"page"` - PerPage float32 `json:"perPage"` - Total float32 `json:"total"` + Items []EnrollmentApiKey `json:"items"` + Page float32 `json:"page"` + PerPage float32 `json:"perPage"` + Total float32 `json:"total"` } if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err @@ -16520,8 +15795,7 @@ func ParseGetFleetEpmPackagesResponse(rsp *http.Response) (*GetFleetEpmPackagesR switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest struct { - Items []PackageListItem `json:"items"` - Response *[]GetFleetEpmPackages_200_Response_Item `json:"response,omitempty"` + Items []PackageListItem `json:"items"` } if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err @@ -16577,8 +15851,6 @@ func ParseDeleteFleetEpmPackagesPkgnamePkgversionResponse(rsp *http.Response) (* case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest struct { Items []DeleteFleetEpmPackagesPkgnamePkgversion_200_Items_Item `json:"items"` - // Deprecated: - Response *[]DeleteFleetEpmPackagesPkgnamePkgversion_200_Response_Item `json:"response,omitempty"` } if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err @@ -16621,8 +15893,6 @@ func ParseGetFleetEpmPackagesPkgnamePkgversionResponse(rsp *http.Response) (*Get Metadata *struct { HasPolicies bool `json:"has_policies"` } `json:"metadata,omitempty"` - // Deprecated: - Response *GetFleetEpmPackagesPkgnamePkgversion_200_Response `json:"response,omitempty"` } if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err @@ -16665,8 +15935,6 @@ func ParsePostFleetEpmPackagesPkgnamePkgversionResponse(rsp *http.Response) (*Po InstallSource string `json:"install_source"` } `json:"_meta"` Items []PostFleetEpmPackagesPkgnamePkgversion_200_Items_Item `json:"items"` - // Deprecated: - Response *[]PostFleetEpmPackagesPkgnamePkgversion_200_Response_Item `json:"response,omitempty"` } if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err diff --git a/internal/clients/fleet/fleet.go b/internal/clients/fleet/fleet.go index edaef837b..77bf9b464 100644 --- a/internal/clients/fleet/fleet.go +++ b/internal/clients/fleet/fleet.go @@ -370,11 +370,7 @@ func InstallPackage(ctx context.Context, client *Client, name, version string, f // Uninstall uninstalls a package. func Uninstall(ctx context.Context, client *Client, name, version string, force bool) diag.Diagnostics { - body := kbapi.DeleteFleetEpmPackagesPkgnamePkgversionJSONRequestBody{ - Force: force, - } - - resp, err := client.API.DeleteFleetEpmPackagesPkgnamePkgversionWithResponse(ctx, name, version, nil, body) + resp, err := client.API.DeleteFleetEpmPackagesPkgnamePkgversionWithResponse(ctx, name, version, nil) if err != nil { return utils.FrameworkDiagFromError(err) } From 1fb4bd9be9402bcf7bd3ff0745eaf7ec7dca3da2 Mon Sep 17 00:00:00 2001 From: Raymond Lynch Date: Tue, 12 Nov 2024 10:54:32 -0500 Subject: [PATCH 13/15] lint/fmt/autoformat findings --- internal/clients/fleet/client.go | 2 +- internal/clients/fleet/fleet.go | 2 +- internal/fleet/agent_policy/models.go | 2 +- internal/fleet/enrollment_tokens/models.go | 2 +- internal/fleet/enrollment_tokens/read.go | 2 +- internal/fleet/integration_ds/models.go | 2 +- internal/fleet/integration_policy/models.go | 2 +- internal/fleet/integration_policy/secrets.go | 2 +- internal/fleet/integration_policy/secrets_test.go | 10 +++++----- internal/fleet/output/models.go | 2 +- internal/fleet/server_host/models.go | 2 +- provider/factory_test.go | 3 +-- 12 files changed, 16 insertions(+), 17 deletions(-) diff --git a/internal/clients/fleet/client.go b/internal/clients/fleet/client.go index 623b1204d..0e1844960 100644 --- a/internal/clients/fleet/client.go +++ b/internal/clients/fleet/client.go @@ -8,7 +8,7 @@ import ( "os" "strings" - "github.com/elastic/terraform-provider-elasticstack/generated/kibana" + kbapi "github.com/elastic/terraform-provider-elasticstack/generated/kibana" "github.com/elastic/terraform-provider-elasticstack/internal/utils" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/logging" ) diff --git a/internal/clients/fleet/fleet.go b/internal/clients/fleet/fleet.go index 77bf9b464..d8429914d 100644 --- a/internal/clients/fleet/fleet.go +++ b/internal/clients/fleet/fleet.go @@ -6,7 +6,7 @@ import ( "fmt" "net/http" - "github.com/elastic/terraform-provider-elasticstack/generated/kibana" + kbapi "github.com/elastic/terraform-provider-elasticstack/generated/kibana" "github.com/elastic/terraform-provider-elasticstack/internal/utils" "github.com/hashicorp/terraform-plugin-framework/diag" ) diff --git a/internal/fleet/agent_policy/models.go b/internal/fleet/agent_policy/models.go index 7acc8390f..86a39fcd7 100644 --- a/internal/fleet/agent_policy/models.go +++ b/internal/fleet/agent_policy/models.go @@ -3,7 +3,7 @@ package agent_policy import ( "slices" - "github.com/elastic/terraform-provider-elasticstack/generated/kibana" + kbapi "github.com/elastic/terraform-provider-elasticstack/generated/kibana" "github.com/elastic/terraform-provider-elasticstack/internal/utils" "github.com/hashicorp/terraform-plugin-framework/types" ) diff --git a/internal/fleet/enrollment_tokens/models.go b/internal/fleet/enrollment_tokens/models.go index 30da4e2c7..6d059ee86 100644 --- a/internal/fleet/enrollment_tokens/models.go +++ b/internal/fleet/enrollment_tokens/models.go @@ -3,7 +3,7 @@ package enrollment_tokens import ( "context" - "github.com/elastic/terraform-provider-elasticstack/generated/kibana" + kbapi "github.com/elastic/terraform-provider-elasticstack/generated/kibana" "github.com/elastic/terraform-provider-elasticstack/internal/utils" "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/path" diff --git a/internal/fleet/enrollment_tokens/read.go b/internal/fleet/enrollment_tokens/read.go index 559670e61..6dc34232c 100644 --- a/internal/fleet/enrollment_tokens/read.go +++ b/internal/fleet/enrollment_tokens/read.go @@ -3,7 +3,7 @@ package enrollment_tokens import ( "context" - "github.com/elastic/terraform-provider-elasticstack/generated/kibana" + kbapi "github.com/elastic/terraform-provider-elasticstack/generated/kibana" "github.com/elastic/terraform-provider-elasticstack/internal/clients/fleet" "github.com/elastic/terraform-provider-elasticstack/internal/utils" "github.com/hashicorp/terraform-plugin-framework/datasource" diff --git a/internal/fleet/integration_ds/models.go b/internal/fleet/integration_ds/models.go index 896f55c99..fe296300c 100644 --- a/internal/fleet/integration_ds/models.go +++ b/internal/fleet/integration_ds/models.go @@ -1,7 +1,7 @@ package integration_ds import ( - "github.com/elastic/terraform-provider-elasticstack/generated/kibana" + kbapi "github.com/elastic/terraform-provider-elasticstack/generated/kibana" "github.com/hashicorp/terraform-plugin-framework/types" ) diff --git a/internal/fleet/integration_policy/models.go b/internal/fleet/integration_policy/models.go index f61234222..f0143d74d 100644 --- a/internal/fleet/integration_policy/models.go +++ b/internal/fleet/integration_policy/models.go @@ -4,7 +4,7 @@ import ( "context" "sort" - "github.com/elastic/terraform-provider-elasticstack/generated/kibana" + kbapi "github.com/elastic/terraform-provider-elasticstack/generated/kibana" "github.com/elastic/terraform-provider-elasticstack/internal/utils" "github.com/hashicorp/terraform-plugin-framework-jsontypes/jsontypes" "github.com/hashicorp/terraform-plugin-framework/diag" diff --git a/internal/fleet/integration_policy/secrets.go b/internal/fleet/integration_policy/secrets.go index 8d1340e63..5e33792fa 100644 --- a/internal/fleet/integration_policy/secrets.go +++ b/internal/fleet/integration_policy/secrets.go @@ -4,7 +4,7 @@ import ( "context" "encoding/json" - "github.com/elastic/terraform-provider-elasticstack/generated/kibana" + kbapi "github.com/elastic/terraform-provider-elasticstack/generated/kibana" "github.com/elastic/terraform-provider-elasticstack/internal/utils" "github.com/hashicorp/terraform-plugin-framework/diag" ) diff --git a/internal/fleet/integration_policy/secrets_test.go b/internal/fleet/integration_policy/secrets_test.go index 689820a6a..996f95f10 100644 --- a/internal/fleet/integration_policy/secrets_test.go +++ b/internal/fleet/integration_policy/secrets_test.go @@ -5,7 +5,7 @@ import ( "maps" "testing" - "github.com/elastic/terraform-provider-elasticstack/generated/kibana" + kbapi "github.com/elastic/terraform-provider-elasticstack/generated/kibana" "github.com/elastic/terraform-provider-elasticstack/internal/fleet/integration_policy" "github.com/elastic/terraform-provider-elasticstack/internal/utils" "github.com/hashicorp/terraform-plugin-framework/diag" @@ -87,7 +87,7 @@ func TestHandleRespSecrets(t *testing.T) { SecretReferences: secretRefs, Inputs: map[string]kbapi.PackagePolicyInput{ "input1": { - Streams: &map[string]kbapi.PackagePolicyInputStream{"stream1": kbapi.PackagePolicyInputStream{Vars: utils.Pointer(maps.Clone(tt.input))}}, + Streams: &map[string]kbapi.PackagePolicyInputStream{"stream1": {Vars: utils.Pointer(maps.Clone(tt.input))}}, Vars: utils.Pointer(maps.Clone(tt.input)), }, }, @@ -96,7 +96,7 @@ func TestHandleRespSecrets(t *testing.T) { wants := kbapi.PackagePolicy{ Inputs: map[string]kbapi.PackagePolicyInput{ "input1": { - Streams: &map[string]kbapi.PackagePolicyInputStream{"stream1": kbapi.PackagePolicyInputStream{Vars: utils.Pointer(tt.want)}}, + Streams: &map[string]kbapi.PackagePolicyInputStream{"stream1": {Vars: utils.Pointer(tt.want)}}, Vars: &tt.want, }, }, @@ -201,7 +201,7 @@ func TestHandleReqRespSecrets(t *testing.T) { SecretReferences: secretRefs, Inputs: map[string]kbapi.PackagePolicyInput{ "input1": { - Streams: &map[string]kbapi.PackagePolicyInputStream{"stream1": kbapi.PackagePolicyInputStream{Vars: utils.Pointer(maps.Clone(tt.respInput))}}, + Streams: &map[string]kbapi.PackagePolicyInputStream{"stream1": {Vars: utils.Pointer(maps.Clone(tt.respInput))}}, Vars: utils.Pointer(maps.Clone(tt.respInput)), }, }, @@ -210,7 +210,7 @@ func TestHandleReqRespSecrets(t *testing.T) { wants := kbapi.PackagePolicy{ Inputs: map[string]kbapi.PackagePolicyInput{ "input1": { - Streams: &map[string]kbapi.PackagePolicyInputStream{"stream1": kbapi.PackagePolicyInputStream{Vars: utils.Pointer(tt.want)}}, + Streams: &map[string]kbapi.PackagePolicyInputStream{"stream1": {Vars: utils.Pointer(tt.want)}}, Vars: &tt.want, }, }, diff --git a/internal/fleet/output/models.go b/internal/fleet/output/models.go index b7879b6c8..48c98695a 100644 --- a/internal/fleet/output/models.go +++ b/internal/fleet/output/models.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/elastic/terraform-provider-elasticstack/generated/kibana" + kbapi "github.com/elastic/terraform-provider-elasticstack/generated/kibana" "github.com/elastic/terraform-provider-elasticstack/internal/utils" "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/path" diff --git a/internal/fleet/server_host/models.go b/internal/fleet/server_host/models.go index d17bd314a..7621ef3c4 100644 --- a/internal/fleet/server_host/models.go +++ b/internal/fleet/server_host/models.go @@ -3,7 +3,7 @@ package server_host import ( "context" - "github.com/elastic/terraform-provider-elasticstack/generated/kibana" + kbapi "github.com/elastic/terraform-provider-elasticstack/generated/kibana" "github.com/elastic/terraform-provider-elasticstack/internal/utils" "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/path" diff --git a/provider/factory_test.go b/provider/factory_test.go index 05cb90f29..3b2e89fbc 100644 --- a/provider/factory_test.go +++ b/provider/factory_test.go @@ -2,7 +2,6 @@ package provider import ( "context" - "fmt" "testing" "github.com/hashicorp/terraform-plugin-go/tfprotov6" @@ -33,7 +32,7 @@ func TestMuxServer(t *testing.T) { }, Steps: []resource.TestStep{ { - Config: fmt.Sprintf(providerConfig), + Config: providerConfig, }, }, }) From f08e21ff156c8a392c88bfa328573dfd4de60a20 Mon Sep 17 00:00:00 2001 From: Raymond Lynch Date: Mon, 18 Nov 2024 09:56:17 -0500 Subject: [PATCH 14/15] fresh pull, rename to kbapi --- generated/{kibana => kbapi}/.gitignore | 0 generated/{kibana => kbapi}/Makefile | 0 generated/{kibana => kbapi}/kibana.gen.go | 54 ++++++++++++++++--- generated/{kibana => kbapi}/oapi-config.yaml | 0 .../{kibana => kbapi}/transform_schema.go | 0 internal/clients/fleet/client.go | 2 +- internal/clients/fleet/fleet.go | 2 +- internal/clients/kibana2/client.go | 2 +- internal/clients/kibana2/data_views.go | 2 +- internal/fleet/agent_policy/models.go | 2 +- internal/fleet/enrollment_tokens/models.go | 2 +- internal/fleet/enrollment_tokens/read.go | 2 +- internal/fleet/integration_ds/models.go | 2 +- internal/fleet/integration_policy/models.go | 2 +- internal/fleet/integration_policy/secrets.go | 2 +- .../fleet/integration_policy/secrets_test.go | 2 +- internal/fleet/output/models.go | 2 +- internal/fleet/server_host/models.go | 2 +- internal/kibana/data_view/models.go | 2 +- internal/kibana/data_view/models_test.go | 2 +- tools/kbapi_gen.go | 3 ++ tools/kibana_gen.go | 3 -- 22 files changed, 64 insertions(+), 26 deletions(-) rename generated/{kibana => kbapi}/.gitignore (100%) rename generated/{kibana => kbapi}/Makefile (100%) rename generated/{kibana => kbapi}/kibana.gen.go (99%) rename generated/{kibana => kbapi}/oapi-config.yaml (100%) rename generated/{kibana => kbapi}/transform_schema.go (100%) create mode 100644 tools/kbapi_gen.go delete mode 100644 tools/kibana_gen.go diff --git a/generated/kibana/.gitignore b/generated/kbapi/.gitignore similarity index 100% rename from generated/kibana/.gitignore rename to generated/kbapi/.gitignore diff --git a/generated/kibana/Makefile b/generated/kbapi/Makefile similarity index 100% rename from generated/kibana/Makefile rename to generated/kbapi/Makefile diff --git a/generated/kibana/kibana.gen.go b/generated/kbapi/kibana.gen.go similarity index 99% rename from generated/kibana/kibana.gen.go rename to generated/kbapi/kibana.gen.go index b4f26a027..b37d067f8 100644 --- a/generated/kibana/kibana.gen.go +++ b/generated/kbapi/kibana.gen.go @@ -14382,10 +14382,29 @@ type GetFleetEnrollmentApiKeysResponse struct { Body []byte HTTPResponse *http.Response JSON200 *struct { - Items []EnrollmentApiKey `json:"items"` - Page float32 `json:"page"` - PerPage float32 `json:"perPage"` - Total float32 `json:"total"` + Items []EnrollmentApiKey `json:"items"` + // Deprecated: + List []struct { + // Active When false, the enrollment API key is revoked and cannot be used for enrolling Elastic Agents. + Active bool `json:"active"` + + // ApiKey The enrollment API key (token) used for enrolling Elastic Agents. + ApiKey string `json:"api_key"` + + // ApiKeyId The ID of the API key in the Security API. + ApiKeyId string `json:"api_key_id"` + CreatedAt string `json:"created_at"` + Id string `json:"id"` + + // Name The name of the enrollment API key. + Name *string `json:"name,omitempty"` + + // PolicyId The ID of the agent policy the Elastic Agent will be enrolled in. + PolicyId *string `json:"policy_id,omitempty"` + } `json:"list"` + Page float32 `json:"page"` + PerPage float32 `json:"perPage"` + Total float32 `json:"total"` } JSON400 *struct { Error *string `json:"error,omitempty"` @@ -15753,10 +15772,29 @@ func ParseGetFleetEnrollmentApiKeysResponse(rsp *http.Response) (*GetFleetEnroll switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest struct { - Items []EnrollmentApiKey `json:"items"` - Page float32 `json:"page"` - PerPage float32 `json:"perPage"` - Total float32 `json:"total"` + Items []EnrollmentApiKey `json:"items"` + // Deprecated: + List []struct { + // Active When false, the enrollment API key is revoked and cannot be used for enrolling Elastic Agents. + Active bool `json:"active"` + + // ApiKey The enrollment API key (token) used for enrolling Elastic Agents. + ApiKey string `json:"api_key"` + + // ApiKeyId The ID of the API key in the Security API. + ApiKeyId string `json:"api_key_id"` + CreatedAt string `json:"created_at"` + Id string `json:"id"` + + // Name The name of the enrollment API key. + Name *string `json:"name,omitempty"` + + // PolicyId The ID of the agent policy the Elastic Agent will be enrolled in. + PolicyId *string `json:"policy_id,omitempty"` + } `json:"list"` + Page float32 `json:"page"` + PerPage float32 `json:"perPage"` + Total float32 `json:"total"` } if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err diff --git a/generated/kibana/oapi-config.yaml b/generated/kbapi/oapi-config.yaml similarity index 100% rename from generated/kibana/oapi-config.yaml rename to generated/kbapi/oapi-config.yaml diff --git a/generated/kibana/transform_schema.go b/generated/kbapi/transform_schema.go similarity index 100% rename from generated/kibana/transform_schema.go rename to generated/kbapi/transform_schema.go diff --git a/internal/clients/fleet/client.go b/internal/clients/fleet/client.go index 0e1844960..b704cd14e 100644 --- a/internal/clients/fleet/client.go +++ b/internal/clients/fleet/client.go @@ -8,7 +8,7 @@ import ( "os" "strings" - kbapi "github.com/elastic/terraform-provider-elasticstack/generated/kibana" + "github.com/elastic/terraform-provider-elasticstack/generated/kbapi" "github.com/elastic/terraform-provider-elasticstack/internal/utils" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/logging" ) diff --git a/internal/clients/fleet/fleet.go b/internal/clients/fleet/fleet.go index d8429914d..a9e46c94d 100644 --- a/internal/clients/fleet/fleet.go +++ b/internal/clients/fleet/fleet.go @@ -6,7 +6,7 @@ import ( "fmt" "net/http" - kbapi "github.com/elastic/terraform-provider-elasticstack/generated/kibana" + "github.com/elastic/terraform-provider-elasticstack/generated/kbapi" "github.com/elastic/terraform-provider-elasticstack/internal/utils" "github.com/hashicorp/terraform-plugin-framework/diag" ) diff --git a/internal/clients/kibana2/client.go b/internal/clients/kibana2/client.go index 44e0b409a..14ccaf67d 100644 --- a/internal/clients/kibana2/client.go +++ b/internal/clients/kibana2/client.go @@ -8,7 +8,7 @@ import ( "os" "strings" - kbapi "github.com/elastic/terraform-provider-elasticstack/generated/kibana" + "github.com/elastic/terraform-provider-elasticstack/generated/kbapi" "github.com/elastic/terraform-provider-elasticstack/internal/utils" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/logging" ) diff --git a/internal/clients/kibana2/data_views.go b/internal/clients/kibana2/data_views.go index 4ee9d5e52..7633e242c 100644 --- a/internal/clients/kibana2/data_views.go +++ b/internal/clients/kibana2/data_views.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - kbapi "github.com/elastic/terraform-provider-elasticstack/generated/kibana" + "github.com/elastic/terraform-provider-elasticstack/generated/kbapi" "github.com/elastic/terraform-provider-elasticstack/internal/utils" "github.com/hashicorp/terraform-plugin-framework/diag" ) diff --git a/internal/fleet/agent_policy/models.go b/internal/fleet/agent_policy/models.go index 86a39fcd7..0f06dce37 100644 --- a/internal/fleet/agent_policy/models.go +++ b/internal/fleet/agent_policy/models.go @@ -3,7 +3,7 @@ package agent_policy import ( "slices" - kbapi "github.com/elastic/terraform-provider-elasticstack/generated/kibana" + "github.com/elastic/terraform-provider-elasticstack/generated/kbapi" "github.com/elastic/terraform-provider-elasticstack/internal/utils" "github.com/hashicorp/terraform-plugin-framework/types" ) diff --git a/internal/fleet/enrollment_tokens/models.go b/internal/fleet/enrollment_tokens/models.go index 6d059ee86..a8cdcb101 100644 --- a/internal/fleet/enrollment_tokens/models.go +++ b/internal/fleet/enrollment_tokens/models.go @@ -3,7 +3,7 @@ package enrollment_tokens import ( "context" - kbapi "github.com/elastic/terraform-provider-elasticstack/generated/kibana" + "github.com/elastic/terraform-provider-elasticstack/generated/kbapi" "github.com/elastic/terraform-provider-elasticstack/internal/utils" "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/path" diff --git a/internal/fleet/enrollment_tokens/read.go b/internal/fleet/enrollment_tokens/read.go index 6dc34232c..85fe2b48a 100644 --- a/internal/fleet/enrollment_tokens/read.go +++ b/internal/fleet/enrollment_tokens/read.go @@ -3,7 +3,7 @@ package enrollment_tokens import ( "context" - kbapi "github.com/elastic/terraform-provider-elasticstack/generated/kibana" + "github.com/elastic/terraform-provider-elasticstack/generated/kbapi" "github.com/elastic/terraform-provider-elasticstack/internal/clients/fleet" "github.com/elastic/terraform-provider-elasticstack/internal/utils" "github.com/hashicorp/terraform-plugin-framework/datasource" diff --git a/internal/fleet/integration_ds/models.go b/internal/fleet/integration_ds/models.go index fe296300c..f24cf87d9 100644 --- a/internal/fleet/integration_ds/models.go +++ b/internal/fleet/integration_ds/models.go @@ -1,7 +1,7 @@ package integration_ds import ( - kbapi "github.com/elastic/terraform-provider-elasticstack/generated/kibana" + "github.com/elastic/terraform-provider-elasticstack/generated/kbapi" "github.com/hashicorp/terraform-plugin-framework/types" ) diff --git a/internal/fleet/integration_policy/models.go b/internal/fleet/integration_policy/models.go index f0143d74d..0ffe6014e 100644 --- a/internal/fleet/integration_policy/models.go +++ b/internal/fleet/integration_policy/models.go @@ -4,7 +4,7 @@ import ( "context" "sort" - kbapi "github.com/elastic/terraform-provider-elasticstack/generated/kibana" + "github.com/elastic/terraform-provider-elasticstack/generated/kbapi" "github.com/elastic/terraform-provider-elasticstack/internal/utils" "github.com/hashicorp/terraform-plugin-framework-jsontypes/jsontypes" "github.com/hashicorp/terraform-plugin-framework/diag" diff --git a/internal/fleet/integration_policy/secrets.go b/internal/fleet/integration_policy/secrets.go index 5e33792fa..3c266b9dd 100644 --- a/internal/fleet/integration_policy/secrets.go +++ b/internal/fleet/integration_policy/secrets.go @@ -4,7 +4,7 @@ import ( "context" "encoding/json" - kbapi "github.com/elastic/terraform-provider-elasticstack/generated/kibana" + "github.com/elastic/terraform-provider-elasticstack/generated/kbapi" "github.com/elastic/terraform-provider-elasticstack/internal/utils" "github.com/hashicorp/terraform-plugin-framework/diag" ) diff --git a/internal/fleet/integration_policy/secrets_test.go b/internal/fleet/integration_policy/secrets_test.go index 996f95f10..c62348c00 100644 --- a/internal/fleet/integration_policy/secrets_test.go +++ b/internal/fleet/integration_policy/secrets_test.go @@ -5,7 +5,7 @@ import ( "maps" "testing" - kbapi "github.com/elastic/terraform-provider-elasticstack/generated/kibana" + "github.com/elastic/terraform-provider-elasticstack/generated/kbapi" "github.com/elastic/terraform-provider-elasticstack/internal/fleet/integration_policy" "github.com/elastic/terraform-provider-elasticstack/internal/utils" "github.com/hashicorp/terraform-plugin-framework/diag" diff --git a/internal/fleet/output/models.go b/internal/fleet/output/models.go index 48c98695a..2bece8c9f 100644 --- a/internal/fleet/output/models.go +++ b/internal/fleet/output/models.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - kbapi "github.com/elastic/terraform-provider-elasticstack/generated/kibana" + "github.com/elastic/terraform-provider-elasticstack/generated/kbapi" "github.com/elastic/terraform-provider-elasticstack/internal/utils" "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/path" diff --git a/internal/fleet/server_host/models.go b/internal/fleet/server_host/models.go index 7621ef3c4..f0b25a39b 100644 --- a/internal/fleet/server_host/models.go +++ b/internal/fleet/server_host/models.go @@ -3,7 +3,7 @@ package server_host import ( "context" - kbapi "github.com/elastic/terraform-provider-elasticstack/generated/kibana" + "github.com/elastic/terraform-provider-elasticstack/generated/kbapi" "github.com/elastic/terraform-provider-elasticstack/internal/utils" "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/path" diff --git a/internal/kibana/data_view/models.go b/internal/kibana/data_view/models.go index 8e3fcffd3..2daf569da 100644 --- a/internal/kibana/data_view/models.go +++ b/internal/kibana/data_view/models.go @@ -4,7 +4,7 @@ import ( "context" "slices" - kbapi "github.com/elastic/terraform-provider-elasticstack/generated/kibana" + "github.com/elastic/terraform-provider-elasticstack/generated/kbapi" "github.com/elastic/terraform-provider-elasticstack/internal/clients" "github.com/elastic/terraform-provider-elasticstack/internal/utils" "github.com/hashicorp/terraform-plugin-framework/diag" diff --git a/internal/kibana/data_view/models_test.go b/internal/kibana/data_view/models_test.go index 35a37419e..375f4e4d9 100644 --- a/internal/kibana/data_view/models_test.go +++ b/internal/kibana/data_view/models_test.go @@ -4,7 +4,7 @@ import ( "context" "testing" - kbapi "github.com/elastic/terraform-provider-elasticstack/generated/kibana" + "github.com/elastic/terraform-provider-elasticstack/generated/kbapi" "github.com/elastic/terraform-provider-elasticstack/internal/utils" "github.com/hashicorp/terraform-plugin-framework/diag" "github.com/hashicorp/terraform-plugin-framework/path" diff --git a/tools/kbapi_gen.go b/tools/kbapi_gen.go new file mode 100644 index 000000000..aa6b777a6 --- /dev/null +++ b/tools/kbapi_gen.go @@ -0,0 +1,3 @@ +package tools + +//go:generate make -C ../generated/kbapi clean all diff --git a/tools/kibana_gen.go b/tools/kibana_gen.go deleted file mode 100644 index bd3ec3bcb..000000000 --- a/tools/kibana_gen.go +++ /dev/null @@ -1,3 +0,0 @@ -package tools - -//go:generate make -C ../generated/kibana clean all From 2053d8f82de663bcb8e017f759903c4cd0cafc52 Mon Sep 17 00:00:00 2001 From: Raymond Lynch Date: Mon, 18 Nov 2024 10:26:11 -0500 Subject: [PATCH 15/15] kibana_oapi --- internal/clients/api_client.go | 26 +++++++++---------- internal/clients/config/base.go | 4 +-- internal/clients/config/client.go | 4 +-- internal/clients/config/env.go | 8 +++--- internal/clients/config/fleet.go | 4 +-- internal/clients/config/fleet_test.go | 16 ++++++------ internal/clients/config/framework.go | 8 +++--- .../config/{kibana2.go => kibana_oapi.go} | 18 ++++++------- .../{kibana2_test.go => kibana_oapi_test.go} | 26 +++++++++---------- internal/clients/config/sdk.go | 8 +++--- .../{kibana2 => kibana_oapi}/client.go | 2 +- .../{kibana2 => kibana_oapi}/data_views.go | 2 +- .../{kibana2 => kibana_oapi}/errors.go | 2 +- internal/kibana/data_view/create.go | 6 ++--- internal/kibana/data_view/delete.go | 6 ++--- internal/kibana/data_view/read.go | 6 ++--- internal/kibana/data_view/update.go | 6 ++--- 17 files changed, 76 insertions(+), 76 deletions(-) rename internal/clients/config/{kibana2.go => kibana_oapi.go} (83%) rename internal/clients/config/{kibana2_test.go => kibana_oapi_test.go} (91%) rename internal/clients/{kibana2 => kibana_oapi}/client.go (99%) rename internal/clients/{kibana2 => kibana_oapi}/data_views.go (99%) rename internal/clients/{kibana2 => kibana_oapi}/errors.go (93%) diff --git a/internal/clients/api_client.go b/internal/clients/api_client.go index 3cd5c9f3c..a65ed05bc 100644 --- a/internal/clients/api_client.go +++ b/internal/clients/api_client.go @@ -15,7 +15,7 @@ import ( "github.com/elastic/terraform-provider-elasticstack/generated/slo" "github.com/elastic/terraform-provider-elasticstack/internal/clients/config" "github.com/elastic/terraform-provider-elasticstack/internal/clients/fleet" - "github.com/elastic/terraform-provider-elasticstack/internal/clients/kibana2" + "github.com/elastic/terraform-provider-elasticstack/internal/clients/kibana_oapi" "github.com/elastic/terraform-provider-elasticstack/internal/models" "github.com/elastic/terraform-provider-elasticstack/internal/utils" "github.com/hashicorp/go-version" @@ -72,7 +72,7 @@ type ApiClient struct { elasticsearch *elasticsearch.Client elasticsearchClusterInfo *models.ClusterInfo kibana *kibana.Client - kibana2 *kibana2.Client + kibanaOapi *kibana_oapi.Client alerting alerting.AlertingAPI connectors *connectors.Client slo slo.SloAPI @@ -108,7 +108,7 @@ func NewAcceptanceTestingClient() (*ApiClient, error) { return nil, fmt.Errorf("cannot create Kibana action connectors client: [%w]", err) } - kibana2Client, err := kibana2.NewClient(*cfg.Kibana2) + kibOapi, err := kibana_oapi.NewClient(*cfg.KibanaOapi) if err != nil { return nil, err } @@ -121,7 +121,7 @@ func NewAcceptanceTestingClient() (*ApiClient, error) { return &ApiClient{ elasticsearch: es, kibana: kib, - kibana2: kibana2Client, + kibanaOapi: kibOapi, alerting: buildAlertingClient(cfg, kibanaHttpClient).AlertingAPI, slo: buildSloClient(cfg, kibanaHttpClient).SloAPI, connectors: actionConnectors, @@ -244,12 +244,12 @@ func (a *ApiClient) GetKibanaClient() (*kibana.Client, error) { return a.kibana, nil } -func (a *ApiClient) GetKibana2Client() (*kibana2.Client, error) { - if a.kibana2 == nil { - return nil, errors.New("kibana2 client not found") +func (a *ApiClient) GetKibanaOapiClient() (*kibana_oapi.Client, error) { + if a.kibanaOapi == nil { + return nil, errors.New("kibana_oapi client not found") } - return a.kibana2, nil + return a.kibanaOapi, nil } func (a *ApiClient) GetAlertingClient() (alerting.AlertingAPI, error) { @@ -470,10 +470,10 @@ func buildKibanaClient(cfg config.Client) (*kibana.Client, error) { return kib, nil } -func buildKibana2Client(cfg config.Client) (*kibana2.Client, error) { - client, err := kibana2.NewClient(*cfg.Kibana2) +func buildKibanaOapiClient(cfg config.Client) (*kibana_oapi.Client, error) { + client, err := kibana_oapi.NewClient(*cfg.KibanaOapi) if err != nil { - return nil, fmt.Errorf("Unable to create Kibana2 client: %w", err) + return nil, fmt.Errorf("Unable to create KibanaOapi client: %w", err) } return client, nil @@ -576,11 +576,11 @@ func newApiClientFromConfig(cfg config.Client, version string) (*ApiClient, erro } client.kibana = kibanaClient - kibana2Client, err := buildKibana2Client(cfg) + kibanaOapiClient, err := buildKibanaOapiClient(cfg) if err != nil { return nil, err } - client.kibana2 = kibana2Client + client.kibanaOapi = kibanaOapiClient kibanaHttpClient := kibanaClient.Client.GetClient() connectorsClient, err := buildConnectorsClient(cfg, kibanaHttpClient) diff --git a/internal/clients/config/base.go b/internal/clients/config/base.go index aa4b195f3..2f6751377 100644 --- a/internal/clients/config/base.go +++ b/internal/clients/config/base.go @@ -77,8 +77,8 @@ func (b baseConfig) toKibanaConfig() kibanaConfig { } } -func (b baseConfig) toKibana2Config() kibana2Config { - return kibana2Config{ +func (b baseConfig) toKibanaOapiConfig() kibanaOapiConfig { + return kibanaOapiConfig{ Username: b.Username, Password: b.Password, APIKey: b.ApiKey, diff --git a/internal/clients/config/client.go b/internal/clients/config/client.go index 5e80c5504..b34f95723 100644 --- a/internal/clients/config/client.go +++ b/internal/clients/config/client.go @@ -4,13 +4,13 @@ import ( "github.com/disaster37/go-kibana-rest/v8" "github.com/elastic/go-elasticsearch/v8" "github.com/elastic/terraform-provider-elasticstack/internal/clients/fleet" - "github.com/elastic/terraform-provider-elasticstack/internal/clients/kibana2" + "github.com/elastic/terraform-provider-elasticstack/internal/clients/kibana_oapi" ) type Client struct { UserAgent string Kibana *kibana.Config - Kibana2 *kibana2.Config + KibanaOapi *kibana_oapi.Config Elasticsearch *elasticsearch.Config Fleet *fleet.Config } diff --git a/internal/clients/config/env.go b/internal/clients/config/env.go index eb6cc48b6..496ef44a6 100644 --- a/internal/clients/config/env.go +++ b/internal/clients/config/env.go @@ -5,7 +5,7 @@ import ( "github.com/disaster37/go-kibana-rest/v8" "github.com/elastic/terraform-provider-elasticstack/internal/clients/fleet" - "github.com/elastic/terraform-provider-elasticstack/internal/clients/kibana2" + "github.com/elastic/terraform-provider-elasticstack/internal/clients/kibana_oapi" "github.com/elastic/terraform-provider-elasticstack/internal/utils" ) @@ -26,10 +26,10 @@ func NewFromEnv(version string) Client { kibanaCfg := base.toKibanaConfig().withEnvironmentOverrides() client.Kibana = (*kibana.Config)(&kibanaCfg) - kibana2Cfg := base.toKibana2Config().withEnvironmentOverrides() - client.Kibana2 = (*kibana2.Config)(&kibana2Cfg) + kibanaOapiCfg := base.toKibanaOapiConfig().withEnvironmentOverrides() + client.KibanaOapi = (*kibana_oapi.Config)(&kibanaOapiCfg) - fleetCfg := kibana2Cfg.toFleetConfig().withEnvironmentOverrides() + fleetCfg := kibanaOapiCfg.toFleetConfig().withEnvironmentOverrides() client.Fleet = (*fleet.Config)(&fleetCfg) return client diff --git a/internal/clients/config/fleet.go b/internal/clients/config/fleet.go index 4f4144351..893642387 100644 --- a/internal/clients/config/fleet.go +++ b/internal/clients/config/fleet.go @@ -13,7 +13,7 @@ import ( type fleetConfig fleet.Config -func newFleetConfigFromSDK(d *schema.ResourceData, kibanaCfg kibana2Config) (fleetConfig, sdkdiags.Diagnostics) { +func newFleetConfigFromSDK(d *schema.ResourceData, kibanaCfg kibanaOapiConfig) (fleetConfig, sdkdiags.Diagnostics) { config := kibanaCfg.toFleetConfig() // Set variables from resource config. @@ -56,7 +56,7 @@ func newFleetConfigFromSDK(d *schema.ResourceData, kibanaCfg kibana2Config) (fle return config.withEnvironmentOverrides(), nil } -func newFleetConfigFromFramework(ctx context.Context, cfg ProviderConfiguration, kibanaCfg kibana2Config) (fleetConfig, fwdiags.Diagnostics) { +func newFleetConfigFromFramework(ctx context.Context, cfg ProviderConfiguration, kibanaCfg kibanaOapiConfig) (fleetConfig, fwdiags.Diagnostics) { config := kibanaCfg.toFleetConfig() if len(cfg.Fleet) > 0 { diff --git a/internal/clients/config/fleet_test.go b/internal/clients/config/fleet_test.go index 06c1bf8d8..021b746fd 100644 --- a/internal/clients/config/fleet_test.go +++ b/internal/clients/config/fleet_test.go @@ -16,7 +16,7 @@ import ( func Test_newFleetConfigFromSDK(t *testing.T) { type args struct { - kibanaCfg kibana2Config + kibanaCfg kibanaOapiConfig resourceData map[string]interface{} expectedConfig fleetConfig expectedDiags sdkdiags.Diagnostics @@ -29,7 +29,7 @@ func Test_newFleetConfigFromSDK(t *testing.T) { { name: "should return kibana config if no fleet config defined", args: func() args { - kibanaCfg := kibana2Config{ + kibanaCfg := kibanaOapiConfig{ URL: "example.com/kibana", Username: "elastic", Password: "changeme", @@ -46,7 +46,7 @@ func Test_newFleetConfigFromSDK(t *testing.T) { { name: "should use the provided config optios", args: func() args { - kibanaCfg := kibana2Config{ + kibanaCfg := kibanaOapiConfig{ URL: "example.com/kibana", Username: "elastic", Password: "changeme", @@ -81,7 +81,7 @@ func Test_newFleetConfigFromSDK(t *testing.T) { { name: "should prefer environment variables", args: func() args { - kibanaCfg := kibana2Config{ + kibanaCfg := kibanaOapiConfig{ URL: "example.com/kibana", Username: "elastic", Password: "changeme", @@ -149,7 +149,7 @@ func Test_newFleetConfigFromSDK(t *testing.T) { func Test_newFleetConfigFromFramework(t *testing.T) { type args struct { - kibanaCfg kibana2Config + kibanaCfg kibanaOapiConfig providerConfig ProviderConfiguration expectedConfig fleetConfig expectedDiags fwdiags.Diagnostics @@ -162,7 +162,7 @@ func Test_newFleetConfigFromFramework(t *testing.T) { { name: "should return kibana config if no fleet config defined", args: func() args { - kibanaCfg := kibana2Config{ + kibanaCfg := kibanaOapiConfig{ URL: "example.com/kibana", Username: "elastic", Password: "changeme", @@ -179,7 +179,7 @@ func Test_newFleetConfigFromFramework(t *testing.T) { { name: "should use the provided config options", args: func() args { - kibanaCfg := kibana2Config{ + kibanaCfg := kibanaOapiConfig{ URL: "example.com/kibana", Username: "elastic", Password: "changeme", @@ -217,7 +217,7 @@ func Test_newFleetConfigFromFramework(t *testing.T) { { name: "should prefer environment variables", args: func() args { - kibanaCfg := kibana2Config{ + kibanaCfg := kibanaOapiConfig{ URL: "example.com/kibana", Username: "elastic", Password: "changeme", diff --git a/internal/clients/config/framework.go b/internal/clients/config/framework.go index 2670682ee..3a91909e2 100644 --- a/internal/clients/config/framework.go +++ b/internal/clients/config/framework.go @@ -5,7 +5,7 @@ import ( "github.com/disaster37/go-kibana-rest/v8" "github.com/elastic/terraform-provider-elasticstack/internal/clients/fleet" - "github.com/elastic/terraform-provider-elasticstack/internal/clients/kibana2" + "github.com/elastic/terraform-provider-elasticstack/internal/clients/kibana_oapi" "github.com/elastic/terraform-provider-elasticstack/internal/utils" "github.com/hashicorp/terraform-plugin-framework/diag" ) @@ -32,14 +32,14 @@ func NewFromFramework(ctx context.Context, cfg ProviderConfiguration, version st client.Kibana = (*kibana.Config)(&kibanaCfg) - kibana2Cfg, diags := newKibana2ConfigFromFramework(ctx, cfg, base) + kibanaOapiCfg, diags := newKibanaOapiConfigFromFramework(ctx, cfg, base) if diags.HasError() { return Client{}, diags } - client.Kibana2 = (*kibana2.Config)(&kibana2Cfg) + client.KibanaOapi = (*kibana_oapi.Config)(&kibanaOapiCfg) - fleetCfg, diags := newFleetConfigFromFramework(ctx, cfg, kibana2Cfg) + fleetCfg, diags := newFleetConfigFromFramework(ctx, cfg, kibanaOapiCfg) if diags.HasError() { return Client{}, diags } diff --git a/internal/clients/config/kibana2.go b/internal/clients/config/kibana_oapi.go similarity index 83% rename from internal/clients/config/kibana2.go rename to internal/clients/config/kibana_oapi.go index 0268ed177..5f5d299ff 100644 --- a/internal/clients/config/kibana2.go +++ b/internal/clients/config/kibana_oapi.go @@ -6,19 +6,19 @@ import ( "strconv" "strings" - "github.com/elastic/terraform-provider-elasticstack/internal/clients/kibana2" + "github.com/elastic/terraform-provider-elasticstack/internal/clients/kibana_oapi" fwdiags "github.com/hashicorp/terraform-plugin-framework/diag" sdkdiags "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) -type kibana2Config kibana2.Config +type kibanaOapiConfig kibana_oapi.Config -func newKibana2ConfigFromSDK(d *schema.ResourceData, base baseConfig) (kibana2Config, sdkdiags.Diagnostics) { +func newKibanaOapiConfigFromSDK(d *schema.ResourceData, base baseConfig) (kibanaOapiConfig, sdkdiags.Diagnostics) { var diags sdkdiags.Diagnostics // Use ES details by default - config := base.toKibana2Config() + config := base.toKibanaOapiConfig() kibConn, ok := d.GetOk("kibana") if !ok { return config, diags @@ -62,8 +62,8 @@ func newKibana2ConfigFromSDK(d *schema.ResourceData, base baseConfig) (kibana2Co return config.withEnvironmentOverrides(), nil } -func newKibana2ConfigFromFramework(ctx context.Context, cfg ProviderConfiguration, base baseConfig) (kibana2Config, fwdiags.Diagnostics) { - config := base.toKibana2Config() +func newKibanaOapiConfigFromFramework(ctx context.Context, cfg ProviderConfiguration, base baseConfig) (kibanaOapiConfig, fwdiags.Diagnostics) { + config := base.toKibanaOapiConfig() if len(cfg.Kibana) > 0 { kibConfig := cfg.Kibana[0] @@ -82,7 +82,7 @@ func newKibana2ConfigFromFramework(ctx context.Context, cfg ProviderConfiguratio var cas []string diags.Append(kibConfig.CACerts.ElementsAs(ctx, &cas, true)...) if diags.HasError() { - return kibana2Config{}, diags + return kibanaOapiConfig{}, diags } if len(endpoints) > 0 { @@ -99,7 +99,7 @@ func newKibana2ConfigFromFramework(ctx context.Context, cfg ProviderConfiguratio return config.withEnvironmentOverrides(), nil } -func (k kibana2Config) withEnvironmentOverrides() kibana2Config { +func (k kibanaOapiConfig) withEnvironmentOverrides() kibanaOapiConfig { k.Username = withEnvironmentOverride(k.Username, "KIBANA_USERNAME") k.Password = withEnvironmentOverride(k.Password, "KIBANA_PASSWORD") k.APIKey = withEnvironmentOverride(k.APIKey, "KIBANA_API_KEY") @@ -117,6 +117,6 @@ func (k kibana2Config) withEnvironmentOverrides() kibana2Config { return k } -func (k kibana2Config) toFleetConfig() fleetConfig { +func (k kibanaOapiConfig) toFleetConfig() fleetConfig { return fleetConfig(k) } diff --git a/internal/clients/config/kibana2_test.go b/internal/clients/config/kibana_oapi_test.go similarity index 91% rename from internal/clients/config/kibana2_test.go rename to internal/clients/config/kibana_oapi_test.go index 3716439b1..08457c144 100644 --- a/internal/clients/config/kibana2_test.go +++ b/internal/clients/config/kibana_oapi_test.go @@ -14,11 +14,11 @@ import ( "github.com/stretchr/testify/require" ) -func Test_newKibana2ConfigFromSDK(t *testing.T) { +func Test_newKibanaOapiConfigFromSDK(t *testing.T) { type args struct { baseCfg baseConfig resourceData map[string]interface{} - expectedConfig kibana2Config + expectedConfig kibanaOapiConfig expectedDiags sdkdiags.Diagnostics env map[string]string } @@ -37,7 +37,7 @@ func Test_newKibana2ConfigFromSDK(t *testing.T) { return args{ baseCfg: baseCfg, resourceData: map[string]interface{}{}, - expectedConfig: baseCfg.toKibana2Config(), + expectedConfig: baseCfg.toKibanaOapiConfig(), } }, }, @@ -62,7 +62,7 @@ func Test_newKibana2ConfigFromSDK(t *testing.T) { }, }, }, - expectedConfig: kibana2Config{ + expectedConfig: kibanaOapiConfig{ URL: "example.com/kibana", Username: "kibana", Password: "baltic", @@ -100,7 +100,7 @@ func Test_newKibana2ConfigFromSDK(t *testing.T) { "KIBANA_INSECURE": "false", "KIBANA_CA_CERTS": "black,sea", }, - expectedConfig: kibana2Config{ + expectedConfig: kibanaOapiConfig{ URL: "example.com/cabana", Username: "elastic", Password: "thin-lines", @@ -130,7 +130,7 @@ func Test_newKibana2ConfigFromSDK(t *testing.T) { os.Setenv(key, val) } - kibanaCfg, diags := newKibana2ConfigFromSDK(rd, args.baseCfg) + kibanaCfg, diags := newKibanaOapiConfigFromSDK(rd, args.baseCfg) require.Equal(t, args.expectedConfig, kibanaCfg) require.Equal(t, args.expectedDiags, diags) @@ -138,11 +138,11 @@ func Test_newKibana2ConfigFromSDK(t *testing.T) { } } -func Test_newkibana2ConfigFromFramework(t *testing.T) { +func Test_newKibanaOapiConfigFromFramework(t *testing.T) { type args struct { baseCfg baseConfig providerConfig ProviderConfiguration - expectedConfig kibana2Config + expectedConfig kibanaOapiConfig expectedDiags fwdiags.Diagnostics env map[string]string } @@ -161,7 +161,7 @@ func Test_newkibana2ConfigFromFramework(t *testing.T) { return args{ baseCfg: baseCfg, providerConfig: ProviderConfiguration{}, - expectedConfig: baseCfg.toKibana2Config(), + expectedConfig: baseCfg.toKibanaOapiConfig(), } }, }, @@ -191,7 +191,7 @@ func Test_newkibana2ConfigFromFramework(t *testing.T) { }, }, }, - expectedConfig: kibana2Config{ + expectedConfig: kibanaOapiConfig{ URL: "example.com/kibana", Username: "kibana", Password: "baltic", @@ -222,7 +222,7 @@ func Test_newkibana2ConfigFromFramework(t *testing.T) { }, }, }, - expectedConfig: kibana2Config{ + expectedConfig: kibanaOapiConfig{ URL: "example.com/kibana", APIKey: "test", Insecure: true, @@ -263,7 +263,7 @@ func Test_newkibana2ConfigFromFramework(t *testing.T) { "KIBANA_INSECURE": "false", "KIBANA_CA_CERTS": "black,sea", }, - expectedConfig: kibana2Config{ + expectedConfig: kibanaOapiConfig{ URL: "example.com/cabana", Username: "elastic", Password: "thin-lines", @@ -290,7 +290,7 @@ func Test_newkibana2ConfigFromFramework(t *testing.T) { os.Setenv(key, val) } - kibanaCfg, diags := newKibana2ConfigFromFramework(context.Background(), args.providerConfig, args.baseCfg) + kibanaCfg, diags := newKibanaOapiConfigFromFramework(context.Background(), args.providerConfig, args.baseCfg) require.Equal(t, args.expectedConfig, kibanaCfg) require.Equal(t, args.expectedDiags, diags) diff --git a/internal/clients/config/sdk.go b/internal/clients/config/sdk.go index d4d107360..3124cb449 100644 --- a/internal/clients/config/sdk.go +++ b/internal/clients/config/sdk.go @@ -3,7 +3,7 @@ package config import ( "github.com/disaster37/go-kibana-rest/v8" "github.com/elastic/terraform-provider-elasticstack/internal/clients/fleet" - "github.com/elastic/terraform-provider-elasticstack/internal/clients/kibana2" + "github.com/elastic/terraform-provider-elasticstack/internal/clients/kibana_oapi" "github.com/elastic/terraform-provider-elasticstack/internal/utils" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -49,14 +49,14 @@ func newFromSDK(d *schema.ResourceData, version, esConfigKey string) (Client, di client.Kibana = (*kibana.Config)(&kibanaCfg) - kibana2Cfg, diags := newKibana2ConfigFromSDK(d, base) + kibanaOapiCfg, diags := newKibanaOapiConfigFromSDK(d, base) if diags.HasError() { return Client{}, diags } - client.Kibana2 = (*kibana2.Config)(&kibana2Cfg) + client.KibanaOapi = (*kibana_oapi.Config)(&kibanaOapiCfg) - fleetCfg, diags := newFleetConfigFromSDK(d, kibana2Cfg) + fleetCfg, diags := newFleetConfigFromSDK(d, kibanaOapiCfg) if diags.HasError() { return Client{}, diags } diff --git a/internal/clients/kibana2/client.go b/internal/clients/kibana_oapi/client.go similarity index 99% rename from internal/clients/kibana2/client.go rename to internal/clients/kibana_oapi/client.go index 14ccaf67d..91c55f7ff 100644 --- a/internal/clients/kibana2/client.go +++ b/internal/clients/kibana_oapi/client.go @@ -1,4 +1,4 @@ -package kibana2 +package kibana_oapi import ( "crypto/tls" diff --git a/internal/clients/kibana2/data_views.go b/internal/clients/kibana_oapi/data_views.go similarity index 99% rename from internal/clients/kibana2/data_views.go rename to internal/clients/kibana_oapi/data_views.go index 7633e242c..78d5bcd36 100644 --- a/internal/clients/kibana2/data_views.go +++ b/internal/clients/kibana_oapi/data_views.go @@ -1,4 +1,4 @@ -package kibana2 +package kibana_oapi import ( "context" diff --git a/internal/clients/kibana2/errors.go b/internal/clients/kibana_oapi/errors.go similarity index 93% rename from internal/clients/kibana2/errors.go rename to internal/clients/kibana_oapi/errors.go index 9dcfe607f..08aef219d 100644 --- a/internal/clients/kibana2/errors.go +++ b/internal/clients/kibana_oapi/errors.go @@ -1,4 +1,4 @@ -package kibana2 +package kibana_oapi import ( "fmt" diff --git a/internal/kibana/data_view/create.go b/internal/kibana/data_view/create.go index c90200069..0473024cb 100644 --- a/internal/kibana/data_view/create.go +++ b/internal/kibana/data_view/create.go @@ -3,7 +3,7 @@ package data_view import ( "context" - "github.com/elastic/terraform-provider-elasticstack/internal/clients/kibana2" + "github.com/elastic/terraform-provider-elasticstack/internal/clients/kibana_oapi" "github.com/hashicorp/terraform-plugin-framework/resource" ) @@ -22,14 +22,14 @@ func (r *DataViewResource) Create(ctx context.Context, req resource.CreateReques return } - client, err := r.client.GetKibana2Client() + client, err := r.client.GetKibanaOapiClient() if err != nil { resp.Diagnostics.AddError(err.Error(), "") return } spaceID := planModel.SpaceID.ValueString() - dataView, diags := kibana2.CreateDataView(ctx, client, spaceID, body) + dataView, diags := kibana_oapi.CreateDataView(ctx, client, spaceID, body) resp.Diagnostics.Append(diags...) if resp.Diagnostics.HasError() { return diff --git a/internal/kibana/data_view/delete.go b/internal/kibana/data_view/delete.go index e6ec07d4b..460135f19 100644 --- a/internal/kibana/data_view/delete.go +++ b/internal/kibana/data_view/delete.go @@ -3,7 +3,7 @@ package data_view import ( "context" - "github.com/elastic/terraform-provider-elasticstack/internal/clients/kibana2" + "github.com/elastic/terraform-provider-elasticstack/internal/clients/kibana_oapi" "github.com/hashicorp/terraform-plugin-framework/resource" ) @@ -16,13 +16,13 @@ func (r *DataViewResource) Delete(ctx context.Context, req resource.DeleteReques return } - client, err := r.client.GetKibana2Client() + client, err := r.client.GetKibanaOapiClient() if err != nil { resp.Diagnostics.AddError(err.Error(), "") return } viewID, spaceID := stateModel.getViewIDAndSpaceID() - diags = kibana2.DeleteDataView(ctx, client, spaceID, viewID) + diags = kibana_oapi.DeleteDataView(ctx, client, spaceID, viewID) resp.Diagnostics.Append(diags...) } diff --git a/internal/kibana/data_view/read.go b/internal/kibana/data_view/read.go index 7f91a3f61..c2c61b906 100644 --- a/internal/kibana/data_view/read.go +++ b/internal/kibana/data_view/read.go @@ -3,7 +3,7 @@ package data_view import ( "context" - "github.com/elastic/terraform-provider-elasticstack/internal/clients/kibana2" + "github.com/elastic/terraform-provider-elasticstack/internal/clients/kibana_oapi" "github.com/hashicorp/terraform-plugin-framework/resource" ) @@ -16,14 +16,14 @@ func (r *DataViewResource) Read(ctx context.Context, req resource.ReadRequest, r return } - client, err := r.client.GetKibana2Client() + client, err := r.client.GetKibanaOapiClient() if err != nil { resp.Diagnostics.AddError(err.Error(), "") return } viewID, spaceID := stateModel.getViewIDAndSpaceID() - dataView, diags := kibana2.GetDataView(ctx, client, spaceID, viewID) + dataView, diags := kibana_oapi.GetDataView(ctx, client, spaceID, viewID) resp.Diagnostics.Append(diags...) if resp.Diagnostics.HasError() { return diff --git a/internal/kibana/data_view/update.go b/internal/kibana/data_view/update.go index b8d4b5525..c6a912b74 100644 --- a/internal/kibana/data_view/update.go +++ b/internal/kibana/data_view/update.go @@ -3,7 +3,7 @@ package data_view import ( "context" - "github.com/elastic/terraform-provider-elasticstack/internal/clients/kibana2" + "github.com/elastic/terraform-provider-elasticstack/internal/clients/kibana_oapi" "github.com/hashicorp/terraform-plugin-framework/resource" ) @@ -16,7 +16,7 @@ func (r *DataViewResource) Update(ctx context.Context, req resource.UpdateReques return } - client, err := r.client.GetKibana2Client() + client, err := r.client.GetKibanaOapiClient() if err != nil { resp.Diagnostics.AddError(err.Error(), "") return @@ -29,7 +29,7 @@ func (r *DataViewResource) Update(ctx context.Context, req resource.UpdateReques } viewID, spaceID := planModel.getViewIDAndSpaceID() - dataView, diags := kibana2.UpdateDataView(ctx, client, spaceID, viewID, body) + dataView, diags := kibana_oapi.UpdateDataView(ctx, client, spaceID, viewID, body) resp.Diagnostics.Append(diags...) if resp.Diagnostics.HasError() { return